/* 40 Jahre DAS DA THEATER – gemeinsames Stylesheet */

/* Domaine Display: sobald die lizenzierte Datei in /fonts liegt, diesen Block einkommentieren.
   Bis dahin greift Gloock als Ersatz (so entsteht keine vergebliche Anfrage).
@font-face {
  font-family: "Domaine Display";
  src: url("../fonts/domaine-display-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
*/
/* Selbst gehostet (SIL Open Font License), Quelle: Google Fonts, nur Latin-Zeichensatz */
@font-face {
  font-family: "Gloock";
  src: url("../fonts/gloock-400-latin.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-variable-latin.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --ink: #0f172a;
  --paper: #ffffff;
  --mist: #f1f5f9;
  --cyan: #009ee0;
  --text-2: #cbd5e1;
  --text-3: #94a3b8;
  --line: #1e293b;
  --display: "Domaine Display", "Gloock", Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --gutter: 16px;
  --header-h: 52px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  caret-color: var(--cyan);
  scrollbar-color: #334155 var(--ink);
}
::selection { background: var(--cyan); color: var(--ink); }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* Kopfzeile */
.site-header {
  position: sticky; top: 0; z-index: 10;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 var(--gutter);
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}
.site-header__home {
  font-weight: 700; font-size: 15px; letter-spacing: 0.01em; text-decoration: none;
}
.decade-menu { position: relative; }
.decade-menu summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 2px;
  font-size: 15px; color: var(--text-2);
}
.decade-menu summary::-webkit-details-marker { display: none; }
.decade-menu summary svg { transition: transform 200ms var(--ease-out); }
.decade-menu[open] summary svg { transform: rotate(180deg); }
.decade-menu ul {
  position: absolute; right: 0; top: calc(100% + 4px);
  margin: 0; padding: 6px 0; list-style: none; min-width: 190px;
  background: var(--ink); border: 1px solid #334155;
  box-shadow: 0 12px 32px rgb(2 6 23 / 0.6);
}
.decade-menu li a, .decade-menu li span {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; min-height: 44px; text-decoration: none; font-size: 16px;
}
.decade-menu li a:hover { background: var(--line); }
.decade-menu li [aria-current="page"] { color: var(--cyan); font-weight: 700; }
.decade-menu li span { color: var(--text-3); }
.decade-menu small { font-size: 13px; color: var(--text-3); }

/* Jahrzehnt-Einstieg */
.decade-intro { padding: 40px var(--gutter) 8px; }
.decade-intro h1 {
  margin: 0; font-family: var(--display); font-weight: 400;
  font-size: clamp(34px, 10.4vw, 96px); line-height: 1.1; letter-spacing: -0.01em;
}
.decade-intro p { margin: 14px 0 0; color: var(--text-2); max-width: 34em; }

/* Spielzeiten-Leiste: zeigt, dass nur eine Auswahl zu sehen ist */
.seasons { margin-top: 28px; }
.seasons__note { margin: 0 0 10px; font-size: 15px; color: var(--text-2); }
.seasons__note b { color: var(--paper); }
.seasons__list {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 4px 6px; margin: 0; padding: 0; list-style: none; max-width: 52rem;
}
@media (min-width: 560px) { .seasons__list { grid-template-columns: repeat(8, 1fr); } }
.seasons__list a, .seasons__list span {
  display: flex; align-items: center; justify-content: center;
  min-height: 44px; font-size: 15px; font-variant-numeric: tabular-nums;
  border-bottom: 2px solid #334155;
}
.seasons__list span { color: var(--text-3); }
.seasons__list a {
  color: var(--paper); font-weight: 700; text-decoration: none;
  border-bottom-color: var(--cyan);
  transition: background 160ms var(--ease-out);
}
.seasons__list a:hover { background: var(--line); }

/* Chronik: die nicht gezeigten Produktionen ziehen beim Scrollen vorbei */
.chronicle {
  position: relative; list-style: none;
  margin: 56px var(--gutter) 40px; padding: 4px 0 4px 22px;
  max-width: 40rem;
}
.chronicle::before {
  content: ""; position: absolute; left: 3px; top: 0; bottom: 0; width: 1px; background: #334155;
}
.chronicle li {
  position: relative;
  display: grid; grid-template-columns: 2em 3.2em 1fr; gap: 10px; align-items: baseline;
  padding: 11px 0;
  color: var(--text-3); font-size: 16px; line-height: 1.35;
  font-variant-numeric: tabular-nums;
  transition: color 320ms var(--ease-out);
}
/* Punkt mittig zur ersten Textzeile: Abstand oben (11px) + halbe Zeilenhöhe (10.8px) − halbe Punktgröße */
.chronicle li::before {
  content: ""; position: absolute; left: -22px; top: calc(11px + 0.675em - 3.5px);
  width: 7px; height: 7px; border-radius: 50%;
  background: #334155;
  transition: background 320ms var(--ease-out), transform 320ms var(--ease-out);
}
.chronicle__n { font-size: 13px; }
.chronicle__date { font-size: 15px; }
.chronicle__cat { display: block; font-size: 13px; line-height: 1.4; color: var(--text-3); }
.chronicle li.is-passing .chronicle__cat { color: var(--text-2); }

