/* ==========================================================================
   consent.css — MV Webdesign Consent-Banner & -Einstellungen (v1.0.1)
   Eigenstaendig: definiert alle benoetigten Tokens selbst (Brand-Werte aus
   styles.css gespiegelt), damit Banner/Modal auf JEDER Seite identisch
   aussehen — auch auf analyse.html (eigene analyse.css). Greift nicht in
   bestehende Styles ein; alles unter .mvc-root gescopet.
   Fixed-Position → keine Layoutverschiebung (CLS = 0).
   ========================================================================== */

.mvc-root {
  /* Brand-Tokens (Quelle: styles.css) */
  --mvc-ink:        #16130f;
  --mvc-ink-1:      #1b1712;
  --mvc-ink-2:      #211c16;
  --mvc-gold:       #c6a15b;
  --mvc-gold-soft:  #dabd85;
  --mvc-on-dark:    #ece4d6;
  --mvc-muted:      #a99f8d;
  --mvc-faint:      #6f6656;
  --mvc-line:       rgba(236, 228, 214, 0.12);
  --mvc-line-gold:  rgba(198, 161, 91, 0.32);
  --mvc-r:          16px;
  --mvc-r-lg:       24px;
  --mvc-r-pill:     999px;
  --mvc-shadow:     0 24px 60px -26px rgba(0, 0, 0, .6);
  --mvc-font-sans:  'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mvc-ease:       cubic-bezier(.22, .61, .36, 1);
  --mvc-dur:        .32s;

  font-family: var(--mvc-font-sans);
  color: var(--mvc-on-dark);
  line-height: 1.6;
  box-sizing: border-box;
}
.mvc-root *, .mvc-root *::before, .mvc-root *::after { box-sizing: border-box; }
.mvc-root a { color: var(--mvc-gold); text-decoration: underline; text-underline-offset: 2px; }
.mvc-root a:hover { color: var(--mvc-gold-soft); }
/* Kein background/border im Reset — sonst schlaegt (0,1,1) die .mvc-btn-Stile (0,1,0). */
.mvc-root button { font: inherit; color: inherit; cursor: pointer; margin: 0; }
.mvc-root :focus-visible { outline: 2px solid var(--mvc-gold); outline-offset: 3px; border-radius: 4px; }

.mvc-sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ======================== SCROLL-LOCK (Gate) ========================
   Greift, solange eine Consent-Oberflaeche offen ist. Das position:fixed am
   body setzt consent.js per Inline-Style (inkl. Ausgleich der Scrollbalken-
   Breite), damit iOS/Safari nicht weiterscrollt und das Layout nicht springt. */
html.mvc-scroll-locked { overflow: hidden; }
html.mvc-scroll-locked, html.mvc-scroll-locked body { overscroll-behavior: none; }

/* ============================ BANNER ============================
   Vollflaechiges Overlay: die Seite bleibt sichtbar, ist aber nicht mehr
   bedienbar. Der Kasten sitzt weiterhin unten — Optik unveraendert. */
#mv-consent-banner {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(.9rem, 3vw, 2rem);
  outline: none;
}
#mv-consent-banner[hidden] { display: none; }

.mvc-banner-card {
  position: relative;                 /* ueber dem Backdrop */
  z-index: 1;
  width: 100%;
  max-width: 980px;
  margin-inline: auto;
  outline: none;
  background: var(--mvc-ink-1);
  border: 1px solid var(--mvc-line);
  border-radius: var(--mvc-r-lg);
  box-shadow: var(--mvc-shadow);
  padding: clamp(1.1rem, 2.6vw, 1.6rem) clamp(1.2rem, 3vw, 1.9rem);
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.6vw, 2rem);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--mvc-dur) var(--mvc-ease), transform var(--mvc-dur) var(--mvc-ease);
}
#mv-consent-banner.mvc-visible .mvc-banner-card { opacity: 1; transform: none; }

.mvc-banner-copy { flex: 1 1 340px; min-width: 0; }
.mvc-eyebrow {
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--mvc-gold);
  font-weight: 600;
  margin: 0 0 .45rem;
}
.mvc-text { font-size: .92rem; color: var(--mvc-muted); margin: 0; }

.mvc-banner-actions {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  flex: 0 0 auto;
  min-width: 200px;
}

