/* The Mass, step by step.
   One moment of the Mass per page. The signature is the Missal's own convention,
   "say the black, do the red": what to do is set in rubric red, the words to say in
   black serif, on a white page with a ribbon (still a light page in dark mode, so the
   black stays black). Everything else stays quiet.
   Type: Young Serif for titles and the words of the Mass; Atkinson Hyperlegible Next,
   made for legibility, for reading. --season is the liturgical colour of the day. */

:root {
  --stone: #eef1f2;     /* the page */
  --stone-2: #e2e7ea;   /* a chapter, a fold */
  --paper: #ffffff;     /* the missal page, cards */
  --night: #1f2b45;     /* ink and the quiz */
  --slate: #56627a;     /* secondary text */
  --rule: #d3d9de;
  --rubric: #b3261e;    /* what to do: red, as in the Missal */
  --gilt: #a87a24;
  --gilt-l: #e7c27a;
  --teal: #2f6f6a;
  --season: #3f7d52;    /* set from the calendar by mass.js */
  --vest: var(--season);
  --vest-d: color-mix(in srgb, var(--vest) 78%, #000);
  --vest-l: color-mix(in srgb, var(--vest) 70%, #fff);

  --serif: "Young Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --col: 44rem;
  --wide: 76rem;
  --gut: clamp(1rem, 5vw, 2.5rem);
  --radius: 1.25rem;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --stone: #121826;
    --stone-2: #1a2232;
    --paper: #1c2536;
    --night: #e9eef6;
    --slate: #a3aec3;
    --rule: #2c3750;
    --rubric: #ff8f80;
    --gilt: #e0b45e;
    --gilt-l: #e0b45e;
    --teal: #7cc7bf;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--stone);
  color: var(--night);
  font: 400 1.125rem/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:where(a, button, summary):focus-visible { outline: 3px solid var(--season); outline-offset: 3px; border-radius: 0.4rem; }
[hidden] { display: none !important; }
.i { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; padding: 0.5rem 1rem; background: var(--paper); z-index: 20; }
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---------- top bar + the track ---------- */
.top {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem var(--gut);
  max-width: calc(var(--wide) + 2 * var(--gut));
  width: 100%;
  margin: 0 auto;
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; text-decoration: none; font: 400 1.05rem/1.2 var(--serif); }
.mark { width: 1.6rem; height: 1.6rem; color: var(--gilt); }
.count { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.count .of { font-weight: 400; color: var(--slate); }
.top-link { margin-left: auto; color: var(--slate); }

.track { padding: 0 var(--gut); max-width: calc(var(--wide) + 2 * var(--gut)); width: 100%; margin: 0 auto 0.25rem; }
.track > ol, .track-part ol { list-style: none; display: flex; }
.track > ol { gap: 0.4rem; }
.track-part { flex: var(--n, 1); }
.track-part ol { gap: 3px; }
.track-part li { flex: 1; }
.seg { display: block; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--slate) 25%, transparent); }
.seg.done { background: color-mix(in srgb, var(--season) 55%, var(--stone)); }
.seg.now { background: var(--season); height: 6px; box-shadow: 0 0 0 2px var(--stone), 0 0 0 3px var(--season); }
.seg:hover { background: var(--season); }

main { flex: 1 0 auto; width: 100%; }

/* ---------- a moment of the Mass ---------- */
.stop { max-width: calc(var(--col) + 2 * var(--gut)); margin: 0 auto; padding: 1rem var(--gut) 2rem; }

.chapter {
  margin: 0.5rem calc(-1 * var(--gut)) 2rem;
  padding: 1.75rem var(--gut);
  background: var(--night);
  color: var(--stone);
}
@media (prefers-color-scheme: dark) { .chapter { background: var(--stone-2); color: var(--night); } }
.chapter-n { font-weight: 600; color: var(--gilt-l); }
.chapter-t { font: 400 clamp(2.25rem, 9vw, 3rem)/1.05 var(--serif); margin-top: 0.25rem; }
.chapter-sub { opacity: 0.75; margin-top: 0.15rem; }
.chapter-emmaus { margin-top: 1rem; font-size: 1.2rem; }
.chapter-four { margin-top: 0.75rem; }
.chapter-posture { margin-top: 1rem; font-size: 1rem; opacity: 0.88; padding-top: 0.9rem; border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
.chapter a { color: inherit; }

.stop-head { margin-top: 0.75rem; }
.where { font-size: 1rem; color: var(--slate); }
.where a { text-decoration: none; }
.where a:hover { text-decoration: underline; }
.stop-head h1 { display: flex; align-items: baseline; gap: 0.75rem; margin-top: 0.35rem; font: 400 clamp(2.1rem, 8.5vw, 3rem)/1.08 var(--serif); letter-spacing: -0.005em; }
.stop-head .n { flex: none; color: var(--season); font: 700 0.7em/1 var(--sans); }
.four { list-style: none; display: flex; gap: 0.35rem; margin-top: 0.9rem; }
.four li { padding: 0.2rem 0.75rem; border-radius: 999px; border: 1.5px solid var(--rule); font-weight: 600; font-size: 0.95rem; color: var(--slate); }
.four li[aria-current] { background: var(--night); border-color: var(--night); color: var(--stone); }

.art { margin: 1.25rem calc(-1 * var(--gut)) 0; }
.art .scene { display: block; width: 100%; height: auto; background: #f3e5ca; }
.art figcaption { padding: 0.6rem var(--gut) 0; font-size: 1rem; color: var(--slate); }
.art figcaption b { color: var(--night); font-weight: 600; }
.art-missing { aspect-ratio: 16 / 10; display: grid; place-items: center; background: var(--stone-2); color: var(--slate); }
@media (min-width: 44rem) {
  .art { margin-left: 0; margin-right: 0; }
}
@media (min-width: 64rem) {
  /* wide screens: the picture on the left stays in view while the words scroll on the right */
  .stop { max-width: calc(var(--wide) + 2 * var(--gut)); }
  .stop-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 3rem; align-items: start; margin-top: 1.25rem; }
  .stop .art { position: sticky; top: 1rem; margin: 0; }
  .stop-text > .lead:first-child { margin-top: 0; }
}
@media (min-width: 44rem) {
  .art .scene { border-radius: var(--radius); }
  .art figcaption { padding-left: 0; padding-right: 0; }
}
@media (prefers-color-scheme: dark) { .art .scene { filter: brightness(0.92); } }
.scene .vest { fill: var(--vest); }
.scene .vest-d { fill: var(--vest-d); }
.scene .vest-l { fill: var(--vest-l); }
.scene .vest-s { stroke: var(--vest-d); }

.lead { margin-top: 1.5rem; font-size: clamp(1.25rem, 4.6vw, 1.4rem); line-height: 1.55; }

/* the missal page */
.missal {
  position: relative;
  margin-top: 1.75rem;
  padding: 1.4rem 1.25rem 1.3rem;
  background: var(--paper);
  border-radius: 0.35rem;
  border-top: 4px double var(--rubric);
  box-shadow: 0 1px 0 var(--rule), 0 12px 28px -18px rgb(31 43 69 / 0.35);
}
.missal::after { /* the ribbon */
  content: "";
  position: absolute;
  top: -4px;
  right: 1.4rem;
  width: 0.8rem;
  height: 3.2rem;
  background: var(--season);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
}
.missal p + p { margin-top: 0.85rem; }
.missal .k { display: block; font: 700 0.95rem/1.3 var(--sans); margin-bottom: 0.1rem; }
.missal .do { color: var(--rubric); padding-right: 1.6rem; }
.missal .say .k { color: var(--slate); }
.missal .say { font-size: 1.125rem; }
.missal .w { font: 400 1.25rem/1.45 var(--serif); }
.missal .latin { font-size: 1rem; color: var(--slate); padding-top: 0.75rem; border-top: 1px solid var(--rule); }
.missal .latin a { color: var(--night); font-style: italic; }
/* In dark mode the missal stays a printed page, dimmed a little: "say the black" needs black ink. */
@media (prefers-color-scheme: dark) {
  .missal {
    --paper: #dfe4e8;
    --night: #1f2b45;
    --slate: #4d5970;
    --rule: #c3cbd2;
    --rubric: #b3261e;
    color: var(--night);
    box-shadow: none;
  }
}

/* a word to know */
.word { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.word-k { font-size: 1rem; color: var(--slate); }
.word-t { font: 400 clamp(1.7rem, 6.5vw, 2rem)/1.15 var(--serif); margin-top: 0.15rem; overflow-wrap: anywhere; }
.word-t dfn { font-style: normal; }
.word-d { margin-top: 0.35rem; }

/* did you know */
.dyk { margin-top: 2rem; padding: 1.4rem 1.25rem 1.3rem; border-radius: var(--radius); background: var(--night); color: var(--stone); }
@media (prefers-color-scheme: dark) { .dyk { background: #2a3a5e; color: #f1f4f9; } }
.dyk-k { font-weight: 600; color: var(--gilt-l); }
.dyk-q { margin-top: 0.3rem; font: 400 1.4rem/1.3 var(--serif); }
.dyk-btn { margin-top: 1rem; min-height: 2.75rem; padding: 0.45rem 1.1rem; border-radius: 999px; border: 1.5px solid var(--gilt-l); color: inherit; font-weight: 600; }
.dyk-btn:hover { background: color-mix(in srgb, var(--gilt-l) 18%, transparent); }
.dyk-a { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent); font-size: 1.125rem; }
.dyk-a a { color: inherit; text-decoration-color: var(--gilt-l); }

/* previous / next */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 2.25rem; }
.pg { display: flex; align-items: center; gap: 0.4rem; min-height: 4.5rem; padding: 0.75rem 0.9rem; border-radius: 0.9rem; background: var(--paper); text-decoration: none; box-shadow: 0 1px 0 var(--rule); }
.pg:hover { box-shadow: 0 0 0 1.5px var(--season); }
.pg span { display: flex; flex-direction: column; min-width: 0; font-weight: 600; line-height: 1.25; }
.pg small { font-weight: 400; color: var(--slate); font-size: 0.9rem; }
.pg.next { justify-content: flex-end; text-align: right; }
.pg .i { color: var(--slate); }

/* for parents */
.parents { margin-top: 2rem; border-radius: var(--radius); background: var(--stone-2); }
.parents summary { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.1rem; cursor: pointer; list-style: none; }
.parents summary::-webkit-details-marker { display: none; }
.parents summary span { display: flex; flex-direction: column; line-height: 1.3; }
.parents summary small { color: var(--slate); font-size: 0.95rem; }
.parents summary::after { content: "+"; margin-left: auto; font: 400 1.6rem/1 var(--sans); color: var(--slate); }
.parents[open] summary::after { content: "\2212"; }
.parents-body { padding: 0 1.1rem 1.25rem; font-size: 1rem; }
.parents-body h2 { font: 400 1.25rem/1.3 var(--serif); margin: 1.25rem 0 0.5rem; }
.parents-body h2:first-child { margin-top: 0.25rem; }
.deeper-list { list-style: none; display: grid; gap: 0.5rem; }
.deeper-list a { display: flex; flex-direction: column; padding: 0.75rem 0.9rem; border-radius: 0.75rem; background: var(--paper); text-decoration: none; }
.deeper-list a:hover { box-shadow: 0 0 0 1.5px var(--season); }
.deeper-list span { color: var(--slate); font-size: 0.95rem; }
.notes, .claims { list-style: none; display: grid; gap: 0.6rem; }
.claims li, .notes li { line-height: 1.5; }
.labels-key { margin-top: 1rem; color: var(--slate); }
.ref { white-space: nowrap; }
.cite { color: inherit; }

.lbl { display: inline-block; padding: 0 0.45rem; border-radius: 0.35rem; font-size: 0.8rem; font-weight: 700; line-height: 1.5; vertical-align: 0.08em; white-space: nowrap; }
.lbl-teaching { background: color-mix(in srgb, var(--night) 12%, transparent); color: var(--night); }
.lbl-tradition { background: color-mix(in srgb, var(--gilt) 18%, transparent); color: color-mix(in srgb, var(--gilt) 80%, var(--night)); }
.lbl-tip { background: color-mix(in srgb, var(--teal) 16%, transparent); color: var(--teal); }

/* the dock: previous / next under the thumb on phones */
.dock { display: none; }
@media (max-width: 47.99rem) {
  .is-stop { padding-bottom: calc(4.25rem + env(safe-area-inset-bottom)); }
  .dock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 8;
    display: grid; grid-template-columns: 4rem 1fr 4rem; align-items: center;
    padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--stone) 88%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--rule);
  }
  .dock a { display: grid; place-items: center; min-height: 3rem; border-radius: 0.75rem; text-decoration: none; }
  .dock a:first-child, .dock a:last-child { background: var(--paper); }
  .dock-map { display: inline-flex !important; align-items: center; justify-content: center; gap: 0.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
}

/* ---------- home ---------- */
.home { padding-bottom: 2rem; }
.home > section, .home > .pair { max-width: calc(var(--wide) + 2 * var(--gut)); margin: 0 auto; padding: 0 var(--gut); }
.pair { display: grid; gap: 0 4rem; }
@media (min-width: 64rem) { .pair { grid-template-columns: 1fr 1fr; } }
.hero { display: grid; gap: 1.25rem; padding-top: 0.5rem !important; }
.hero-art { margin-top: 0.5rem; }
.hero h1 .nw { white-space: nowrap; }
.hero h1 { font: 400 clamp(2.6rem, 11vw, 3.9rem)/1.02 var(--serif); letter-spacing: -0.01em; }
.hero-p { margin-top: 0.85rem; font-size: clamp(1.2rem, 4.4vw, 1.4rem); max-width: 34rem; }
/* two buttons of one size: side by side where they fit, otherwise full width, one above the other */
.hero-go { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.4rem; }
.hero-go .btn { flex: 1 1 auto; justify-content: center; padding: 0 1.15rem; }
.btn { display: inline-flex; align-items: center; min-height: 3.25rem; padding: 0 1.5rem; border-radius: 999px; background: var(--night); color: var(--stone); font-weight: 700; text-decoration: none; }
.btn:hover { background: color-mix(in srgb, var(--night) 85%, var(--season)); }
.btn-2 { background: transparent; color: var(--night); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--night) 40%, transparent); }
.btn-2:hover { background: color-mix(in srgb, var(--night) 8%, transparent); }
@media (min-width: 56rem) {
  .hero { grid-template-columns: 1fr 1.1fr; align-items: center; gap: 2.5rem; }
  .hero-art { order: 2; margin: 0; }
}

