/* ETSOMP – Christmas theme. Works together with /assets/xmas.js (it only applies when html.xmas is set). */

html.xmas {
  --xmas-red: #ff3b4e;
  --xmas-green: #2fdc7a;
  --xmas-gold: #ffd24a;
  --xmas-blue: #49b8ff;
}

/* ---------- string of lights under the top bar ---------- */
.xmas-lights {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 34px;
  margin-top: -5px;
  pointer-events: none;
  z-index: 2;
}
.xmas-lights-fixed { position: fixed; top: 0; margin-top: 0; z-index: 60; }

.xmas-wire {
  position: absolute;
  inset: 0 0 auto 0;
  width: 100%;
  height: 20px;
  overflow: visible;
}
.xmas-wire path {
  fill: none;
  stroke: #1c2a22;
  stroke-width: 1.6px;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 1px 0 rgba(255,255,255,.08));
}

.xmas-bulb {
  position: absolute;
  top: 10px;
  width: 9px;
  height: 14px;
  margin-left: -4.5px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60% !important;
  background: var(--c);
  box-shadow: 0 0 6px 1px var(--c), 0 0 16px 3px color-mix(in srgb, var(--c) 45%, transparent);
  animation: xmas-twinkle 2.4s ease-in-out infinite;
}
.xmas-bulb::before {
  content: "";
  position: absolute;
  left: 1.5px;
  top: -4px;
  width: 6px;
  height: 5px;
  border-radius: 1.5px !important;
  background: #3a4640;
}
.xmas-bulb::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 3px;
  width: 2.5px;
  height: 4px;
  border-radius: 50% !important;
  background: rgba(255,255,255,.75);
}
.xmas-bulb:nth-child(odd) { top: 12px; transform: rotate(-8deg); }
.xmas-bulb:nth-child(even) { transform: rotate(7deg); }

.xmas-r { --c: var(--xmas-red); }
.xmas-g { --c: var(--xmas-green); }
.xmas-y { --c: var(--xmas-gold); }
.xmas-b { --c: var(--xmas-blue); }

@keyframes xmas-twinkle {
  0%, 100% { opacity: 1; filter: brightness(1.15); }
  45% { opacity: .38; filter: brightness(.7); box-shadow: 0 0 2px 0 var(--c); }
}

/* ---------- hanging baubles ---------- */
.xmas-hang {
  position: absolute;
  top: 100%;
  width: 2px;
  height: var(--len, 50px);
  background: linear-gradient(#c9a64a, #8a6d2a);
  pointer-events: none;
  transform-origin: top center;
  animation: xmas-swing 5s ease-in-out infinite;
  z-index: 1;
}
.xmas-hang-l1 { left: 26px; }
.xmas-hang-l2 { left: 58px; animation-delay: -1.6s; }
.xmas-hang-l3 { left: 92px; animation-delay: -3s; }
.xmas-hang-r1 { right: 96px; animation-delay: -.8s; }
.xmas-hang-r2 { right: 62px; animation-delay: -2.4s; }
.xmas-hang-r3 { right: 30px; animation-delay: -3.8s; }

.xmas-ball {
  position: absolute;
  left: 50%;
  top: 100%;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  border-radius: 50% !important;
  background:
    radial-gradient(circle at 32% 30%, rgba(255,255,255,.85) 0 3px, rgba(255,255,255,0) 7px),
    radial-gradient(circle at 50% 55%, var(--c), color-mix(in srgb, var(--c) 55%, #000) 100%);
  box-shadow: 0 6px 14px rgba(0,0,0,.45), 0 0 18px color-mix(in srgb, var(--c) 35%, transparent);
}
.xmas-ball::before {
  content: "";
  position: absolute;
  left: 7px;
  top: -4px;
  width: 8px;
  height: 5px;
  border-radius: 2px !important;
  background: linear-gradient(#f2d47a, #a5822f);
}
.xmas-hang-l2 .xmas-ball, .xmas-hang-r2 .xmas-ball { width: 28px; height: 28px; margin-left: -14px; }
.xmas-hang-l2 .xmas-ball::before, .xmas-hang-r2 .xmas-ball::before { left: 10px; }

@keyframes xmas-swing {
  0%, 100% { transform: rotate(4deg); }
  50% { transform: rotate(-4deg); }
}

/* ---------- Santa hat on the logo ---------- */
.xmas-hat-box { position: relative; display: inline-block; line-height: 0; }
.xmas-hat {
  position: absolute;
  left: -9px;
  top: -17px;
  width: 36px;
  height: 27px;
  pointer-events: none;
  transform: rotate(-16deg);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.4));
  z-index: 3;
}
.xmas-hat svg { width: 100% !important; height: 100% !important; display: block; overflow: visible; fill: none; stroke: none; }
.xmas-hat svg .h-red { fill: #e0263a !important; stroke: none !important; }
.xmas-hat svg .h-fur { fill: #f6f7fb !important; stroke: none !important; }

/* ---------- snow ---------- */
.xmas-snow {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
}
.xmas-snow[hidden] { display: none; }

/* ---------- snow on/off button ---------- */
.xmas-snow-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  max-width: calc(100vw - 36px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 9px 11px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px !important;
  background: rgba(10, 16, 24, .82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #eaf6ff;
  font: 700 12px/1 Inter, system-ui, sans-serif;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  transition: background .2s, border-color .2s, transform .2s;
}
.xmas-snow-toggle:hover { border-color: rgba(255,255,255,.4); transform: translateY(-1px); }
.xmas-snow-toggle:focus-visible { outline: 2px solid var(--xmas-blue); outline-offset: 3px; }
.xmas-snow-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #bfe6ff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.xmas-snow-toggle.is-off { color: #9aa7b4; }
.xmas-snow-toggle.is-off svg { stroke: #6b7886; }

/* ---------- small festive touches ---------- */
html.xmas .news-card.featured {
  box-shadow: inset 0 3px 0 var(--xmas-red), 0 0 0 1px rgba(255, 59, 78, .18);
}

@media (max-width: 860px) {
  .xmas-hang { display: none; }
  .xmas-snow-toggle { padding: 10px; right: 12px; bottom: 12px; }
  .xmas-snow-toggle .xmas-snow-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .xmas-bulb, .xmas-hang { animation: none; }
}

/* keep round shapes on skins that square everything (UCP GTA skin) */
html.xmas body .xmas-bulb { border-radius: 50% 50% 50% 50% / 40% 40% 60% 60% !important; }
html.xmas body .xmas-bulb::after,
html.xmas body .xmas-ball { border-radius: 50% !important; }
html.xmas body .xmas-bulb::before { border-radius: 1.5px !important; }
html.xmas body .xmas-ball::before { border-radius: 2px !important; }
html.xmas body .xmas-snow-toggle { border-radius: 999px !important; }
