/* =========================================================================
   FOKALiS – Impressum und Datenschutz (impressum.html, datenschutz.html)
   Leitidee „Abspann“: Nach dem Film kommt das Kleingedruckte – ruhig,
   gut lesbar, ohne Effekte. Kurzer dunkler Seitenkopf, darunter ein helles
   Blatt (Drehbuchseite) mit angenehmer Zeilenlänge.

   Der Inhalt in .legal-sheet wird beim Veröffentlichen vom CMS ersetzt – und das
   CMS entfernt dabei das Attribut data-rechtstext. Deshalb hängen alle Regeln an
   der Klasse .legal-sheet, nie an [data-rechtstext].
   (Standard 7b). Deshalb sind alle Regeln dort generisch: h1, h2, h3, p, ul,
   ol, a, strong, table sowie die CMS-Klassen .fk-recht, .fk-recht-impressum,
   .fk-recht-datenschutz, .fk-recht-hervorgehoben, .fk-recht-stand.
   Keine Silbentrennung (hyphens:manual). Bewegungswerte nach DESIGN-KONZEPT.md.
   ========================================================================= */

/* ---------- Seitenkopf (kurz, dunkel) --------------------------------- */
.legal-hero{position:relative;background:var(--black);color:var(--on-dark);overflow:hidden;isolation:isolate;
  padding:calc(var(--header-h) + clamp(44px,6vw,88px)) 0 calc(clamp(40px,5vw,64px) + var(--legal-overlap))}
:root{--legal-overlap:clamp(40px,6vw,96px)}
/* Sehr dezentes Licht von rechts oben, kein Kopfbild */
.legal-hero::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;
  background:radial-gradient(60% 120% at 85% 0%,rgba(236,176,20,.07) 0,transparent 60%),
             radial-gradient(80% 100% at 10% 100%,rgba(255,255,255,.035) 0,transparent 70%)}
.legal-hud{position:absolute;left:var(--gutter);right:var(--gutter);top:calc(var(--header-h) + 14px);display:flex;justify-content:space-between;gap:16px;
  font-size:10.5px;font-weight:600;letter-spacing:.2em;text-transform:uppercase;color:rgba(255,255,255,.42);pointer-events:none}
.legal-hud-rec::before{content:"";display:inline-block;width:7px;height:7px;border-radius:50%;background:var(--gold);margin-right:10px;vertical-align:1px;opacity:.85}
.legal-hud [data-timecode]{font-variant-numeric:tabular-nums}
@media (max-width:760px){.legal-hud{display:none}}

.legal-hero-inner{display:grid;grid-template-columns:minmax(0,1fr);gap:18px;justify-items:start}
.legal-hero .crumbs{margin-bottom:4px}
.legal-hero .eyebrow{color:var(--on-dark-muted)}
.legal-hero-lead{max-width:52ch;font-family:var(--font-head);font-weight:200;font-size:clamp(24px,2.6vw,38px);line-height:1.25;letter-spacing:.005em;color:var(--white);text-wrap:balance}

/* Ruhiges Erscheinen beim Laden (einmal, kein Dauereffekt) */
.js .legal-intro{opacity:0;transform:translateY(14px);animation:legal-in 1.4s var(--ease-glide) .2s forwards}
.js .legal-intro--late{animation-delay:.45s}
@keyframes legal-in{to{opacity:1;transform:none}}

/* Fuß: aktuelle Rechtsseite markieren */
.footer-bottom a[aria-current="page"]{color:var(--white)}
.footer-bottom a[aria-current="page"]::before{content:"";display:inline-block;width:5px;height:5px;border-radius:50%;background:var(--gold);margin-right:8px;vertical-align:2px}

/* ---------- Bühne: Inhaltsverzeichnis + Blatt -------------------------- */
.legal-stage{background:var(--paper);color:var(--on-light);padding-bottom:clamp(64px,8vw,128px)}
.legal-grid{display:grid;grid-template-columns:minmax(0,1fr);justify-items:center}
.legal-grid.has-toc{grid-template-columns:minmax(200px,260px) minmax(0,800px);justify-content:start;justify-items:stretch;column-gap:clamp(40px,6vw,120px)}

