/*
 * Christmas decorations, shown every December (ApplicationHelper#christmas_season?, #99).
 * Decoration only: hidden from screen readers, clicks go through, and no motion for people
 * who ask for less.
 */

/* Snow: snowflakes falling from above the page to below it, drifting and turning. */
.christmas-snow {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 50;
}

.christmas-snowflake {
  position: absolute;
  top: -2rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1;
  animation-name: christmas-snowfall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

@keyframes christmas-snowfall {
  to { transform: translate(2rem, 105vh) rotate(360deg); }
}

/* Lights: a dark wire along the top, bulbs in four colours glowing in turn. */
.christmas-lights {
  position: relative;
  display: flex;
  justify-content: space-around;
  height: 1.75rem;
  overflow: hidden;
  pointer-events: none;
  border-top: 2px solid #1f2937;
}

.christmas-light {
  flex-shrink: 0;
  width: 0.6rem;
  height: 1rem;
  margin-top: 0.3rem;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  position: relative;
  animation: christmas-light-glow 2s ease-in-out infinite;
}

/* The socket holding the bulb on the wire. */
.christmas-light::before {
  content: "";
  position: absolute;
  top: -0.3rem;
  left: 0.15rem;
  width: 0.3rem;
  height: 0.35rem;
  background: #374151;
  border-radius: 2px;
}

.christmas-light:nth-child(4n + 1) { background: #ef4444; color: #ef4444; animation-delay: 0s; }
.christmas-light:nth-child(4n + 2) { background: #facc15; color: #facc15; animation-delay: 0.5s; }
.christmas-light:nth-child(4n + 3) { background: #22c55e; color: #22c55e; animation-delay: 1s; }
.christmas-light:nth-child(4n + 4) { background: #3b82f6; color: #3b82f6; animation-delay: 1.5s; }

@keyframes christmas-light-glow {
  0%, 100% { opacity: 1; box-shadow: 0 0 0.6rem 0.15rem currentColor; }
  50% { opacity: 0.35; box-shadow: none; }
}

/* Santa hat, tilted on the top-right of the logo. */
.santa-hat {
  position: absolute;
  top: -28%;
  right: -22%;
  width: 62%;
  transform: rotate(18deg);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .christmas-snow { display: none; }
  .christmas-light { animation: none; box-shadow: 0 0 0.4rem 0.1rem currentColor; }
}
