@font-face {
  font-family: 'Spectral';
  src: local('Spectral'),
       url('fonts/Spectral/Spectral-Regular.ttf') format('ttf');
}

@font-face {
  font-family: 'trattatello';
  src: local('trattatello'),
       url('fonts/Trattatello/web/font/Trattatello.woff2') format('woff2');
}

.timeline-overlay {
  position: absolute;
  width: 100%;
  height: 100dvh;
  inset: 0;
  background: rgba(255, 255, 255, 0.924);
  z-index: 20000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  pointer-events: none;   /* 👈 WICHTIG */
  overflow-x: visible;
  overflow-y: hidden;
}

.timeline-overlay-content{
  display:absolute;
  overflow: visible;
  left: 5%;
  right: 5%;
  max-width: none;
  width: auto;
  box-sizing: border-box;
  /* outline: solid 1px rgb(103, 131, 255); */
}

.timeline-overlay.is-active {
  opacity: 1;

}


.timeline-overlay a {
  pointer-events: auto;
  cursor: pointer;
  /* outline: 1px solid rgb(255, 103, 103); */
}

/* .timeline-overlay.overlay-tags-block ul {
    outline: 1px solid rgb(103, 255, 240);
    } */

.timeline-overlay-content {
  position: absolute;
  margin-top: 9vh;

  left: 5%;
  right: 5%;          /* ✅ definiert die Breite sauber */
  width: auto;
  max-width: none;

  padding: clamp(12px, 2vw, 28px);
  box-sizing: border-box;

  display: flex;
  /* gap: clamp(12px, 2vw, 28px); */
  align-items: flex-start;

  max-height: 90vh;
  overflow: hidden;   /* ✅ NICHTS darf rauslaufen */
  align-items: flex-start;
  /* gap: 2rem; */
  padding-right: 6px; /* oder mehr */

  /*overflow: hidden;    👈 wichtig */

  gap: clamp(10px, 1.6vw, 24px);

}

  


.timeline-overlay[hidden] {
  display: none;
}

.timeline-overlay a {
  pointer-events: auto;
  cursor: alias;
}

.overlay-title {
  font-size: clamp(1.1rem, 1.3vw, 1.5rem);
  margin-bottom: -0.8rem;
  font-family: 'Spectral', serif;
  font-weight: bold;
  position: sticky;
  top: 0.5rem;
  /* outline: 1px solid rgb(255, 103, 103) ; */
  background-color: rgb(255, 255, 255);
  box-shadow: 0.2px -20px rgb(255, 255, 255);
  
  z-index: 11;

}

.overlay-year {
  font-size: clamp(1rem, 1.2vw, 1.4rem);
  font-family: 'Spectral', serif;
  position: sticky;
  /* top: 1rem; */
  /* outline: 1px solid rgb(255, 103, 103) ; */
  background-color: rgb(255, 255, 255);
  box-shadow: 0.1px 9px 10px 1px rgb(255, 255, 255), 0px -14px 0px 0px #ffffff;
    z-index: 10;
}

.overlay-tags-block {
  margin: 0.5rem;
  font-size: clamp(0.8rem, 0.9vw, 1rem);
  font-family: 'Spectral', serif;
  font-style: italic;
  list-style-type: none;
  max-width: 60vh;
  padding-top: 5%;
}

.overlay-tags-block ul li {
  list-style-type: none;
  margin: 0; /* optional, um Abstände zu entfernen */
  padding-top: 0.2rem;
  font-family: 'Spectral', serif;
  font-style: italic;
  align-content: column;
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background-color: #ffffff;
  border: 0.7px solid #000;
  border-radius: 60%;
  font-size: inherit;
}

.overlay-sources-block{
  font-size: clamp(0.8rem, 0.9vw, 1rem);
  font-family: 'Spectral', serif;
  font-style: italic;
  margin-bottom: 300px;
}

.overlay-sources-block ul li {
  list-style-type: "✹  ";
  margin: 0; /* optional, um Abstände zu entfernen */
  padding: 0;

}

.overlay-sources-toggle {
  border: none;
  background: none;
  font-family: 'Spectral', serif;
  font-style: italic;
  
  font-size: clamp(0.75rem, 0.9vw, 0.85rem);
  cursor: pointer;
  margin-bottom: 0.4rem;
}

.overlay-sources[hidden] {
  display: none;
}


/* Bild selbst darf nicht „sprengen“ */

.overlay-image img {
  display: block;
  width: auto;          /* 🔥 wichtig */
  max-width: 32vw;      /* gewünschtes Limit */
  max-height: 70vh;
  height: auto;
  object-fit: contain;
}

.overlay-text {
  max-width: 65ch;   /* ca. 60–70 Zeichen pro Zeile */
  min-width: 10ch;
  font-size: clamp(0.95rem, 1vw, 1.15rem);
  font-family: 'Spectral', serif;
  margin-top: 1rem;

}