/* Das Blatt */
.legal-sheet{position:relative;width:100%;max-width:800px;min-width:0;margin-top:calc(var(--legal-overlap) * -1);
  background:var(--white);border-top:2px solid var(--gold);border-radius:var(--radius);
  box-shadow:0 30px 80px -40px rgba(10,10,10,.35),0 2px 6px rgba(10,10,10,.04);
  padding:clamp(28px,5vw,72px) clamp(22px,5.5vw,80px) clamp(32px,5vw,64px);container-type:inline-size}
.js .legal-sheet{opacity:0;transform:translateY(28px);animation:legal-in 1.4s var(--ease-glide) .55s forwards}

/* ---------- Inhaltsverzeichnis (per JS aus den h2 erzeugt) ------------ */
.legal-toc{min-width:0;align-self:start;position:sticky;top:calc(var(--header-h) + 28px);margin-top:clamp(40px,4vw,64px);
  max-height:calc(100vh - var(--header-h) - 56px);overflow:auto;scrollbar-width:thin}
.legal-toc[hidden]{display:none}
.legal-toc summary{list-style:none;display:flex;align-items:center;gap:12px;font-size:12px;font-weight:600;letter-spacing:.22em;text-transform:uppercase;color:var(--on-light-muted);padding-bottom:14px}
.legal-toc summary::-webkit-details-marker{display:none}
.legal-toc summary::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--gold);flex:none}
.legal-toc ol{list-style:none;margin:0;padding:0;border-left:1px solid var(--line-light)}
.legal-toc li{margin:0}
.legal-toc a{position:relative;display:grid;grid-template-columns:2.1em minmax(0,1fr);gap:4px;padding:7px 0 7px 18px;font-size:13.5px;line-height:1.4;color:var(--on-light-muted);text-decoration:none;
  overflow-wrap:break-word;hyphens:manual;transition:color .5s}
.legal-toc a::before{content:"";position:absolute;left:-4px;top:50%;width:7px;height:7px;margin-top:-3.5px;border-radius:50%;background:var(--gold);transform:scale(0);transition:transform .8s var(--ease-glide)}
.legal-toc a:hover{color:var(--anth)}
.legal-toc a[aria-current="true"]{color:var(--anth);font-weight:600}
.legal-toc a[aria-current="true"]::before{transform:scale(1)}
.legal-toc-num{font-family:var(--font-head);font-weight:300;font-size:14px;color:var(--on-light-muted);font-variant-numeric:tabular-nums}
.legal-toc a:not(:has(.legal-toc-num)){grid-template-columns:minmax(0,1fr)}
/* Am Desktop ist das Verzeichnis immer offen; der Kopf ist nur Beschriftung */
@media (min-width:1101px){.legal-toc summary{pointer-events:none;cursor:default}}
/* Flache Laptop-Fenster: Verzeichnis kompakter, damit es ohne eigenen Scrollbalken passt */
@media (min-width:1101px) and (max-height:820px){
  .legal-toc{margin-top:32px}
  .legal-toc summary{padding-bottom:8px}
  .legal-toc a{padding-block:4px;font-size:12.5px;line-height:1.35}
  .legal-toc-num{font-size:13px}
}
@media (min-width:1101px) and (max-height:640px){
  .legal-toc a{padding-block:2px;font-size:12px;line-height:1.3}
}

/* Schmaler: Verzeichnis als Aufklapper über dem Blatt */
@media (max-width:1100px){
  .legal-grid.has-toc{grid-template-columns:minmax(0,800px);justify-content:center}
  .legal-toc{position:relative;top:auto;z-index:1;max-height:none;overflow:visible;margin:calc(var(--legal-overlap) * -1) 0 16px;width:100%;
    background:var(--white);border:1px solid var(--line-light);border-top:2px solid var(--gold);border-radius:var(--radius);padding:16px 20px;
    box-shadow:0 20px 60px -40px rgba(10,10,10,.35)}
  .legal-grid.has-toc .legal-sheet{margin-top:0}
  .legal-toc summary{padding-bottom:0;cursor:pointer;width:100%;justify-content:flex-start}
  .legal-toc summary::after{content:"";width:9px;height:9px;margin-left:auto;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;margin-right:4px;transform:rotate(45deg) translateY(-3px);transition:transform .6s var(--ease-glide)}
  .legal-toc[open] summary::after{transform:rotate(-135deg) translateY(-2px)}
  .legal-toc[open] summary{padding-bottom:14px}
  .legal-toc a{padding-block:8px}
  .js .legal-sheet{animation-delay:.65s}
}
@media (max-width:560px){
  .legal-stage>.wrap{padding-inline:12px}
  .legal-sheet{padding:28px 20px 32px}
  .legal-toc{padding:14px 18px}
}

