/* KEROLINA – Einwilligungsdialog „Ihre Cookie-Einstellungen“ (includes/kerolina-einwilligung.php), Fassung E2.
   Modaler Dialog: Seite abgedunkelt, Fenster fest unten rechts (Desktop) bzw. unten über volle Innenbreite (mobil),
   in sich scrollbar. Pflaume #2a1c33 mit Gold #d2c485 (Kontrast rund 9:1), Knöpfe gold bzw. creme mit Tinte #1e1122
   (je über 11:1). Keine CSS-order: Darstellung, Tastatur und Screenreader folgen derselben Reihenfolge.
   Fokus nur bei Tastaturbedienung sichtbar (:focus-visible), cremefarbener Rahmen. */
.einwilligung[hidden], .einwilligung [hidden] { display: none !important; }
.einwilligung {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: flex-end; justify-content: flex-end;
  padding: 24px;
  background: rgba(30, 17, 34, .55);
}
.einwilligung__fenster {
  position: relative; box-sizing: border-box;
  width: 100%; max-width: 660px; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow-y: auto;
  padding: 32px 32px 24px;
  background: var(--plum, #2a1c33); color: var(--gold, #d2c485);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(30, 17, 34, .45);
  font-family: var(--font-body); font-size: 1rem; line-height: 1.5;
}
.einwilligung__titel {
  margin: 0 32px 14px; text-align: center;
  font-family: var(--font-body); font-weight: 400; font-size: 1.3125rem; line-height: 1.3;
  color: var(--gold, #d2c485);
}
.einwilligung__text, .einwilligung__hinweis, .einwilligung__kat-text { margin: 0 0 14px; text-align: left; color: var(--gold, #d2c485); }
/* Betreiber 26.10.2026 (nach Livegang): Bannertext einschließlich Datenschutzlink in normaler Stärke */
.einwilligung [data-ansicht="start"] .einwilligung__text { font-weight: 400; }
.einwilligung__hinweis { font-weight: 600; color: var(--cream, #fdf1d1); }
.einwilligung a { color: var(--gold, #d2c485); text-decoration: underline; text-underline-offset: 3px; }
.einwilligung a:hover { color: var(--cream, #fdf1d1); }

.einwilligung__knoepfe { display: flex; gap: 12px; margin: 6px 0 4px; }
.einwilligung__knopf {
  flex: 1 1 0; min-width: max-content; min-height: 48px; margin: 0; padding: 10px 16px;
  border: 2px solid var(--cream, #fdf1d1); border-radius: 10px;
  background: var(--cream, #fdf1d1); color: var(--ink, #1e1122);
  font-family: var(--font-body); font-size: 1rem; font-weight: 700; line-height: 1.25;
  white-space: nowrap; cursor: pointer;
}
.einwilligung__knopf:hover { background: #fff; border-color: #fff; }
.einwilligung__knopf--gold { background: var(--gold, #d2c485); border-color: var(--gold, #d2c485); }
.einwilligung__knopf--gold:hover { background: var(--gold-deep, #bca572); border-color: var(--gold-deep, #bca572); }
.einwilligung__schliessen { margin: 0 0 8px; }
.einwilligung__schliessen .einwilligung__knopf { width: 100%; }

.einwilligung__zu {
  position: absolute; top: 10px; right: 10px;
  width: 44px; height: 44px; margin: 0; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--gold, #d2c485);
  font-size: 1.75rem; line-height: 1; cursor: pointer;
}
.einwilligung__zu:hover { background: rgba(210, 196, 133, .14); }

.einwilligung__kategorie { margin: 0 0 14px; padding: 14px 16px; border: 1px solid rgba(210, 196, 133, .45); border-radius: 10px; }
.einwilligung__kategorie .einwilligung__kat-text { margin: 6px 0 0; font-size: .9375rem; }
.einwilligung__kat-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; }
.einwilligung__kat-name { font-weight: 700; color: var(--cream, #fdf1d1); }
.einwilligung__immer { font-size: .9375rem; font-weight: 600; color: var(--gold, #d2c485); white-space: nowrap; }
/* Schalter: natives Kontrollkästchen (role="switch"), 52 × 30 px, Trefferfläche über Rand auf 44 px erweitert */
.einwilligung__schalter {
  -webkit-appearance: none; appearance: none; flex: none; position: relative;
  width: 52px; height: 30px; margin: 7px 0; border-radius: 15px; cursor: pointer;
  background: rgba(253, 241, 209, .18); border: 2px solid var(--cream, #fdf1d1);
}
.einwilligung__schalter::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--cream, #fdf1d1);
}
.einwilligung__schalter:checked { background: var(--gold, #d2c485); border-color: var(--gold, #d2c485); }
.einwilligung__schalter:checked::before { left: 25px; background: var(--ink, #1e1122); }
@media (prefers-reduced-motion: no-preference) { .einwilligung__schalter::before { transition: left .15s ease; } }

.einwilligung__links { margin: 14px 0 0; text-align: center; }
.einwilligung__links a { display: inline-block; margin: 0 10px; padding: 10px 2px; }

.einwilligung :focus { outline: none; }
.einwilligung :focus-visible { outline: 3px solid var(--cream, #fdf1d1); outline-offset: 3px; }
/* Das Fenster selbst erhält den Fokus nur beim automatischen Öffnen (Ansage des Dialogs) – ohne Rahmen */
.einwilligung .einwilligung__fenster:focus, .einwilligung .einwilligung__fenster:focus-visible { outline: none; }
.einwilligung a, .einwilligung button, .einwilligung input { scroll-margin: 8px; }

/* Mobil und schmale Fenster (auch Zoom): volle Breite mit 16 px Rand, Knöpfe untereinander in voller Innenbreite,
   Beschriftung darf umbrechen */
@media (max-width: 720px) {
  .einwilligung { padding: 16px; justify-content: center; }
  .einwilligung__fenster { max-width: none; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); padding: 24px 20px 16px; }
  .einwilligung__knoepfe { flex-direction: column; gap: 10px; }
  .einwilligung__knopf { flex: none; width: 100%; min-width: 0; white-space: normal; }
}
/* Niedrige Bildschirme (z. B. 375 × 667): dichter setzen, damit die drei Knöpfe ohne Scrollen erreichbar bleiben */
@media (max-height: 720px) {
  .einwilligung__fenster { padding-top: 20px; padding-bottom: 12px; }
  .einwilligung__titel { margin-bottom: 8px; font-size: 1.25rem; }
  .einwilligung__text { margin-bottom: 10px; line-height: 1.4; }
  .einwilligung__knoepfe { gap: 8px; }
  .einwilligung__knopf { min-height: 44px; padding-top: 8px; padding-bottom: 8px; }
  .einwilligung__links { margin-top: 6px; }
  .einwilligung__links a { padding: 8px 2px; }
}
@media print { .einwilligung { display: none !important; } }
/* Übergang E1 → E2 (bis zu 1 h zwischengespeicherte Seiten mit altem Markup .einwilligung__innen): dasselbe Fenster,
   damit das alte Banner unter der neuen Abdunklung bedienbar bleibt. Entfernen, sobald kein E1-Markup mehr ausgeliefert wird. */
.einwilligung__innen {
  box-sizing: border-box; width: 100%; max-width: 660px; max-height: calc(100vh - 48px); overflow-y: auto;
  padding: 28px 28px 20px; border-radius: 16px; background: var(--plum, #2a1c33); color: var(--gold, #d2c485);
  font-family: var(--font-body); line-height: 1.5;
}
.einwilligung__innen .einwilligung__titel { margin: 0 0 12px; }
.einwilligung__innen .einwilligung__knopf { white-space: normal; }

/* Videobühnen: die Hülle (Vorschaubild + Knopf) trägt data-einwilligung-schale; youtube-medien.js setzt hidden. */
.mf-video__schale[hidden], .mg-video__schale[hidden] { display: none !important; }
