/* Holiday decorations (1 Dec – 7 Jan, see src/utils/season.js). Only loaded in
   season, by the siteHeader partial. Everything is drawn here or in
   holiday.js: no images, nothing from other sites. */

/* ── Santa hat on the logo ─────────────────────────────────────────────── */
.holiday .brand-link { position: relative; }
.holiday-hat {
  position: absolute;
  width: 30px;
  height: auto;
  top: -15px;
  left: 50%;
  transform: translateX(-46%) rotate(14deg);
  transform-origin: 50% 100%;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .45));
  transition: transform .3s ease;
}
.brand-link:hover .holiday-hat { transform: translateX(-46%) rotate(4deg) translateY(-3px); }
@media (max-width: 576px) {
  .holiday-hat { width: 25px; top: -12px; }
}

/* ── String lights along the bottom of the header ──────────────────────── */
.holiday-lights {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 18px;
  overflow: hidden;
  pointer-events: none;
  display: flex;
  padding-left: 14px;               /* first bulb under the first dip of the wire */
  /* The wire: one sagging span every 36px, the bulbs hang from the dips. */
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="36" height="10"><path d="M0 1 Q18 10 36 1" fill="none" stroke="%23475569" stroke-width="1.2"/></svg>') repeat-x 0 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}
.holiday-lights i {
  --bulb: #ff4d5e;
  flex: 0 0 auto;
  position: relative;
  width: 8px;
  height: 11px;
  margin: 6px 28px 0 0;             /* 8 + 28 = the wire's 36px period */
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .85), var(--bulb) 45%);
  box-shadow: 0 0 6px 1px var(--bulb), 0 0 14px 2px color-mix(in srgb, var(--bulb) 45%, transparent);
  animation: holiday-twinkle 2.6s ease-in-out infinite;
}
.holiday-lights i::before {          /* the socket */
  content: '';
  position: absolute;
  top: -3px;
  left: 1.5px;
  width: 5px;
  height: 4px;
  border-radius: 1px;
  background: #334155;
}
.holiday-lights i:nth-child(4n+2) { --bulb: #fbbf24; animation-delay: -.7s; }
.holiday-lights i:nth-child(4n+3) { --bulb: #34d399; animation-delay: -1.4s; }
.holiday-lights i:nth-child(4n)   { --bulb: #22d3ee; animation-delay: -2.1s; }
.holiday-lights i:nth-child(3n)   { animation-duration: 3.4s; }
@keyframes holiday-twinkle {
  0%, 100% { opacity: 1;   filter: brightness(1.1); }
  50%      { opacity: .45; filter: brightness(.7); }
}

/* ── Snow (canvas drawn by holiday.js) ─────────────────────────────────── */
.holiday-snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;                      /* over the starfield, behind the content */
  pointer-events: none;
}

/* Calm versions: the site's own animation switch, or the device setting. */
.animations-paused .holiday-lights i { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .holiday-lights i { animation: none; }
  .holiday-snow { display: none; }
}
