/* ==========================================================================
   consent.css — Einwilligungs-Banner (Hochzeitsfarben.de), angelegt 2026-08-13
   --------------------------------------------------------------------------
   Gehört zu /assets/js/consent.js. Vor einer Entscheidung lädt kein einziger
   Drittanbieter (Ahrefs Analytics, ProvenExpert-Widget).

   Gestaltung nutzt die Tokens aus style.css (:root), damit das Banner nicht
   wie ein Fremdkörper wirkt: Off-White-Karte, Champagner-Hairline, ruhige
   Typo. Kein Dark-Pattern — „Ablehnen" hat exakt dieselbe Größe, Schriftart
   und Trefferfläche wie „Akzeptieren" (Vorgabe der Datenschutzkonferenz).

   Barrierefreiheit: alle Kontraste ≥ 4,5:1 auf --card (#ffffff), Fokus
   sichtbar, Trefferflächen ≥ 44px, prefers-reduced-motion respektiert.
   Kein Fokus-Trap: die Seite selbst ist erstanbieterisch und darf gelesen
   werden, ohne vorher zu entscheiden.

   Cache-Hinweis: 180 Tage immutable — Änderungen brauchen neuen ?v=.
   ========================================================================== */

.mt-consent {
  position: fixed;
  z-index: 9999;
  inset-inline: 0;
  bottom: 0;
  background: hsl(var(--card, 0 0% 100%));
  border-top: 1px solid hsl(var(--border, 33 10% 86%));
  box-shadow: 0 -8px 30px -12px rgb(0 0 0 / 0.25);
  padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  font-family: var(--font-sans, system-ui, sans-serif);
  color: hsl(var(--foreground, 30 10% 14%));
  animation: mt-consent-auf 0.45s ease-out;
}

/* Champagner-Hairline als Anklang an die lux-Schicht */
.mt-consent::before {
  content: "";
  position: absolute;
  top: -1px;
  inset-inline: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    hsl(var(--champagne, 34 40% 72%) / 0.9),
    transparent
  );
}

@keyframes mt-consent-auf {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.mt-consent__innen {
  max-width: 64rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mt-consent__titel {
  font-family: var(--font-serif, Georgia, serif);
  font-weight: 400;
  font-size: 1.125rem;
  line-height: 1.3;
  margin: 0 0 0.4rem;
  color: hsl(var(--foreground, 30 10% 14%));
}

.mt-consent__text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.6;
  font-weight: 400;
  /* --muted-foreground (33 12% 38%) auf Weiß = 6,4:1 */
  color: hsl(var(--muted-foreground, 33 12% 38%));
}

.mt-consent__text a {
  color: hsl(var(--primary, 33 20% 31%));
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mt-consent__text a:hover {
  text-decoration-thickness: 2px;
}

/* --- Schaltflächen ------------------------------------------------------ */

.mt-consent__knoepfe {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: stretch;
}

.mt-consent__knopf {
  /* Gleiche Metrik für Akzeptieren und Ablehnen — keine visuelle Bevorzugung */
  flex: 1 1 12rem;
  min-height: 44px;
  padding: 0.7rem 1.5rem;
  border-radius: 9999px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease;
}

.mt-consent__knopf--ja {
  background: hsl(var(--primary, 33 20% 31%));
  border: 1px solid hsl(var(--primary, 33 20% 31%));
  color: #fff; /* Weiß auf --primary = 8,6:1 */
}

.mt-consent__knopf--ja:hover {
  background: hsl(var(--primary, 33 20% 31%) / 0.9);
}

.mt-consent__knopf--nein {
  background: transparent;
  border: 1px solid hsl(var(--primary, 33 20% 31%));
  color: hsl(var(--primary, 33 20% 31%)); /* auf Weiß = 7,9:1 */
}

.mt-consent__knopf--nein:hover {
  background: hsl(var(--primary, 33 20% 31%) / 0.08);
}

/* Tertiär, aber vollwertig bedienbar */
.mt-consent__knopf--mehr {
  flex: 0 1 auto;
  background: transparent;
  border: 1px solid hsl(var(--border, 33 10% 86%));
  color: hsl(var(--muted-foreground, 33 12% 38%));
}

.mt-consent__knopf--mehr:hover {
  border-color: hsl(var(--primary, 33 20% 31%));
  color: hsl(var(--primary, 33 20% 31%));
}

.mt-consent__knopf:focus-visible,
.mt-consent__schalter input:focus-visible {
  outline: 2px solid hsl(var(--primary, 33 20% 31%));
  outline-offset: 2px;
}

/* --- Einstellungen ------------------------------------------------------ */

.mt-consent__details {
  display: none;
  flex-direction: column;
  gap: 0.9rem;
  border-top: 1px solid hsl(var(--border, 33 10% 86%));
  padding-top: 1rem;
  margin-top: 0.25rem;
}

.mt-consent[data-details="offen"] .mt-consent__details {
  display: flex;
}

.mt-consent__schalter {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.mt-consent__schalter input {
  /* 20px Box, aber 44px Trefferfläche über das umschließende Label */
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.1rem 0 0;
  flex: none;
  accent-color: hsl(var(--primary, 33 20% 31%));
  cursor: pointer;
}

.mt-consent__schalter label {
  cursor: pointer;
}

.mt-consent__schalter-titel {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground, 30 10% 14%));
  margin-bottom: 0.15rem;
}

.mt-consent__schalter-text {
  display: block;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: hsl(var(--muted-foreground, 33 12% 38%));
}

/* --- Fußzeilen-Auslöser ------------------------------------------------- */

.mt-consent-oeffnen {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
}

.mt-consent-oeffnen:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mt-consent-oeffnen:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* --- Zusammenspiel mit der ProvenExpert-Leiste -------------------------- */
/* Die PE-Einbindung reserviert per Inline-<style> 44px am Seitenende. Ohne
   Einwilligung lädt die Leiste nicht — dann darf der Platz auch nicht
   freigehalten werden, sonst klafft unten eine leere Lücke. */
@media (min-width: 768px) {
  html:not(.mt-pe-aktiv) {
    padding-bottom: 0 !important;
  }
}

/* --- Schmale Viewports -------------------------------------------------- */

@media (max-width: 640px) {
  .mt-consent {
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
    max-height: 85vh;
    overflow-y: auto;
  }

  .mt-consent__knopf {
    flex-basis: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mt-consent {
    animation: none;
  }

  .mt-consent__knopf {
    transition: none;
  }
}
