/* The Famoo Christmas Book (famoo.app/christmas/). Same palette as /advent/. Same-origin only. */
:root {
  color-scheme: light;
  --ink: #213c48;
  --green: #284e46;
  --green-soft: #e6ecdf;
  --cream: #faf6ee;
  --clay: #a54f39;
  --gold: #e8c87b;
  --line: #cbd3c8;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 18px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--green); }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, h3:focus-visible { outline: 3px solid var(--clay); outline-offset: 3px; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; line-height: 1.12; letter-spacing: -0.02em; }
h1 { font-size: clamp(36px, 7vw, 64px); margin: 0.2em 0 0.4em; }
h2 { font-size: clamp(26px, 4.5vw, 38px); margin: 0 0 0.4em; }
h3 { font-size: 21px; line-height: 1.25; }
img { max-width: 100%; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 10; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.small { font-size: 14px; }
.eyebrow { font: 700 13px/1.4 system-ui, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; color: var(--clay); margin: 0; }
.lead { font-size: 20px; max-width: 640px; }
.button, .secondary {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 22px;
  border-radius: 999px; font-weight: 650; text-decoration: none; border: 2px solid var(--green);
}
.button { background: var(--green); color: #fff; }
.secondary { background: #fff; color: var(--green); }
.button.secondary { background: #fff; color: var(--green); }

.top, main, .foot { max-width: 1120px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.top { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; padding-bottom: 6px; }
.top img { display: block; width: 100px; height: auto; }
.top-link { font-size: 15px; }

/* Cover */
.cover { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; padding: 24px 0 36px; }
.cover-picture { margin: 0; }
.cover-picture img { display: block; width: 100%; height: auto; border-radius: 22px; border: 6px solid #fff; box-shadow: 0 14px 40px #213c4822; }
.cover-picture figcaption { font-size: 13px; margin-top: 6px; }

/* Cards */
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.card a { display: block; height: 100%; background: #fff; border-radius: 18px; overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: 0 6px 20px #213c4812; }
.card a:hover .card-title { text-decoration: underline; }
.card-title { display: block; font-weight: 700; font-size: 18px; line-height: 1.3; padding: 10px 12px 0; }
.card-meta { display: block; font-size: 14px; padding: 2px 12px 12px; color: #4a5f66; }
.card[hidden] { display: none; }
.week { background: var(--green-soft); border-radius: 26px; padding: 22px 18px; margin-bottom: 36px; }
.week-note { margin-top: 0; }
.browse { margin-bottom: 40px; }

/* Picture panels: instructions.webp is a 3 x 2 grid of 418 x 627 panels.
   Panel 0 shows what you need, panels 1 to 5 the steps. */
.pic { position: relative; display: block; overflow: hidden; background: #ede6d6; }
.pic img { position: absolute; width: 300%; height: auto; max-width: none; }
.pic.sq { aspect-ratio: 1 / 1; }
.pic.sq.p0 img, .pic.sq.p3 img { left: 0; }
.pic.sq.p1 img, .pic.sq.p4 img { left: -100%; }
.pic.sq.p2 img, .pic.sq.p5 img { left: -200%; }
.pic.sq.p0 img, .pic.sq.p1 img, .pic.sq.p2 img { top: -25%; }
.pic.sq.p3 img, .pic.sq.p4 img, .pic.sq.p5 img { top: -175%; }
.reader-pic { aspect-ratio: 2 / 3; }
.reader-pic.p0 img, .reader-pic.p3 img { left: 0; }
.reader-pic.p1 img, .reader-pic.p4 img { left: -100%; }
.reader-pic.p2 img, .reader-pic.p5 img { left: -200%; }
.reader-pic.p0 img, .reader-pic.p1 img, .reader-pic.p2 img { top: 0; }
.reader-pic.p3 img, .reader-pic.p4 img, .reader-pic.p5 img { top: -100%; }

/* Filters (shown only when the script runs) */
.filters[hidden] { display: none; }
.filter { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter legend { font-weight: 700; font-size: 15px; padding: 0; margin-bottom: 6px; width: 100%; }
.filter button, .age-chooser button { min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid #6f817a; background: #fff; color: var(--ink); font-size: 15px; }
.filter button[aria-pressed="true"], .age-chooser button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.filter-note { font-size: 14px; margin: 0 0 12px; }
.filter-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-bottom: 18px; }
.filter-actions p { margin: 0; font-size: 15px; }
.none { font-weight: 600; }

.print-link { background: #fff; border-radius: 22px; padding: 22px 18px; margin-bottom: 40px; }
.text-versions { margin-bottom: 30px; }
.text-version { border-top: 1px solid var(--line); padding: 8px 0 14px; }
.text-version h4 { margin: 12px 0 4px; font-size: 16px; }
.text-version ul, .text-version ol { padding-left: 22px; margin: 4px 0; }
.js .text-versions { display: none; }
.outcome-line { font-weight: 600; }
.made-note { font-size: 14px; border-top: 1px solid var(--line); padding-top: 12px; margin-bottom: 24px; }
.foot { font-size: 14px; border-top: 1px solid var(--line); padding-top: 12px; padding-bottom: 28px; }

/* Reader */
dialog#reader { border: 0; padding: 0; margin: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; background: var(--cream); color: var(--ink); }
dialog#reader::backdrop { background: #132a36cc; }
.reader { max-width: 900px; height: 100%; margin: 0 auto; padding: 10px 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.reader-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.reader-progress { margin: 0; font-size: 15px; font-weight: 600; }
.reader-title { font-size: 26px; margin: 0; }
.reader-stage { flex: 1; min-height: 0; overflow-y: auto; display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start; touch-action: pan-y; }
/* content-box, so the 2:3 ratio applies inside the border and no strip of the next panel shows. */
.reader-pic { box-sizing: content-box; height: min(56vh, 520px); border-radius: 18px; border: 5px solid #fff; box-shadow: 0 8px 26px #213c4822; }
.reader-words h3 { font-size: 24px; margin: 4px 0 8px; }
.reader-words p { font-size: 20px; margin: 0 0 12px; }
.reader-words ul { padding-left: 22px; margin: 0 0 12px; }
.reader-words li { margin-bottom: 4px; }
.reader-words .part { background: #fff; border-radius: 14px; padding: 10px 14px; margin-bottom: 8px; font-size: 17px; }
.reader-words .joke { font-size: 17px; }
.age-chooser { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 10px; }
.age-label { font-weight: 700; font-size: 15px; width: 100%; }
.reader-words .jokes li { font-size: 17px; }
.reader-words .joke-head { font-weight: 600; margin-bottom: 4px; }
.reader-stage.is-end .reader-pic { height: min(22vh, 200px); }
.filters-toggle { margin-bottom: 14px; }
.filters-toggle[hidden] { display: none; }
#reader-step-title:focus { outline: none; }
.reader-audio { display: flex; align-items: center; gap: 10px; }
.reader-audio[hidden] { display: none; }
.reader-nav { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.outcome { background: #fff; border: 2px solid var(--gold); border-radius: 18px; padding: 14px 16px; margin: 6px 0 12px; }
.outcome h4 { font-size: 19px; margin: 0 0 6px; }
.outcome p { font-size: 16px !important; }

@media (max-width: 720px) {
  .cover { grid-template-columns: 1fr; gap: 18px; padding-top: 10px; }
  .cover-picture { order: -1; }
  .lead { font-size: 18px; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-title { font-size: 16px; }
  .reader-stage { grid-template-columns: 1fr; gap: 10px; }
  .reader-pic { height: min(40vh, 420px); margin: 0 auto; }
  .reader-title { font-size: 21px; }
  .reader-words h3 { font-size: 21px; }
  .reader-words p { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* 12 activities of Christmas: A4 */
.twelve-list { padding-left: 0; list-style: none; counter-reset: act; }
.twelve-list[start="7"] { counter-reset: act 6; }
.twelve-list > li { counter-increment: act; background: #fff; border-radius: 16px; padding: 12px 16px; margin-bottom: 12px; }
.twelve-list > li h2 { font-size: 22px; margin: 0 0 4px; }
.twelve-list > li h2::before { content: counter(act) ". "; color: var(--clay); }
.twelve-time { font: 600 14px system-ui, sans-serif; color: #4a5f66; letter-spacing: 0; }
.twelve-list ol { margin: 4px 0 0; padding-left: 20px; font-size: 16px; }
.twelve-list p { margin: 0; font-size: 16px; }
.twelve-foot { font-size: 14px; }
@page { size: A4; margin: 12mm; }
@media print {
  body { background: #fff; font-size: 10.5pt; line-height: 1.35; }
  .top, .foot, .skip-link, .screen-only, .no-print { display: none !important; }
  main { max-width: none; padding: 0; }
  h1 { font-size: 22pt; margin: 0 0 3pt; }
  .lead { font-size: 11pt; max-width: none; }
  .twelve-list { columns: 2; column-gap: 8mm; }
  .twelve-list > li { break-inside: avoid; padding: 0 0 4pt; margin: 0 0 4pt; border-radius: 0; border-bottom: 0.5pt solid #999; }
  .twelve-list > li h2 { font-size: 12pt; }
  .twelve-list ol, .twelve-list p { font-size: 9pt; }
  .twelve-foot { font-size: 9pt; }
  .twelve-page-end { break-after: page; }
  a { color: inherit; text-decoration: none; }
}

/* Guide hero picture under the lead (scripts/website/build-guide-heroes.py). */
.guide-hero { margin: 1.5rem 0 2rem; max-width: 712px; }
.guide-hero img { display: block; width: 100%; height: auto; border-radius: 16px; background: #FBF5E9; }
@media print { .guide-hero { display: none; } }