/* Stücke mit Fotos: Zeile zum Aufklappen */
.chronicle li.has-more { display: block; padding: 0; color: var(--paper); scroll-margin-top: calc(var(--header-h) + 4px); }
.chronicle li.has-more::before {
  background: var(--ink); box-shadow: inset 0 0 0 2px var(--cyan);
  width: 11px; height: 11px; left: -24px; top: calc(11px + 0.675em - 5.5px);
}
.chronicle li.has-more.is-passing::before { background: var(--cyan); transform: scale(1.2); }

/* Meilensteine der Theaterpädagogik: nur die Kategorie in Cyan, sonst wie jede andere Zeile */
.chronicle li.is-meilenstein .chronicle__cat { color: var(--cyan); }
.chronicle summary {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 2em 3.2em 1fr 30px; gap: 10px; align-items: baseline;
  padding: 11px 0;
  -webkit-tap-highlight-color: transparent;
}
.chronicle summary::-webkit-details-marker { display: none; }
.chronicle summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.chronicle li.has-more .chronicle__title { font-weight: 700; }
.chronicle li.has-more .chronicle__cat { font-weight: 400; }
/* Pfeil für die ganze Zeile: „hier gibt es mehr“ */
/* Oben angedockt: Oberkante des Kästchens = Oberkante der Großbuchstaben in der ersten Zeile (≈ 0,3em unter der Zeilenoberkante) */
.chronicle__toggle {
  align-self: start; justify-self: end; margin-top: 0.3em;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; color: var(--cyan);
  box-shadow: inset 0 0 0 1.5px var(--cyan); border-radius: 3px;
  transition: background 200ms var(--ease-out), color 200ms var(--ease-out);
}
.chronicle__toggle svg { transition: transform 240ms var(--ease-out); }
details[open] .chronicle__toggle svg { transform: rotate(180deg); }
.chronicle summary:hover .chronicle__toggle,
details[open] .chronicle__toggle { background: var(--cyan); color: var(--ink); }

/* Aufgeklappter Inhalt bleibt rechts der Zeitachse; die Galerie läuft bis zum rechten Rand */
.more {
  margin: 4px calc(-1 * var(--gutter)) 28px 0;
  padding-top: 8px;
}
.more .gallery__track { padding-left: 0; scroll-padding-left: 0; }
.more .gallery__bar { padding-left: 0; }
.more .gallery { --photo-h: min(62vw, 46svh, 480px); }
.more__info { padding: 14px var(--gutter) 0 0; max-width: 40rem; }
.more__info .play__meta { margin-top: 0; }
@media (prefers-reduced-motion: no-preference) {
  details[open] .more { animation: more-in 420ms var(--ease-out); }
}
@keyframes more-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* Jahrzehnt-Wegmarke im Zeitstrahl */
.era {
  margin: 72px var(--gutter) 0; padding-top: 16px;
  border-top: 1px solid #334155;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(64px, 22vw, 96px); line-height: 0.95; letter-spacing: -0.01em;
  scroll-margin-top: calc(var(--header-h) + 8px);
}
.era + .chronicle { margin-top: 32px; }
/* Genug Platz nach unten, damit auch die letzte Produktion die Bildschirmmitte erreicht */
.timeline-end {
  margin: 56px var(--gutter) max(64px, calc(50svh - 100px));
  font-family: var(--display); font-size: 40px; line-height: 1.1;
}
.chronicle li.is-passing { color: var(--paper); }
.chronicle li.is-passing .chronicle__date { color: var(--cyan); }
.chronicle li.is-passing::before { background: var(--cyan); transform: scale(1.5); }
@media (prefers-reduced-motion: reduce) {
  .chronicle li, .chronicle li::before { transition: none; }
}

