/* ==========================================================================
   Kidscope Paediatric Clinic
   Palette derived from the supplied logo (#4E91BD sampled from the wordmark).
   The brand blue measures 3.44:1 on white, so it is reserved for decoration
   and large headings; --brand-deep carries all text and filled surfaces.
   ========================================================================== */

:root {
  --brand:         #4e91bd;  /* sampled from logo. Decorative / >=24px only  */
  --brand-deep:    #1f5c82;  /* 6.88:1 on ground, 7.21:1 white-on-it         */
  --brand-deeper:  #17496a;  /* hover states, footer ground                  */
  --brand-tint:    #eaf3f8;  /* card washes                                  */
  --brand-tint-2:  #d7e8f2;  /* borders on tinted surfaces                   */

  --ink:           #1c2b36;  /* 13.83:1 on ground                            */
  --ink-soft:      #46586a;  /* secondary text, still ~7:1 on ground          */
  --ground:        #f7fafc;  /* off-white page ground, not pure white        */
  --surface:       #ffffff;
  --line:          #dde6ed;

  --focus:         #b4530a;  /* 4.79:1 on ground - warm so it reads on blue  */
  --focus-on-dark: #ffffff;  /* for anything on a filled blue surface        */

  /* Fallback before header.js measures the real height; overwritten as a
     custom property on the root so :target scroll offsets clear the sticky
     header even when it wraps to two rows on narrow screens. */
  --header-h: 132px;

  --radius:      20px;
  --radius-sm:   12px;
  --measure:     68ch;
  --shadow:      0 1px 2px rgba(28, 43, 54, .04), 0 8px 24px rgba(28, 43, 54, .06);
  --shadow-lift: 0 2px 4px rgba(28, 43, 54, .06), 0 16px 40px rgba(28, 43, 54, .10);

  --font: "Lexend", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
          Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, ul, ol, li, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg { max-width: 100%; display: block; }

body {
  font-family: var(--font);
  font-size: 1.0625rem;           /* 17px base - a touch larger for reading ease */
  line-height: 1.65;              /* dyslexia-friendly leading                   */
  color: var(--ink);
  background: var(--ground);
  text-align: left;               /* never justified                             */
  -webkit-font-smoothing: antialiased;
}

/* --- focus ------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
.site-footer :focus-visible,
.hero :focus-visible,
.on-brand :focus-visible { outline-color: var(--focus-on-dark); }

.skip-link {
  position: absolute; left: 8px; top: -60px;
  z-index: 100;
  background: var(--brand-deep); color: #fff;
  padding: .7rem 1.2rem; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600; text-decoration: none;
  transition: top .15s ease;
}
.skip-link:focus { top: 0; }
/* Reduced-motion users get the skip link immediately rather than sliding it in -
   it is the first thing a keyboard user hits, so it must never lag. */
@media (prefers-reduced-motion: reduce) {
  .skip-link { transition: none; }
}

/* --- layout ------------------------------------------------------------ */
.wrap { width: min(1120px, 100% - 2.5rem); margin-inline: auto; }
.prose { max-width: var(--measure); }
.prose p + p { margin-top: 1.1em; }
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section + .section { padding-top: 0; }

/* --- typography -------------------------------------------------------- */
h1, h2, h3 { line-height: 1.25; font-weight: 600; letter-spacing: -.015em; color: var(--ink); }
h1 { font-size: clamp(2rem, 5vw, 2.9rem); }
h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); }
h3 { font-size: 1.2rem; font-weight: 600; }
.lede { font-size: clamp(1.1rem, 2.2vw, 1.3rem); color: var(--ink-soft); line-height: 1.55; }

/* Section headings get a brand rule. Colour is decorative, not carrying text. */
.rule-head { position: relative; padding-top: 1.15rem; margin-bottom: 1.25rem; }
.rule-head::before {
  content: ""; position: absolute; top: 0; left: 0;
  width: 56px; height: 5px; border-radius: 3px; background: var(--brand);
}

a { color: var(--brand-deep); text-underline-offset: .18em; text-decoration-thickness: .09em; }
a:hover { color: var(--brand-deeper); }

/* --- header ------------------------------------------------------------ */
/* The Kidscope logo PNG carries a real alpha channel, so the header no
   longer *needs* a white ground - it stays white for legibility of the
   search field and menu button, not to hide a baked-in logo background. */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "brand nav" "search search";
  align-items: center;
  row-gap: .6rem; column-gap: 1rem;
  padding-block: .65rem;
  min-height: 78px;
}
.brand-link { grid-area: brand; display: inline-flex; flex: 0 0 auto; border-radius: 6px; }
/* Native width is 249px; capping at 210 keeps it crisp on 2x screens. */
.brand-link img { width: 210px; height: auto; }

@media (min-width: 700px) {
  .header-inner {
    grid-template-columns: auto minmax(200px, 1fr) auto;
    grid-template-areas: "brand search nav";
    column-gap: 1.5rem;
  }
  .brand-link img { width: 240px; }
}

/* --- header search ------------------------------------------------------ */
.header-search { grid-area: search; position: relative; }
.search-input {
  display: block; width: 100%;
  font: inherit; font-size: .95rem;
  padding: .62rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--ground); color: var(--ink);
}
.search-input::placeholder { color: var(--ink-soft); }
.search-input:focus-visible { background: var(--surface); outline-color: var(--brand-deep); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lift);
  max-height: 60vh; overflow-y: auto;
  padding: .3rem;
  z-index: 60;
}
.search-results[hidden] { display: none; }
.search-result {
  display: block;
  padding: .65rem .8rem;
  border-radius: var(--radius-sm);
  text-decoration: none; color: inherit;
}
.search-result:hover,
.search-result[aria-selected="true"] { background: var(--brand-tint); }
.search-result .sr-title { display: block; font-weight: 600; color: var(--brand-deep); }
.search-result .sr-hint { display: block; font-size: .85rem; color: var(--ink-soft); margin-top: .1rem; }
.search-empty { display: block; padding: .7rem .8rem; font-size: .9rem; color: var(--ink-soft); }

