/* COVERSTORY 7.0 – Videoartikel „Bevor es gebaut wird“
   Zwei Layouts, je nach Seitenverhältnis des webmag-Rahmens:
   quer  (Desktop/Tablet, 16:9-Box)  = Bühne: Film vollflächig, alles darüber
   hoch  (Handy-Box, 540 px hoch)     = Stapel: Film oben, Leiste, darunter Untertitel (falls an) und Artikelkopf
   Farben: helles Grün nur für Schmuck (2,2:1), alles mit Bedeutung – Schrift, Zustände, Fortschritt – dunkles Grün. */

@font-face { font-family: "Open Sans"; font-weight: 400; font-display: swap; src: url("schrift/OpenSans-Regular.037236ed4b.ttf") format("truetype"); }
@font-face { font-family: "Open Sans"; font-weight: 600; font-display: swap; src: url("schrift/OpenSans-SemiBold.5e8d9e1a89.ttf") format("truetype"); }
@font-face { font-family: "Open Sans"; font-weight: 700; font-display: swap; src: url("schrift/OpenSans-Bold.f7916a3737.ttf") format("truetype"); }

:root {
  --gruen: #8abd24;          /* Coverstory-Grün: Schmuck (Linien, Leuchte) – 2,2:1 auf Weiß, nie für Bedeutung */
  --gruen-dunkel: #4a7212;   /* Schrift, Zustände, Fortschritt: 5,67:1 auf Weiß, 5,19:1 auf --flaeche (WCAG AA) */
  --blau: #009fe3;           /* Ladeanzeige */
  --fokus: #0077b3;          /* Fokusrahmen: 4,9:1 auf Weiß (WCAG 1.4.11 verlangt 3:1) */
  --text: #222;
  --text-leise: #6c6c6c;
  --linie: #e6e6e6;
  --flaeche: #f5f5f5;
  --weiss: #fff;
  --schatten: 0 10px 30px rgba(0, 0, 0, .16);
  --leiste-h: 48px;
  --schrift: "Open Sans", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; background: var(--weiss); }