/* Fortschritt durch die 33 Produktionen, als Linie unter der Kopfzeile */
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--cyan); transform-origin: left;
  transform: scaleX(var(--progress, 0));
  transition: transform 400ms var(--ease-out);
}

/* Stück */
.play { padding: 8px 0 8px; scroll-margin-top: 4px; }
.play__n { display: block; margin-top: 2px; color: var(--text-3); font-size: 15px; }

/* Galerie */
.gallery { position: relative; }
.gallery { --photo-h: min(52svh, 520px); }
.gallery__track {
  display: flex; gap: 12px; align-items: flex-end;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  padding: 0 var(--gutter);
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}
.gallery__track::-webkit-scrollbar { display: none; }
/* Jedes Foto in seinem echten Format: gemeinsame Höhe, Breite aus dem Seitenverhältnis */
.gallery__slide {
  flex: 0 0 auto;
  scroll-snap-align: start;
  margin: 0;
}
.gallery__open {
  all: unset; cursor: zoom-in; display: block;
  -webkit-tap-highlight-color: transparent;
}
.gallery__open:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
/* Nach Tippen/Wischen/Klicken keine Kontur (Klasse setzt gallery.js); Tastatur behält sie */
.nutzt-zeiger .gallery__open:focus-visible,
.nutzt-zeiger .gallery__track:focus-visible { outline: none; }
/* Einheitliche Höhe, Breite aus dem Format. Breite Querformat-Fotos behalten die volle Höhe und
   dürfen über den Bildschirmrand hinausragen; man wischt/scrollt weiter, um sie ganz zu sehen. */