/* --- header menu (hamburger) -------------------------------------------- */
.nav-details { grid-area: nav; justify-self: end; position: relative; }
.nav-toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  font: inherit; font-weight: 600; font-size: .95rem;
  color: var(--brand-deep); background: var(--brand-tint);
  border: 1px solid var(--brand-tint-2); border-radius: var(--radius-sm);
  padding: .55rem 1rem; cursor: pointer;
  list-style: none;
}
.nav-toggle::-webkit-details-marker { display: none; }
.nav-toggle:hover { background: var(--brand-tint-2); }
.nav-toggle svg { width: 18px; height: 18px; flex: 0 0 auto; transition: transform .15s ease; }
.nav-details[open] .nav-toggle { background: var(--brand-tint-2); border-color: var(--brand); }
.nav-details[open] .nav-toggle svg { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .nav-toggle svg { transition: none; } }

.site-nav {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: max-content;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 2rem));
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: .4rem;
  z-index: 60;
}
.site-nav ul { display: grid; gap: .1rem; }
.site-nav a {
  display: block;
  padding: .8rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .98rem; font-weight: 500;
  color: var(--ink); text-decoration: none;
}
.site-nav a:hover { background: var(--brand-tint); color: var(--brand-deep); }
.site-nav a[aria-current="page"] {
  background: var(--brand-tint); color: var(--brand-deep); font-weight: 600;
  border-left: 4px solid var(--brand-deep); padding-left: calc(.9rem - 4px);
}

/* --- primary nav (wide-viewport persistent bar) -------------------------
   Duplicates the six links already inside .site-nav so a wide-viewport
   visitor sees the full site IA without opening "Menu" first. The two
   <nav aria-label="Main"> elements are mutually exclusive via display:none
   at any given width, so only one is ever in the accessibility tree. */
.primary-nav { display: none; grid-area: primarynav; }
.primary-nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem; }
.primary-nav a {
  display: inline-block;
  padding: .55rem .65rem;
  border-radius: var(--radius-sm);
  font-size: .95rem; font-weight: 500;
  color: var(--ink); text-decoration: none;
}
.primary-nav a:hover { background: var(--brand-tint); color: var(--brand-deep); }
.primary-nav a[aria-current="page"] {
  background: var(--brand-tint); color: var(--brand-deep); font-weight: 600;
}

/* 1080px, not 960px: six links at this padding need roughly 900px in a
   row, and .wrap is 100% - 2.5rem below its 1120px cap - too tight a
   margin at 960px, where the bar would wrap to two centered lines right
   at its own on-ramp. */
@media (min-width: 1080px) {
  .header-inner {
    grid-template-columns: auto minmax(200px, 1fr);
    grid-template-areas: "brand search" "primarynav primarynav";
    row-gap: 0;
  }
  .nav-details { display: none; }
  .primary-nav {
    display: block;
    margin-top: .5rem;
    padding-top: .3rem;
    border-top: 1px solid var(--line);
  }
}

/* --- hero -------------------------------------------------------------- */
/* Photo of the Kidscope playroom, cropped (never stretched) via
   background-size: cover. The gradient sits on top at ~90% opacity so the
   white heading/lede/facts and the white focus ring keep the same verified
   contrast they had against the flat gradient - the photo is a texture
   under the brand colour, not a replacement for it. */
.hero {
  background:
    linear-gradient(160deg, rgba(31, 92, 130, .90) 0%, rgba(23, 73, 106, .94) 100%),
    url("../img/hero-classroom.jpg") center 35% / cover no-repeat;
  color: #fff;
  padding-block: clamp(3rem, 8vw, 5.5rem);
}
.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
/* Below 860px the grid stacks to one column; the photo is the one asset
   doing emotional work, so it visually leads on the viewport parents are
   most likely to open this page on. Reading/focus order is untouched -
   `order` only changes paint order, and the photo has no focusable
   content, so screen-reader and keyboard order still meet the heading
   and lede first. */