.rechts,
.overlay-text{
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* DESKTOP: Bild-Wrapper ist der Anker */
.overlay-image figure,
.overlay-image .timeline-figure,
.overlay-image .overlay-figure{
  position: relative;      /* Anker für absolute children */
  max-width: 32vw;  
}

.overlay-close {
  font-family: 'Spectral', serif;
  position: absolute;
  align-items: left;
  font-size: clamp(1.2rem, 1.3vw, 1.5rem);
  background: transparent;
  border: none;
  color: rgb(0, 0, 0);
  cursor: pointer;
  position: absolute;      
  top: -2.2rem;            /* Abstand oberhalb */
  left: 0;                /* rechts am Bild */
  z-index: 999999;
  line-height: 1.2;
}


.links {
  flex: 0 1 auto;   /* darf schrumpfen */
  min-width: 0;     /* 🔥 extrem wichtig */
  max-width: 32vw;  /* bleibt dein Limit */
  margin-top: 1rem;
  max-height: 90vh;

  /* outline: 1px solid rgb(255, 103, 103); */
}

.links:empty {
  display: none;
}

/* Desktop: linke Spalte darf Caption zeigen */
.overlay-image,
.overlay-image figure,
.overlay-image .timeline-figure{
  overflow: visible;
}

.overlay-image figure{
  display: inline-block;   /* 🔥 nimmt nur Bildbreite an */
  margin: 0;
  max-width: 32vw; 
}

.overlay-image{
  flex: 0 0 auto;
}

/* REPLACE your .overlay-image figcaption { ... } with: */
.overlay-image figcaption,
.overlay-image .overlay-caption{
  width: 100%;          /* = Breite der figure */
  max-width: 100%;
  display: block;
  box-sizing: border-box;

  margin-top: .5rem;
  font-family: 'Spectral', serif;
  font-size: clamp(0.75rem, 0.8vw, 0.9rem);
  font-style: italic;
  line-height: 1.3;

  overflow-wrap: anywhere; /* verhindert “sprengen” */
  word-break: break-word;
  white-space: normal;
}

/* Bild */
.overlay-image .overlay-clean-img{
  display: block;
  width: auto;
  max-width: 32vw;
  max-height: 70vh;
  height: auto;
}




.rechts {
  margin-top: 1rem;
  margin-left: 1px;
  flex: 1 1 0;  /* wächst/schrumpft, aber mit Grenzen */
  min-width: 0;                         /* 🔥 erlaubt shrink */
  max-width: 90vh;

  overflow-y: auto;
  overflow-x: hidden;

}

/* Overlay-Tags als Buttons */
.overlay-tags li {
  list-style: none;
  display: inline-block;
  margin: 0.2rem 0.4rem 0.2rem 0;
  padding: 0.2rem 0.4rem;
  border: 1px solid black;
  border-radius: 999px;
  cursor: pointer;
  font-size: clamp(0.75rem, 0.9vw, 0.85rem);
  user-select: none;
  transition: background 0.2s ease, color 0.2s ease;
  max-width: 50vh;
}

/* Symbol vor Overlay-Tags */
.overlay-tags li .tagSym{
  display: inline-block;
  margin-right: 0.45em;
  font-size: 0.95em;
  line-height: 1;
  opacity: 0.9;
}

.overlay-tags li.is-active {
  background: black;
  color: white;
}

.overlay-tags li.is-inactive {
  opacity: 0.9;
  background: white;
  outline: 0.6px solid black;
}

.invisible-scrollbar::-webkit-scrollbar {
  display: none;
}



/* global sauber: wenn aktiv, dann klickbar */
.timeline-overlay.is-active { pointer-events: auto; }

/* Mobile only */
@media (max-width: 768px){

  /* Overlay: Hintergrund fix, kein Scroll hier */
  .timeline-overlay{
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.91);
    overflow-y: visible;
  }

  /* EIN Scroll-Container */
  .timeline-overlay-content{
    position: fixed;
    inset: 0;
    padding: 1.2rem;
    padding-top: 10vh;
    padding-bottom: 50px;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;

    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* outline: solid 1px rgb(103, 131, 255); */

    padding-left: 2rem;   /* ← hier einstellen */
    padding-right: 2rem;  /* ← hier einstellen */
  }

  /* Close / Title / Year nicht sticky */
  /* .overlay-close, */
  .overlay-title,
  .overlay-year{
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0;
  }

  .overlay-title{
    font-size: clamp(1.9rem, 6vw, 2.5rem);
    line-height: 0.92;
    margin: 0 0 0.12em 0;
    max-width: none;
    width: auto;
  }

  .overlay-year{
    display: block;
    font-size: clamp(0.9rem, 3.8vw, 1.15rem);
    line-height: 1;
    margin: 0 0 clamp(1rem, 2.6vh, 1.6rem) 0;
  }

  /* optional: links komplett aus */
/* .links{
  position: static !important;
  width: 100% !important;
 margin: 0; 
} */

  .rechts{
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* outline: solid 1px rgb(103, 255, 247); */
  }

.links,
.rechts{
  display: flex;
  flex-direction: column;
  /* outline: solid 1px rgb(125, 17, 17); */
}

  /* ---------- Bild: full-bleed (geht aus dem padding raus) ---------- */
  /* .overlay-image{
    margin: 12px -1.2rem 18px -1.2rem;          
    width: calc(100% + 2.4rem);
    outline: solid 1px rgb(103, 131, 255);
  } */

  /* egal ob geklonte figure oder clean img: im Flow halten */
  .overlay-image,
  .overlay-image figure,
  .overlay-image .timeline-figure{
    display: block;
    position: static !important;
    transform: none !important;
    float: none !important;
    overflow: visible !important;
    /* outline: 1px solid rgb(108, 255, 103); */
  }



  /* Text läuft nie über’s Bild */
  .overlay-text{ clear: both; }

  /* Quellen */
  .overlay-sources-toggle{ 
    margin-top: 6px; 
  
  }

  .overlay-sources{ 
    margin-top: 0;
    margin-bottom: 120px;
  }

  .overlay-sources-block{
    margin-bottom: 120px;
  }

  /* ------------------------------
   MOBILE FIXED CLOSE BUTTON
--------------------------------*/

.overlay-close{
  position: fixed !important;
  /* bottom: 24px; */
  left: 50%;
  transform: translateX(-50%);
  /* height: 4vh; */
  background: white;
  border: 1px solid black;
  padding: 0 5rem;
  /* padding: 12px 28px 12px 28px; */
  margin-top: 92vh;
  border-radius: 60%;
  font-size: 1rem;
  font-family: 'Trattatello', serif;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 999999;
}

/* optional: schöner Hover */
.overlay-close:active{
  transform: translateX(-50%) scale(0.97);
}

.padding-bottom-mobil{
  height: 100px;  
  /* outline: solid 1px rgb(255, 103, 103); */
  flex-shrink: 0;   /* 🔥 wichtig */
}

  /* wichtig: figure darf NICHT shrink-wrappen */
  .overlay-image figure,
  .overlay-image .timeline-figure,
  .overlay-image .overlay-figure{
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* wrapper auch */
  .overlay-image,
  .overlay-image.links{
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto;
    align-self: stretch;
  }

  /* bild = volle breite von .rechts */
  .overlay-image img,
  .overlay-image .overlay-clean-img{
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  /* caption ebenfalls */
  .overlay-image figcaption,
  .overlay-image .overlay-caption{
    width: 100% !important;
    max-width: 100% !important;
  }

  /* und: diese clamp-regel auf mobile deaktivieren */
  .overlay-image img{
    width: 100% !important;   /* überschreibt clamp sicher */
  }

  /* Bild IMMER volle Breite der Spalte */
  .rechts img,
  .rechts .overlay-clean-img{
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }

  /* Figure darf nicht shrink-wrappen */
  .rechts figure,
  .rechts .overlay-figure,
  .rechts .timeline-figure{
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
  }

}

/* Wrapper links */
.overlay-left{
  position: relative;
  flex: 0 0 auto;
}


/* Bild-Block: Breite = Bildbreite */
.overlay-image .overlay-figure{
  position: relative;
  /* display: inline-block;   
  max-width: 32vw; */
  margin: 0;
}

/* NUR wenn Bild da ist: Close sitzt über dem Bild (rechts oben) */
/* .overlay-left.has-image .overlay-close{
  top: -2.1rem;
  left: auto;
  right: 0;
} */

/* der Bildbereich ist der Anker */
.overlay-image.links{
  position: relative;
    display: block;   /* damit Breite "an Inhalt" hängt */
  max-width: 32vw;
}

/* Close sitzt über dem Bildbereich */
.overlay-image.links .overlay-close{
  position: absolute;
  top: -2.1rem;
  left: 0;
  z-index: 999999;
  background: white;
  border: 1px solid black;
  border-radius: 999px;
  padding: 0.05rem 0.6rem;
  line-height: 1.2;
}

/* Bild/figure: Breite = Bildbreite, Caption wird nie breiter */
.overlay-image.links .overlay-figure{
  display: inline-block;
  margin: 0;
  max-width: 32vw;
}

.overlay-image.links .overlay-clean-img{
  display: block;
  max-width: 32vw;
  height: auto;
}

.overlay-image.links .overlay-caption{
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  white-space: normal;
}/* =========================================
   DESKTOP – Bild skaliert bis max 32vw
   aber NICHT künstlich größer als nötig
   Caption exakt Bildbreite
   ========================================= */

@media (min-width: 769px){

  /* linke Spalte shrink-wrap */
/* #timeline-overlay .links{
  flex: 0 1 clamp(260px, 32vw, 520px);

  max-width: clamp(260px, 32vw, 520px);
  min-width: 0;

  display: flex;
  flex-direction: column;
} */

#timeline-overlay .links{
  flex: 0 0 auto;
  width: fit-content;
  max-width: 32vw;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

  /* figure bestimmt Breite */
  #timeline-overlay .overlay-figure{
    display: inline-block;
    max-width: 100%;
    margin: 0;
  }

  /* Bild: darf wachsen, aber nicht über 32vw */
#timeline-overlay .overlay-clean-img{
  display: block;

  width: 100%;
  height: auto;

  max-width: 100%;
  max-height: 70vh;

  object-fit: contain;
}

  /* Caption = exakt figure Breite */
  #timeline-overlay .overlay-caption{
    max-width: 30vw;
    width: 100%;
    box-sizing: border-box;

    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .overlay-caption {
  white-space: normal;
  overflow-wrap: break-word;
}

.overlay-caption .caption-main {
  display: block;
}

.overlay-caption .caption-credit {
  display: block;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;

  margin-top: .2rem;
  font-size: 0.85em;
  opacity: 0.75;
}

}