/* Buttons — Spiegelung der .btn-Stile aus styles.css.
   „Alle akzeptieren" und „Nur notwendige" sind gleich gross und gleich
   bedienbar (keine manipulative Gewichtung). */
.mvc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .6rem;
  padding: .82rem 1.4rem;
  border-radius: var(--mvc-r-pill);
  font-weight: 600;
  font-size: .92rem;
  line-height: 1;
  background: transparent;
  border: 1px solid transparent;
  transition: transform var(--mvc-dur) var(--mvc-ease), background var(--mvc-dur) var(--mvc-ease),
              color var(--mvc-dur) var(--mvc-ease), border-color var(--mvc-dur) var(--mvc-ease);
  width: 100%;
}
.mvc-btn-primary { background: var(--mvc-gold); color: #1a1409; }
.mvc-btn-primary:hover { background: var(--mvc-gold-soft); transform: translateY(-1px); }
.mvc-btn-ghost { background: transparent; color: var(--mvc-on-dark); border-color: var(--mvc-line-gold); }
.mvc-btn-ghost:hover { background: rgba(198, 161, 91, .1); border-color: var(--mvc-gold); transform: translateY(-1px); }
.mvc-btn-quiet { background: transparent; color: var(--mvc-muted); border-color: var(--mvc-line); }
.mvc-btn-quiet:hover { color: var(--mvc-on-dark); border-color: var(--mvc-line-gold); }

/* ============================ MODAL ============================ */
#mv-consent-modal { position: fixed; inset: 0; z-index: 9995; }
#mv-consent-modal[hidden] { display: none; }
/* Backdrop fuer Banner UND Modal. position:fixed statt absolute, damit die
   Abdeckung auch dann die ganze Flaeche haelt, wenn der Dialog selbst scrollt
   (kleine Viewports, langer Einstellungs-Dialog). */
.mvc-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 8, 6, .66);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity var(--mvc-dur) var(--mvc-ease);
}
#mv-consent-modal.mvc-visible .mvc-backdrop,
#mv-consent-banner.mvc-visible .mvc-backdrop { opacity: 1; }

/* Gate-Modus: ohne vorliegende Entscheidung gibt es keinen Schliess-Button.
   ESC und Backdrop-Klick sind zusaetzlich in consent.js gesperrt. */
.mvc-must-decide .mvc-close { display: none; }

.mvc-modal-card {
  --mvc-pad: clamp(1.3rem, 3.4vw, 2rem);
  position: relative;
  max-width: 640px;
  margin: clamp(1rem, 6vh, 4.5rem) auto 0;
  max-height: calc(100vh - clamp(2rem, 10vh, 6rem));
  max-height: calc(100dvh - clamp(2rem, 10vh, 6rem));
  overflow-y: auto;
  background: var(--mvc-ink-1);
  border: 1px solid var(--mvc-line);
  border-radius: var(--mvc-r-lg);
  box-shadow: var(--mvc-shadow);
  padding: var(--mvc-pad);
  width: calc(100% - 2rem);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--mvc-dur) var(--mvc-ease), transform var(--mvc-dur) var(--mvc-ease);
  outline: none;
}
#mv-consent-modal.mvc-visible .mvc-modal-card { opacity: 1; transform: none; }

.mvc-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .35rem; }
.mvc-modal-head .mvc-eyebrow { font-size: .8rem; margin: 0; }
.mvc-close {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--mvc-line);
  color: var(--mvc-muted);
  transition: color var(--mvc-dur) var(--mvc-ease), border-color var(--mvc-dur) var(--mvc-ease);
}
.mvc-close:hover { color: var(--mvc-on-dark); border-color: var(--mvc-line-gold); }
.mvc-close svg { width: 16px; height: 16px; }

.mvc-cats { margin-top: 1.15rem; display: grid; gap: .8rem; }
.mvc-cat {
  border: 1px solid var(--mvc-line);
  border-radius: var(--mvc-r);
  padding: .95rem 1.05rem;
  background: var(--mvc-ink-2);
}
.mvc-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.mvc-cat-label { font-weight: 600; font-size: .98rem; color: var(--mvc-on-dark); }
.mvc-always {
  font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--mvc-gold); font-weight: 600;
}
.mvc-cat-desc { margin: .5rem 0 0; font-size: .86rem; color: var(--mvc-muted); }