.hero-media { order: -1; }
.hero h1 { color: #fff; max-width: 20ch; }
.hero .lede { color: rgba(255,255,255,.92); max-width: 56ch; margin-top: 1.1rem; }
.hero-consultant { margin-top: 1rem; font-size: 1rem; font-weight: 500; color: rgba(255,255,255,.9); }
.hero-consultant strong { color: #fff; font-weight: 600; }

/* Photo alongside the hero copy, once there is room beside it. A thicker
   border plus a soft outward glow, layered on top of the normal drop
   shadow, so the photo visibly separates from the brand-blue background. */
.hero-media img {
  width: 100%; height: auto;
  border-radius: var(--radius);
  border: 4px solid rgba(255,255,255,.75);
  box-shadow: var(--shadow-lift), 0 0 40px rgba(255,255,255,.35);
}
@media (min-width: 860px) {
  .hero-grid { grid-template-columns: 1.15fr 1fr; }
  .hero-media { order: 0; }
}

/* Inner page header - lighter than the home hero */
.page-head {
  background: var(--brand-tint);
  border-bottom: 1px solid var(--brand-tint-2);
  padding-block: clamp(2.2rem, 5vw, 3.4rem);
}
.page-head .lede { margin-top: .85rem; }
.crumb { font-size: .9rem; color: var(--ink-soft); margin-bottom: .5rem; }

/* Photo variant of the inner page header, for pages with a supplied hero
   photo - same gradient-over-photo treatment as the home .hero, scaled
   down to page-head height. Photo is a texture under the brand colour,
   never a replacement for it, so the gradient still carries contrast. */
.page-head-photo {
  background-image:
    linear-gradient(160deg, rgba(31, 92, 130, .90) 0%, rgba(23, 73, 106, .94) 100%),
    var(--page-head-photo);
  background-repeat: no-repeat;
  background-size: cover;
  border-bottom: 0;
  color: #fff;
}
.page-head-photo .crumb { color: rgba(255,255,255,.75); }
.page-head-photo .crumb a { color: #fff; }
.page-head-photo h1 { color: #fff; }
.page-head-photo .lede { color: rgba(255,255,255,.92); }
.page-head-photo .jump a { color: #fff; }
.page-head-photo .jump .sep { color: rgba(255,255,255,.6); }
.page-head-photo .lede a { color: #fff; text-decoration: underline; }

.page-head--what-we-do { --page-head-photo: url("../img/hero-what-we-do.jpg"); background-position: center 20%; }
.page-head--referrals  { --page-head-photo: url("../img/hero-referrals.jpg"); background-position: center 22%; }
.page-head--research   { --page-head-photo: url("../img/hero-research.jpg"); background-position: center 32%; }
.page-head--contact    { --page-head-photo: url("../img/hero-contact.jpg"); background-position: center 22%; }
.page-head--resources  { --page-head-photo: url("../img/hero-resources.jpg"); background-position: center 28%; }
.page-head--family-resources { --page-head-photo: url("../img/hero-contact.jpg"); background-position: center 22%; }
.page-head--vaccinations     { --page-head-photo: url("../img/hero-classroom.jpg"); background-position: center 35%; }

/* --- cards ------------------------------------------------------------- */
.grid { display: grid; gap: 1.15rem; }
/* Four "How can we help?" cards - an explicit 2-column track forces a
   clean 2x2 at every width above the stack point. auto-fit/minmax was
   tried here first but a 360px floor still fits 3 tracks inside the
   1120px wrap on most desktop widths (1280/1366/1440/1920px), producing
   an unbalanced 3-then-1 row - the opposite of what it was meant to do. */
.help-grid { grid-template-columns: 1fr; }
@media (min-width: 640px) {
  .help-grid { grid-template-columns: repeat(2, 1fr); }
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--ink-soft); font-size: .97rem; }

/* Quick-link cards on the home page */
a.link-card {
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
a.link-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
  border-color: var(--brand);
}
a.link-card h3 { color: var(--brand-deep); }
a.link-card .go { margin-top: auto; padding-top: 1rem; font-weight: 600; font-size: .95rem; color: var(--brand-deep); }
a.link-card .go::after { content: " \2192"; }
@media (prefers-reduced-motion: reduce) {
  a.link-card, a.link-card:hover { transition: none; transform: none; }
}

/* The two most time-critical destinations (contact, referrals) get a
   tinted card and an eyebrow label, so a parent who was just handed a
   referral doesn't have to read all five destinations to find theirs. */
a.link-card.card--primary { background: var(--brand-tint); border-color: var(--brand-tint-2); }
a.link-card.card--primary:hover { border-color: var(--brand); }

.grid-footnote { margin-top: 1.25rem; font-size: .95rem; color: var(--ink-soft); }

/* --- aims list --------------------------------------------------------- */
.aims { counter-reset: aim; display: grid; gap: 1rem; margin-top: 1.5rem; }
.aims li {
  counter-increment: aim;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.35rem 1.15rem 3.9rem;
  box-shadow: var(--shadow);
}
.aims li::before {
  content: counter(aim);
  position: absolute; left: 1.25rem; top: 1.05rem;
  width: 1.9rem; height: 1.9rem;
  display: grid; place-items: center;
  background: var(--brand-deep); color: #fff;
  border-radius: 50%;
  font-size: .95rem; font-weight: 600; line-height: 1;
}

/* --- team / involved --------------------------------------------------- */
.team-list { display: grid; gap: .6rem; margin-top: 1.25rem; }
.team-list li {
  display: flex; gap: .75rem; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .85rem 1.1rem;
}
.team-list li::before {
  content: ""; flex: 0 0 auto;
  width: 9px; height: 9px; margin-top: .62rem;
  border-radius: 50%; background: var(--brand);
}

/* --- callout ----------------------------------------------------------- */
.callout {
  border: 1px solid var(--brand-tint-2);
  background: var(--brand-tint);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
}
.callout h3 { color: var(--brand-deep); margin-bottom: .35rem; }

/* --- section illustrations -------------------------------------------- */
/* Public-domain cartoons (openclipart.org, CC0) beside a section's text.
   Purely decorative, so alt="" in the markup. Below 860px they drop under
   the text at a modest size rather than pushing the content down. */
.with-art { display: grid; gap: 2rem 3.5rem; --art-w: 230px; }
.with-art--wide { --art-w: 320px; }
.with-art > :first-child { min-width: 0; }
.art {
  justify-self: center;
  width: min(calc(var(--art-w) * .7), 50%);
  height: auto;
}
@media (min-width: 860px) {
  .with-art { grid-template-columns: minmax(0, 1fr) var(--art-w); align-items: center; }
  .art { width: 100%; justify-self: end; }
}
@media print { .art { display: none; } }

/* Portrait inside a callout (Dr Gibson's bio): its own column beside the
   heading and text from 640px, so no line ever wraps under it; above them
   on a phone. */
.bio-photo {
  display: block;
  width: 132px; height: auto;
  aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}
@media (min-width: 640px) {
  .bio { display: grid; grid-template-columns: 132px minmax(0, 1fr); column-gap: 1.4rem; align-items: start; }
  .bio-photo { grid-row: 1 / span 2; margin: .2rem 0 0; }
  .bio > :not(.bio-photo) { grid-column: 2; }
}

/* --- contact ----------------------------------------------------------- */
.contact-rows { display: grid; gap: 1rem; margin-top: 1.5rem; }
.contact-row {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  box-shadow: var(--shadow);
}
.contact-row .ico {
  flex: 0 0 auto;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand-deep);
  border-radius: 50%;
}
.contact-row .ico svg { width: 21px; height: 21px; }
.contact-row h3 { font-size: 1.05rem; margin-bottom: .15rem; }
.contact-row address { font-style: normal; color: var(--ink-soft); }
.phone-link { font-size: 1.25rem; font-weight: 600; display: inline-block; margin-top: .1rem; }

/* --- resources --------------------------------------------------------- */
.res-group + .res-group { margin-top: 2.5rem; }
.res-list { display: grid; gap: .75rem; margin-top: 1.15rem; }
a.res-item {
  display: flex; align-items: flex-start; gap: .85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  text-decoration: none; color: var(--ink);
  transition: border-color .15s ease, background .15s ease;
}
a.res-item:hover { border-color: var(--brand); background: var(--brand-tint); }
a.res-item .res-txt { flex: 1 1 auto; }
a.res-item .res-name { font-weight: 600; color: var(--brand-deep); }
a.res-item .res-meta { display: block; font-size: .88rem; color: var(--ink-soft); margin-top: .1rem; }
a.res-item .ext { flex: 0 0 auto; width: 16px; height: 16px; color: var(--ink-soft); margin-top: .28rem; }
/* Plain text, not a pill - the em dash separator is written into the HTML
   itself (not CSS generated content) so it reads consistently for screen
   readers building the link's accessible name. */
.tag {
  font-size: .8rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
  color: var(--ink-soft);
}
@media (prefers-reduced-motion: reduce) { a.res-item { transition: none; } }

/* Categories with a long list of PDFs collapse behind a dropdown so the
   page doesn't open on a wall of links. Same native <details>/<summary>
   disclosure as the header menu (.nav-details) - no extra ARIA needed. */
.res-dropdown { margin-top: 1.15rem; }
.res-dropdown > .res-list { margin-top: 1.15rem; }
.res-toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  font: inherit; font-weight: 600; font-size: .95rem;
  color: var(--brand-deep); background: var(--brand-tint);
  border: 1px solid var(--brand-tint-2); border-radius: var(--radius-sm);
  padding: .55rem 1rem; cursor: pointer;
  list-style: none;
}
.res-toggle::-webkit-details-marker { display: none; }
.res-toggle:hover { background: var(--brand-tint-2); }
.res-toggle .chevron { width: 18px; height: 18px; flex: 0 0 auto; transition: transform .15s ease; }
.res-dropdown[open] .res-toggle { background: var(--brand-tint-2); border-color: var(--brand); }
.res-dropdown[open] .res-toggle .chevron { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .res-toggle .chevron { transition: none; } }

/* Jump nav on the resources page - plain underlined links, dot-separated,
   rather than pill buttons. The separator is a visually-hidden-from-AT span
   between the <a> elements, since screen readers already pause between
   separate links without needing "dot" read out. */
/* gap (not the separator's own text spacing) provides the horizontal
   rhythm - a flex item's own leading/trailing whitespace collapses away
   once it's blockified as a flex child, so spaces baked into the "sep"
   text alone would not survive. */
.jump { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem .4rem; margin-top: 1.5rem; }
.jump a {
  font-size: .92rem; font-weight: 500; text-decoration: underline;
  text-underline-offset: .18em; text-decoration-thickness: .08em;
  color: var(--brand-deep);
}
.jump a:hover { color: var(--brand-deeper); }
.jump .sep { color: var(--ink-soft); }
:target { scroll-margin-top: calc(var(--header-h) + 12px); }

/* --- in-page PDF viewer (progressive enhancement, js/pdf-viewer.js) -----
   A resource PDF opens over the page in the browser's own PDF reader
   instead of a separate browser tab, so a parent keeps their place in a
   long list and their way back is a Close button rather than the browser
   chrome. All of it is built from the same tokens as the rest of the
   site, so the high-contrast and colour-blind toggles reach inside the
   viewer without needing overrides here.

   z-index sits above the skip link (100), the header (50), its dropdowns
   (60) and the accessibility widget (80) - the viewer covers everything. */
.pdf-viewer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0px, 2vw, 28px);
}
.pdf-viewer[hidden] { display: none; }

.pdf-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 73, 106, .58);
  animation: kc-fade-in var(--dur-fast) var(--ease-out);
}