/* Wenn der Tags-Block hidden ist → Quellen bekommen oben Luft */
#timeline-overlay .overlay-tags-block[hidden] + .overlay-sources-block{
  margin-top: 1.2rem;   /* <- hier feinjustieren */
}

/* Wenn Tags sichtbar sind → keine Extra-Luft (wie jetzt) */
#timeline-overlay .overlay-tags-block:not([hidden]) + .overlay-sources-block{
  margin-top: 0;
}

/* MOBILE: Overlay-Bild immer volle Breite */
@media (max-width: 768px){

  /* die linke Spalte darf nicht 32vw begrenzen */
  #timeline-overlay .links{
    width: 100% !important;
    max-width: 100% !important;
  }

  /* killt shrink-wrap auf dem Bild-Wrapper */
  #timeline-overlay .overlay-image,
  #timeline-overlay .overlay-image.links,
  #timeline-overlay .overlay-image figure,
  #timeline-overlay .overlay-image .overlay-figure,
  #timeline-overlay .overlay-image .timeline-figure{
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* das eigentliche Bild MUSS max-width:32vw überschreiben */
#timeline-overlay .overlay-image img,
#timeline-overlay .overlay-image .overlay-clean-img{
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;   /* <-- wichtig */
  object-fit: contain !important;
}

  /* Caption auch volle Breite */
  #timeline-overlay .overlay-image figcaption,
  #timeline-overlay .overlay-image .overlay-caption{
    width: 100% !important;
    max-width: 100% !important;
  }

  #timeline-overlay img{
  width: 100%;
  height: auto;
}

