/* assets/css/xmas.css */

/* Basis: XMAS-Theme aktiv, wenn body.theme-xmas gesetzt ist */
body.theme-xmas {
  --xmas-accent: #f4c96b;
  --xmas-red: #d4584a;
  --xmas-green: #2f6f4e;
}

/* -------------------------------------------------
   HERO: fallender Goldstaub + (optional) Skull
   (Logo bleibt UNVERÄNDERT!)
-------------------------------------------------- */
body.theme-xmas .hero {
  position: relative;
  overflow: hidden;
}

/* Optional: schwebender Skull über der Headline
   -> Bild-Datei: /assets/img/xmas-skull-gold.svg
   Wenn du KEINEN Skull willst, diesen Block einfach auskommentieren. */
body.theme-xmas .hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  width: 70px;
  height: 70px;
  background: url("/assets/img/xmas-skull-gold.svg") center/contain no-repeat;
  opacity: 0.42;
  pointer-events: none;
  animation: xmasSkullFloat 10s ease-in-out infinite;
}

/* Fallender Goldstaub nur im oberen Hero-Bereich */
body.theme-xmas .hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 65%;              /* nur oberer Bereich, kein Balken ueber der ganzen Seite */
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.35;
  background-image:
    radial-gradient(circle, rgba(244, 201, 107, 0.42) 1px, transparent 3px),
    radial-gradient(circle, rgba(255, 240, 205, 0.35) 1px, transparent 4px),
    radial-gradient(circle, rgba(201, 163, 74, 0.28) 1.6px, transparent 5px);
  background-size: 130px 200px, 170px 240px, 220px 320px;
  background-repeat: repeat;
  background-position: 0 0, 50px -40px, -40px -110px;
  animation: xmasGoldDustFallback 22s linear infinite;
}

body.theme-xmas .hero.has-gold-dust::after {
  opacity: 0;
}

body.theme-xmas .hero .xmas-gold-dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  mix-blend-mode: screen;
  opacity: 0.9;
  filter: drop-shadow(0 0 8px rgba(7, 10, 15, 0.45));
}


/* Headline leicht betonen, aber kein fetter Balken */
body.theme-xmas .hero h1 {
  text-shadow:
    0 0 10px rgba(244, 201, 107, 0.4),
    0 0 22px rgba(0, 0, 0, 0.85);
}

@keyframes xmasGoldDustFallback {
  0% {
    background-position: 0 0, 50px -40px, -40px -110px;
    opacity: 0.28;
  }
  50% {
    opacity: 0.45;
  }
  100% {
    background-position: 0 250px, 50px 210px, -40px 180px;
    opacity: 0.28;
  }
}


@keyframes xmasSkullFloat {
  0%   { transform: translate(-50%, 0); }
  50%  { transform: translate(-50%, -8px); }
  100% { transform: translate(-50%, 0); }
}

/* Etwas kleiner auf Mobile */
@media (max-width: 768px) {
  body.theme-xmas .hero::before {
    top: 16%;
    width: 50px;
    height: 50px;
    opacity: 0.35;
  }

  body.theme-xmas .hero::after {
    height: 70%;
    opacity: 0.45;
  }
}

/* -------------------------------------------------
   XMAS-CARDS: Goldrahmen + Candle-Light
   -> Klasse "xmas-card" an beliebige Cards hängen
-------------------------------------------------- */
body.theme-xmas .xmas-card {
  position: relative;
  overflow: hidden;
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

/* Goldrahmen & dezenter Glow */
body.theme-xmas .xmas-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 1px solid rgba(244, 201, 107, 0.35);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.7) inset,
    0 0 18px rgba(244, 201, 107, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

/* Candle-Light-Flicker im Inneren */
body.theme-xmas .xmas-card::after {
  content: "";
  position: absolute;
  inset: -30%;
  background:
    radial-gradient(circle at 20% 0%, rgba(244, 201, 107, 0.2), transparent 55%);
  mix-blend-mode: screen;
  opacity: 0.12;
  pointer-events: none;
  animation: xmasCandle 7s ease-in-out infinite;
}

@keyframes xmasCandle {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: 0.12; }
  35%      { transform: translate3d(2px, -3px, 0); opacity: 0.22; }
  60%      { transform: translate3d(-2px, 2px, 0); opacity: 0.16; }
}

/* Hover-State: etwas Lift + sichtbarer Rahmen */
body.theme-xmas .xmas-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.65);
}

body.theme-xmas .xmas-card:hover::before {
  opacity: 1;
}