.pdf-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1100px, 100%);
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  animation: kc-pop-in var(--dur-base) var(--ease-out);
}

.pdf-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .8rem 1rem;
  background: var(--brand-tint);
  border-bottom: 1px solid var(--brand-tint-2);
}
/* min-width:0 is what lets the title actually truncate rather than
   pushing the buttons off the end of a narrow bar. */
.pdf-titles { flex: 1 1 auto; min-width: 0; }
.pdf-title,
.pdf-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pdf-title { font-size: 1.02rem; font-weight: 600; line-height: 1.35; color: var(--brand-deep); }
.pdf-meta { font-size: .85rem; color: var(--ink-soft); }
.pdf-meta[hidden] { display: none; }

.pdf-actions { flex: 0 0 auto; display: flex; gap: .4rem; }
.pdf-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  color: var(--brand-deep);
  background: var(--surface);
  border: 1px solid var(--brand-tint-2);
  border-radius: 999px;
  padding: .42rem .8rem;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.pdf-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }
.pdf-btn[hidden] { display: none; }
.pdf-btn:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.pdf-btn:active { transform: scale(.97); }
.pdf-btn-close { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.pdf-btn-close:hover { background: var(--brand-deeper); border-color: var(--brand-deeper); }

/* One button, two icons: the "expand" corners going in, the "collapse"
   corners coming back out. js/pdf-viewer.js flips .is-full from the
   browser's own fullscreenchange event, so it stays right even when the
   visitor leaves full screen with Escape or F11. */
.pdf-btn-full .ico-exit { display: none; }
.pdf-btn-full.is-full .ico-enter { display: none; }
.pdf-btn-full.is-full .ico-exit { display: block; }
.pdf-btn-full.is-full { background: var(--brand-deep); border-color: var(--brand-deep); color: #fff; }
.pdf-btn-full.is-full:focus-visible { outline-color: var(--focus-on-dark); }

/* Full screen: the panel is the whole display, so the inset margin,
   rounded corners and border it wears as an overlay all come off.
   :fullscreen and :-webkit-full-screen must stay in separate rules -
   a selector list is dropped whole by any browser that doesn't know one
   of its parts. */
.pdf-panel:fullscreen { width: 100%; height: 100%; border: 0; border-radius: 0; }
.pdf-panel:-webkit-full-screen { width: 100%; height: 100%; border: 0; border-radius: 0; }
.pdf-panel::backdrop { background: #0e2c40; }
/* On a blue-filled button the warm focus ring measures too low - switch
   to the white ring the rest of the site uses on blue surfaces. */
.pdf-btn-close:focus-visible { outline-color: var(--focus-on-dark); }

.pdf-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;              /* lets the frame shrink inside the flex column */
  background: #eef2f6;
}
.pdf-frame { width: 100%; height: 100%; border: 0; display: block; }
.pdf-frame[hidden] { display: none; }

.pdf-loading {
  display: none;
  position: absolute;
  inset-inline: 0;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  font-size: .95rem;
  color: var(--ink-soft);
}
.pdf-stage.is-loading .pdf-loading { display: block; }

/* The pdf.js column (phones). One page per row, each reserving its true
   height from the start so the list never jumps while pages draw. */
.pdf-pages {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;         /* don't chain the scroll to the page behind */
  /* Flex, not grid: an auto-sized grid row measures its item's *content*,
     and an unrendered canvas measures nothing - which stacked every page
     into a 17px row on top of the one before it. A flex column resolves
     each page's height from its width and aspect-ratio, and
     js/pdf-viewer.js pins the same height in pixels for browsers that
     don't do aspect-ratio at all. */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  padding: .7rem;
}
.pdf-page {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  max-width: 900px;
  background: var(--surface);
  border-radius: 4px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.pdf-page canvas { width: 100%; height: 100%; display: block; }
/* Same shimmer the partner logos and the map use, for the same reason:
   something is genuinely on its way. */
.pdf-page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, var(--brand-tint) 30%, var(--brand-tint-2) 50%, var(--brand-tint) 70%);
  background-size: 300% 100%;
  animation: kc-shimmer 1.4s ease-in-out infinite;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.pdf-page.is-rendered::after { opacity: 0; animation: none; }
@media (prefers-reduced-motion: reduce) {
  .pdf-page::after { animation: none; background: var(--brand-tint); }
}

.pdf-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  gap: .6rem;
  padding: clamp(1.5rem, 5vw, 3rem);
  background: var(--surface);
}
.pdf-fallback[hidden] { display: none; }
.pdf-fallback h3 { font-size: 1.1rem; color: var(--brand-deep); }
.pdf-fallback p { color: var(--ink-soft); max-width: 46ch; }

/* Scroll lock: without it the page underneath scrolls away behind the
   overlay on a trackpad or a phone. */
html.pdf-viewer-open, html.pdf-viewer-open body { overflow: hidden; }

/* Phone: full-bleed, with the buttons dropping onto their own row so the
   document title keeps a readable width. */
@media (max-width: 700px) {
  .pdf-viewer { padding: 0; }
  .pdf-panel { width: 100%; border: 0; border-radius: 0; }
  .pdf-bar { flex-wrap: wrap; gap: .55rem; padding: .7rem .85rem; }
  .pdf-titles { flex: 1 0 100%; }
  .pdf-actions { flex: 1 0 100%; justify-content: flex-end; }
  .pdf-btn { padding: .45rem .7rem; }
}

/* Small phone: four labelled pills no longer fit on one row, so the three
   secondary ones go to icon-only. The label is *clipped*, not removed -
   display:none would take it out of the accessibility tree with it and
   leave three unnamed buttons. Close keeps its word: it is the way back. */
@media (max-width: 480px) {
  .pdf-btn-full .pdf-btn-label,
  #pdf-download .pdf-btn-label,
  #pdf-newtab .pdf-btn-label {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
    white-space: nowrap; border: 0;
  }
  .pdf-btn-full, #pdf-download, #pdf-newtab { padding: .45rem .55rem; }
}