#timeline-overlay .overlay-left{
  width: 0 !important;
  max-width: 0 !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 0 !important;
}
}

/* =========================================
   SCROLLBARS ÜBERALL AUSBLENDEN
   ========================================= */

/* Firefox + IE/Edge alt */
.timeline-overlay,
.timeline-overlay-content,
#timeline-overlay .rechts,
#timeline-overlay .links,
#timeline-overlay .overlay-sources,
#timeline-overlay .overlay-tags-block,
#timeline-overlay .overlay-sources-block {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Chrome / Safari / Opera */
.timeline-overlay::-webkit-scrollbar,
.timeline-overlay-content::-webkit-scrollbar,
#timeline-overlay .rechts::-webkit-scrollbar,
#timeline-overlay .links::-webkit-scrollbar,
#timeline-overlay .overlay-sources::-webkit-scrollbar,
#timeline-overlay .overlay-tags-block::-webkit-scrollbar,
#timeline-overlay .overlay-sources-block::-webkit-scrollbar {
  display: none;
}

@media (min-width: 1700px){

  .overlay-tags-block{
    font-size: clamp(0.9rem, 1vw, 1rem);
  }

  .overlay-sources-block{
    font-size: clamp(0.9rem, 1vw, 1rem);
  }

  .overlay-sources-toggle{
    font-size: clamp(0.85rem, 1vw, 1rem);
  }

  .overlay-text,
  .overlay-year{
    font-size: clamp(1.05rem, 1.1vw, 1.25rem);
  }

  .overlay-tags-block ul li{
    border: 0.4px solid #000;
  }


.overlay-tags li.is-inactive {
  opacity: 0.9;
  background: white;
  outline: none;
}


}

/* =========================================
   MOBILE OVERLAY TITLE/YEAR FINAL OVERRIDE
   GANZ AM ENDE DER DATEI
   ========================================= */
@media (max-width: 768px) {
  #timeline-overlay .overlay-title {
    font-size: clamp(1.9rem, 6vw, 2.5rem) !important;
    line-height: 0.99 !important;
    margin: 0 0 0.12em 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: auto !important;
    display: block !important;
  }

  #timeline-overlay .overlay-year {
    display: block !important;
    font-size: clamp(0.9rem, 3.8vw, 1.15rem) !important;
    line-height: 1 !important;
    margin: 0 0 clamp(1rem, 2.6vh, 1.6rem) 0 !important;
    padding: 0 !important;
  }
}

/* =========================================
   SEHR KLEINE HANDYS – Overlay Title/Year
   GANZ AM ENDE DER DATEI
   ========================================= */
@media (max-width: 420px) {
  #timeline-overlay .overlay-title {
    font-size: clamp(2.1rem, 8.6vw, 3rem) !important;
    line-height: 0.4 !important;
    letter-spacing: -0.02em !important;

    margin: 0 0 0.32em 0 !important;
    padding: 0 !important;

    display: block !important;
    max-width: 11ch !important;
    width: auto !important;
  }

  #timeline-overlay .overlay-year {
    font-size: clamp(0.95rem, 4.2vw, 1.15rem) !important;
    line-height: 1 !important;

    margin: 0 0 6rem 0 !important;
    padding: 0 !important;

    display: block !important;
  }
}

@font-face {
  font-family: 'Spectral';
  src: local('Spectral'),
       url('fonts/Spectral/Spectral-Regular.ttf') format('ttf');
}

@font-face {
  font-family: 'trattatello';
  src: local('trattatello'),
       url('fonts/Trattatello/web/font/Trattatello.woff2') format('woff2');
}