.story, .red-black { margin-top: 3rem !important; }
.story h2, .red-black h2, .map > h2 { font: 400 clamp(1.7rem, 6vw, 2.2rem)/1.15 var(--serif); }
.story p { margin-top: 0.75rem; max-width: 38rem; font-size: 1.2rem; }
.story .story-more { font-size: 1rem; color: var(--slate); }
.red-black { display: grid; gap: 1.25rem; }
.rb-text p { margin-top: 0.75rem; max-width: 34rem; }
.missal.sample { margin-top: 0; }
@media (min-width: 56rem) { .red-black { grid-template-columns: 1fr 1fr; align-items: center; gap: 2.5rem; } }

.map { margin-top: 3.5rem !important; }
.map-parts { list-style: none; margin-top: 1.25rem; display: grid; gap: 2.25rem; }
.mp-head { padding-left: 1rem; border-left: 4px solid var(--season); }
.mp-n { font-weight: 600; color: var(--slate); }
.mp h3 { font: 400 1.75rem/1.15 var(--serif); }
.mp-sub { color: var(--slate); }
.mp-emmaus { margin-top: 0.4rem; max-width: 38rem; }
.mp-stops { list-style: none; margin-top: 1rem; display: grid; gap: 0.5rem; }
.mp-stops a { display: grid; grid-template-columns: 6.5rem auto 1fr; align-items: center; gap: 0.85rem; padding: 0.45rem 0.9rem 0.45rem 0.45rem; border-radius: 0.9rem; background: var(--paper); text-decoration: none; }
.mp-stops a:hover { box-shadow: 0 0 0 1.5px var(--season); }
.mp-stops img { width: 6.5rem; height: auto; aspect-ratio: 16 / 10; border-radius: 0.55rem; display: block; background: #f3e5ca; }
.sn { font: 700 1.1rem/1 var(--sans); color: var(--season); min-width: 1.4rem; text-align: right; font-variant-numeric: tabular-nums; }
.st { font-weight: 600; line-height: 1.3; }
@media (min-width: 56rem) {
  .map-parts > li { display: grid; grid-template-columns: 15rem 1fr; gap: 2rem; align-items: start; }
  .mp-head { position: sticky; top: 1rem; }
  .mp-stops { margin-top: 0; grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 80rem) { .mp-stops { grid-template-columns: repeat(3, 1fr); } }

.more { margin-top: 3.5rem !important; display: grid; gap: 0.9rem; }
@media (min-width: 48rem) { .more { grid-template-columns: repeat(3, 1fr); } }
.tile { display: flex; flex-direction: column; gap: 0.3rem; padding: 1.25rem; border-radius: var(--radius); text-decoration: none; }
.tile-mark { width: 2.5rem; height: 2.5rem; margin-bottom: 0.65rem; }
.tile-t { font: 400 1.5rem/1.2 var(--serif); }
.tile-p { font-size: 1rem; max-width: 22rem; }
.tile-words { background: var(--paper); }
.tile-words .tile-mark { color: var(--rubric); }
.tile-quiz { background: var(--night); color: var(--stone); }
@media (prefers-color-scheme: dark) { .tile-quiz { background: #2a3a5e; color: #f1f4f9; } }
.tile-quiz .tile-mark { color: var(--gilt-l); }
.tile-parents { background: var(--stone-2); }
.tile-parents .tile-mark { color: var(--teal); }
.tile:hover .tile-t { text-decoration: underline; text-underline-offset: 0.18em; }

/* ---------- sub pages ---------- */
.sub { max-width: calc(var(--col) + 2 * var(--gut)); margin: 0 auto; padding: 1rem var(--gut) 3rem; }
.sub-head h1, .ex h1 { font: 400 clamp(2.3rem, 9vw, 3.2rem)/1.05 var(--serif); }
h1, h2, .word-t, .dyk-q, .card-q { overflow-wrap: break-word; hyphens: auto; }
.sub-p { margin-top: 0.75rem; font-size: 1.25rem; }
.sub section { margin-top: 2.25rem; }
.sub section > h2 { font: 400 1.6rem/1.2 var(--serif); margin-bottom: 0.5rem; }
.sub .note { margin-top: 0.75rem; color: var(--slate); font-size: 1rem; }
.tips, .labels, .ppk { list-style: none; display: grid; gap: 0.75rem; margin-top: 0.5rem; }
.tips li { padding: 0.9rem 1rem; background: var(--paper); border-radius: 0.9rem; }
.ppk b { font-family: var(--serif); font-weight: 400; font-size: 1.15rem; }

.ex-k { color: var(--slate); font-weight: 600; }
.ex h1 { margin-top: 0.25rem; }
.ex-short { margin-top: 0.6rem; font-size: 1.2rem; color: var(--slate); }
.kids { margin-top: 1.5rem; padding: 1.1rem 1.2rem; background: var(--paper); border-radius: var(--radius); }
.kids-k { font-weight: 600; color: var(--slate); font-size: 1rem; }
.kids-t { margin-top: 0.25rem; font: 400 1.25rem/1.45 var(--serif); }
.kids-from { margin-top: 0.5rem; font-size: 1rem; color: var(--slate); }
.ex section { margin-top: 1.75rem; }
.ex section h2 { font: 400 1.4rem/1.25 var(--serif); margin-bottom: 0.35rem; }
.ex .qs dl { display: grid; gap: 0.9rem; }
.ex .qs dt { font-weight: 700; }
.ex .avoid p { padding: 0.9rem 1rem; border-left: 4px solid var(--rubric); background: var(--paper); border-radius: 0 0.75rem 0.75rem 0; }
.ex-more { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.ex-more h2 { font: 400 1.3rem/1.2 var(--serif); }
.ex-more ul { list-style: none; display: grid; gap: 0.4rem; margin-top: 0.6rem; }

.letter { display: grid; grid-template-columns: 3rem 1fr; gap: 0.5rem; margin-top: 1.75rem; }
.letter-l { font: 400 2.5rem/1 var(--serif); color: var(--rubric); }
.letter dl { display: grid; gap: 1.1rem; }
.w dfn { font: 400 1.5rem/1.2 var(--serif); font-style: normal; }
.w dd p { margin-top: 0.2rem; }
.w-from { display: inline-block; margin-top: 0.25rem; font-size: 1rem; color: var(--slate); }

.cards { list-style: none; display: grid; gap: 1rem; margin-top: 1.5rem; }
.card { padding: 1.5rem 1.3rem 1.4rem; border-radius: var(--radius); background: var(--night); color: var(--stone); }
@media (prefers-color-scheme: dark) { .card { background: #2a3a5e; color: #f1f4f9; } }
.card-n { color: var(--gilt-l); font-weight: 600; }
.card-q { margin-top: 0.35rem; font: 400 clamp(1.5rem, 6vw, 1.85rem)/1.25 var(--serif); }
.card-a { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent); }
.card-a p + p { margin-top: 0.6rem; }
.card-a a { color: inherit; text-decoration-color: var(--gilt-l); }
.deck.is-deck .card { min-height: 18rem; }
.deck-nav { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 1rem; }
.deck-nav button { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 3rem; padding: 0 1rem; border-radius: 999px; background: var(--paper); font-weight: 600; }
.deck-nav button:disabled { opacity: 0.4; cursor: default; }
.deck-pos { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--slate); }
.deck-all-p { margin-top: 1.25rem; text-align: center; }
.deck-all { color: var(--slate); text-decoration: underline; text-underline-offset: 0.2em; }

/* ---------- the explainer panel ---------- */
.panel {
  margin: auto 0 0 auto;
  width: min(38rem, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  border: 0;
  background: var(--stone);
  color: var(--night);
  box-shadow: -10px 0 40px rgb(0 0 0 / 0.2);
  display: none;
  flex-direction: column;
}
.panel[open] { display: flex; }
.panel::backdrop { background: rgb(18 24 38 / 0.5); }
.panel-bar { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0.6rem 0.5rem 1.25rem; border-bottom: 1px solid var(--rule); }
.panel-open { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--slate); font-size: 1rem; }
.panel-open .i { width: 1rem; height: 1rem; }
.panel-close { margin-left: auto; width: 2.75rem; height: 2.75rem; display: grid; place-items: center; border-radius: 50%; color: var(--slate); }
.panel-close:hover { background: var(--stone-2); color: var(--night); }
.panel-body { overflow-y: auto; padding: 1.25rem 1.25rem 3rem; overscroll-behavior: contain; }
.panel .ex-more { display: none; }
@media (max-width: 40rem) {
  .panel { width: 100vw; height: 92dvh; margin: auto 0 0; border-radius: 1.25rem 1.25rem 0 0; box-shadow: 0 -10px 40px rgb(0 0 0 / 0.22); }
}

/* ---------- footer ---------- */
.foot { padding: 2rem var(--gut) 2.5rem; text-align: center; color: var(--slate); font-size: 0.95rem; }
.foot p + p { margin-top: 0.4rem; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .dyk-a:not([hidden]), .card-a:not([hidden]) { animation: show 0.25s ease-out; }
  @keyframes show { from { opacity: 0; transform: translateY(-4px); } }
}

/* ---------- wide screens: use the width with columns, not longer lines ---------- */
@media (min-width: 64rem) {
  /* explainers: what your child reads stays beside the text */
  .deep { max-width: calc(var(--wide) + 2 * var(--gut)); }
  .deep .ex { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; column-gap: 4rem; }
  .deep .ex > * { grid-column: 1; }
  .deep .ex > .kids { grid-column: 2; grid-row: 1 / span 40; align-self: start; position: sticky; top: 1.5rem; margin-top: 0.5rem; }
  .deep .ex-more ul { grid-template-columns: repeat(3, 1fr); column-gap: 2rem; }

  /* the parents' page and the words: two columns of sections */
  .parents-page, .words-page { max-width: calc(var(--wide) + 2 * var(--gut)); columns: 2; column-gap: 4rem; }
  .parents-page > .sub-head, .words-page > .sub-head { column-span: all; }
  .parents-page > section, .words-page .letter { break-inside: avoid; }
  /* a column drops the top margin of whatever starts it, so space with padding to keep the columns level */
  .parents-page > section { margin-top: 0; padding-top: 2.25rem; }
  .words-page .letter { margin-top: 0; padding-top: 1.75rem; }

  /* the quiz: a bigger card, and every question in two columns when shown at once */
  .quiz-page { max-width: calc(52rem + 2 * var(--gut)); }
  .deck:not(.is-deck) .cards { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 90rem) {
  .words-page { columns: 3; }
}
