/* YAH for Schools — a quiet, readable educational library. All assets are local. */
:root {
    --paper: #f7f6ee;
    --surface: #fffef8;
    --ink: #183d35;
    --text: #243e35;
    --muted: #53635b;
    --line: #d6ddd0;
    --line-strong: #aab9a8;
    --lime: #d8ed90;
    --sage: #e9eedf;
    --coral: #a84636;
    --peach: #f1e7da;
    --on-dark: #f7f8ed;
    --on-dark-muted: #c4d5c5;
    --focus: #a84636;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --serif: Georgia, "Times New Roman", serif;
    --page-width: 1248px;
    --gutter: clamp(1rem, 4vw, 4rem);
    --radius: .25rem;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font-family: var(--sans); font-size: 1rem; line-height: 1.6; }
::selection { background: var(--lime); color: var(--ink); }
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .13em; }
a:focus-visible, button:focus-visible, summary:focus-visible, [tabindex="0"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; border-radius: 2px; }
button, input { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
img { height: auto; }
svg { flex-shrink: 0; vertical-align: middle; }
h1, h2, h3, h4, p, ol, ul, dl, figure { margin: 0; }
h1, h2, h3 { color: var(--ink); }
h1, h2, h3 { text-wrap: balance; }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -.045em; line-height: 1.1; }
h3 { font-weight: 600; line-height: 1.3; }
em { font-family: var(--serif); font-weight: 400; }
.container { width: min(var(--page-width), calc(100% - var(--gutter) * 2)); margin-inline: auto; }
.page-main { min-height: 50vh; }
.page-main:focus { outline: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; z-index: 100; left: 1rem; top: -6rem; padding: .75rem 1.25rem; background: var(--lime); color: var(--ink); font-weight: 700; }
.skip-link:focus { top: .75rem; }
.eyebrow { font-family: var(--sans); font-size: .75rem; font-weight: 650; line-height: 1.5; letter-spacing: .105em; text-transform: uppercase; }
.button-link { display: inline-flex; align-items: center; justify-content: center; gap: 1.5rem; min-height: 3.25rem; padding: .875rem 1.25rem; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--ink); color: var(--on-dark); font-size: .9375rem; font-weight: 650; line-height: 1.5; text-decoration: none; }
.button-link:hover { background: #285246; border-color: #285246; text-decoration: none; }
.button-link > span, .button-link > svg { margin-left: auto; }
.text-link { display: inline-flex; align-items: baseline; gap: 1rem; font-size: .9375rem; font-weight: 650; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: .35em; }
.text-link:hover { text-decoration-color: currentColor; }
.text-link > span { flex-shrink: 0; }
.section-space { padding-block: 5rem; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 2.25rem; }
.section-heading h2 { margin-top: .875rem; font-size: clamp(2rem, 3.2vw, 3.25rem); }
.section-heading-wide > p, .section-heading-wide > div:last-child:not(:first-child) { flex: 0 1 26rem; }
.section-heading-wide > p { color: var(--muted); font-size: 1.0625rem; line-height: 1.75; }

/* Masthead and navigation */
.masthead-note { background: var(--ink); color: var(--on-dark); }
.masthead-note-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 2.125rem; padding-block: .375rem; font-size: .6875rem; font-weight: 500; letter-spacing: .025em; }
.masthead-note-inner > :last-child { color: var(--on-dark-muted); }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 2rem; min-height: 6.5rem; }
.brand { display: inline-flex; align-items: center; gap: .625rem; color: var(--ink); text-decoration: none; flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand-initials { font-family: var(--sans); font-size: 2.9375rem; font-weight: 800; letter-spacing: -.09em; line-height: 1; }
.brand-words { font-size: .875rem; font-weight: 600; letter-spacing: -.025em; line-height: 1.1; padding-left: .25rem; }
.primary-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 1.75rem; }
.primary-nav a { padding-block: .75rem; font-size: .875rem; font-weight: 600; text-decoration: none; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: .6em; text-decoration-color: var(--coral); }
.mobile-menu { display: none; }
.mobile-menu summary { display: flex; align-items: center; gap: .75rem; min-height: 2.75rem; padding: .5rem .625rem; border: 1px solid var(--line-strong); border-radius: var(--radius); font-size: .875rem; font-weight: 650; cursor: pointer; list-style: none; }
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu[open] summary { background: var(--sage); }
.mobile-nav { position: absolute; top: calc(100% - .25rem); left: 0; right: 0; z-index: 20; padding: .5rem 1.25rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); box-shadow: 0 .75rem 1.5rem #183d3512; }
.mobile-nav a { display: flex; justify-content: space-between; gap: 1rem; padding: .875rem 0; border-bottom: 1px solid var(--line); font-size: .9375rem; font-weight: 600; text-decoration: none; }
.mobile-nav a:last-child { border-bottom: 0; }
.mobile-nav a[aria-current="page"] { color: var(--coral); }
.mobile-nav .mobile-contact { font-size: .8125rem; font-weight: 500; }