.timeline-overlay {
  position: absolute;
  width: 100%;
  height: 100dvh;
  inset: 0;
  background: rgba(255, 255, 255, 0.924);
  z-index: 20000;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  pointer-events: none;   /* 👈 WICHTIG */
  overflow-x: visible;
  overflow-y: hidden;
}

.timeline-overlay-content{
  display:absolute;
  overflow: visible;
  left: 5%;
  right: 5%;
  max-width: none;
  width: auto;
  box-sizing: border-box;
  /* outline: solid 1px rgb(103, 131, 255); */
}

.timeline-overlay.is-active {
  opacity: 1;

}


.timeline-overlay a {
  pointer-events: auto;
  cursor: pointer;
  /* outline: 1px solid rgb(255, 103, 103); */
}

/* .timeline-overlay.overlay-tags-block ul {
    outline: 1px solid rgb(103, 255, 240);
    } */

.timeline-overlay-content {
  position: absolute;
  margin-top: 10vh;

  left: 5%;
  right: 5%;          /* ✅ definiert die Breite sauber */
  width: auto;
  max-width: none;

  padding: clamp(12px, 2vw, 28px);
  box-sizing: border-box;

  display: flex;
  /* gap: clamp(12px, 2vw, 28px); */
  align-items: flex-start;

  max-height: 90vh;
  overflow: hidden;   /* ✅ NICHTS darf rauslaufen */
  align-items: flex-start;
  /* gap: 2rem; */
  padding-right: 6px; /* oder mehr */

  /*overflow: hidden;    👈 wichtig */

  gap: clamp(10px, 1.6vw, 24px);

}

  


.timeline-overlay[hidden] {
  display: none;
}

.timeline-overlay a {
  pointer-events: auto;
  cursor: alias;
}

.overlay-title {
  font-size: clamp(1.05rem, 1.25vw, 1.45rem);
  margin-bottom: -0.3rem;
  font-family: 'Spectral', serif;
  font-weight: bold;
  position: sticky;
  top: 1rem;
  /* outline: 1px solid rgb(255, 103, 103) ; */
  background-color: rgb(255, 255, 255);
  box-shadow: 0.2px -20px rgb(255, 255, 255);
  
  z-index: 11;

}

.overlay-year {
  font-size: clamp(1rem, 1.2vw, 1.4rem);
  font-family: 'Spectral', serif;
  position: sticky;
  top: 2.4rem;
  /* outline: 1px solid rgb(255, 103, 103) ; */
  background-color: rgb(255, 255, 255);
  box-shadow: 0.1px 9px 10px 1px rgb(255, 255, 255), 0px -14px 0px 0px #ffffff;
    z-index: 10;
}

.overlay-tags-block {
  margin: 0.5rem;
  font-size: clamp(0.8rem, 0.9vw, 1rem);
  font-family: 'Spectral', serif;
  font-style: italic;
  list-style-type: none;
  max-width: 60vh;
  padding-top: 5%;
}

.overlay-tags-block ul li {
  list-style-type: none;
  margin: 0; /* optional, um Abstände zu entfernen */
  padding-top: 0.2rem;
  font-family: 'Spectral', serif;
  font-style: italic;
  align-content: column;
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background-color: #ffffff;
  border: 0.7px solid #000;
  border-radius: 60%;
  font-size: inherit;
}

.overlay-sources-block{
  font-size: clamp(0.8rem, 0.9vw, 1rem);
  font-family: 'Spectral', serif;
  font-style: italic;
  margin-bottom: 300px;
}

.overlay-sources-block ul li {
  list-style-type: "✹  ";
  margin: 0; /* optional, um Abstände zu entfernen */
  padding: 0;

}

.overlay-sources-toggle {
  border: none;
  background: none;
  font-family: 'Spectral', serif;
  font-style: italic;
  
  font-size: clamp(0.75rem, 0.9vw, 0.85rem);
  cursor: pointer;
  margin-bottom: 0.4rem;
}

.overlay-sources[hidden] {
  display: none;
}


/* Bild selbst darf nicht „sprengen“ */

.overlay-image img {
  display: block;
  width: auto;          /* 🔥 wichtig */
  max-width: 32vw;      /* gewünschtes Limit */
  max-height: 70vh;
  height: auto;
  object-fit: contain;
}

.overlay-text {
  max-width: 65ch;   /* ca. 60–70 Zeichen pro Zeile */
  min-width: 10ch;
  font-size: clamp(0.95rem, 1vw, 1.15rem);
  font-family: 'Spectral', serif;
  margin-top: 1rem;

}

