/* Advent calendar (/advent-calendar/, scripts/advent.mjs + public/advent.js). */
.adv { margin: 8px 0 24px; }
.adv-banner { background: var(--sun-field); border: 2px solid var(--line-2); border-radius: var(--radius-lg); padding: 14px 18px; margin: 0 0 16px; }
.adv-banner p { margin: 4px 0; }
.adv-when strong { font-size: var(--t-lg); }
.adv-count { font-size: var(--t-lg); font-weight: 700; color: var(--coral-dark); font-variant-numeric: tabular-nums; }
.adv-today-row:has(> [hidden]) { display: none; }
.adv-set { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 16px; }
.adv-set h3 { margin: 0 0 6px; font-size: var(--t-lg); }
.adv-set p { margin: 8px 0; }
.adv-set select { min-height: 44px; max-width: 100%; font: inherit; padding: 6px 10px; border: 2px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--ink); }
.adv-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
.adv-check input { width: 22px; height: 22px; accent-color: var(--coral); }

/* The doors: 4 across on phones, 6 across from tablets. */
.adv-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .adv-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 900px) { .adv-grid { grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 16px; } }
.adv-grid li { display: block; }
.adv-door { --door: #a3330f; position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; min-height: 0; padding: 0; border: 0; border-radius: 48% 48% 10px 10px / 34% 34% 10px 10px;
  background: radial-gradient(circle at 50% 45%, #fff6c9, #ffcf4a 70%); box-shadow: inset 0 0 0 3px rgba(29, 29, 59, .25); color: #fff; cursor: pointer; perspective: 420px; }
.adv-grid li:nth-child(4n+2) .adv-door { --door: #1f6b3a; }
.adv-grid li:nth-child(4n+3) .adv-door { --door: #1f4e9a; }
.adv-grid li:nth-child(4n+4) .adv-door { --door: #6a2c7a; }
.adv-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4%; border-radius: inherit;
  background: var(--door); border: 3px solid rgba(255, 255, 255, .35); transform-origin: left center; transition: transform .55s cubic-bezier(.34, 1.3, .64, 1); backface-visibility: hidden; }
.adv-face::after { content: ""; position: absolute; right: 12%; top: 56%; width: 9%; aspect-ratio: 1; border-radius: 50%; background: var(--sun); }
.adv-face .adv-ico { width: 52%; height: auto; background: #fff; border-radius: 50%; padding: 6%; box-sizing: border-box; }
.adv-num { font-size: clamp(1.25rem, 5.5vw, 2rem); font-weight: 800; line-height: 1; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.adv-tag { position: absolute; z-index: 1; left: 38%; right: 4px; top: 50%; transform: translateY(-50%); font-size: clamp(.75rem, 2.4vw, .875rem); font-weight: 800; line-height: 1.15; color: var(--ink); text-align: center; }
.adv-tag::before { content: "✓"; display: block; font-size: 1.4em; color: #1f6b3a; }
.adv-tag:empty { display: none; }
.adv-door.is-locked .adv-face { filter: saturate(.55) brightness(.92); }
.adv-lock { position: absolute; top: 7%; right: 9%; width: 17%; height: auto; display: none; }
.adv-door.is-locked .adv-lock { display: block; }
.adv-door.is-open:hover .adv-face, .adv-door.is-open:focus-visible .adv-face { transform: rotateY(-14deg); }
.adv-door.is-opened .adv-face { transform: rotateY(-62deg); }
.adv-door.is-opened:hover .adv-face, .adv-door.is-opened:focus-visible .adv-face { transform: rotateY(-70deg); }
.adv-door.is-today { outline: 4px solid var(--coral); outline-offset: 3px; }
/* Today's door pulses three times, then rests (no motion competing with colouring). */
.adv-door.is-today:not(.is-opened) { animation: adv-glow 1.6s ease-in-out 6 alternate; }
.adv-door:focus-visible { outline: 4px solid var(--focus); outline-offset: 3px; }
.adv-door.is-opening .adv-face { transform: rotateY(-70deg); }
.adv-door.is-shake { animation: adv-shake .4s ease; }
@keyframes adv-glow { from { box-shadow: 0 0 0 0 rgba(200, 64, 28, .0); } to { box-shadow: 0 0 0 8px rgba(200, 64, 28, .25); } }
@keyframes adv-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-4px) rotate(-2deg); } 75% { transform: translateX(4px) rotate(2deg); } }
@media (prefers-reduced-motion: reduce) {
  .adv-face { transition: none; }
  .adv-door.is-today:not(.is-opened), .adv-door.is-shake { animation: none; }
}
.adv-status { min-height: 1.6em; margin: 12px 0 0; font-weight: 700; }
.adv-nojs { background: var(--coral-soft); padding: 10px 14px; border-radius: var(--radius); }

/* The open door. */
.adv-open { margin: 24px 0 0; scroll-margin-top: 12px; }
.adv-kind { margin: 0; color: var(--coral-dark); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: var(--t-sm); }
.adv-open h2 { margin: 2px 0 6px; }
.adv-how, .adv-idea { max-width: var(--measure); margin: 6px 0; }
.adv-idea { background: var(--green-soft); border-radius: 12px; padding: 8px 12px; }
.adv-studio .out { margin-top: 12px; }
.adv-studio .out > .adv-check { justify-content: center; }
.adv-answers { margin: 12px 0 0; }
.adv-answers summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
.adv-answers img { width: 100%; max-width: 420px; height: auto; display: block; margin: 8px auto 0; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.adv-more { text-align: center; margin: 12px 0 4px; }
.adv-more a { display: inline-block; padding: 10px 0; }
.adv-studio .side > p:last-child { text-align: center; margin: 4px 0 0; }

/* Poster and PDF blocks. */
.adv-pdfs { display: flex; flex-wrap: wrap; gap: 8px; }
.adv-poster img, .adv-pdf img { width: 100%; max-width: 360px; height: auto; display: block; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.adv-pdf-row { display: grid; gap: 16px 32px; align-items: start; }
@media (min-width: 900px) { .adv-pdf-row { grid-template-columns: 360px minmax(0, 1fr); } }
.adv-ideas { columns: 2 14ch; column-gap: 32px; padding-left: 1.6em; margin: 8px 0; }
.adv-ideas li { break-inside: avoid; margin: 0 0 4px; }
@media print { .adv, .adv-open, .adv-poster { display: none !important; } }

/* Advent colouring book gallery (/advent-calendar/colouring-book/): 2 across on phones, up to 6. */
.adv-book { list-style: none; margin: 12px 0 24px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 640px) { .adv-book { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .adv-book { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1200px) { .adv-book { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.adv-book figure { margin: 0; }
.adv-book a { display: block; border-radius: 12px; }
.adv-book img { width: 100%; height: auto; display: block; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.adv-book a:hover img { border-color: var(--coral); }
.adv-book figcaption { margin: 6px 2px 0; font-size: var(--t-sm); line-height: 1.3; }
.adv-book figcaption strong { display: block; color: var(--coral-dark); }