/* Homepage */
.home-hero { display: grid; grid-template-columns: 1.2fr .86fr; align-items: center; gap: clamp(2.5rem, 6vw, 6.25rem); padding-block: 4.25rem 4.75rem; border-bottom: 1px solid var(--line); }
.hero-copy { min-width: 0; }
.hero-copy > .eyebrow { display: flex; align-items: center; gap: .625rem; margin-bottom: 1.5rem; }
.status-dot { display: inline-block; flex-shrink: 0; width: .625rem; height: .625rem; border: 1px solid var(--ink); border-radius: 50%; background: var(--lime); }
.home-hero h1 { max-width: none; font-size: clamp(3.5rem, 4.75vw, 4.25rem); line-height: 1.08; letter-spacing: -.055em; }
.home-hero h1 > span, .home-hero h1 > em { display: block; }
.home-hero h1 em { color: #4c6b4f; }
.hero-intro { max-width: 35rem; margin-top: 1.75rem; color: var(--muted); font-size: 1.0625rem; line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 1.75rem; margin-top: 2rem; }
.hero-audience { margin-top: 1.5rem; color: var(--muted); font-size: .8125rem; line-height: 1.7; }
.thinking-card { position: relative; padding: 1.5rem 1.75rem 1.375rem; border-radius: .375rem; background: var(--ink); color: var(--on-dark); }
.thinking-card-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: var(--on-dark-muted); font-size: .6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.thought-symbol { color: var(--lime); font-size: 2rem; line-height: 1; }
.thinking-card h2 { margin-top: 1.75rem; color: var(--on-dark); font-size: clamp(2rem, 3.1vw, 3.125rem); line-height: 1.13; }
.example-paper { margin-top: 1.75rem; padding: 1.375rem; border: 1px solid var(--lime); border-radius: 2px; background: var(--paper); color: var(--ink); }
.example-label { color: var(--muted); font-size: .625rem; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; }
.example-claim { margin-top: .75rem; margin-bottom: 1.125rem; font-family: var(--serif); font-size: clamp(1.4rem, 2.1vw, 2rem); line-height: 1.2; letter-spacing: -.025em; }
.example-questions { border-top: 1px solid var(--line-strong); }
.example-questions > div { display: grid; grid-template-columns: 5rem 1fr; gap: .625rem; padding: .625rem 0; border-bottom: 1px solid var(--line); font-size: .75rem; }
.example-questions > div:last-child { border-bottom: 0; padding-bottom: 0; }
.example-questions dt { font-weight: 650; }
.example-questions dd { margin: 0; color: var(--muted); }
.thinking-card-link { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; margin-top: 1.25rem; padding-block: .25rem; color: var(--lime); font-size: .75rem; font-weight: 600; text-decoration: none; }
.thinking-card-link:hover { text-decoration: underline; }
.topic-paths { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.topic-path { padding: 2rem 2.25rem 1.875rem; border-radius: var(--radius); background: var(--sage); }
.topic-reasoning { background: var(--peach); }
.topic-path-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.topic-glyph { font-family: var(--serif); font-size: 1.5rem; font-style: italic; letter-spacing: -.05em; }
.topic-reasoning .topic-glyph { color: var(--coral); }
.topic-path h3 { font-family: var(--serif); font-size: clamp(1.875rem, 2.6vw, 2.625rem); font-weight: 400; letter-spacing: -.035em; line-height: 1.13; }
.topic-path > p { max-width: 31rem; margin-top: 1.125rem; color: var(--muted); font-size: .9375rem; line-height: 1.75; }
.topic-links { margin: 1.5rem 0 1.25rem; padding: 0; list-style: none; }
.topic-links li { border-top: 1px solid #aab9a888; }
.topic-links li:last-child { border-bottom: 1px solid #aab9a888; }
.topic-links a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding-block: .875rem; font-size: .875rem; font-weight: 650; text-decoration: none; }
.topic-links a:hover { text-decoration: underline; }
.topic-path > .text-link { font-size: .8125rem; }
.home-resources { padding: 3rem 3.25rem 2rem; border-radius: var(--radius); background: var(--ink); color: var(--on-dark); }
.home-resources .eyebrow { color: var(--lime); }
.home-resources h2 { color: var(--on-dark); }
.home-resources .section-heading { margin-bottom: 2.5rem; }
.resource-section-intro { max-width: 23rem; color: var(--on-dark-muted); }
.resource-section-intro p { margin-bottom: 1rem; font-size: .9375rem; line-height: 1.75; }
.resource-section-intro .text-link { color: var(--lime); font-size: .875rem; text-decoration-color: #819f6f; }
.resource-list { padding: 0; list-style: none; border-top: 1px solid #5b7766; }
.resource-list > li { border-bottom: 1px solid #5b7766; }
.resource-row { display: grid; grid-template-columns: 2rem minmax(0, 1fr) 9.5rem 1.5rem; align-items: center; gap: 1.5rem; padding-block: 1.5rem; text-decoration: none; }
.resource-row:hover { text-decoration: none; }
.resource-number { color: var(--on-dark-muted); font-size: .75rem; font-variant-numeric: tabular-nums; align-self: start; padding-top: .5rem; }
.resource-summary h3 { color: var(--on-dark); font-family: var(--serif); font-size: clamp(1.375rem, 1.9vw, 1.875rem); font-weight: 400; letter-spacing: -.025em; line-height: 1.2; }
.resource-row:hover h3 { text-decoration: underline; text-decoration-color: var(--lime); text-decoration-thickness: 1px; text-underline-offset: .25em; }
.resource-summary p { max-width: 39rem; margin-top: .5rem; color: var(--on-dark-muted); font-size: .8125rem; line-height: 1.7; }
.resource-formats { display: grid; justify-items: start; gap: .5rem; color: var(--on-dark-muted); font-size: .75rem; line-height: 1.6; }
.resource-timing { display: grid; gap: .125rem; }
.format-tag { display: inline-flex; align-items: center; padding: .25rem .5rem; border: 1px solid #92b18b; border-radius: 2px; color: var(--lime); font-size: .6875rem; font-weight: 650; letter-spacing: .04em; }
.resource-arrow { color: var(--lime); font-size: 1.375rem; transition: transform .15s ease; }
.resource-row:hover .resource-arrow { transform: translate(2px, -2px); }
.home-resources a:focus-visible, .site-footer a:focus-visible { outline-color: var(--lime); }
.resource-timing-note { margin-top: 1rem; color: var(--on-dark-muted); font-size: .75rem; }
.teacher-section { display: grid; grid-template-columns: .95fr 1.05fr; gap: 5.5rem; }
.teacher-section > * { min-width: 0; }
.teacher-introduction h2 { margin-top: 1rem; font-size: clamp(2.5rem, 3.7vw, 3.75rem); line-height: 1.12; }
.teacher-introduction h2 em { color: #4c6b4f; }
.teacher-introduction > p:not(.eyebrow) { max-width: 28rem; margin-top: 1.5rem; color: var(--muted); font-size: .9375rem; line-height: 1.75; }
.teacher-introduction .text-link { margin-top: 1.25rem; }
.teacher-routes { align-self: center; padding: 0; list-style: none; }
.teacher-routes > li { display: grid; grid-template-columns: 2rem 1fr; gap: 1.25rem; padding: 1.5rem 0; border-top: 1px solid var(--line-strong); }
.teacher-routes > li:last-child { border-bottom: 1px solid var(--line-strong); }
.route-number { padding-top: .125rem; color: var(--coral); font-size: .75rem; font-variant-numeric: tabular-nums; }
.teacher-routes h3 { font-size: 1rem; }
.teacher-routes h3 a { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; text-decoration: none; }
.teacher-routes h3 a:hover { text-decoration: underline; }
.teacher-routes p { margin-top: .625rem; color: var(--muted); font-size: .875rem; line-height: 1.75; }
.home-editorial { display: grid; grid-template-columns: .65fr 1.35fr; gap: 5.5rem; margin-bottom: 5rem; padding: 3rem; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.editorial-mark { display: flex; flex-direction: column; align-items: flex-start; align-self: center; font-family: var(--serif); font-size: clamp(2rem, 3.25vw, 3.25rem); letter-spacing: -.04em; line-height: 1.15; }
.editorial-mark span:nth-child(2) { color: var(--coral); font-style: italic; }
.home-editorial-body { min-width: 0; }
.home-editorial .prose h2:first-child { margin-top: 0; }
.home-editorial .prose { font-size: .9375rem; }
.home-editorial .prose h2 { font-size: 1.75rem; }

/* Reference pages */
.breadcrumbs { padding-top: 1.5rem; color: var(--muted); font-size: .75rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .375rem .625rem; padding: 0; list-style: none; }
.breadcrumbs li { min-width: 0; overflow-wrap: anywhere; }
.breadcrumbs li + li::before { content: "/"; margin-right: .625rem; color: var(--muted); }
.breadcrumbs a { text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--ink); }
.page-heading { padding: 3rem 0 2.75rem; border-bottom: 1px solid var(--line); }
.page-heading > .eyebrow { margin-bottom: 1rem; color: var(--coral); }
.page-heading h1 { max-width: 23ch; font-size: clamp(2.625rem, 4.6vw, 4.75rem); line-height: 1.08; letter-spacing: -.05em; }
.page-intro { max-width: 65ch; margin-top: 1.375rem; color: var(--muted); font-size: 1.125rem; line-height: 1.75; }
.page-number { display: block; margin-top: .75rem; font-family: var(--sans); font-size: 1rem; letter-spacing: normal; }
.article-meta { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: 1.5rem; color: var(--muted); font-size: .75rem; }
.article-meta a { color: var(--ink); }
.resource-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 1.5rem; }
.resource-actions > span { color: var(--muted); font-size: .8125rem; }
.hero-media { margin-top: 2.5rem; }
.hero-media img { display: block; width: 100%; border-radius: var(--radius); }
.reading-layout { display: grid; padding-block: 3rem; }
.reading-layout.has-toc { grid-template-columns: minmax(12rem, .65fr) minmax(0, 2fr); gap: clamp(2rem, 6vw, 6.5rem); }
.reading-body { min-width: 0; max-width: 52rem; }
.reading-layout:not(.has-toc) .reading-body { max-width: 50rem; }
.contents-rail { position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); overflow-y: auto; align-self: start; padding: 0 .375rem .375rem; margin-left: -.375rem; color: var(--muted); font-size: .8125rem; }
.toc-details summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 2rem; margin-bottom: .625rem; color: var(--ink); font-weight: 650; list-style: none; cursor: pointer; }
.toc-details summary::-webkit-details-marker { display: none; }
.toc-details summary > span { font-size: 1rem; }
.toc-details:not([open]) summary > span { transform: rotate(-90deg); }
.toc-details ol { padding: .25rem 0 .25rem .875rem; border-left: 1px solid var(--line-strong); list-style: none; }
.toc-details li + li { margin-top: .25rem; }
.toc-details a { display: block; padding: .375rem .25rem; line-height: 1.55; text-decoration: none; }
.toc-details a:hover { color: var(--ink); text-decoration: underline; }
.print-text-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2.75rem; margin-top: 1rem; padding: .5rem 0; border: 0; border-bottom: 1px solid var(--line-strong); background: transparent; color: var(--ink); font-size: .75rem; font-weight: 600; }
.prose { color: var(--text); font-size: 1.0625rem; line-height: 1.8; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose dl { margin-bottom: 1.25rem; }
.prose h2 { margin: 2.75rem 0 1.125rem; padding-top: .125rem; font-size: clamp(1.75rem, 2.2vw, 2.25rem); letter-spacing: -.035em; line-height: 1.2; }
.prose h3 { margin: 2rem 0 .875rem; font-family: var(--sans); font-size: 1.1875rem; letter-spacing: -.015em; line-height: 1.45; }
.prose h4 { margin: 1.5rem 0 .75rem; font-size: 1.0625rem; line-height: 1.5; }
.prose h2, .prose h3, .prose h4 { scroll-margin-top: 1.5rem; }
.prose a { color: #21533e; text-decoration-color: #92a98a; overflow-wrap: anywhere; }
.prose a:hover { text-decoration-color: var(--ink); }
.prose strong { font-weight: 650; }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose li { padding-left: .25rem; margin-bottom: .5rem; }
.prose li::marker { color: var(--coral); font-weight: 600; }
.prose li > ul, .prose li > ol { margin-top: .75rem; margin-bottom: .75rem; }
.prose li > p { margin-bottom: .5rem; }
.prose blockquote { margin-inline: 0; padding: 1.25rem 1.5rem; border-left: 3px solid var(--coral); background: var(--sage); font-family: var(--serif); font-size: 1.25rem; line-height: 1.6; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--line); }
.prose code { padding: .125rem .25rem; border-radius: 2px; background: var(--sage); font-size: .875em; }
.prose pre { overflow-x: auto; padding: 1.25rem; border: 1px solid var(--line); background: var(--surface); }
.prose pre code { padding: 0; background: transparent; }
.prose table { display: block; width: 100%; max-width: 100%; overflow-x: auto; margin: 1.5rem 0 2rem; border-collapse: collapse; border: 1px solid var(--line-strong); font-size: .875rem; line-height: 1.6; }
.prose th, .prose td { min-width: 8rem; padding: .875rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.prose th { background: var(--sage); color: var(--ink); font-weight: 650; }
.prose td { background: var(--surface); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose th + th, .prose td + td { border-left: 1px solid var(--line); }
.table-scroll { margin: 1.5rem 0 2rem; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--line-strong); border-radius: 2px; }
.prose .table-scroll table { display: table; margin: 0; border: 0; }
.prose a[href^="/downloads/"] { display: inline-flex; align-items: center; gap: .75rem; padding: .5rem .875rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--sage); color: var(--ink); font-family: var(--sans); font-size: .875rem; font-weight: 600; text-decoration: none; }
.prose a[href^="/downloads/"]::after { content: "↓"; }
.prose a[href^="/downloads/"]:hover { background: var(--lime); }
.sources { margin-top: 3rem; padding: 1.75rem 2rem; border-top: 1px solid var(--line-strong); background: var(--sage); font-size: .875rem; }
.sources > .eyebrow { margin-bottom: .625rem; color: var(--muted); font-size: .6875rem; }
.sources h2 { margin-top: 0; font-size: 1.625rem; }
.sources ol { padding-left: 1.25rem; }
.sources li { margin-bottom: 1rem; }
.sources li:last-child { margin-bottom: 0; }
.source-date { display: block; margin-top: .125rem; color: var(--muted); font-size: .6875rem; }
.collection-section { padding-block: 3.5rem 4rem; border-top: 1px solid var(--line); }
.collection-section .section-heading h2 { font-size: clamp(2rem, 3vw, 2.75rem); }
.collection-count { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.page-list { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.list-entry { padding: 1.75rem; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.entry-type { margin-bottom: .875rem; color: var(--muted); font-size: .625rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.list-entry h3 { font-family: var(--serif); font-size: 1.625rem; font-weight: 400; letter-spacing: -.025em; }
.list-entry h3 a { display: flex; justify-content: space-between; gap: 1rem; text-decoration: none; }
.list-entry h3 a:hover { text-decoration: underline; }
.entry-arrow { flex-shrink: 0; color: var(--coral); font-family: var(--sans); font-size: 1.375rem; }
.entry-description { margin-top: .875rem; color: var(--muted); font-size: .875rem; line-height: 1.75; }
.pagination { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-top: 2rem; font-size: .875rem; }
.pagination a, .pagination > span:first-child, .pagination > span:last-child { padding: .625rem 1rem; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.pagination [aria-disabled="true"] { color: var(--muted); background: var(--sage); }
.empty-state { margin-top: 1.5rem; color: var(--muted); }
.utility-topics { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; margin-block: 1.5rem; }

/* Footer and useful error pages */
.site-footer { margin-top: 1rem; background: var(--ink); color: var(--on-dark); }
.footer-inner { display: grid; grid-template-columns: 1.5fr 1fr .8fr; gap: 4rem; padding-block: 3.5rem; }
.footer-brand { color: var(--on-dark); }
.footer-tagline { margin-top: 1.5rem; color: var(--lime); font-size: .875rem; }
.footer-introduction > p:last-child { max-width: 25rem; margin-top: .875rem; color: var(--on-dark-muted); font-size: .8125rem; line-height: 1.75; }
.footer-inner nav { display: flex; align-items: flex-start; flex-direction: column; gap: .75rem; }
.footer-inner nav h2 { margin-bottom: .375rem; color: var(--on-dark-muted); font-family: var(--sans); font-size: .625rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.footer-inner nav a { color: var(--on-dark); font-size: .8125rem; text-decoration: none; }
.footer-inner nav a:hover { text-decoration: underline; }
.footer-base { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding-block: 1.25rem; border-top: 1px solid #5b7766; color: var(--on-dark-muted); font-size: .6875rem; }
.footer-base > a { white-space: nowrap; color: var(--on-dark); text-decoration: none; }
.footer-base > a:hover { text-decoration: underline; }
.error-masthead { min-height: 6rem; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.error-page { max-width: 55rem; padding-block: 5rem; }
.error-code { margin-bottom: 1rem; color: var(--coral); font-size: .8125rem; font-weight: 650; letter-spacing: .1em; }
.error-page h1 { max-width: 18ch; font-size: clamp(2.75rem, 6vw, 5rem); }
.error-page .page-intro { max-width: 48ch; }
.error-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 2rem; margin-top: 2rem; }
.error-help { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .875rem; }

@media (min-width: 1100px) {
    .related-section .page-list { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
}
@media (max-width: 1100px) {
    .primary-nav { gap: 1.125rem; }
    .primary-nav a { font-size: .8125rem; }
    .home-hero { gap: 2.5rem; }
    .hero-actions { align-items: flex-start; flex-direction: column; gap: 1.25rem; }
    .home-resources { padding-inline: 2rem; }
    .teacher-section, .home-editorial { gap: 3rem; }
    .resource-row { gap: 1rem; grid-template-columns: 1.5rem minmax(0, 1fr) 8rem 1rem; }
}
@media (max-width: 920px) {
    .desktop-nav { display: none; }
    .mobile-menu { display: block; }
    .header-inner { min-height: 5.5rem; }
    .home-hero { grid-template-columns: 1.1fr .9fr; gap: 2rem; padding-block: 3rem; }
    .home-hero h1 { font-size: clamp(3rem, 6vw, 4.5rem); }
    .hero-copy > .eyebrow { font-size: .625rem; }
    .thinking-card { padding: 1.25rem; }
    .thinking-card h2 { font-size: 2.25rem; }
    .example-paper { padding: 1rem; }
    .example-questions > div { grid-template-columns: 1fr; gap: .125rem; padding-block: .5rem; }
    .example-claim { font-size: 1.5rem; }
    .section-heading-wide { align-items: flex-start; }
    .section-heading-wide > p, .section-heading-wide > div:last-child:not(:first-child) { flex-basis: 21rem; }
    .topic-path { padding: 1.5rem; }
    .topic-path h3 { font-size: 2rem; }
    .teacher-section { gap: 2rem; }
    .teacher-introduction h2 { font-size: 2.5rem; }
    .home-editorial { padding: 2rem; }
    .reading-layout.has-toc { grid-template-columns: 12rem minmax(0, 1fr); gap: 2rem; }
    .footer-inner { gap: 2rem; grid-template-columns: 1.2fr 1fr .8fr; }
}
@media (max-width: 740px) {
    .masthead-note-inner { justify-content: center; }
    .masthead-note-inner > :last-child { display: none; }
    .home-hero { grid-template-columns: 1fr; gap: 2.5rem; }
    .home-hero h1 { max-width: 14ch; font-size: clamp(3.25rem, 9vw, 4.5rem); }
    .hero-copy > .eyebrow { font-size: .6875rem; }
    .hero-intro { max-width: 40rem; }
    .hero-actions { flex-direction: row; align-items: center; }
    .thinking-card { display: grid; grid-template-columns: 1fr 1.15fr; gap: 0 1.5rem; padding: 1.5rem; }
    .thinking-card-top { grid-column: 1; align-self: start; }
    .thinking-card-top > span:first-child { max-width: 12ch; }
    .thinking-card h2 { grid-column: 1; margin-top: .625rem; align-self: start; }
    .example-paper { grid-column: 2; grid-row: 1 / 4; margin-top: 0; }
    .example-questions > div { grid-template-columns: 1fr; }
    .thinking-card-link { grid-column: 1; margin-top: 1rem; align-self: end; line-height: 1.65; }
    .section-space { padding-block: 3.5rem; }
    .section-heading { gap: 1.25rem; }
    .section-heading-wide { flex-direction: column; }
    .section-heading-wide > p, .section-heading-wide > div:last-child:not(:first-child) { flex-basis: auto; max-width: 40rem; }
    .topic-paths { gap: 1rem; }
    .topic-path { padding: 1.25rem; }
    .topic-path h3 { font-size: 1.75rem; }
    .topic-path > p { font-size: .875rem; }
    .topic-links a { font-size: .8125rem; }
    .topic-path-top .eyebrow { font-size: .625rem; }
    .home-resources { padding: 2rem 1.5rem 1.5rem; }
    .home-resources .section-heading { margin-bottom: 1.5rem; }
    .resource-section-intro { max-width: 40rem; }
    .resource-row { grid-template-columns: 1.5rem minmax(0, 1fr) 1rem; gap: .75rem; padding-block: 1.25rem; }
    .resource-summary h3 { font-size: 1.5rem; }
    .resource-formats { grid-column: 2; grid-row: 2; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
    .resource-formats > span:last-child { line-height: 1.5; }
    .resource-timing { display: flex; flex-wrap: wrap; gap: .125rem .625rem; }
    .resource-arrow { grid-column: 3; grid-row: 1; align-self: start; }
    .teacher-section { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
    .teacher-introduction h2 { font-size: 3rem; }
    .teacher-introduction h2 br { display: none; }
    .teacher-introduction > p:not(.eyebrow) { max-width: 40rem; }
    .teacher-routes > li { padding-block: 1.25rem; }
    .home-editorial { grid-template-columns: 1fr; gap: 1.5rem; margin-bottom: 3.5rem; padding: 1.5rem; }
    .editorial-mark { flex-direction: row; flex-wrap: wrap; gap: .25rem .5rem; font-size: 2rem; }
    .page-heading { padding-block: 2.5rem 2rem; }
    .page-heading h1 { font-size: clamp(2.5rem, 6vw, 3.5rem); }
    .page-intro { font-size: 1.0625rem; }
    .reading-layout, .reading-layout.has-toc { grid-template-columns: minmax(0, 1fr); gap: 2rem; padding-top: 2rem; }
    .contents-rail { position: static; margin: 0; padding: 1rem 1.25rem; border: 1px solid var(--line-strong); background: var(--sage); max-height: none; }
    .toc-details summary { margin-bottom: 0; }
    .toc-details[open] summary { margin-bottom: .75rem; }
    .toc-details ol { border-color: var(--line-strong); }
    .contents-rail .print-text-button { display: none; }
    .prose { font-size: 1rem; }
    .sources { padding: 1.5rem; }
    .page-list { gap: 1rem; }
    .list-entry { padding: 1.25rem; }
    .list-entry h3 { font-size: 1.5rem; }
    .collection-section { padding-block: 2.75rem; }
    .collection-section .section-heading h2 { font-size: 2rem; }
    .footer-inner { grid-template-columns: 1fr 1fr; gap: 2.5rem 2rem; padding-block: 2.75rem; }
    .footer-introduction { grid-column: 1 / -1; }
    .footer-introduction > p:last-child { max-width: 35rem; }
    .footer-base { align-items: flex-start; font-size: .625rem; }
}
@media (max-width: 480px) {
    .brand-initials { font-size: 2.625rem; }
    .brand-words { font-size: .75rem; }
    .header-inner { min-height: 5rem; gap: .75rem; }
    .home-hero { padding-block: 2.5rem; }
    .home-hero h1 { font-size: clamp(2.5rem, 10.5vw, 3.5rem); }
    .hero-copy > .eyebrow { align-items: flex-start; font-size: .625rem; }
    .status-dot { margin-top: .125rem; }
    .hero-intro { margin-top: 1.25rem; font-size: 1rem; }
    .hero-actions { gap: 1rem; }
    .hero-actions .button-link { width: 100%; }
    .hero-audience { margin-top: 1.25rem; font-size: .75rem; }
    .thinking-card { display: block; padding: 1.25rem; }
    .thinking-card-top > span:first-child { max-width: none; }
    .thinking-card h2 { margin-top: 1.25rem; font-size: 2.25rem; }
    .example-paper { margin-top: 1.25rem; padding: 1rem; }
    .example-claim { font-size: 1.75rem; }
    .example-questions > div { grid-template-columns: 4.5rem 1fr; gap: .5rem; font-size: .75rem; }
    .thinking-card-link { font-size: .6875rem; }
    .section-space { padding-block: 3rem; }
    .section-heading h2 { font-size: 2.125rem; }
    .section-heading-wide > p { font-size: 1rem; }
    .topic-paths { grid-template-columns: 1fr; }
    .topic-path { padding: 1.5rem; }
    .topic-path h3 { font-size: 2rem; }
    .topic-path > p, .topic-links a { font-size: .875rem; }
    .topic-path-top .eyebrow { font-size: .6875rem; }
    .home-resources { padding-inline: 1.125rem; }
    .home-resources h2 { font-size: 2rem; }
    .resource-row { grid-template-columns: 1rem minmax(0, 1fr) .75rem; gap: .5rem .75rem; }
    .resource-number { font-size: .625rem; }
    .resource-summary h3 { font-size: 1.375rem; }
    .resource-summary p { font-size: .75rem; }
    .resource-formats { font-size: .6875rem; }
    .resource-timing-note { font-size: .6875rem; }
    .teacher-introduction h2 { font-size: 2.5rem; }
    .teacher-routes > li { grid-template-columns: 1.25rem 1fr; gap: .875rem; }
    .teacher-routes h3 { font-size: .9375rem; }
    .teacher-routes p { font-size: .8125rem; }
    .home-editorial { padding: 1.25rem; }
    .editorial-mark { font-size: 1.75rem; }
    .breadcrumbs { font-size: .6875rem; padding-top: 1.125rem; }
    .page-heading h1 { font-size: clamp(2.375rem, 10vw, 3rem); }
    .page-heading > .eyebrow { font-size: .6875rem; }
    .article-meta { flex-direction: column; gap: .375rem; }
    .resource-actions .button-link { width: 100%; font-size: .8125rem; }
    .prose h2 { margin-top: 2.25rem; font-size: 1.75rem; }
    .prose h3 { font-size: 1.125rem; }
    .prose blockquote { padding: 1rem 1.125rem; font-size: 1.125rem; }
    .prose th, .prose td { padding: .75rem; font-size: .8125rem; }
    .sources { padding: 1.25rem; }
    .sources h2 { font-size: 1.5rem; }
    .page-list { grid-template-columns: 1fr; }
    .list-entry { padding: 1.5rem; }
    .collection-section .section-heading { align-items: flex-start; flex-direction: column; }
    .collection-count { display: none; }
    .footer-base { flex-direction: column; gap: .75rem; }
    .error-page { padding-block: 3rem; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
    .button-link, .format-tag, .contents-rail, .list-entry, .example-paper { border: 1px solid CanvasText; }
    .status-dot { background: CanvasText; }
}
@page { size: A4; margin: 17mm; }
@media print {
    :root { --paper: #fff; --surface: #fff; --ink: #000; --text: #000; --muted: #333; --line: #bbb; --line-strong: #777; --sage: #fff; }
    html { font-size: 10pt; scroll-behavior: auto; }
    body { background: #fff; color: #000; }
    .container { width: 100%; max-width: none; }
    .masthead-note, .site-header, .site-footer, .skip-link, .breadcrumbs, .contents-rail, .collection-section, .resource-actions, [data-print], .hero-actions, .thinking-card-link, .home-resources .text-link, .error-masthead { display: none !important; }
    .page-main { min-height: 0; }
    .page-heading { padding: 0 0 1.5rem; margin-bottom: 1.5rem; }
    .page-heading::before { display: block; content: "YAH for Schools · yah4schools.org.uk"; margin-bottom: 1.25rem; font-size: 9pt; }
    .page-heading h1 { max-width: none; font-size: 28pt; }
    .page-intro { max-width: none; font-size: 11pt; }
    .article-meta { font-size: 8pt; }
    .reading-layout, .reading-layout.has-toc { display: block; padding: 0; }
    .reading-body { max-width: none; }
    .prose { font-size: 10pt; line-height: 1.55; }
    .prose h2 { font-size: 18pt; margin-top: 1.75rem; }
    .prose h3 { font-size: 12pt; }
    h1, h2, h3, h4 { break-after: avoid; }
    p, li { orphans: 3; widows: 3; }
    .prose a { color: #000; text-decoration: underline; }
    .prose blockquote { background: #fff; border-color: #777; break-inside: avoid; font-size: 12pt; }
    .table-scroll { overflow: visible; border: 0; }
    .prose table, .prose .table-scroll table { display: table; table-layout: fixed; width: 100%; overflow: visible; border: 1px solid #777; font-size: 8pt; }
    .prose th, .prose td { min-width: 0; padding: .5rem; background: #fff; color: #000; font-size: 8pt; overflow-wrap: anywhere; }
    tr { break-inside: avoid; }
    thead { display: table-header-group; }
    .sources { padding: 1rem 0; background: #fff; font-size: 8pt; }
    .sources a::after { content: " (" attr(href) ")"; font-size: 7pt; overflow-wrap: anywhere; }
    .source-date { font-size: 7pt; }
    .home-hero, .topic-paths, .teacher-section, .home-editorial { display: block; padding: 1.5rem 0; }
    .home-hero h1 { font-size: 34pt; max-width: none; }
    .thinking-card, .topic-path, .home-resources, .example-paper { padding: 1.25rem; margin-top: 1rem; border: 1px solid #777; background: #fff; color: #000; }
    .thinking-card *, .home-resources *, .teacher-introduction h2 em { color: #000 !important; }
    .thinking-card h2, .home-resources h2 { font-size: 24pt; }
    .example-questions > div { grid-template-columns: 5rem 1fr; }
    .resource-row { grid-template-columns: 1rem 1fr 8rem; padding-block: 1rem; }
    .resource-arrow { display: none; }
    .resource-row, .teacher-routes > li, .topic-path { break-inside: avoid; }
    .section-space { padding-block: 2rem; }
    .editorial-mark { display: none; }
}