.rechts,
.overlay-text{
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* DESKTOP: Bild-Wrapper ist der Anker */
.overlay-image figure,
.overlay-image .timeline-figure,
.overlay-image .overlay-figure{
  position: relative;      /* Anker für absolute children */
  max-width: 32vw;  
}

.overlay-close {
  font-family: 'Spectral', serif;
  position: absolute;
  align-items: left;
  font-size: clamp(1.2rem, 1.3vw, 1.5rem);
  background: transparent;
  border: none;
  color: rgb(0, 0, 0);
  cursor: pointer;
  position: absolute;      
  top: -2.2rem;            /* Abstand oberhalb */
  left: 0;                /* rechts am Bild */
  z-index: 999999;
  line-height: 1.2;
}


.links {
  flex: 0 1 auto;   /* darf schrumpfen */
  min-width: 0;     /* 🔥 extrem wichtig */
  max-width: 32vw;  /* bleibt dein Limit */
  margin-top: 1rem;
  max-height: 90vh;

  /* outline: 1px solid rgb(255, 103, 103); */
}

.links:empty {
  display: none;
}

/* Desktop: linke Spalte darf Caption zeigen */
.overlay-image,
.overlay-image figure,
.overlay-image .timeline-figure{
  overflow: visible;
}

.overlay-image figure{
  display: inline-block;   /* 🔥 nimmt nur Bildbreite an */
  margin: 0;
  max-width: 32vw; 
}

.overlay-image{
  flex: 0 0 auto;
}

/* REPLACE your .overlay-image figcaption { ... } with: */
.overlay-image figcaption,
.overlay-image .overlay-caption{
  width: 100%;          /* = Breite der figure */
  max-width: 100%;
  display: block;
  box-sizing: border-box;

  margin-top: .5rem;
  font-family: 'Spectral', serif;
  font-size: clamp(0.75rem, 0.8vw, 0.9rem);
  font-style: italic;
  line-height: 1.3;

  overflow-wrap: anywhere; /* verhindert “sprengen” */
  word-break: break-word;
  white-space: normal;
}

/* Bild */
.overlay-image .overlay-clean-img{
  display: block;
  width: auto;
  max-width: 32vw;
  max-height: 70vh;
  height: auto;
}




.rechts {
  margin-top: 1rem;
  margin-left: 1px;
  flex: 1 1 0;  /* wächst/schrumpft, aber mit Grenzen */
  min-width: 0;                         /* 🔥 erlaubt shrink */
  max-width: 90vh;

  overflow-y: auto;
  overflow-x: hidden;

}

/* Overlay-Tags als Buttons */
.overlay-tags li {
  list-style: none;
  display: inline-block;
  margin: 0.2rem 0.4rem 0.2rem 0;
  padding: 0.2rem 0.4rem;
  border: 1px solid black;
  border-radius: 999px;
  cursor: pointer;
  font-size: clamp(0.75rem, 0.9vw, 0.85rem);
  user-select: none;
  transition: background 0.2s ease, color 0.2s ease;
  max-width: 50vh;
}

/* Symbol vor Overlay-Tags */
.overlay-tags li .tagSym{
  display: inline-block;
  margin-right: 0.45em;
  font-size: 0.95em;
  line-height: 1;
  opacity: 0.9;
}

.overlay-tags li.is-active {
  background: black;
  color: white;
}

.overlay-tags li.is-inactive {
  opacity: 0.9;
  background: white;
  outline: 0.6px solid black;
}

.invisible-scrollbar::-webkit-scrollbar {
  display: none;
}



/* global sauber: wenn aktiv, dann klickbar */
.timeline-overlay.is-active { pointer-events: auto; }

/* Mobile only */
@media (max-width: 768px){

  /* Overlay: Hintergrund fix, kein Scroll hier */
  .timeline-overlay{
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.91);
    overflow-y: visible;
  }

  /* EIN Scroll-Container */
  .timeline-overlay-content{
    position: fixed;
    inset: 0;
    padding: 1.2rem;
    padding-top: 10vh;
    padding-bottom: 50px;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;

    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    /* outline: solid 1px rgb(103, 131, 255); */

    padding-left: 2rem;   /* ← hier einstellen */
    padding-right: 2rem;  /* ← hier einstellen */
  }

  /* Close / Title / Year nicht sticky */
  /* .overlay-close, */
  .overlay-title,
  .overlay-year{
    position: static !important;
    top: auto !important;
    z-index: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0;
  }

  .overlay-title{
    font-size: clamp(1.9rem, 6vw, 2.5rem);
    line-height: 0.92;
    margin: 0 0 0.12em 0;
    max-width: none;
    width: auto;
  }

  .overlay-year{
    display: block;
    font-size: clamp(0.9rem, 3.8vw, 1.15rem);
    line-height: 1;
    margin: 0 0 clamp(1rem, 2.6vh, 1.6rem) 0;
  }

  /* optional: links komplett aus */
/* .links{
  position: static !important;
  width: 100% !important;
 margin: 0; 
} */

  .rechts{
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* outline: solid 1px rgb(103, 255, 247); */
  }

.links,
.rechts{
  display: flex;
  flex-direction: column;
  /* outline: solid 1px rgb(125, 17, 17); */
}

  /* ---------- Bild: full-bleed (geht aus dem padding raus) ---------- */
  /* .overlay-image{
    margin: 12px -1.2rem 18px -1.2rem;          
    width: calc(100% + 2.4rem);
    outline: solid 1px rgb(103, 131, 255);
  } */

  /* egal ob geklonte figure oder clean img: im Flow halten */
  .overlay-image,
  .overlay-image figure,
  .overlay-image .timeline-figure{
    display: block;
    position: static !important;
    transform: none !important;
    float: none !important;
    overflow: visible !important;
    /* outline: 1px solid rgb(108, 255, 103); */
  }



  /* Text läuft nie über’s Bild */
  .overlay-text{ clear: both; }

  /* Quellen */
  .overlay-sources-toggle{ 
    margin-top: 6px; 
  
  }

  .overlay-sources{ 
    margin-top: 0;
    margin-bottom: 120px;
  }

  .overlay-sources-block{
    margin-bottom: 120px;
  }

  /* ------------------------------
   MOBILE FIXED CLOSE BUTTON
--------------------------------*/

.overlay-close{
  position: fixed !important;
  /* bottom: 24px; */
  left: 50%;
  transform: translateX(-50%);
  /* height: 4vh; */
  background: white;
  border: 1px solid black;
  padding: 0 5rem;
  /* padding: 12px 28px 12px 28px; */
  margin-top: 92vh;
  border-radius: 60%;
  font-size: 1rem;
  font-family: 'Trattatello', serif;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 999999;
}

/* optional: schöner Hover */
.overlay-close:active{
  transform: translateX(-50%) scale(0.97);
}

.padding-bottom-mobil{
  height: 100px;  
  /* outline: solid 1px rgb(255, 103, 103); */
  flex-shrink: 0;   /* 🔥 wichtig */
}

  /* wichtig: figure darf NICHT shrink-wrappen */
  .overlay-image figure,
  .overlay-image .timeline-figure,
  .overlay-image .overlay-figure{
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* wrapper auch */
  .overlay-image,
  .overlay-image.links{
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 auto;
    align-self: stretch;
  }

  /* bild = volle breite von .rechts */
  .overlay-image img,
  .overlay-image .overlay-clean-img{
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
  }

  /* caption ebenfalls */
  .overlay-image figcaption,
  .overlay-image .overlay-caption{
    width: 100% !important;
    max-width: 100% !important;
  }

  /* und: diese clamp-regel auf mobile deaktivieren */
  .overlay-image img{
    width: 100% !important;   /* überschreibt clamp sicher */
  }

  /* Bild IMMER volle Breite der Spalte */
  .rechts img,
  .rechts .overlay-clean-img{
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }

  /* Figure darf nicht shrink-wrappen */
  .rechts figure,
  .rechts .overlay-figure,
  .rechts .timeline-figure{
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
  }

}

/* Wrapper links */
.overlay-left{
  position: relative;
  flex: 0 0 auto;
}


/* Bild-Block: Breite = Bildbreite */
.overlay-image .overlay-figure{
  position: relative;
  /* display: inline-block;   
  max-width: 32vw; */
  margin: 0;
}

/* NUR wenn Bild da ist: Close sitzt über dem Bild (rechts oben) */
/* .overlay-left.has-image .overlay-close{
  top: -2.1rem;
  left: auto;
  right: 0;
} */

/* der Bildbereich ist der Anker */
.overlay-image.links{
  position: relative;
    display: block;   /* damit Breite "an Inhalt" hängt */
  max-width: 32vw;
}

/* Close sitzt über dem Bildbereich */
.overlay-image.links .overlay-close{
  position: absolute;
  top: -2.1rem;
  left: 0;
  z-index: 999999;
  background: white;
  border: 1px solid black;
  border-radius: 999px;
  padding: 0.05rem 0.6rem;
  line-height: 1.2;
}

/* Bild/figure: Breite = Bildbreite, Caption wird nie breiter */
.overlay-image.links .overlay-figure{
  display: inline-block;
  margin: 0;
  max-width: 32vw;
}

.overlay-image.links .overlay-clean-img{
  display: block;
  max-width: 32vw;
  height: auto;
}

.overlay-image.links .overlay-caption{
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  white-space: normal;
}/* =========================================
   DESKTOP – Bild skaliert bis max 32vw
   aber NICHT künstlich größer als nötig
   Caption exakt Bildbreite
   ========================================= */

@media (min-width: 769px){

  /* linke Spalte shrink-wrap */
/* #timeline-overlay .links{
  flex: 0 1 clamp(260px, 32vw, 520px);

  max-width: clamp(260px, 32vw, 520px);
  min-width: 0;

  display: flex;
  flex-direction: column;
} */

#timeline-overlay .links{
  flex: 0 0 auto;
  width: fit-content;
  max-width: 32vw;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

  /* figure bestimmt Breite */
  #timeline-overlay .overlay-figure{
    display: inline-block;
    max-width: 100%;
    margin: 0;
  }

  /* Bild: darf wachsen, aber nicht über 32vw */
#timeline-overlay .overlay-clean-img{
  display: block;

  width: 100%;
  height: auto;

  max-width: 100%;
  max-height: 70vh;

  object-fit: contain;
}

  /* Caption = exakt figure Breite */
  #timeline-overlay .overlay-caption{
    max-width: 30vw;
    width: 100%;
    box-sizing: border-box;

    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .overlay-caption {
  white-space: normal;
  overflow-wrap: break-word;
}

