body {
  background-color: #e8ddc1;
  background-image: url("https://verso.neocities.org/Conifer.png"), url("https://verso.neocities.org/bgt/cartographer.png");
  background-repeat: no-repeat, repeat;
  background-size: cover, auto;
  background-attachment: fixed, fixed;
  transition: background-position 1.4s cubic-bezier(.16,.84,.44,1), filter 1s ease;
  /* transition: background-position 0.8s cubic-bezier(.25,.8,.25,1); */
  /* transition: background-image 0.6s ease-in-out; */
  /* background-color: white; */
  color: black;
  font-family: "Jost-V";
  font-size: 16px;
  line-height: 1.2;
  text-align: justify; 
  hyphens:auto;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

entry-body {
  background-color: #e8ddc1;
  background-image: url("https://verso.neocities.org/bgt/cartographer.png");
  background-repeat: repeat;
  background-size: auto;
  background-attachment: fixed;
  transition: background-position 1.4s cubic-bezier(.16,.84,.44,1), filter 1s ease;
  /* transition: background-position 0.8s cubic-bezier(.25,.8,.25,1); */
  /* transition: background-image 0.6s ease-in-out; */
  /* background-color: white; */
  color: black;
  font-family: "Jost-V";
  font-size: 16px;
  line-height: 1.2;
  text-align: justify; 
  hyphens:auto;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

@font-face {
  font-family: "Jost-V";
  src: url("https://verso.neocities.org/Jost-V.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

header {
    background: rgba(255,245,235,0.55);
    padding: 10px;
    z-index: 10;
    flex-shrink: 0; 
}

footer {
    background: rgba(255,245,235,0.55);
   /* background-image: url("https://verso.neocities.org/Floral_headpiece_by_Heinrich_Vogeler.svg.png"); */
   /* background-size: contain; */
    padding: 10px;
    z-index: 10;
    flex-shrink: 0; 
}

.columns-viewport {
  flex: 1;
  /* width: 100%; */
  /* height: calc(100vh - 131.1px - 71.2px - 40px); same as your main height */
  overflow: hidden;             /* hide everything outside current page */
  position: relative;
  min-height: 0;
}

main {
    display: flex;
    flex-direction: column;
    height: max-content;
    width: 100%;
    transition: transform 0.5s ease;
}

main img {
    max-width: 100%;
    height: auto;
    break-inside: avoid;
}

.page {
  height: calc(100vh - 131.1px - 71.2px - 0px);
  width: 100%;
  flex-shrink: 0; 
  padding: 10px;
  box-sizing: border-box;
  background: rgba(255,245,235,0.55);
  /* background-image: url("https://verso.neocities.org/blume.png"); */
  /* background-size: contain; */
  column-count: 5;
  column-gap: 20px;
  column-rule: 1.5px inset black;
  column-fill: auto;
  overflow: hidden;
}

.page--bigpic {
  column-count: 1;          /* override the 5-column default */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.page--bigpic img{
  max-height: 75%;
  width: auto;
  max-width: 100%;
}

/* guestbook */

.page--gb {
  column-count: 1;          /* override the 5-column default */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.page--gb img{
  max-height: 75%;
  width: auto;
  max-width: 100%;
}

.page--entry {
  column-count: 1;          /* override the 5-column default */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: center;
  position: relative;
}

.page--entry img{
  max-height: 100%;
  width: auto;
  max-width: 100%;
}

.entry {
  height: calc(100vh - 131.1px - 71.2px - 0px);
  width: 100%;
  flex-shrink: 0; 
  padding: 10px;
  box-sizing: border-box;
  background: rgba(255,245,235,0.55);
}

.entry-frame {
  position: relative;
  width: fit-content;   /* wrapper matches image width */
  height: auto;         /* wrapper matches image height */
}

.entry-frame img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 131.1px - 71.2px - 20px); /* same limit as .page */
}

.text-overlay {
  position: absolute;
  top: 4%;   /* Abstand von oben */
  left: 50%; /* Abstand von links */
  width: 42%;
  max-height: 72%;     /* overlay cannot grow beyond this */
  overflow: scroll;    /* hide overflow instead of expanding */
  color: black;
  font-size: 1rem;
  line-height: 1.1;
  text-align: center;
  display: block;
}

.entry-icon-wrapper {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  display: block;
}

.entry-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.page--two-col {
  column-count: 2;          /* simply overrides the default 5 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: calc(100vh - 131.1px - 71.2px - 0px);
  max-height: 75%;
  width: auto;
  max-width: 100%;
  flex-shrink: 0; 
  padding: 10px;
  box-sizing: border-box;
  background: rgba(255,245,235,0.55);
  object-fit: contain;
  column-fill: auto;
}

.page--fullpic {
  column-count: 1;
  padding: 0;               /* remove padding so image goes edge to edge */
}

.page--fullpic img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;        /* fills the whole page like a poster */
}

h1, h2, h3, h4, h5, h6 {
    break-after: avoid;
    break-inside: avoid;
}

/* toc=table of contents */

.page--toc {
  column-count: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toc-box {
  max-width: 400px;
  width: 100%;
  padding: 100px; /* space between frame and content */
  padding-right: 200px;
  padding-left: 200px;
  border-image-source: url("https://verso.neocities.org/tr/frame2.png");
  border-image-slice: 350; /*  depends on your frame image */
  border-image-repeat: stretch; /* or round */
  border-image-width: 120px;
}

.toc-box h2 {
  margin-bottom: 20px;
}

.toc-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-box li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,0.15);
}

.toc-num {
  font-size: 12px;
  opacity: 0.5;
  flex-shrink: 0;
}

.toc-box a {
  color: black;
  text-decoration: none;
  font-size: 18px;
}

.toc-box a:hover {
  text-decoration: underline;
}

/* photo page */

.page--collage {
  column-count: 1;
  padding: 0;
  position: relative;
}

.collage {
  position: relative;
  width: 100%;
  height: 100%;
}

.collage-img {
  position: absolute;
  width: 28%;             /* adjust per photo */
  height: auto;
  box-shadow: 3px 4px 12px rgba(0,0,0,0.3);
  cursor: default;
  transition: transform 0.2s ease, z-index 0.2s ease;
}

.collage-img:hover {
  transform: scale(1.04);
  z-index: 10;            /* pops to front on hover */
}

/* Dias */

.collage-dia {
  position: relative;
  display: block;
  width: 40px;
  height: auto;
  padding: 12px;                     /* dicker Rahmen */
  background: #fff;
  border: 2px solid #e6e6e6;         /* innerer Rand */
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  cursor: pointer;
  transition: transform 0.25s ease;
  transform-origin: center;
  max-width: 40px;   /* absolute Begrenzung */
  max-height: 40px;   /* absolute Begrenzung */
}

.collage-dia:hover {
  transform: scale(1.06) rotate(1deg);
  animation: swing-strong 1.5s ease-in-out infinite;
}

.dia-wrapper {
  position: absolute;
  display: inline-block;
  animation: swing-soft 4s ease-in-out infinite;
  transform-origin: top center;
}

.dia-wrapper::before {
  content: "";
  position: absolute;
  top: -28px;
  left: 50%;
  width: 2px;
  height: 40px;
  background: #8b5a2b;
  transform: translateX(-50%);
  z-index: -1; /* hinter dem Dia */
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  box-shadow: 0 0 20px black;
}

.hidden {
  display: none;
}

#page-title {
  transition: opacity 0.4s ease;
  font-size: 36px;
  letter-spacing: 0.1em;
  opacity: 0.6;
  margin-left: 24px;
}

/* Animations */

.fade { opacity: 0; animation: fadeIn 4s ease forwards; } 
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideFlipIn { from { transform: translateX(40px) rotateY(90deg); opacity: 0; } to { transform: translateX(0) rotateY(0deg); opacity: 1; } }
.header img { animation: slideFlipIn 1.2s ease-out forwards; }
.header img:nth-child(1) { animation-delay: 0s; } 
.header img:nth-child(2) { animation-delay: 0.2s; } 
.header img:nth-child(3) { animation-delay: 0.4s; } 
.header img:nth-child(4) { animation-delay: 0.6s; } 
.header img:nth-child(5) { animation-delay: 0.8s; } 
.header img:nth-child(6) { animation-delay: 1.0s; } 
.header img:nth-child(7) { animation-delay: 1.2s; }

.header img {
  animation: slideFlipIn 1.2s ease-out forwards;
  transition: transform 0.2s ease, filter 0.2s ease; /* for simple hover effects */
}
.header img:hover {
  animation: flipHover 0.5s ease forwards;
}

/* @keyframes flipHover { */
/*  0%   { transform: rotateY(0deg); } */
/*  50%  { transform: rotateY(90deg); } */
/*  100% { transform: rotateY(0deg); } */
/* } */

.header img:hover {
  animation: flipHover 0.5s ease forwards;
}
@keyframes flipHover {
  0%   { transform: rotateY(0deg); }
  50%  { transform: rotateY(90deg); }
  100% { transform: rotateY(0deg); }
}

@keyframes swing-soft {
  0%   { transform: rotate(-2deg); }
  50%  { transform: rotate(2deg); }
  100% { transform: rotate(-2deg); }
}

@keyframes swing-strong {
  0%   { transform: rotate(-4deg); }
  50%  { transform: rotate(4deg); }
  100% { transform: rotate(-4deg); }
}

@keyframes swing-fadeout {
  0%   { transform: rotate(4deg); }
  50%   { transform: rotate(2deg); }
  100% { transform: rotate(0deg); }
}

@media (max-width: 1400px) { .page { column-count: 4; } }
@media (max-width: 1100px) { .page { column-count: 3; } }
@media (max-width: 800px)  { .page { column-count: 2; } }
@media (max-width: 500px)  { .page { column-count: 1; } }