/* The public pages' header and footer (2026-11-25, owner: the same refinements as the new home page everywhere).
   Loaded after each page's own styles (scripts/topic-pages.js shell; scripts/rechrome-public.js for pages already
   built): the logo mark, quiet links, Share and Sign in, a wider page for the index pages, the new footer. */
/* the header's base (also in each generated page's own styles, scripts/topic-pages.js) - for the hand-written
   public pages (help, privacy, terms, teacher quick start) that don't carry it */
header.site-header { display: flex; align-items: center; justify-content: space-between; color: #fff; text-align: left; }
header.site-header .logo { color: #fff; text-decoration: none; } header.site-header .logo span { color: #F0B93B; }
header.site-header nav { display: flex; }
/* the site header (2026-11-21): search from any page; on a phone, Menu and search buttons */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
header.site-header { position: relative; }
header.site-header nav { order: 2; }
.site-search { order: 3; position: relative; margin: 0; }
.site-search input { font: inherit; font-size: var(--fs-md, 0.875rem); width: 190px; padding: 6px 12px; border-radius: var(--r-sm, 8px); border: .5px solid rgba(255,255,255,.3); background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 1px 1px rgba(0,0,0,.15); }
.site-search input::placeholder { color: rgba(255,255,255,.75); }
.site-search input:focus { outline: 3px solid rgba(240,185,59,.6); outline-offset: 1px; background: rgba(255,255,255,.2); }
.site-results { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; width: min(340px, 92vw); list-style: none; margin: 0; padding: 6px; background: var(--white, #fff); color: var(--grey-800, #1f2937); border: .5px solid var(--grey-200, #e5e7eb); border-radius: var(--r, 12px); box-shadow: var(--sh-3); }
.site-results[hidden] { display: none; }
.site-results a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm, 8px); color: var(--grey-800, #1f2937); text-decoration: none; }
.site-results a:hover, .site-results a:focus-visible, .site-results a.sel { background: var(--teal-light, #f3eaf6); outline: none; }
.site-results small { color: var(--grey-600, #4b5563); } .site-results .all a { color: var(--teal-text, #5e2670); font-size: var(--fs-md, 0.875rem); }
.hd-btns { display: none; order: 1; gap: 6px; }
.hd-btns button { font: inherit; font-size: var(--fs-md, 0.875rem); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; color: #fff; background: rgba(255,255,255,.1); border: .5px solid rgba(255,255,255,.25); border-radius: var(--r-sm, 8px); padding: 6px 10px; min-height: 36px; cursor: pointer; }
.hd-btns button[aria-expanded="true"] { background: rgba(255,255,255,.22); }
@media (max-width: 640px) {
  header.site-header { flex-wrap: wrap; }
  .hd-btns { display: inline-flex; margin-left: auto; }
  header.site-header nav, .site-search { display: none; flex-basis: 100%; }
  header.site-header.nav-open nav { display: flex; flex-direction: column; gap: 0; }
  header.site-header.nav-open nav a { padding: 10px 2px; border-top: .5px solid rgba(255,255,255,.15); }
  header.site-header.search-open .site-search { display: block; }
  .site-search input { width: 100%; font-size: var(--fs-base, 1rem); padding: 9px 12px; }
  .site-results { left: 0; right: 0; width: auto; }
}
@media print { .site-search, .hd-btns { display: none !important; } }

header.site-header { position: sticky; top: 0; z-index: 50; min-height: 60px; padding: 10px max(20px, calc((100% - 1140px) / 2)); gap: 10px 22px; flex-wrap: nowrap; background: #2A1033; box-shadow: none; }
header.site-header .logo { display: inline-flex; align-items: center; gap: 8px; font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; flex: none; order: 0; }
header.site-header .logo-mark { height: 28px; width: auto; }
header.site-header nav { order: 1; gap: 4px 18px; flex-wrap: nowrap; }
header.site-header nav a { color: #fff; opacity: .85; text-decoration: none; font-size: .9rem; white-space: nowrap; }
header.site-header nav a:hover, header.site-header nav a[aria-current="page"] { opacity: 1; }
header.site-header nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 #F0B93B; }
header.site-header .nav-signin { display: none; }
header.site-header .site-search { order: 2; margin-left: auto; }
header.site-header .site-search input { width: 200px; border-radius: 999px; padding: 7px 14px; }
.hd-cta { order: 3; display: inline-flex; gap: 8px; flex: none; }
.hd-cta button, .hd-cta a { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,.3); background: none; color: #fff; border-radius: 999px; padding: 7px 15px; font: inherit; font-size: .86rem; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; }
.hd-cta svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.hd-cta .hd-fav[aria-pressed="true"] { background: rgba(240,185,59,.18); border-color: #F0B93B; } .hd-cta .fav-star { font-size: 1rem; line-height: 1; } .hd-cta .hd-fav[hidden] { display: none; }
.hd-cta .hd-signin { background: #F0B93B; border-color: #F0B93B; color: #2a1033 !important; }
header.site-header a:focus-visible, header.site-header button:focus-visible { outline: 3px solid #F0B93B; outline-offset: 2px; }
@media (max-width: 1000px) { header.site-header .site-search input { width: 150px; } header.site-header nav { gap: 4px 12px; } }
@media (max-width: 860px) { header.site-header nav a[href="/student-app/"] { display: none; } }
@media (max-width: 640px) {
  header.site-header { flex-wrap: wrap; padding: 10px 16px; }
  .hd-cta { order: 1; margin-left: auto; } .hd-cta .hd-signin { display: none; } .hd-cta .hd-share span, .hd-cta .hd-fav span:not(.fav-star) { display: none; } .hd-cta .hd-share { padding: 7px 10px; }
  .hd-btns { order: 2; margin-left: 0; }
  header.site-header nav { flex-wrap: wrap; }
  header.site-header nav a[href="/student-app/"], header.site-header .nav-signin { display: block; }
  header.site-header .site-search { margin-left: 0; } header.site-header .site-search input { width: 100%; }
}
@media print { .hd-cta { display: none !important; } }

/* wider pages for the index pages (the reading pages keep a comfortable line length) */
main.wide { max-width: 1140px; padding-left: max(16px, 24px); padding-right: max(16px, 24px); }
main:not(.wide) { max-width: 840px; }

/* footer */
footer.site-footer { border-top: 1px solid var(--grey-200, #e5e7eb); margin-top: 24px; padding: 22px max(16px, calc((100% - 1140px) / 2)) 30px; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; align-items: center; font-size: .86rem; color: var(--grey-600, #4b5563); text-align: left; }
footer.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
footer.site-footer a, footer.site-footer button { color: inherit; } footer.site-footer button { border: 0; background: none; font: inherit; padding: 0; cursor: pointer; text-decoration: underline; width: auto; display: inline; color: inherit; border-radius: 0; }
footer.site-footer .ft-brand a { font-weight: 700; color: var(--grey-800, #1f2937); text-decoration: none; }
[data-theme="dark"] footer.site-footer { border-color: #33284a; color: #b8aec9; } [data-theme="dark"] footer.site-footer .ft-brand a { color: #f1ecf7; }
/* the light/dark switch (shared/ui.js) at the end of the row */
header.site-header .ui-theme { order: 4; flex: none; }
@media (max-width: 640px) {
  header.site-header { flex-wrap: wrap; row-gap: 8px; column-gap: 6px; padding-left: 14px; padding-right: 14px; }
  header.site-header .logo { font-size: 1.05rem; } header.site-header .logo-mark { height: 24px; }
  header.site-header .logo { margin-right: auto; }
  .hd-cta { order: 1; margin-left: 0; } .hd-btns { order: 2; } header.site-header .ui-theme { order: 3; }
  .hd-btns .hd-menu-btn { font-size: 0; gap: 0; padding: 7px 10px; } .hd-btns .hd-menu-btn svg { font-size: 1rem; }
  header.site-header nav, header.site-header .site-search { order: 5; }
}

/* Key-stage badges (shared/stage.js, 2026-12-02): one colour per stage, the level inside */
:root { --stg-ks3: #1E6E47; --stg-ks3-bg: #E4F2EA; --stg-gcse: #6A2C7E; --stg-gcse-bg: #F3EAF6; --stg-alevel: #1F4E8C; --stg-alevel-bg: #E6EEF8; --stg-primary: #9A4A0C; --stg-primary-bg: #FBEEDD; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --stg-ks3: #8FD6AE; --stg-ks3-bg: #12291D; --stg-gcse: #D6B0EA; --stg-gcse-bg: #2A1636; --stg-alevel: #9DC0F0; --stg-alevel-bg: #132238; --stg-primary: #F2B98A; --stg-primary-bg: #2E1D0D; } }
[data-theme="dark"] { --stg-ks3: #8FD6AE; --stg-ks3-bg: #12291D; --stg-gcse: #D6B0EA; --stg-gcse-bg: #2A1636; --stg-alevel: #9DC0F0; --stg-alevel-bg: #132238; --stg-primary: #F2B98A; --stg-primary-bg: #2E1D0D; }
.stg { display: inline-flex; align-items: center; gap: 6px; padding: 1px 4px 1px 8px; border-radius: 999px; font-size: .74rem; font-weight: 800; letter-spacing: .03em; line-height: 1.6; vertical-align: middle; white-space: nowrap; color: #fff; background: var(--stg-gcse); }
.stg b { font-weight: 700; letter-spacing: 0; padding: 0 7px; border-radius: 999px; background: var(--stg-gcse-bg); color: var(--stg-gcse); }
.stg:not(:has(b)) { padding-right: 8px; }
.stg-ks3 { background: var(--stg-ks3); } .stg-ks3 b { background: var(--stg-ks3-bg); color: var(--stg-ks3); }
.stg-alevel { background: var(--stg-alevel); } .stg-alevel b { background: var(--stg-alevel-bg); color: var(--stg-alevel); }
.stg-primary { background: var(--stg-primary); } .stg-primary b { background: var(--stg-primary-bg); color: var(--stg-primary); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stg { color: #14091a; } }
[data-theme="dark"] .stg { color: #14091a; }
.stg-key { font-size: .85rem; color: var(--muted, #5d5470); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; }
.stg-key-h { font-weight: 700; }
.stg-key .stg + .stg, .stg-key .stg { margin-left: 6px; }
@media print { .stg { color: #000 !important; background: none !important; border: 1px solid #000; } .stg b { background: none !important; color: #000 !important; } }