.overlay-caption .caption-main {
  display: block;
}

.overlay-caption .caption-credit {
  display: block;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;

  margin-top: .2rem;
  font-size: 0.85em;
  opacity: 0.75;
}

}

/* Wenn der Tags-Block hidden ist → Quellen bekommen oben Luft */
#timeline-overlay .overlay-tags-block[hidden] + .overlay-sources-block{
  margin-top: 1.2rem;   /* <- hier feinjustieren */
}

/* Wenn Tags sichtbar sind → keine Extra-Luft (wie jetzt) */
#timeline-overlay .overlay-tags-block:not([hidden]) + .overlay-sources-block{
  margin-top: 0;
}

/* MOBILE: Overlay-Bild immer volle Breite */
@media (max-width: 768px){

  /* die linke Spalte darf nicht 32vw begrenzen */
  #timeline-overlay .links{
    width: 100% !important;
    max-width: 100% !important;
  }

  /* killt shrink-wrap auf dem Bild-Wrapper */
  #timeline-overlay .overlay-image,
  #timeline-overlay .overlay-image.links,
  #timeline-overlay .overlay-image figure,
  #timeline-overlay .overlay-image .overlay-figure,
  #timeline-overlay .overlay-image .timeline-figure{
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* das eigentliche Bild MUSS max-width:32vw überschreiben */
#timeline-overlay .overlay-image img,
#timeline-overlay .overlay-image .overlay-clean-img{
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: none !important;   /* <-- wichtig */
  object-fit: contain !important;
}

  /* Caption auch volle Breite */
  #timeline-overlay .overlay-image figcaption,
  #timeline-overlay .overlay-image .overlay-caption{
    width: 100% !important;
    max-width: 100% !important;
  }

  #timeline-overlay img{
  width: 100%;
  height: auto;
}

