/* ==========================================================================
   BetaBe Events - Motto-Looks für die ganze Seite
   html[data-motto="halloween|y2k|neon|winter|schule"] färbt die Seite um,
   die Effekt-Ebene (.motto-fx) kommt aus js/motto-theme.js. Wird auf allen
   Seiten geladen (außer /screen).
   ========================================================================== */

/* --- Effekt-Ebene (Seite und Vorschau in der Karte) ------------------------- */
.motto-fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1; /* hinter Text und Buttons */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.motto-fx.is-on { opacity: 1; }
.motto-fx--klein { position: absolute; z-index: -1; border-radius: inherit; }

/* --- Motto-Looks für die ganze Seite --------------------------------------- */
html[data-motto] body { transition: background-color 0.8s var(--ease); }

/* Farbschleier hinter dem Inhalt (ohne Mischmodus, das wäre beim Scrollen teuer) */
html[data-motto] body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(60% 45% at 8% 0%, var(--motto-a), transparent 70%),
    radial-gradient(55% 45% at 95% 100%, var(--motto-b), transparent 70%);
  animation: mottoEin 0.8s var(--ease);
}
@keyframes mottoEin { from { opacity: 0; } to { opacity: 1; } }

html[data-motto] .hero__glow,
html[data-motto] .page-head::before {
  background:
    radial-gradient(70% 60% at 15% 12%, var(--motto-glow-a), transparent 62%),
    radial-gradient(60% 55% at 85% 20%, var(--motto-glow-b), transparent 60%);
}
html[data-motto] .btn--primary { box-shadow: 0 10px 28px var(--motto-a); }

/* Effekt-Seiten: Kopfbereiche nicht mehr abschotten, damit die Effekt-Ebene über
   ihrem Hintergrund, aber unter Text und Buttons liegt */
html[data-motto-fx-an] .hero,
html[data-motto-fx-an] .event-hero { isolation: auto; }

/* --- Deko (z. B. Kürbisse), nur auf Effekt-Seiten -------------------------- */
.motto-deko {
  position: absolute;
  z-index: 1;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 0 16px rgba(249, 115, 22, 0.45));
  transform-origin: 50% 90%;
  animation: dekoWippen 4.5s ease-in-out infinite;
}
@keyframes dekoWippen {
  0%, 100% { transform: rotate(var(--dreh, 0deg)); }
  50% { transform: rotate(calc(var(--dreh, 0deg) + 4deg)) translateY(-3px); }
}
.motto-deko--hero-gross { right: 4%; bottom: 3%; width: clamp(64px, 10vw, 140px); --dreh: -8deg; }
.motto-deko--hero-klein { right: calc(4% + clamp(56px, 9vw, 124px)); bottom: 2%; width: clamp(40px, 6vw, 84px); --dreh: 10deg; animation-delay: -1.6s; }
.motto-deko--kopf { right: 5%; bottom: 12%; width: clamp(56px, 9vw, 110px); --dreh: 6deg; }
.motto-deko--event { right: 4%; top: 10%; width: clamp(56px, 9vw, 120px); --dreh: -6deg; }
.motto-deko--titel {
  position: static;
  display: inline-block;
  width: 1.15em;
  margin-left: 0.3em;
  vertical-align: -0.12em;
  --dreh: 8deg;
}
html[data-motto-fx-an] .site-footer { position: relative; }
.motto-deko--footer { right: 6%; top: 0; width: clamp(48px, 6vw, 72px); translate: 0 -70%; --dreh: -4deg; }