/* ---------- Rechtstext: Typografie (generisch, CMS ersetzt den Inhalt) - */
.legal-sheet{font-family:var(--font-body);font-size:16px;line-height:1.75;font-weight:300;color:var(--on-light);
  hyphens:manual;-webkit-hyphens:manual;overflow-wrap:break-word;text-wrap:pretty}
.legal-sheet .fk-recht{max-width:68ch}
.legal-sheet>*:first-child,.legal-sheet .fk-recht>*:first-child{margin-top:0}

/* Größe am Blatt gemessen (cqi), damit „Datenschutzerklärung“ immer in eine Zeile passt */
.legal-sheet h1{font-family:var(--font-head);font-weight:300;font-size:clamp(24px,9.4cqi,76px);line-height:1.16;letter-spacing:.005em;text-transform:uppercase;
  color:var(--anth);margin:0 0 .5em;text-wrap:balance;overflow-wrap:normal}
.legal-sheet h1::after{content:"";display:inline-block;width:.15em;height:.15em;margin-left:.08em;border-radius:50%;background:var(--gold);vertical-align:baseline}

/* Einleitung direkt unter dem Titel etwas größer */
.legal-sheet h1+p{font-size:clamp(16.5px,1.3vw,18px);line-height:1.7;color:var(--on-light-muted);margin-bottom:.5em}

.legal-sheet section{padding-top:clamp(28px,3vw,40px);margin-top:clamp(28px,3vw,40px);border-top:1px solid var(--line-light);scroll-margin-top:calc(var(--header-h) + 20px)}
.legal-sheet h1+section,.legal-sheet h1+p+section{border-top-color:rgba(34,35,35,.22)}

.legal-sheet h2{font-family:var(--font-head);font-weight:400;font-size:clamp(22px,2vw,28px);line-height:1.22;letter-spacing:.02em;text-transform:uppercase;
  color:var(--anth);margin:0 0 .7em;text-wrap:balance;overflow-wrap:normal;scroll-margin-top:calc(var(--header-h) + 20px)}
/* Nummer der Datenschutz-Abschnitte (per JS in <span> gesetzt) */
.legal-sheet h2:has(.legal-num){padding-left:1.6em;text-indent:-1.6em}
.legal-sheet .legal-num{display:inline-block;min-width:1.6em;text-indent:0;font-weight:200;color:var(--on-light-muted);font-variant-numeric:tabular-nums}

.legal-sheet h3{font-family:var(--font-body);font-weight:600;font-size:17px;line-height:1.45;color:var(--anth);margin:1.6em 0 .45em;text-wrap:balance}
.legal-sheet h4{font-family:var(--font-body);font-weight:600;font-size:15px;line-height:1.5;color:var(--anth);margin:1.4em 0 .4em}

.legal-sheet p{margin:0 0 1em}
.legal-sheet p:last-child{margin-bottom:0}
.legal-sheet strong,.legal-sheet b{font-weight:600;color:var(--anth)}
.legal-sheet em{font-style:italic}

.legal-sheet ul,.legal-sheet ol{margin:0 0 1em;padding:0}
.legal-sheet ul{list-style:none}
.legal-sheet ul>li{position:relative;padding-left:22px;margin:0 0 .45em}
.legal-sheet ul>li::before{content:"";position:absolute;left:2px;top:.72em;width:6px;height:6px;border-radius:50%;background:var(--gold)}
.legal-sheet ol{padding-left:1.5em}
.legal-sheet ol>li{margin:0 0 .45em;padding-left:.2em}
.legal-sheet ol>li::marker{font-family:var(--font-head);color:var(--on-light-muted)}