#timeline-overlay .overlay-left{
  width: 0 !important;
  max-width: 0 !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 0 !important;
}
}

/* =========================================
   SCROLLBARS ÜBERALL AUSBLENDEN
   ========================================= */

/* Firefox + IE/Edge alt */
.timeline-overlay,
.timeline-overlay-content,
#timeline-overlay .rechts,
#timeline-overlay .links,
#timeline-overlay .overlay-sources,
#timeline-overlay .overlay-tags-block,
#timeline-overlay .overlay-sources-block {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* Chrome / Safari / Opera */
.timeline-overlay::-webkit-scrollbar,
.timeline-overlay-content::-webkit-scrollbar,
#timeline-overlay .rechts::-webkit-scrollbar,
#timeline-overlay .links::-webkit-scrollbar,
#timeline-overlay .overlay-sources::-webkit-scrollbar,
#timeline-overlay .overlay-tags-block::-webkit-scrollbar,
#timeline-overlay .overlay-sources-block::-webkit-scrollbar {
  display: none;
}

@media (min-width: 1700px){

  .overlay-tags-block{
    font-size: clamp(0.9rem, 1vw, 1rem);
  }

  .overlay-sources-block{
    font-size: clamp(0.9rem, 1vw, 1rem);
  }

  .overlay-sources-toggle{
    font-size: clamp(0.85rem, 1vw, 1rem);
  }

  .overlay-text,
  .overlay-year{
    font-size: clamp(1.05rem, 1.1vw, 1.25rem);
  }

  .overlay-tags-block ul li{
    border: 0.4px solid #000;
  }


.overlay-tags li.is-inactive {
  opacity: 0.9;
  background: white;
  outline: none;
}


}

@media (max-width: 768px) {
  #timeline-overlay .timeline-overlay-content {
    padding-top: 12.5vh !important;
  }

  #timeline-overlay .rechts {
    gap: 0 !important; /* entfernt Extra-Abstand zwischen title/year/text */
  }

  #timeline-overlay .overlay-title {
    font-size: clamp(1.2rem, 4.2vw, 1.40rem) !important;
    line-height: 0.99 !important;
    margin: 0.8em 0 0.08em 0 !important; /* weniger Abstand zum Jahr */
    padding: 0 !important;
    max-width: none !important;
    width: auto !important;
    display: block !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    hyphens: auto !important;
    white-space: normal !important;
  }

  #timeline-overlay .overlay-year {
    display: block !important;
    font-size: clamp(0.95rem, 3.85vw, 1.20rem) !important;
    line-height: 1 !important;
    margin: 0 0 1.8em 0 !important;
    padding: 0 !important;
  }

  #timeline-overlay .overlay-text {
    max-width: 99% !important;
    width: 99% !important;
    margin-top: 0 !important; 
  font-size: clamp(0.95rem, 1vw, 1.15rem);
  font-family: 'Spectral', serif;
}

}

@media (max-width: 420px) {
  #timeline-overlay .timeline-overlay-content {
    padding-top: 14vh !important;
  }

  #timeline-overlay .rechts {
    gap: 0 !important;
  }

  #timeline-overlay .overlay-title {
    font-size: clamp(1.2rem, 4.2vw, 1.40rem) !important;
    line-height: 0.99 !important;
    margin: 0.4em 0 0.06em 0 !important; /* weniger Abstand zum Jahr */
    padding: 0 !important;
    max-width: none !important;
    width: auto !important;
    display: block !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    hyphens: auto !important;
    white-space: normal !important;
  }

  #timeline-overlay .overlay-year {
    font-size: clamp(0.95rem, 3.85vw, 1.20rem) !important;
    line-height: 1 !important;
    margin: 0 0 0.4em 0 !important;
    padding: 0 !important;
    display: block !important;
  }

  #timeline-overlay .overlay-text {
    max-width: 100% !important;
    width: 100% !important;
    margin-top: 0 !important; 
  font-size: clamp(0.95rem, 1vw, 1.15rem);
  font-family: 'Spectral', serif;
}}