body { font-family: var(--schrift); color: var(--text); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--fokus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Grundgerüst ---------- */
.buehne { position: relative; width: 100%; height: 100%; overflow: hidden; background: var(--weiss); }
/* Bis layout.js quer/hoch gesetzt hat, nichts zeigen – Chrome malt sonst bei langsamem Netz kurz die ungeordnete Seite */
.buehne:not(.buehne-quer):not(.buehne-hoch) { visibility: hidden; }

.bild { position: relative; overflow: hidden; background: #e9ece6; }
.bild-innen { position: absolute; inset: 0; transform-origin: 58% 42%; }
.film, .standbild { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.standbild { transition: opacity .35s ease; }
.standbild.weg { opacity: 0; pointer-events: none; }
.bild-klick { position: absolute; inset: 0; }                              /* Maus/Finger; Tastatur nutzt die Leiste */

/* Das Standbild „atmet“ leicht, solange auf den Schalter gewartet wird */
.buehne[data-zustand="intro"] .bild-innen { animation: atmen 22s cubic-bezier(.25, .1, .25, 1) forwards; }
@keyframes atmen { from { transform: scale(1); } to { transform: scale(1.045); } }

/* Ladeanzeige: schmale Linie statt Kreisel */
.laden { position: absolute; left: 0; right: 0; top: 0; height: 3px; overflow: hidden; opacity: 0; transition: opacity .2s; pointer-events: none; }
.laden::before { content: ""; position: absolute; top: 0; bottom: 0; width: 30%; background: var(--blau); animation: laden 1.1s ease-in-out infinite; }
@keyframes laden { from { left: -30%; } to { left: 100%; } }
.buehne.laedt .laden { opacity: 1; }

/* Fortschrittslinie, die bleibt, wenn die Leiste ausgeblendet ist */
.linie { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .35); opacity: 0; transition: opacity .3s; pointer-events: none; }
.linie span { display: block; height: 100%; width: 0; background: var(--gruen); }

/* ---------- Typografie im Magazin-Stil ---------- */
.dachzeile { margin: 0 0 .5em; color: var(--gruen-dunkel); font-weight: 600; font-size: 13px; letter-spacing: .01em; }
.intro h1, .ende h2 { margin: 0; font-weight: 600; line-height: 1.18; letter-spacing: -.005em; color: var(--text); }
.autoren { margin: .7em 0 0; color: var(--text-leise); font-size: 14px; line-height: 1.45; }
.fehler { margin: 1em 0 0; color: #b3261e; font-size: 13px; }

/* ---------- KI-Kennzeichnung (Art. 50 KI-VO): ab dem ersten Bild und während des ganzen Films sichtbar ----------
   Marke auf dem Bild, dazu der Satz im Artikelkopf (auf dem Handy direkt unter dem Film). */
.ki-marke {
  position: absolute; top: 14px; right: 14px; z-index: 2; margin: 0; pointer-events: none;
  display: flex; align-items: center; gap: 7px; padding: 4px 9px 4px 4px; white-space: nowrap;
  background: rgba(255, 255, 255, .94); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  font-size: clamp(12px, 1.7vh, 16px); font-weight: 600; line-height: 1.3;
}
.ki-zeichen { padding: 1px 5px; background: var(--gruen-dunkel); color: var(--weiss); font-weight: 700; font-size: .92em; letter-spacing: .04em; }
.ki-hinweis { margin: 12px 0 0; color: var(--text-leise); font-size: 12.5px; line-height: 1.45; }

/* ---------- Lichtschalter ---------- */
.schalter { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--linie); width: 100%; text-align: left; }
.schalter-platte {
  flex: none; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 4px;
  background: linear-gradient(180deg, #fdfdfd, #eeeeee); border: 1px solid #d6d6d6;
  box-shadow: inset 0 1px 0 #fff, 0 2px 6px rgba(0, 0, 0, .12); transition: border-color .2s, box-shadow .2s;
}
.schalter-wippe {
  position: relative; width: 36px; height: 36px; border-radius: 2px; background: linear-gradient(180deg, #fff 0%, #e9e9e9 100%);
  border: 1px solid #cfcfcf; box-shadow: 0 3px 3px -1px rgba(0, 0, 0, .2);
  transform: perspective(90px) rotateX(14deg); transition: transform .12s ease-out, box-shadow .12s ease-out;
}
.schalter-punkt { position: absolute; left: 50%; bottom: 6px; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: #c9c9c9; transition: background .2s, box-shadow .2s; }
.schalter:hover .schalter-platte { border-color: var(--gruen); box-shadow: inset 0 1px 0 #fff, 0 3px 10px rgba(138, 189, 36, .28); }
.schalter:hover .schalter-punkt { background: #b5d47a; }
.schalter:active .schalter-wippe, .schalter[aria-pressed="true"] .schalter-wippe { transform: perspective(90px) rotateX(-14deg); box-shadow: 0 -3px 3px -1px rgba(0, 0, 0, .16); }
.schalter[aria-pressed="true"] .schalter-punkt { background: var(--gruen); box-shadow: 0 0 8px 2px rgba(138, 189, 36, .7); }
.schalter-text { display: flex; flex-direction: column; gap: 2px; }
.schalter-text strong { font-weight: 700; font-size: 16px; color: var(--text); }
.schalter-text small { font-size: 13px; color: var(--text-leise); }
.schalter:disabled { cursor: default; }

/* ---------- Leiste ---------- */
.leiste {
  display: flex; align-items: center; gap: 2px; height: var(--leiste-h); padding: 0 6px;
  background: rgba(255, 255, 255, .97); color: var(--text); font-size: 13px; z-index: 5;
  transition: opacity .25s ease, transform .25s ease;
}
.buehne[data-zustand="intro"] .leiste { display: none; }
.knopf { flex: none; height: 40px; min-width: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; color: var(--text); transition: color .15s, background .15s; }
.knopf:hover { color: var(--gruen-dunkel); background: var(--flaeche); }
.ic { width: 22px; height: 22px; display: block; }
.knopf-ut[aria-expanded="true"] { background: var(--flaeche); color: var(--gruen-dunkel); }
.knopf-ut { position: relative; }
.knopf-ut.aktiv { color: var(--gruen-dunkel); }
.knopf-ut.aktiv::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 6px; height: 2px; background: var(--gruen-dunkel); }

.knopf-spiel .ic-spiel, .buehne.pausiert .knopf-spiel .ic-pause { display: none; }
.buehne.pausiert .knopf-spiel .ic-spiel { display: block; }
.knopf-ton .ic-ton-aus, .buehne.stumm .knopf-ton .ic-ton-an { display: none; }
.buehne.stumm .knopf-ton .ic-ton-aus { display: block; }
.knopf-voll .ic-voll-aus, .buehne.voll .knopf-voll .ic-voll-an { display: none; }
.buehne.voll .knopf-voll .ic-voll-aus { display: block; }
.buehne.kein-vollbild .knopf-voll { display: none; }

.zeit { flex: none; padding: 0 8px 0 4px; font-variant-numeric: tabular-nums; color: var(--text-leise); white-space: nowrap; }
.zeit-jetzt { color: var(--text); font-weight: 600; }

.spur { position: relative; flex: 1 1 auto; min-width: 60px; height: 40px; display: flex; align-items: center; cursor: pointer; touch-action: none; margin: 0 6px; }
.spur-bahn { position: relative; width: 100%; height: 4px; background: var(--linie); transition: height .15s; }
.spur:hover .spur-bahn, .spur.zieht .spur-bahn, .spur:focus-visible .spur-bahn { height: 6px; }
/* hellgrün = schon gesehen; nur bis dorthin lässt sich springen */
.spur-gesehen { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #d5e8b0; }
.spur-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--gruen-dunkel); }
.spur-fill::after { content: ""; position: absolute; right: -6px; top: 50%; width: 12px; height: 12px; margin-top: -6px; background: var(--gruen-dunkel); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); border-radius: 50%; transform: scale(0); transition: transform .15s; }
.spur:hover .spur-fill::after, .spur.zieht .spur-fill::after, .spur:focus-visible .spur-fill::after { transform: scale(1); }
.spur-tipp { position: absolute; bottom: 42px; transform: translateX(-50%); background: var(--text); color: #fff; font-size: 12px; font-weight: 600; line-height: 1.35; padding: 5px 8px; white-space: nowrap; pointer-events: none; }
.spur-tipp.gesperrt { background: #fff; color: var(--text-leise); font-weight: 400; box-shadow: var(--schatten); }

/* Untertitel-Menü */
.ut-wahl { position: relative; flex: none; }
.ut-menue {
  position: absolute; bottom: calc(100% + 6px); right: 0; min-width: 190px; padding: 6px 0;
  background: var(--weiss); box-shadow: var(--schatten); border-top: 3px solid var(--gruen); z-index: 6;
}
.menue-titel { margin: 4px 14px 6px; font-size: 12px; font-weight: 600; color: var(--text-leise); }
.ut-menue button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 14px; font-size: 14px; text-align: left; }
.ut-menue button:hover { background: var(--flaeche); }
.ut-menue button[aria-checked="true"] { font-weight: 600; color: var(--gruen-dunkel); }
.ut-menue button[aria-checked="true"]::after { content: ""; margin-left: auto; width: 6px; height: 11px; border: solid var(--gruen-dunkel); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-2px, -2px); }
.flagge { width: 24px; height: 16px; flex: none; display: block; box-shadow: 0 0 0 1px rgba(0, 0, 0, .14); }
.flagge-aus { box-shadow: none; }

/* ---------- Untertitel ---------- */
.ut p { margin: 0; }
.ut-text:empty, .ut-tafel:empty { display: none; }

/* ---------- Ende ---------- */
.ende { position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--weiss); animation: einblenden .6s ease both; }
.ende-inhalt { max-width: 34em; text-align: center; }
.ende h2 { font-size: clamp(22px, 3.2vw, 36px); }
.ende h2:focus { outline: none; }
.ende-inhalt > p:not(.dachzeile) { margin: .8em auto 0; color: var(--text-leise); font-size: 15px; line-height: 1.55; max-width: 30em; }
.ende-knoepfe { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px; font-weight: 600; font-size: 15px; text-decoration: none; transition: background .15s, color .15s, border-color .15s; }
.btn-gruen { background: var(--gruen-dunkel); color: #fff; }
.btn-gruen:hover { background: #3b5c0e; }
.btn-rahmen { border: 2px solid var(--linie); color: var(--text); }
.btn-rahmen:hover { border-color: var(--gruen); color: var(--gruen-dunkel); }
@keyframes einblenden { from { opacity: 0; } to { opacity: 1; } }

/* =====================================================================
   QUER: Bühne (Desktop, Tablet, Kinomodus quer)
   ===================================================================== */
.buehne-quer .bild { position: absolute; inset: 0; }
.buehne-quer .leiste { position: absolute; left: 0; right: 0; bottom: 0; box-shadow: 0 -1px 0 rgba(0, 0, 0, .06); }
.buehne-quer.ruhig .leiste { opacity: 0; transform: translateY(10px); pointer-events: none; }
.buehne-quer.ruhig .linie { opacity: 1; }
.buehne-quer.ruhig { cursor: none; }
.buehne-quer .panel { position: absolute; inset: 0; pointer-events: none; z-index: 4; }

.buehne-quer .intro {
  position: absolute; left: 4%; bottom: 7%; width: min(30em, 46%); padding: 22px 24px 18px;
  background: var(--weiss); box-shadow: var(--schatten); pointer-events: auto;
  animation: hochkommen .7s .25s cubic-bezier(.2, .7, .2, 1) both;
}
.buehne-quer .intro h1 { font-size: clamp(20px, 2.85vw, 34px); }
@keyframes hochkommen { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* Während des Films unsichtbar, aber für Screenreader weiter da (Überschrift und Autoren des Artikels) */
.buehne-quer[data-zustand="spielt"] .intro { animation: wegblenden .3s ease forwards; pointer-events: none; }
@keyframes wegblenden { to { opacity: 0; transform: translateY(10px); } }

.buehne-quer .ut { position: absolute; inset: 0; pointer-events: none; }
.buehne-quer .ut-text, .buehne-quer .ut-tafel { position: absolute; left: 6%; right: 6%; text-align: center; line-height: 1.38; font-weight: 600; }
.buehne-quer .ut-text { bottom: 7%; font-size: clamp(15px, 3.9vh, 40px); transition: bottom .25s ease; }
.buehne-quer:not(.ruhig) .ut-text { bottom: calc(var(--leiste-h) + 3.5%); }
.buehne-quer .ut-tafel { top: max(6%, 52px); font-size: clamp(14px, 3.6vh, 34px); }          /* unter der KI-Marke */
.buehne-quer .ut span { background: rgba(18, 18, 18, .74); color: #fff; padding: .08em .42em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.buehne-quer .ut-tafel span { background: rgba(255, 255, 255, .94); color: var(--text); }

/* Kinomodus: Film nie beschneiden */
.buehne.voll { background: #000; }
.buehne-quer.voll .bild { background: #000; }
.buehne-quer.voll .film, .buehne-quer.voll .standbild { object-fit: contain; }

/* =====================================================================
   HOCH: Stapel (Handy-Box im webmag, Handy hochkant)
   ===================================================================== */
.buehne-hoch { display: flex; flex-direction: column; }
.buehne-hoch .bild { flex: none; width: 100%; aspect-ratio: 16 / 9; }
.buehne-hoch .ki-marke { top: 8px; right: 8px; gap: 5px; padding: 3px 7px 3px 3px; font-size: 11px; }
.buehne-hoch .leiste { flex: none; height: 44px; padding: 0 2px; border-bottom: 1px solid var(--linie); }
.buehne-hoch .knopf { min-width: 38px; padding: 0 6px; }
.buehne-hoch .zeit-trenn, .buehne-hoch .zeit-gesamt { display: none; }
.buehne-hoch .panel { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 18px 12px; }
.buehne-hoch .intro h1 { font-size: clamp(22px, 6.4vw, 27px); }
.buehne-hoch .intro { animation: einblenden .5s .1s ease both; }
/* Während des Films bleibt nur der Artikelkopf stehen – wie eine Magazinseite unter dem Bild */
.buehne-hoch[data-zustand="spielt"] .schalter, .buehne-hoch[data-zustand="ende"] .schalter { display: none; }
.buehne-hoch[data-zustand="spielt"] .intro h1 { font-size: clamp(19px, 5.4vw, 25px); }
/* Laufzeit steht während des Films in der Leiste – Platz für zwei Untertitelzeilen plus Tafel (auch bei 430 px) */
.buehne-hoch[data-zustand="spielt"] .intro .dachzeile { display: none; }
/* Der KI-Hinweis steht auch während des Films unter dem Bild – dafür rückt alles etwas zusammen
   (passt von 320 bis 440 px Breite in die 540-px-Box, gemessen) */
.buehne-hoch .schalter { margin-top: 12px; padding-top: 12px; }
.buehne-hoch .ki-hinweis { margin-top: 8px; font-size: 12px; line-height: 1.4; }
.buehne-hoch[data-zustand="spielt"] .panel { padding-bottom: 8px; }
.buehne-hoch[data-zustand="spielt"] .autoren { margin-top: .5em; }

/* Höhe inkl. Innenabstand: Platz für genau zwei Untertitelzeilen (2 × 18 px × 1,42), damit nichts springt */
.buehne-hoch .ut { min-height: 4.05em; margin: -2px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--linie); }
.buehne-hoch[data-zustand="intro"] .ut, .buehne-hoch.ut-aus .ut { display: none; }
.buehne-hoch .ut-tafel { color: var(--gruen-dunkel); font-weight: 600; font-size: 14px; line-height: 1.4; margin-bottom: 4px; }
.buehne-hoch .ut-text { font-weight: 600; font-size: 18px; line-height: 1.42; color: var(--text); }

/* ---------- Ruhe für alle, die Bewegung reduziert haben ---------- */
@media (prefers-reduced-motion: reduce) {
  .buehne[data-zustand="intro"] .bild-innen { animation: none; }
  .intro, .ende, .buehne-quer .intro { animation-duration: .01s !important; animation-delay: 0s !important; }
  .schalter-wippe, .leiste, .standbild, .ut-text { transition: none !important; }
  .laden::before { animation-duration: 3s; }
}