.gallery__slide img { height: var(--photo-h); width: auto; max-width: none; }
/* Fotonachweis: einmal pro Stück unter der Fotoreihe, steht still beim Wischen */
.gallery__credit {
  margin: 8px var(--gutter) 0; font-size: 13px; line-height: 1.4; color: var(--text-3);
}
.more .gallery__credit { margin-left: 0; }
.gallery__bar {
  display: flex; align-items: center; gap: 16px;
  padding: 14px var(--gutter) 0; min-height: 44px;
}
.gallery__count { margin: 0; font-size: 15px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gallery__count b { color: var(--cyan); font-weight: 700; }
.gallery__dots { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.gallery__dots i {
  width: 6px; height: 6px; border-radius: 50%; background: #475569;
  transition: background 200ms var(--ease-out), transform 200ms var(--ease-out);
}
.gallery__dots i.is-on { background: var(--cyan); transform: scale(1.35); }
.gallery__nav { display: flex; gap: 4px; }
@media (pointer: coarse) { .gallery__nav, .viewer__nav { display: none; } }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: transparent; color: var(--paper); cursor: pointer;
  transition: background 160ms var(--ease-out);
}
.icon-btn:hover { background: var(--line); }
.icon-btn:disabled { color: #475569; cursor: default; background: transparent; }

/* Angaben zum Stück */
.play__info { padding: 22px var(--gutter) 0; max-width: 40rem; }
.play__info h2 {
  margin: 0; font-family: var(--display); font-weight: 400;
  font-size: clamp(34px, 9vw, 52px); line-height: 1.02; text-wrap: balance;
}
.play__meta { margin: 10px 0 0; color: var(--text-2); font-size: 16px; font-variant-numeric: tabular-nums; }
.play__text { margin: 14px 0 0; color: var(--paper); }
/* Erfundene Beispieltexte sichtbar kennzeichnen, bis echte Texte da sind */
.play__text.is-sample::after {
  content: "In Bearbeitung"; display: block; margin-top: 6px;
  font-size: 13px; color: var(--text-3);
}

/* Weiter / Fuß */
.decade-next {
  margin-top: 56px; padding: 32px var(--gutter);
  border-top: 1px solid var(--line);
}
.decade-next a, .decade-next span.soon {
  font-family: var(--display); font-size: 40px; line-height: 1.1; text-decoration: none;
}
.decade-next span.soon { color: var(--text-3); }
.decade-next small { font-family: var(--sans); font-size: 15px; }
.site-footer {
  padding: 24px var(--gutter) 40px; font-size: 13px; line-height: 1.4; color: var(--text-3);
  border-top: 1px solid var(--line);
}

/* Impressum / Datenschutz */
/* Grundfarbe gilt für den ganzen Bereich, damit auch Text außerhalb eines <p> (z. B. nach einer Liste) richtig aussieht */
.legal { padding: 40px var(--gutter) 64px; max-width: 40rem; color: var(--text-2); }
.legal h1, .legal h2 { color: var(--paper); }
.legal h1 {
  margin: 0 0 20px; font-family: var(--display); font-weight: 400;
  font-size: clamp(32px, 7vw, 48px); line-height: 1; letter-spacing: -0.01em;
}
.legal h2 { margin: 28px 0 4px; font-size: 17px; font-weight: 700; line-height: 1.4; }
.legal p, .legal ul, .legal ol { margin: 0 0 12px; font-size: 17px; line-height: 1.55; color: var(--text-2); }
.legal ul, .legal ol { padding-left: 1.25em; }
.legal li + li { margin-top: 4px; }
.legal li > ul, .legal li > ol { margin: 4px 0 0; }
.legal p:empty { display: none; }
.legal .placeholder { color: var(--text-3); font-size: 13px; }

/* Vollbild */
.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: #020617; color: var(--paper);
}
.viewer::backdrop { background: #020617; }
.viewer[open] { display: flex; flex-direction: column; }
@media (prefers-reduced-motion: no-preference) {
  .viewer[open] { animation: viewer-in 260ms var(--ease-out); }
}
@keyframes viewer-in { from { opacity: 0; } to { opacity: 1; } }
.viewer__top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px calc(var(--gutter) - 7px) 4px var(--gutter); min-height: 52px;
}
/* Schließen: gleiche Kästchen-Optik wie der Aufklapp-Pfeil, Tippfläche bleibt 44px */
.viewer__close { position: relative; border-radius: 0; color: var(--cyan); }
.viewer__close::before {
  content: ""; position: absolute; inset: 7px;
  border-radius: 3px; box-shadow: inset 0 0 0 1.5px var(--cyan);
  transition: background 200ms var(--ease-out);
}
.viewer__close svg { position: relative; }
.viewer__close:hover { background: transparent; color: var(--ink); }
.viewer__close:hover::before { background: var(--cyan); }
.viewer__close:focus-visible { outline: none; }
.viewer__close:focus-visible::before { outline: 2px solid var(--cyan); outline-offset: 2px; }
/* Vollansicht per Tippen/Klicken geöffnet: kein Fokusrahmen am X und an den Pfeilen; Tastatur behält ihn */
.nutzt-zeiger .viewer :focus-visible,
.nutzt-zeiger .viewer__close:focus-visible::before { outline: none; }
.viewer__title { font-size: 15px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.viewer__track {
  flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; overscroll-behavior: contain;
}
.viewer__track::-webkit-scrollbar { display: none; }
.viewer__track figure {
  flex: 0 0 100%; margin: 0; scroll-snap-align: center;
  display: flex; align-items: center; justify-content: center; padding: 8px;
}
.viewer__track figure { flex-direction: column; gap: 10px; }
.viewer__track img { max-width: 100%; max-height: calc(100% - 32px); object-fit: contain; }
.viewer__track figcaption { font-size: 13px; line-height: 1.4; color: var(--text-3); }
.viewer__nav {
  display: flex; justify-content: center; gap: 12px; padding: 4px 0 12px;
}

@media (min-width: 768px) {
  :root { --gutter: 40px; }
  .gallery { --photo-h: min(54vh, 600px); }
  .viewer__track figure { padding: 24px 64px; }
}

/* Handy quer: Foto so groß wie möglich. Kopfzeile, Bildunterschrift und Pfeile liegen über dem Foto statt darüber/darunter. */
@media (orientation: landscape) and (max-height: 540px) {
  /* Aufgeklappte Galerie: Fotos füllen die Höhe unter der Kopfzeile */
  .more .gallery { --photo-h: calc(100svh - var(--header-h) - 24px); }
  .viewer { position: fixed; inset: 0; }
  .viewer__top {
    position: absolute; top: 0; left: 0; right: 0; z-index: 2;
    padding-left: max(var(--gutter), env(safe-area-inset-left));
    padding-right: max(calc(var(--gutter) - 7px), env(safe-area-inset-right));
    background: linear-gradient(rgba(2, 6, 23, 0.8), rgba(2, 6, 23, 0));
  }
  .viewer__track figure {
    position: relative; padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left); gap: 0;
  }
  .viewer__track img { max-width: 100%; max-height: 100dvh; }
  .viewer__track figcaption {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 20px var(--gutter) 10px;
    text-align: center; color: var(--text-2);
    background: linear-gradient(rgba(2, 6, 23, 0), rgba(2, 6, 23, 0.8));
  }
  .viewer__track figcaption:empty { display: none; }
  .viewer__nav { position: absolute; right: 8px; bottom: 36px; z-index: 2; padding: 0; gap: 4px; }
}