/* Links: lange Adressen und E-Mails dürfen umbrechen (sonst Überlauf auf dem Handy) */
.legal-sheet a{color:var(--anth);font-weight:400;text-decoration:underline;text-decoration-color:rgba(236,176,20,.75);text-decoration-thickness:1px;text-underline-offset:.22em;
  overflow-wrap:anywhere;transition:text-decoration-color .5s,color .5s}
.legal-sheet a:hover{text-decoration-color:var(--anth)}

/* Tabellen (falls ein Text sie enthält): eigene Scrollfläche statt Überlauf */
.legal-sheet table{display:block;max-width:100%;overflow-x:auto;border-collapse:collapse;margin:0 0 1.2em;font-size:14.5px;line-height:1.55}
.legal-sheet th,.legal-sheet td{padding:10px 14px 10px 0;border-bottom:1px solid var(--line-light);text-align:left;vertical-align:top;min-width:9em;overflow-wrap:break-word}
.legal-sheet th{font-weight:600;color:var(--anth);border-bottom-color:rgba(34,35,35,.3)}

.legal-sheet hr{border:0;border-top:1px solid var(--line-light);margin:2em 0}
.legal-sheet address{font-style:normal}

/* Widerspruchsrecht: das CMS setzt einen Strich in Textfarbe (inline) – hier in Gold */
.legal-sheet .fk-recht-hervorgehoben{border-left:3px solid var(--gold)!important;background:var(--paper);padding:18px 20px 18px 22px!important;margin:1.4em 0!important;border-radius:0 var(--radius) var(--radius) 0}
.legal-sheet .fk-recht-hervorgehoben p{margin-bottom:.6em}
.legal-sheet .fk-recht-hervorgehoben p:last-child{margin-bottom:0}

/* Stand-Zeile am Ende */
.legal-sheet .fk-recht-stand{margin-top:clamp(32px,4vw,48px);padding-top:18px;border-top:1px solid var(--line-light);
  font-size:12px;font-weight:600;letter-spacing:.18em;text-transform:uppercase;color:var(--on-light-muted)}

/* Lokale Vorlage (wird vom CMS ersetzt): Hinweis dezent markieren */
.legal-sheet .legal-vorlage{display:flex;gap:12px;align-items:flex-start;font-size:14px;line-height:1.6;color:var(--on-light-muted);
  background:var(--paper);border:1px dashed rgba(34,35,35,.28);border-radius:var(--radius);padding:14px 16px;margin-bottom:0}
.legal-sheet .legal-vorlage::before{content:"";flex:none;width:8px;height:8px;margin-top:.55em;border-radius:50%;background:var(--gold)}

@media (max-width:560px){
  .legal-sheet{font-size:15.5px;line-height:1.72}
  .legal-sheet h2{font-size:20px}
  .legal-sheet h3{font-size:16px}
}

/* Weniger Bewegung: alles sofort da */
@media (max-width:400px){
  .legal-sheet h2{font-size:18.5px;letter-spacing:.01em}
}

@media (prefers-reduced-motion:reduce){
  .js .legal-intro,.js .legal-sheet{opacity:1;transform:none;animation:none}
  .legal-toc a::before,.legal-toc a{transition:none}
}

/* Druck: nur der Text */
@media print{
  .site-header,.site-footer,.legal-hero,.legal-toc,.grain,.skip-link{display:none!important}
  .legal-stage{background:none;padding:0}
  .legal-sheet{margin:0;box-shadow:none;border:0;padding:0;opacity:1!important;transform:none!important;animation:none!important}
}

/* Formulare „Vertrag widerrufen“ und „Verträge hier kündigen“: Hauptknopf als goldene Pille wie .btn--gold */
.fk-recht button[type=submit]{border:0!important;border-radius:999px!important;background:var(--gold)!important;color:var(--anth)!important;padding:.85em 1.8em!important;letter-spacing:.02em}
.fk-recht button[type=submit]:hover,.fk-recht button[type=submit]:focus-visible{background:var(--anth)!important;color:var(--white)!important}

/* Rechtstexte aus dem CMS: auf dem Handy automatische Silbentrennung (Freigabe Matthias 13.10.) – dort kann niemand von Hand trennen */
@media (max-width:560px){.legal-sheet,.legal-sheet{hyphens:auto;-webkit-hyphens:auto}}