@keyframes kc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* --- map --------------------------------------------------------------- */
.map-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-top: 1.5rem;
}
.map-frame iframe { width: 100%; height: 460px; border: 0; display: block; }
.map-fallback { font-size: .95rem; color: var(--ink-soft); margin-top: .8rem; }
@media (max-width: 620px) { .map-frame iframe { height: 340px; } }

/* --- video ------------------------------------------------------------- */
/* Same frame as the map, but held at 16:9 so the player never letterboxes. */
.video-frame {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
  margin-top: 1.5rem;
  max-width: 760px;
}
.video-frame iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }

/* --- publications empty state ------------------------------------------ */
.empty-state {
  background: var(--surface);
  border: 2px dashed var(--brand-tint-2);
  border-radius: var(--radius);
  padding: clamp(2rem, 5vw, 3rem);
}
.empty-state .ico {
  width: 52px; height: 52px; margin-bottom: 1rem;
  display: grid; place-items: center;
  background: var(--brand-tint); color: var(--brand-deep); border-radius: 50%;
}
.empty-state .ico svg { width: 26px; height: 26px; }

/* --- partners ---------------------------------------------------------- */
/* Six separate logo files (each an opaque white-background JPG/PNG - none
   carry transparency), so each sits in its own white card and links out to
   that partner's own site, instead of one flat unlinked strip. */
