/* Christmas look – only loaded between 12 Nov and 28 Dec (worker/lib/content.js isXmas adds body.xmas and this file).
   Holly on the logo, the menu rabbit in a Santa hat, a garland under the menu bar, snow on the home page photo,
   and the hidden robin (js/xmas.js). */
body.xmas {
  --rabbit: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='%23fff' stroke='%23171515' stroke-width='2' stroke-linejoin='round' stroke-linecap='round'%3E%3Cpath d='M10.4 19.6c-4.1 2.2-3.7 9.4 2.3 9.4h9.5c5.2 0 5.5-7.3.6-9.7-3.6-1.7-8.6-1.8-12.4.3z'/%3E%3Cpath d='M11 13.4C7.6 11.6 3.6 9 3.4 7.2 3.2 5.4 7.6 6.6 12.6 11.4'/%3E%3Cellipse cx='14.6' cy='15.7' rx='5.3' ry='4.4'/%3E%3Ccircle cx='26.1' cy='25.3' r='2.2'/%3E%3Ccircle cx='12.6' cy='15.1' r='.9' fill='%23171515' stroke='none'/%3E%3Cpath d='M9.7 16.9l-.8.4' stroke-width='1.2'/%3E%3Cpath d='M9.6 12.4C10.4 6.6 15 2.6 20.6 3.4c2.6.4 4 2.4 3.8 4.6-1.8-1.2-3.8-.8-4.8 1 .6 1.2.8 2.4.8 3.6z' fill='%23c9343c' stroke-width='1.6'/%3E%3Crect x='8.4' y='11' width='13.4' height='3.2' rx='1.6' stroke-width='1.6'/%3E%3Ccircle cx='24.4' cy='8.6' r='2' stroke-width='1.6'/%3E%3C/svg%3E");
}

/* 1. Holly sprig on the logo badge */
body.xmas .brand::after {
  content: ""; position: absolute; z-index: 3; left: 82px; top: 0; width: 64px; height: 48px; pointer-events: none;
  background: url(img/xmas/holly.svg) no-repeat center / contain; transform: rotate(12deg);
  transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease;
}
body.xmas.scrolled .brand::after, body.xmas.nav-open .brand::after { left: 36px; top: 2px; width: 34px; height: 26px; }
@media (max-width: 720px) {
  body.xmas .brand::after { left: 52px; top: 0; width: 44px; height: 33px; }
  body.xmas.scrolled .brand::after, body.xmas.nav-open .brand::after { left: 31px; top: 2px; width: 28px; height: 21px; }
}
@media (prefers-reduced-motion: reduce) { body.xmas .brand::after { transition: none; } }

/* 4. Garland hanging under the menu bar */
body.xmas header.site::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 22px; margin-top: -3px; z-index: 1; pointer-events: none;
  background: url(img/xmas/garland.svg) repeat-x 0 0 / auto 22px;
}
body.xmas.nav-open header.site::after { display: none; }

/* 3. Snow over the home page photo (js/xmas.js draws it; nothing for people who've asked for less motion) */
.xmas-snow { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }

/* 8. Find the hidden robin */
.xmas-robin {
  display: inline-block; vertical-align: middle; width: 1.3em; height: 1.3em; min-width: 32px; min-height: 32px; margin: -0.2em 0 0 0.3em; padding: 0;
  border: 0; background: url(img/xmas/robin.svg) no-repeat center / contain; cursor: pointer; transform-origin: 50% 100%;
  animation: robin-bob 3.2s ease-in-out infinite;
}
.xmas-robin:focus-visible { outline: 3px solid var(--coral-dark); outline-offset: 3px; border-radius: 50%; }
@keyframes robin-bob { 0%, 82%, 100% { transform: none; } 86% { transform: rotate(-10deg) translateY(-3px); } 92% { transform: rotate(6deg); } }
@media (prefers-reduced-motion: reduce) { .xmas-robin { animation: none; } }
.xmas-hint { font-style: italic; }
.xmas-hint::before { content: ""; display: inline-block; width: 22px; height: 22px; margin: 0 6px -5px 0; background: url(img/xmas/robin.svg) no-repeat center / contain; }
.xmas-found {
  position: fixed; left: 50%; bottom: 24px; z-index: 40; transform: translateX(-50%); width: min(92vw, 420px);
  background: var(--cream2); color: var(--ink); border: 2px solid var(--ink); border-radius: 16px; box-shadow: 6px 6px 0 var(--coral);
  padding: 18px 20px 18px 84px; font: 1rem/1.45 var(--sans);
}
.xmas-found::before { content: ""; position: absolute; left: 16px; top: 50%; width: 56px; height: 56px; margin-top: -28px; background: url(img/xmas/robin.svg) no-repeat center / contain; }
.xmas-found strong { display: block; font: normal 1.35rem/1.2 var(--serif); margin-bottom: 4px; }
.xmas-found button { margin-top: 10px; min-height: 44px; padding: 8px 18px; border: 2px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--cream2); font: 700 .85rem/1 var(--sans); cursor: pointer; }

/* Countdown to Christmas on the home page photo (js/xmas.js) */
.xmas-count {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px; padding: 8px 16px 8px 10px;
  background: var(--cream2); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; box-shadow: 4px 4px 0 #c8262f;
  font: 600 .95rem/1.2 var(--sans);
}
.xmas-count::before { content: ""; width: 34px; height: 29px; flex: none; background: url(img/xmas/holly.svg) no-repeat center / contain; }
.xmas-count b { font: normal 1.6rem/1 var(--serif); }