/* Winter Wonderland: eisblau, Schnee */
html[data-motto="winter"] {
  --color-bg: #040b17;
  --color-bg-alt: #0a1729;
  --color-accent: #7dd3fc;
  --color-accent-2: #e0f2fe;
  --color-accent-3: #bae6fd;
  --gradient-primary: linear-gradient(135deg, #38bdf8, #bae6fd);
  --motto-a: rgba(125, 211, 252, 0.16);
  --motto-b: rgba(224, 242, 254, 0.1);
  --motto-glow-a: rgba(125, 211, 252, 0.4);
  --motto-glow-b: rgba(255, 255, 255, 0.22);
}
html[data-motto="winter"] .btn--primary,
html[data-motto="winter"] .btn--primary:hover { color: #04121f; }
html[data-motto="winter"] h1,
html[data-motto="winter"] h2 { text-shadow: 0 0 24px rgba(186, 230, 253, 0.35); }

/* Neon Night: fast schwarz, Cyan und Magenta, Leuchtschrift */
html[data-motto="neon"] {
  --color-bg: #05010b;
  --color-bg-alt: #0f0620;
  --color-accent: #22d3ee;
  --color-accent-2: #e879f9;
  --color-accent-3: #a5f3fc;
  --gradient-primary: linear-gradient(135deg, #d946ef, #22d3ee);
  --motto-a: rgba(217, 70, 239, 0.16);
  --motto-b: rgba(34, 211, 238, 0.14);
  --motto-glow-a: rgba(217, 70, 239, 0.45);
  --motto-glow-b: rgba(34, 211, 238, 0.4);
}
html[data-motto="neon"] h1,
html[data-motto="neon"] h2 {
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.5), 0 0 18px rgba(232, 121, 249, 0.65), 0 0 42px rgba(34, 211, 238, 0.35);
}
html[data-motto="neon"] .eyebrow { text-shadow: 0 0 10px rgba(34, 211, 238, 0.8); }

/* Y2K: Pink, Lila, Chrom-Schrift, Glitzer und Discolichter */
html[data-motto="y2k"] {
  --color-bg: #0c050f;
  --color-bg-alt: #1a0b20;
  --color-accent: #ff4fd8;
  --color-accent-2: #c4b5fd;
  --color-accent-3: #f9a8d4;
  --gradient-primary: linear-gradient(135deg, #ff4fd8, #c4b5fd 55%, #f5f3ff);
  --motto-a: rgba(255, 79, 216, 0.16);
  --motto-b: rgba(196, 181, 253, 0.14);
  --motto-glow-a: rgba(255, 79, 216, 0.45);
  --motto-glow-b: rgba(196, 181, 253, 0.35);
}
html[data-motto="y2k"] .btn--primary,
html[data-motto="y2k"] .btn--primary:hover { color: #1a0b20; }
html[data-motto="y2k"] .section h2,
html[data-motto="y2k"] .page-head h1 {
  background: linear-gradient(180deg, #ffffff 0%, #fbcfe8 42%, #a78bfa 52%, #ffffff 78%, #f0abfc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Back to School: Gelb/Orange, Karopapier, Kritzeleien, Textmarker */
html[data-motto="schule"] {
  --color-bg: #0b0904;
  --color-bg-alt: #17130a;
  --color-accent: #fbbf24;
  --color-accent-2: #fb923c;
  --color-accent-3: #fde68a;
  --gradient-primary: linear-gradient(135deg, #f59e0b, #fde047);
  --motto-a: rgba(251, 191, 36, 0.12);
  --motto-b: rgba(251, 146, 60, 0.1);
  --motto-glow-a: rgba(251, 191, 36, 0.38);
  --motto-glow-b: rgba(251, 146, 60, 0.3);
}
html[data-motto="schule"] body {
  background-image:
    linear-gradient(rgba(253, 230, 138, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(253, 230, 138, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
}
html[data-motto="schule"] .btn--primary,
html[data-motto="schule"] .btn--primary:hover { color: #1a1203; }
html[data-motto="schule"] .eyebrow {
  display: inline-block;
  padding: 0 0.3em;
  color: #fde68a;
  background: linear-gradient(transparent 55%, rgba(251, 191, 36, 0.35) 55%);
}

/* Halloween: Orange, Glut-Funken, Fledermäuse, Nebel (Standard-Look bis 31.10., js/motto-theme.js) */
html[data-motto="halloween"] {
  --color-bg: #080402;
  --color-bg-alt: #160a04;
  --color-accent: #fb923c;
  --color-accent-2: #f97316;
  --color-accent-3: #fdba74;
  --gradient-primary: linear-gradient(135deg, #ea580c, #fbbf24);
  --motto-a: rgba(249, 115, 22, 0.16);
  --motto-b: rgba(251, 191, 36, 0.1);
  --motto-glow-a: rgba(234, 88, 12, 0.45);
  --motto-glow-b: rgba(251, 146, 60, 0.32);
}
html[data-motto="halloween"] .btn--primary,
html[data-motto="halloween"] .btn--primary:hover { color: #1c0a02; }
html[data-motto="halloween"] h1,
html[data-motto="halloween"] h2 { text-shadow: 0 0 22px rgba(249, 115, 22, 0.45); }
html[data-motto="halloween"] .eyebrow { text-shadow: 0 0 10px rgba(249, 115, 22, 0.7); }

/* Kleiner Schalter, um Effekte und Farbdesign auszuschalten */
.fx-toggle {
  position: fixed;
  left: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 95;
  padding: 6px 12px;
  font: 500 0.72rem/1 var(--font-body, system-ui, sans-serif);
  letter-spacing: 0.02em;
  color: rgba(240, 244, 255, 0.6);
  background: rgba(10, 10, 14, 0.55);
  border: 1px solid rgba(240, 244, 255, 0.14);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, color 0.2s, border-color 0.2s;
}
.fx-toggle:hover,
.fx-toggle:focus-visible { opacity: 1; color: #fff; border-color: rgba(240, 244, 255, 0.4); }
/* Mit Ticket-Leiste am Handy ein Stück höher, damit nichts überdeckt wird */
@media (max-width: 1024px) {
  body:has(.ticket-bar) .fx-toggle { bottom: calc(94px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .motto-fx { transition: none; }
  .motto-deko { animation: none; transform: rotate(var(--dreh, 0deg)); }
  html[data-motto] body::after { animation: none; }
}