.partners { background: var(--surface); border-top: 1px solid var(--line); }
.partner-grid {
  margin-top: 1.4rem;
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.partner-tile {
  display: flex; align-items: center; justify-content: center;
  height: 92px; padding: 1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
a.partner-tile:hover, a.partner-tile:focus-visible {
  transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--brand);
}
.partner-tile img { max-width: 100%; max-height: 100%; width: auto; height: auto; }
/* Springboard has no confirmed URL yet, so it ships as a plain, non-clickable
   tile - deliberately no hover affordance, so it doesn't look like a broken link. */
.partner-tile--unlinked { cursor: default; }
.partner-names { font-size: .92rem; color: var(--ink-soft); margin-top: 1.1rem; }
@media (prefers-reduced-motion: reduce) { a.partner-tile, a.partner-tile:hover { transition: none; transform: none; } }

/* --- footer ------------------------------------------------------------ */
.site-footer { background: var(--brand-deeper); color: rgba(255,255,255,.86); margin-top: 3.5rem; }
.footer-inner { padding-block: 2.75rem 2rem; display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.site-footer h2 { font-size: 1rem; color: #fff; margin-bottom: .7rem; letter-spacing: 0; }
.site-footer a { color: #fff; }
.site-footer ul { display: grid; gap: .4rem; }
.site-footer li a { text-decoration: none; font-size: .96rem; color: rgba(255,255,255,.86); }
.site-footer li a:hover { color: #fff; text-decoration: underline; }
.site-footer address { font-style: normal; font-size: .96rem; line-height: 1.7; }
/* Logo wordmark is brand blue, so it needs a light card behind it to stay
   legible against the dark footer ground - unrelated to the PNG's alpha. */
.footer-logo {
  background: #fff; border-radius: var(--radius-sm);
  padding: .8rem 1rem; display: inline-block; margin-bottom: 1rem;
}
.footer-logo img { width: 150px; height: auto; }
.footer-base {
  border-top: 1px solid rgba(255,255,255,.18);
  padding-block: 1.15rem;
  font-size: .89rem; color: rgba(255,255,255,.72);
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between;
}

/* --- print ------------------------------------------------------------- */
@media print {
  .site-header, .site-nav, .nav-toggle, .jump, .skip-link,
  .pdf-viewer { display: none !important; }
  html.pdf-viewer-open, html.pdf-viewer-open body { overflow: visible !important; }
  body { background: #fff; font-size: 11pt; }
  .card, .res-item, .contact-row { box-shadow: none; break-inside: avoid; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #444; word-break: break-all; }
}

/* --- utilities --------------------------------------------------------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ==========================================================================
   Motion system
   Adds deliberate easing and entrance/hover/press feedback on top of the
   transitions already defined above (link-card, partner-tile, res-item).
   Opt-out at three layers: the OS prefers-reduced-motion query, the
   in-page "Reduce motion" toggle in the accessibility toolbar below
   (html.a11y-reduce-motion), and - for cross-page view transitions
   specifically, since Chrome does not reliably honour reduced-motion for
   those via the media query alone - a dedicated pseudo-element kill switch.
   ========================================================================== */
:root {
  --ease-out:    cubic-bezier(.16, 1, .3, 1);
  --dur-fast: .15s;
  --dur-base: .22s;
  --dur-slow: .38s;
}

/* Native cross-document view transitions - one at-rule turns every link
   click into a soft cross-fade instead of a hard cut. Supporting browsers
   only; every other browser ignores the at-rule and navigates as it does
   today, so this is pure progressive enhancement. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition {
    navigation: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}
/* Header and footer are pixel-identical across all six pages - naming them
   lets the browser morph the same persistent element instead of
   cross-fading two separate snapshots, which reads as a flicker on a
   sticky header. */
.site-header { view-transition-name: site-header; }
.site-footer { view-transition-name: site-footer; }

/* --- entrance animation for the two header dropdowns --------------------
   Opening only. Reliably animating the *closing* direction would mean
   fighting the browser's own display:none handling for both <details>
   and [hidden] (Chrome in particular slots <details> content behind its
   own internal ::details-content visibility, ahead of any authored
   `display` transition) for a payoff most visitors would never notice.
   Instant close matches how most native OS dropdowns already behave. */
@keyframes kc-pop-in {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.nav-details[open] > .site-nav,
.res-dropdown[open] > .res-list,
#search-results:not([hidden]) {
  animation: kc-pop-in var(--dur-base) var(--ease-out);
}

/* --- refined hover / press feedback -------------------------------------- */
a.link-card:active { transform: translateY(-1px) scale(.985); }
a.partner-tile:active, a.res-item:active { transform: scale(.98); }
.nav-toggle, .a11y-toggle, .res-toggle {
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.nav-toggle:active, .a11y-toggle:active, .res-toggle:active { transform: scale(.96); }
@media (prefers-reduced-motion: reduce) {
  a.link-card:active, a.partner-tile:active, a.res-item:active,
  .nav-toggle:active, .a11y-toggle:active, .res-toggle:active { transform: none; }
}

/* --- scroll-reveal (progressive enhancement via js/motion.js) -----------
   motion.js only ever adds .reveal to an element when JS has run AND the
   visitor has not asked for reduced motion, so a no-JS or reduced-motion
   visitor never sees anything but the plain, always-visible layout below. */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
  transition-delay: calc(var(--reveal-i, 0) * 60ms);
}
.reveal.is-visible { opacity: 1; transform: none; }
/* Printing (or a browser Find landing on an off-screen match) must never
   hide real content behind an animation that only fires on scroll. */
@media print {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* --- header elevation on scroll (js/motion.js) --------------------------- */
.site-header { transition: box-shadow var(--dur-base) var(--ease-out); }
.site-header.is-scrolled { box-shadow: var(--shadow); }

/* --- reduced motion, sitewide kill switch --------------------------------
   Covers both the OS-level query and the in-page toolbar toggle in one
   place, for every animation added above. Durations go near-zero rather
   than to `none` so transitionend/animationend still fire - motion.js and
   the skeleton loaders below rely on those events to clean up state. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}

/* ==========================================================================
   Skeleton loading states
   Used only where something genuinely loads asynchronously after the page
   has painted: the lazy-loaded partner logos on the home page, and the
   embedded Google catchment-area map on the referrals page. Not used for
   the page itself, which has nothing worth simulating a wait for.
   ========================================================================== */
@keyframes kc-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
.partner-tile { position: relative; }
.partner-tile::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(100deg, var(--brand-tint) 30%, var(--brand-tint-2) 50%, var(--brand-tint) 70%);
  background-size: 300% 100%;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.partner-tile.is-loading::after {
  opacity: 1;
  animation: kc-shimmer 1.4s ease-in-out infinite;
}
.partner-tile.is-loading img { opacity: 0; }
.partner-tile img { transition: opacity var(--dur-base) var(--ease-out); }
@media (prefers-reduced-motion: reduce) {
  .partner-tile.is-loading::after { animation: none; background: var(--brand-tint); }
}

.map-frame { position: relative; }
.map-frame::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, var(--brand-tint) 30%, var(--brand-tint-2) 50%, var(--brand-tint) 70%);
  background-size: 300% 100%;
  opacity: 0;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.map-frame.is-loading::after {
  opacity: 1;
  animation: kc-shimmer 1.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .map-frame.is-loading::after { animation: none; background: var(--brand-tint); }
}

/* ==========================================================================
   Accessibility toolbar (js/accessibility.js)
   A floating, page-persistent control for the things prefers-* media
   queries can't cover on their own: a dyslexia-friendly typeface, a
   contrast boost, font scaling, a colour-blind friendly palette, and an
   explicit motion override. Built on
   the same <details>/<summary> disclosure pattern as the header menu
   (.nav-details above), so it is keyboard-operable with no extra ARIA.
   ========================================================================== */
.a11y-widget {
  position: fixed;
  right: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 80;
}
.a11y-toggle {
  display: inline-flex; align-items: center; gap: .5rem;
  font: inherit; font-weight: 600; font-size: .9rem;
  color: #fff; background: var(--brand-deep);
  border: 1px solid var(--brand-deeper);
  border-radius: 999px;
  padding: .7rem 1.1rem .7rem .85rem;
  cursor: pointer;
  box-shadow: var(--shadow-lift);
  list-style: none;
}
.a11y-toggle::-webkit-details-marker { display: none; }
.a11y-toggle:hover { background: var(--brand-deeper); }
.a11y-toggle svg { width: 20px; height: 20px; flex: 0 0 auto; }
.a11y-widget[open] .a11y-toggle { background: var(--brand-deeper); }

.a11y-panel {
  position: absolute; right: 0; bottom: calc(100% + 10px);
  width: min(300px, calc(100vw - 2rem));
  max-height: min(70vh, 520px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  padding: 1.1rem;
}
.a11y-panel h2 { font-size: .95rem; margin-bottom: .9rem; }
.a11y-group { margin-bottom: 1rem; }
.a11y-group:last-of-type { margin-bottom: 0; }
.a11y-group-label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--ink-soft); text-transform: uppercase; letter-spacing: .03em;
  margin-bottom: .5rem;
}
.a11y-btn {
  display: flex; align-items: center; justify-content: space-between;
  gap: .6rem; width: 100%;
  font: inherit; font-size: .93rem; font-weight: 500;
  color: var(--ink); background: var(--ground);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .7rem .9rem;
  cursor: pointer; text-align: left;
}
.a11y-btn + .a11y-btn { margin-top: .5rem; }
.a11y-btn:hover { border-color: var(--brand); }
.a11y-btn[aria-pressed="true"] {
  background: var(--brand-tint); border-color: var(--brand);
  color: var(--brand-deep); font-weight: 600;
}
.a11y-btn .tick { opacity: 0; }
.a11y-btn[aria-pressed="true"] .tick { opacity: 1; }

.a11y-steps { display: flex; align-items: center; gap: .5rem; }
.a11y-step-btn {
  flex: 0 0 auto;
  width: 2.4rem; height: 2.4rem;
  display: grid; place-items: center;
  font: inherit; font-weight: 700; font-size: 1rem;
  color: var(--brand-deep); background: var(--ground);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer;
}
.a11y-step-btn:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-tint); }
.a11y-step-btn:disabled { opacity: .4; cursor: not-allowed; }
.a11y-step-status { flex: 1 1 auto; text-align: center; font-size: .85rem; color: var(--ink-soft); }
.a11y-reset {
  display: block; width: 100%; margin-top: 1rem;
  font: inherit; font-size: .85rem; font-weight: 600;
  color: var(--ink-soft); background: none;
  border: 0; border-top: 1px solid var(--line);
  padding-top: .8rem; cursor: pointer; text-align: center;
}
.a11y-reset:hover { color: var(--brand-deep); }

/* --- read this page aloud (toolbar control) -------------------------------
   The Stop button and status line only appear once reading has started
   (js/accessibility.js toggles [hidden] and fills the status text), so a
   visitor who never touches "Listen" sees nothing extra here. */
.a11y-btn--speak svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--brand-deep); }
.a11y-btn--stop {
  color: var(--focus); border-color: var(--focus);
}
.a11y-btn--stop svg { width: 16px; height: 16px; flex: 0 0 auto; }
.a11y-btn--stop:hover { background: #fdf1e8; }
.a11y-speak-status {
  margin: .5rem 0 0; font-size: .82rem; color: var(--ink-soft);
  min-height: 1.1em;
}

/* Marks the sentence currently being read aloud. Outline rather than a
   background wash, so it reads clearly under both .a11y-contrast (which
   turns most colour into black-on-white) and .a11y-colorblind. */
.a11y-speaking {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
  background: var(--brand-tint);
}
:root.a11y-contrast .a11y-speaking { background: #ffe9a8; }

/* --- dyslexia-friendly typeface (toolbar toggle) -------------------------
   OpenDyslexic, served from Fontsource's jsDelivr CDN (no build step, same
   pattern as the Google Fonts <link> already in <head> - see README).
   Falls back through Comic Sans - genuinely useful here, its asymmetric
   letterforms are one of the few system-font traits shown to help some
   dyslexic readers - before the site's normal Lexend stack, in case the
   CDN file is blocked. */
@font-face {
  font-family: 'OpenDyslexic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://cdn.jsdelivr.net/fontsource/fonts/opendyslexic@5.3.0/latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'OpenDyslexic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('https://cdn.jsdelivr.net/fontsource/fonts/opendyslexic@5.3.0/latin-700-normal.woff2') format('woff2');
}
:root {
  --font-dyslexic: 'OpenDyslexic', 'Comic Sans MS', 'Comic Sans', var(--font);
}
html.a11y-dyslexic body { font-family: var(--font-dyslexic); }

/* --- font size steps (toolbar A-/A+) -------------------------------------
   Scales html's root font-size, so every rem-based measurement on the
   page (body copy, the clamp()'d headings, spacing) scales with it. */
html[data-a11y-font-step="1"] { font-size: 110%; }
html[data-a11y-font-step="2"] { font-size: 120%; }
html[data-a11y-font-step="3"] { font-size: 132%; }

/* --- colour-blind friendly palette (single toggle) -----------------------
   Same custom-property idiom as high contrast below, but tuned for hue
   rather than luminance: --brand-deep, --brand-deeper and --focus move to
   darker values in the same blue/vermillion families used by the
   Okabe-Ito colour-blind-safe palette (a peer-reviewed set chosen to stay
   distinguishable under protanopia, deuteranopia and tritanopia alike),
   each re-checked against --ground and white text (7.22:1 / 7.57:1 for
   the new --brand-deep, 5.14:1 / 5.39:1 for --focus - both above the
   4.5:1 AA floor this site holds everywhere else). It also forces link
   underlines sitewide (below, bundled into the shared rule with
   .a11y-contrast) so links are never identified by hue alone.
   Declared before .a11y-contrast so that if a visitor turns both on,
   contrast's near-black values win on the shared properties - the
   black/white axis is unaffected by any form of colour blindness, so
   that's the safer result regardless of which type a visitor has. */
:root.a11y-colorblind {
  --brand-deep: #00588c;
  --brand-deeper: #003d5b;
  --focus: #b34a00;
}

/* --- high contrast (single toggle - see README) --------------------------
   Every colour on this site is already a custom property, so redefining
   them at :root.a11y-contrast strengthens borders, links and text
   sitewide in one place rather than needing per-component overrides.
   This only ever *increases* contrast from the already-verified baseline
   (see README "Accessibility checks performed") - there is deliberately
   no "low contrast" direction, which would undermine that guarantee. */
:root.a11y-contrast {
  --ink: #000000;
  --ink-soft: #1a1a1a;
  --line: #000000;
  --brand-tint-2: #000000;
  --brand-deep: #0d3a54;
  --brand-deeper: #081f2d;
  --shadow: none;
  --shadow-lift: 0 0 0 2px #000;
  --focus: #000000;
}
:root.a11y-contrast :focus-visible { outline-width: 4px; }
.a11y-contrast .prose a,
.a11y-contrast .site-nav a,
.a11y-contrast .site-footer a,
.a11y-contrast .crumb a,
.a11y-contrast .phone-link,
.a11y-contrast .jump a,
.a11y-colorblind .prose a,
.a11y-colorblind .site-nav a,
.a11y-colorblind .site-footer a,
.a11y-colorblind .crumb a,
.a11y-colorblind .phone-link,
.a11y-colorblind .jump a {
  text-decoration: underline;
  text-decoration-thickness: .1em;
}