/* Switch (echte Checkbox, sichtbarer Fokusring auf dem Slider) */
.mvc-switch { position: relative; display: inline-flex; align-items: center; flex: 0 0 auto; cursor: pointer; }
.mvc-switch input {
  position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer;
}
.mvc-slider {
  width: 46px; height: 26px;
  border-radius: var(--mvc-r-pill);
  background: var(--mvc-ink);
  border: 1px solid var(--mvc-line-gold);
  position: relative;
  transition: background var(--mvc-dur) var(--mvc-ease), border-color var(--mvc-dur) var(--mvc-ease);
}
.mvc-slider::after {
  content: '';
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--mvc-faint);
  transition: transform var(--mvc-dur) var(--mvc-ease), background var(--mvc-dur) var(--mvc-ease);
}
.mvc-switch input:checked + .mvc-slider { background: var(--mvc-gold); border-color: var(--mvc-gold); }
.mvc-switch input:checked + .mvc-slider::after { transform: translateX(20px); background: #1a1409; }
.mvc-switch input:focus-visible + .mvc-slider { outline: 2px solid var(--mvc-gold); outline-offset: 3px; }

/* Sticky am unteren Rand des scrollbaren Dialogs — „Auswahl speichern" bleibt
   auch auf niedrigen Viewports immer erreichbar. */
.mvc-modal-actions {
  display: flex; flex-wrap: wrap; gap: .6rem;
  position: sticky; bottom: 0;
  margin: 1.3rem calc(var(--mvc-pad) * -1) calc(var(--mvc-pad) * -1);
  padding: .9rem var(--mvc-pad) var(--mvc-pad);
  background: var(--mvc-ink-1);
  border-top: 1px solid var(--mvc-line);
}
.mvc-modal-actions .mvc-btn { width: auto; flex: 1 1 160px; }

/* ================== Footer-/Inline-Link „Cookie-Einstellungen" ==================
   Passt sich der .legal-Navigation (index.html) bzw. Fliesstext an. */
.mvc-legal-link {
  font: inherit;
  font-size: .84rem;
  color: #a99f8d;
  background: none; border: none; padding: 0; cursor: pointer;
  transition: color .32s cubic-bezier(.22, .61, .36, 1);
}
.mvc-legal-link:hover { color: #c6a15b; }
.mvc-inline-link {
  font: inherit;
  color: #c6a15b;
  text-decoration: underline; text-underline-offset: 2px;
  background: none; border: none; padding: 0; cursor: pointer;
}
.mvc-inline-link:hover { color: #dabd85; }
.mvc-legal-link:focus-visible, .mvc-inline-link:focus-visible {
  outline: 2px solid #c6a15b; outline-offset: 3px; border-radius: 4px;
}

/* ==================== Externe-Medien-Platzhalter (dormant) ==================== */
.mvc-embed {
  background: #1b1712;
  border: 1px solid rgba(236, 228, 214, 0.12);
  border-radius: 16px;
  overflow: hidden;
}
.mvc-embed-inner { padding: clamp(1.2rem, 4vw, 2rem); display: grid; gap: .9rem; justify-items: start; }
.mvc-embed-note { margin: 0; font-size: .9rem; color: #a99f8d; }
.mvc-embed-note b { color: #ece4d6; }
.mvc-embed .mvc-btn { width: auto; }
.mvc-embed-remember { display: inline-flex; align-items: center; gap: .5rem; font-size: .84rem; color: #a99f8d; cursor: pointer; }
.mvc-embed-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }

/* ============================ RESPONSIVE ============================ */
@media (max-width: 760px) {
  .mvc-banner-card { flex-direction: column; align-items: stretch; }
  .mvc-banner-copy { flex: 0 1 auto; }   /* flex-basis waere im Column-Layout eine Hoehe */
  .mvc-banner-actions { min-width: 0; }
  .mvc-modal-actions .mvc-btn { flex-basis: 100%; }
}

/* ============================ REDUCED MOTION ============================ */
@media (prefers-reduced-motion: reduce) {
  .mvc-root, .mvc-root *, .mvc-banner-card, .mvc-modal-card, .mvc-backdrop, .mvc-slider, .mvc-slider::after {
    transition: none !important;
  }
  .mvc-banner-card, .mvc-modal-card { transform: none; }
}