/* -------------------------------------------------
   XMAS-BUTTONS: Gold-Sweep beim Hover
   -> Klasse "xmas-btn" zusätzlich zu "btn"
-------------------------------------------------- */
body.theme-xmas .btn.xmas-btn {
  position: relative;
  overflow: hidden;
  border-color: var(--xmas-accent, #f4c96b);
  box-shadow: 0 0 0 1px rgba(244, 201, 107, 0.15);
  transition:
    color 0.25s ease,
    background-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.12s ease;
}

/* animierter Gold-Sweep */
body.theme-xmas .btn.xmas-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid transparent;
  background-image: linear-gradient(
    120deg,
    transparent 0%,
    rgba(244, 201, 107, 0.8) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.25s ease;
}

body.theme-xmas .btn.xmas-btn:hover {
  background-color: rgba(244, 201, 107, 0.08);
  color: #ffe8b3;
  box-shadow:
    0 0 12px rgba(244, 201, 107, 0.45),
    0 10px 28px rgba(0, 0, 0, 0.7);
  transform: translateY(1px);
}

body.theme-xmas .btn.xmas-btn:hover::before {
  opacity: 1;
  animation: xmasBorderSweep 0.9s linear forwards;
}

@keyframes xmasBorderSweep {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* -------------------------------------------------
   XMAS-SPARKLES: kleine Goldfunken
   -> Klasse "xmas-sparkles" an Badges / kleine Elemente
-------------------------------------------------- */
body.theme-xmas .xmas-sparkles {
  position: relative;
  overflow: hidden;
}

body.theme-xmas .xmas-sparkles .sparkle-star {
  position: absolute;
  left: var(--sparkle-left, 50%);
  top: var(--sparkle-top, 50%);
  width: var(--sparkle-size, 10px);
  height: var(--sparkle-size, 10px);
  margin-left: calc(var(--sparkle-size, 10px) / -2);
  margin-top: calc(var(--sparkle-size, 10px) / -2);
  pointer-events: none;
  opacity: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23f4c96b' fill-opacity='0.9' d='M8 0l1.6 4.9 5 .3-3.9 2.9 1.3 4.9L8 10.2 4 13l1.3-4.9-3.9-2.9 5-.3z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 6px rgba(201, 163, 74, 0.45));
  animation: xmasStarBlink var(--sparkle-duration, 4s) ease-in-out infinite;
  animation-delay: var(--sparkle-delay, 0s);
}

@keyframes xmasStarBlink {
  0%, 100% {
    opacity: 0;
    transform: scale(0.4) rotate(0deg);
  }
  45% {
    opacity: 0.85;
    transform: scale(1) rotate(25deg);
  }
  70% {
    opacity: 0.25;
    transform: scale(0.65) rotate(55deg);
  }
}

/* -------------------------------------------------
   XMAS-FROST: deutlich sichtbare Frostkante oben
   -> Klasse "xmas-frost" zusätzlich an Cards / Boxen
-------------------------------------------------- */
body.theme-xmas .xmas-frost {
  position: relative;
  overflow: hidden;
}

body.theme-xmas .xmas-frost::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  height: 0;
  pointer-events: none;
}

body.theme-xmas .xmas-frost::after {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  top: 0;
  height: 40px;
  pointer-events: none;
  background-image: url("/images/eiszapfen.svg");
  background-repeat: repeat-x;
  background-size: 200px auto;
  background-position: top center;
  opacity: 0.42;
}

body.theme-xmas .card--hero.xmas-frost::before,
body.theme-xmas .card--hero.xmas-frost::after {
  content: none;
}

body.theme-xmas .card--hero.xmas-frost .hero-frost {
  display: block;
  background-image: url("/images/eiszapfen.svg");
  background-repeat: repeat-x;
  background-size: 200px auto;
  background-position: top center;
  opacity: 0.42;
}
/* -------------------------------------------------
   XMAS-ICON: kleines Symbol neben Überschriften
   -> Klasse "xmas-icon" an h3/h2 etc.
-------------------------------------------------- */
body.theme-xmas .xmas-icon {
  position: relative;
}

body.theme-xmas .xmas-icon::after {
  content: "✶";
  position: absolute;
  right: -1.4em;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75em;
  color: var(--xmas-accent, #f4c96b);
  text-shadow: 0 0 6px rgba(244, 201, 107, 0.6);
  pointer-events: none;
}

/* -------------------------------------------------
   Motion-Reduction: Animationen abschwächen
-------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  body.theme-xmas .hero::before,
  body.theme-xmas .hero::after,
  body.theme-xmas .xmas-card::after,
  body.theme-xmas .xmas-sparkles .sparkle-star {
    animation: none;
  }
}
