/* =====================================================================
   FESTIVE DECORATIONS (December only - listings/seasonal.py)
   Shared by the home hero (partials/_hero_festive.html) and the Browse
   page photo (partials/_browse_festive.html). Loaded only while the
   festive season is on, so it costs nothing the rest of the year.
   Decoration only: no words, hidden from screen readers, can't be
   clicked. Animations only touch opacity/transform (cheap on budget
   phones) and stop entirely for "reduce motion" users.
   ===================================================================== */
.hero-fx {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.fx-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Fairy lights */
.fx-garland {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40px;
}
.fx-wire {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.fx-wire path {
  fill: none;
  stroke: #166534;
  stroke-width: 1.6;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.fx-bulb {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 9px;
  height: 13px;
  margin-left: -4.5px;
  margin-top: 1px;
  border-radius: 50% 50% 50% 50% / 42% 42% 58% 58%;
  background: var(--c);
  box-shadow: inset -2px -2px 3px rgba(0, 0, 0, 0.18), 0 0 6px var(--c);
}
.fx-bulb::before {
  /* the socket */
  content: "";
  position: absolute;
  top: -3px;
  left: 2px;
  width: 5px;
  height: 4px;
  border-radius: 1px;
  background: #14532d;
}
.fx-bulb::after {
  /* the glow that twinkles */
  content: "";
  position: absolute;
  inset: -9px -10px -8px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--c) 0%, transparent 62%);
  opacity: 0.55;
  animation: fxTwinkle 2.6s ease-in-out var(--d) infinite alternate;
}
@keyframes fxTwinkle {
  0%   { opacity: 0.15; transform: scale(0.8); }
  100% { opacity: 0.75; transform: scale(1.1); }
}

/* Baubles */
.fx-bauble {
  position: absolute;
  top: 2px;
  width: 26px;
  transform-origin: 50% 0;
  animation: fxSway 4.8s ease-in-out var(--d) infinite alternate;
}
.fx-bauble--l { left: 3.5%; }
.fx-bauble--r { right: 3.5%; }
.fx-thread {
  display: block;
  width: 1.5px;
  height: var(--len);
  margin: 0 auto;
  background: linear-gradient(#a16207, #ca8a04);
}
.fx-bauble svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: -1px;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.18));
}
.fx-cap { fill: #d4a017; }
.fx-band { fill: none; stroke: rgba(255, 255, 255, 0.6); stroke-width: 1.6; }
.fx-shine { fill: #fff; opacity: 0.5; }
@keyframes fxSway {
  0%   { transform: rotate(-5deg); }
  100% { transform: rotate(5deg); }
}

/* Sparkles */
.fx-spark {
  position: absolute;
  left: var(--sx);
  top: var(--sy);
  width: var(--s);
  height: var(--s);
  fill: #f2b81d;
  filter: drop-shadow(0 0 4px rgba(250, 204, 21, 0.75));
  animation: fxSparkle 3.2s ease-in-out var(--d) infinite;
}
@keyframes fxSparkle {
  0%, 100% { opacity: 0.25; transform: scale(0.55) rotate(0deg); }
  50%      { opacity: 1;    transform: scale(1) rotate(20deg); }
}

/* Holly */
.fx-holly {
  position: absolute;
  bottom: -4px;
  width: 62px;
  height: 42px;
}
.fx-holly--l { left: -6px; transform: rotate(8deg); }
.fx-holly--r { right: -6px; transform: scaleX(-1) rotate(8deg); }
.fx-leaf { fill: #15803d; }
.fx-vein { fill: none; stroke: #0b4f26; stroke-width: 1; stroke-linecap: round; opacity: 0.6; }
.fx-berry { fill: #dc2626; }
.fx-berry-shine { fill: #fff; opacity: 0.7; }

.fx-bulb--wide,
.fx-spark--wide { display: none; }

@media (min-width: 720px) {
  .fx-bulb--wide,
  .fx-spark--wide { display: block; }
  .fx-garland { height: 48px; }
  .fx-bulb { width: 11px; height: 15px; margin-left: -5.5px; }
  .fx-bauble { width: 36px; }
  .fx-bauble--l { left: 5%; }
  .fx-bauble--r { right: 5%; }
  .fx-holly { width: 84px; height: 56px; }
}

/* Under 360px there's no empty margin left for sparkles - they'd sit on the words. */
@media (max-width: 359px) {
  .fx-spark { display: none; }
}

/* Dark mode: lights glow brighter on navy; leaves a touch lighter. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fx-wire path { stroke: #4d7c0f; }
  :root:not([data-theme="light"]) .fx-leaf { fill: #16a34a; }
}
:root[data-theme="dark"] .fx-wire path { stroke: #4d7c0f; }
:root[data-theme="dark"] .fx-leaf { fill: #16a34a; }

@media (prefers-reduced-motion: reduce) {
  .hero-fx *,
  .hero-fx *::after {
    animation: none !important;
  }
}
