/*
  Public site template. One stylesheet for every school.

  The school's colours arrive as --brand, --brand-dark, --accent and --on-accent, set
  inline in each page's <head> from schools/<slug>/school.json. Nothing here is a
  school's colour: tints are mixed from --brand, and the neutrals below are fixed.
  --on-accent is the colour of text laid on the accent, chosen by the build so that it
  can always be read.

  Type is a condensed uppercase display face over a serif body. Both families ship
  with the template (fonts/, each beside its Open Font License text; the files are
  the latin subsets published by Fontsource, unmodified), so a heading looks the
  same on every device and no request leaves the school's own site. The stacks
  after them are what shows while a font loads. The display family has ONE weight:
  never ask it for bold, or the browser smears a fake one over it. Per-school fonts
  are not configurable yet.

  Layout follows docs/reference/tka-observed.md: its proportions and rhythm, in
  original code.
*/
@font-face {
  font-family: "League Gothic";
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/league-gothic-400.woff2) format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-weight: 400;
  font-display: swap;
  src: url(/fonts/source-serif-4-400.woff2) format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url(/fonts/source-serif-4-400-italic.woff2) format("woff2");
}
@font-face {
  font-family: "Source Serif 4";
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/source-serif-4-700.woff2) format("woff2");
}

:root {
  --ink: #2f3b4a;
  --muted: #566273;
  --surface: #ffffff;
  --tint: color-mix(in srgb, var(--brand) 7%, #ffffff);
  --line: color-mix(in srgb, var(--brand) 18%, #ffffff);
  /* A lighter tone of the school's colour, for very large headings on the tint. */
  --soft: color-mix(in srgb, var(--brand) 72%, #ffffff);
  --radius: 16px;
  /* The one very large corner that several bands carry. */
  --curve: clamp(3rem, 12vw, 11rem);
  --band: clamp(3rem, 6vw, 5rem);
  /* Side margin of the content: about 9% of the window, and never a line longer than 80rem. */
  --gutter: max(clamp(1.25rem, 9vw, 8.125rem), (100vw - 80rem) / 2);
  /* The header sits closer to the edge than the content does. */
  --edge: clamp(1.25rem, 2.8vw, 2.5rem);
  --display: "League Gothic", "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Serif 4", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1.125rem, 0.45vw + 1rem, 1.375rem);
  line-height: 1.6;
}

img, video { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  margin: 0 0 0.4em;
  color: var(--brand);
  font-family: var(--display);
  font-weight: 400;
  text-wrap: balance;
}
h1, h2 { text-transform: uppercase; }
h1 { font-size: clamp(3.25rem, 9vw, 7.5rem); line-height: 0.9; }
/* Big enough to lead a band, small enough that the hero stays the loudest thing on the page. */
h2 { font-size: clamp(2.75rem, 5.5vw, 4.5rem); line-height: 0.9; }
h3 { font-size: clamp(1.75rem, 2.6vw, 2.25rem); line-height: 1; }
h4 { color: var(--muted); font-size: 1.25rem; letter-spacing: 0.06em; line-height: 1.1; text-transform: uppercase; }

p { margin: 0 0 1em; }
.lead { max-width: 60ch; color: var(--muted); font-size: clamp(1.3rem, 1vw + 1rem, 1.75rem); }

a { color: var(--brand); text-decoration-color: var(--accent); text-underline-offset: 0.2em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[id] { scroll-margin-top: 1.5rem; }

.skip { position: absolute; left: -999rem; }
.skip:focus { left: 1rem; top: 1rem; z-index: 20; padding: 0.5rem 1rem; background: var(--surface); }

.eyebrow {
  margin: 0 0 0.75em;
  color: var(--muted);
  font: 400 1.25rem/1.1 var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.button {
  display: inline-block;
  padding: 0.7em 1.6em 0.6em;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 400 1.25rem/1.1 var(--display);
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}
.button:hover { filter: brightness(1.1); }
.buttons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0; }
/* After the first button the rest are outlines: one thing to do, then the others. */
.buttons .button:not(:first-child), .actions .button:not(:last-child) {
  background: none;
  box-shadow: inset 0 0 0 2px currentColor;
  color: var(--brand);
}

.text-link {
  font: 400 1.25rem/1.1 var(--display);
  letter-spacing: 0.06em;
  text-decoration: underline var(--accent) 3px;
  text-transform: uppercase;
  text-underline-offset: 0.4em;
}

.band { padding: var(--band) var(--gutter); }

/* A block in the school's colours where a photograph would go. */
.placeholder {
  display: block;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--brand) 60%, #ffffff),
    color-mix(in srgb, var(--accent) 45%, #ffffff));
}

/* ------------------------------------------------------------------ header */

.site-header {
  position: relative;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding: 1rem var(--edge);
  background: var(--brand);
  color: #ffffff;
}
.site-header a { text-decoration: none; }
/* Not buttons: a filled button keeps the text colour chosen for its fill (--on-accent). */
.site-header a:not(.button) { color: #ffffff; }

.wordmark {
  color: inherit;
  font-size: 1.5rem;
  font-variant: small-caps;
  letter-spacing: 0.05em;
  line-height: 1.1;
  text-decoration: none;
}
.wordmark span {
  display: block;
  margin-top: 0.3em;
  font-size: 0.5em;
  font-variant: normal;
  letter-spacing: 0.2em;
  opacity: 0.85;
}
.logo { width: auto; height: clamp(3rem, 5vw, 4.5rem); }

.utility, .primary, .actions { display: flex; flex-wrap: wrap; }
.utility { align-items: center; gap: 0.25rem 1.75rem; font-size: 1rem; }
.actions { gap: 0.5rem; margin: 0; }
.actions .button { padding: 0.5em 1.1em 0.4em; font-size: 1.05rem; }
.actions .button:not(:last-child) { color: #ffffff; }
.primary {
  gap: 0.25rem clamp(0.875rem, 1.5vw, 1.75rem);
  font: 400 clamp(1.125rem, 1.5vw, 1.375rem)/1 var(--display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.site-header nav a:hover, .primary a[aria-current] { text-decoration: underline var(--accent) 3px; text-underline-offset: 0.4em; }

.menu-toggle {
  display: none;
  padding: 0.5em 1.2em 0.4em;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 400 1.25rem/1.1 var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

/*
  The full menu needs room for a logo, eight pages and two buttons on one line, which
  is what a real school asked of it. Below 75em it is a button. A menu that wraps
  does not overflow, so nothing but its height would give it away: probe-site.py
  measures that at 1200px.
*/
@media (min-width: 75em) {
  .site-header { flex-wrap: nowrap; padding-block: 1.75rem; }
  /* Two rows on the right: the quick links, then the pages and what to do next. */
  .nav-wrap { display: grid; justify-items: end; gap: 0.9rem; min-width: 0; }
  .utility { justify-content: flex-end; gap: 0.25rem 1.25rem; font-size: 0.9rem; }
  .main-row { display: flex; align-items: center; gap: 1.5rem; }
  /* On the home page the header floats over the hero. */
  .home .site-header {
    position: absolute;
    inset: 0 0 auto;
    background: linear-gradient(rgb(0 0 0 / 0.6), transparent);
  }
  .interior .site-header { border-bottom-left-radius: 3.75rem; }
}

@media (max-width: 74.99em) {
  .nav-wrap { display: flex; flex-basis: 100%; flex-direction: column; }
  /* The pages first, then the quick links, then the buttons. */
  .main-row { display: contents; }
  .primary { order: -1; }
  .actions { order: 1; padding: 1rem 0 0.5rem; }
  .utility, .primary { flex-direction: column; align-items: stretch; gap: 0; }
  .site-header nav a, .utility span { padding: 0.65rem 0; border-top: 1px solid rgb(255 255 255 / 0.2); }
  /* Collapsed only when the script that can open it has run. */
  .js .menu-toggle { display: block; }
  .js .nav-wrap { display: none; }
  .js .nav-wrap[data-open="true"] { display: flex; }
}

/*
  Light header: a white bar on every page, the logo in its own colours, the menu in the
  school's colour. For a logo lettered in that colour, which would vanish on the dark bar.
  The home hero then starts below the header instead of behind it.
*/
.light-header .site-header { background: #ffffff; box-shadow: 0 1px 0 var(--line); color: var(--brand); }
.light-header .site-header a:not(.button) { color: var(--brand); }
.light-header .utility { color: var(--muted); }
.light-header .utility a { color: var(--muted); }
.light-header .actions .button:not(:last-child) { color: var(--brand); }
.light-header .logo { height: clamp(2.5rem, 3.6vw, 3.25rem); }
@media (min-width: 75em) {
  .light-header.home .site-header { position: relative; background: #ffffff; }
  .light-header.interior .site-header { border-bottom-left-radius: 0; }
  .light-header .actions { border-left-color: var(--line); }
}
@media (max-width: 74.99em) {
  .light-header .site-header nav a, .light-header .utility span { border-top-color: var(--line); }
}
.light-header .hero { min-height: min(calc(100svh - 7rem), 52rem); }
.light-header .hero-text { padding-top: var(--band); }

/* -------------------------------------------------------------------- hero */

.hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: min(100svh, 60rem);
  overflow: hidden;
  background: linear-gradient(160deg, var(--brand-dark), var(--brand));
}
.hero-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  /* Heavy enough that white text stays readable over a bright photograph. */
  background: linear-gradient(to top, rgb(0 0 0 / 0.82), rgb(0 0 0 / 0.5) 55%, rgb(0 0 0 / 0.4));
}
/* The top padding is what keeps the words clear of the header floating above them. */
.hero-text { position: relative; z-index: 1; padding: 11rem var(--gutter) var(--band); }
.hero h1, .hero .lead, .hero .eyebrow { color: #ffffff; }
.hero h1, .hero .lead { text-shadow: 0 2px 18px rgb(0 0 0 / 0.5); }
.hero .lead { margin-bottom: 1.5em; }
.hero .buttons .button:not(:first-child) { color: #ffffff; }

/* ---------------------------------------------------- interior page opening */

.subnav { margin: 0 var(--gutter); padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.subnav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 2rem; margin: 0; padding: 0; list-style: none; }
.subnav a {
  display: block;
  padding: 0.3rem 0;
  color: var(--muted);
  font: 400 1.25rem/1.1 var(--display);
  letter-spacing: 0.02em;
  text-decoration: none;
  text-transform: uppercase;
}
.subnav a:hover { text-decoration: underline var(--accent) 3px; text-underline-offset: 0.4em; }

.banner { padding: clamp(2rem, 5vw, 4rem) var(--gutter) 0; }
.banner h1 { font-size: clamp(2.5rem, 4.5vw, 3.75rem); line-height: 1; text-transform: none; }
.banner .buttons { margin-top: 1.5rem; }
.crumbs {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  font: 400 1rem/1.1 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a::after { content: "/"; margin: 0 0.6em; color: var(--muted); }
.crumbs span { color: var(--brand); }

.interior h2 { font-size: clamp(2.25rem, 3.5vw, 3rem); line-height: 1; }
.interior .head { margin-bottom: 1.25rem; }
/* Plain sections that follow one another read as one column of text. */
.section:not([class*="tone-"]) + .section:not([class*="tone-"]) { padding-top: 0; }

/* ---------------------------------------------------------------- sections */

.head { margin-bottom: 2.5rem; }
.head > :last-child, .head:last-child { margin-bottom: 0; }

.tone-tint { background: var(--tint); }
.tone-dark { background: var(--brand-dark); color: #ffffff; }
.tone-dark :is(h2, h3, h4, .lead, a:not(.button)) { color: #ffffff; }
.tone-dark .buttons .button:not(:first-child) { color: #ffffff; }

.body { display: flow-root; }
.body > :is(p, h3, h4, .list) { max-width: 70ch; }
.body > :last-child { margin-bottom: 0; }
.body > :is(h3, h4):not(:first-child) { margin-top: 1.5em; }

.list { margin: 0 0 1em; padding-left: 1.25em; list-style: disc; }
.list li { margin-bottom: 0.35em; break-inside: avoid; }
.list li::marker { color: var(--accent); }
/* A long list runs in columns instead of down the page. */
.body > .list:has(> li:nth-child(7)) { max-width: none; columns: 16rem 3; column-gap: 3rem; }
/* A link to a document says so. */
.list a[href$=".pdf"]::after {
  content: "PDF";
  display: inline-block;
  margin-left: 0.6em;
  padding: 0.15em 0.5em 0.05em;
  border-radius: 4px;
  background: var(--tint);
  color: var(--muted);
  font: 400 0.8em/1.2 var(--display);
  letter-spacing: 0.08em;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
  padding: 0;
  list-style: none;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.75rem 1.5rem;
  border-radius: var(--radius);
  background: var(--tint);
}
.card > * { margin: 0; }
.card h3 { font-size: clamp(1.6rem, 2.2vw, 2rem); }
.card :is(p, .list) { font-size: 0.9em; }
.card .list { margin: 0; }
.tone-tint .card { background: var(--surface); }
.tone-dark .card { background: rgb(255 255 255 / 0.1); }
/* The card's one link covers the whole card. */
.card-link { color: inherit; text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card:has(.card-link):hover { box-shadow: 0 0 0 2px var(--accent); }
.card .text-link { position: relative; z-index: 1; align-self: flex-start; margin-top: auto; padding-top: 0.5rem; font-size: 1.125rem; }
.card-media {
  width: calc(100% + 3rem);
  max-width: none;
  margin: -1.75rem -1.5rem 0.5rem;
  height: auto;
  border-radius: var(--radius) var(--radius) 0 0;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.badge {
  align-self: flex-start;
  padding: 0.3em 0.8em 0.2em;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font: 400 1rem/1.1 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.badge:has(br) { padding: 0.45em 0.75em 0.35em; border-radius: 10px; line-height: 1; text-align: center; }

/* Numbered steps. */
ol.cards { counter-reset: step; }
ol.cards > .card { counter-increment: step; }
ol.cards > .card::before { content: counter(step); color: var(--accent); font: 400 3.5rem/0.9 var(--display); }
/* A card on its own is a note set apart from the text around it. */
.cards > .card:only-child { border-left: 4px solid var(--accent); border-radius: 0; }

.accordion { margin: 2rem 0; border-top: 1px solid var(--line); }
.accordion details { border-bottom: 1px solid var(--line); }
.accordion summary {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 1.25rem 0.5rem 1.1rem;
  color: var(--ink);
  font: 400 1.5rem/1.1 var(--display);
  list-style: none;
  cursor: pointer;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::before { content: "+"; flex: 0 0 1ch; color: var(--accent); font-size: 1.75rem; text-align: center; }
.accordion details[open] > summary::before { content: "\2212"; }
.accordion details > :not(summary) { max-width: 70ch; margin-left: 2.5rem; }
.accordion details > :last-child:not(summary) { margin-bottom: 1.5rem; }

.images.strip { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 3rem; margin: 2rem 0; }
.strip-media { width: auto; height: clamp(3rem, 6vw, 4.5rem); object-fit: contain; }
.images.figure { margin: 0 0 2rem; }
.figure-media { width: 100%; height: auto; border-radius: var(--radius) var(--radius) var(--curve) var(--radius); }
@media (min-width: 60em) {
  /* The picture sits beside the paragraphs that follow it. */
  .body > .images.figure { float: right; width: 46%; margin: 0 0 2rem 4rem; }
}

.faq .body > h3 { margin-top: 0; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.faq .body > p + h3 { margin-top: 1.5rem; }

/* ------------------------------------------------------------------- tiles */

/* Tiles with no heading of their own belong to the band above them. */
.tiles-band:not(:has(> .head)) { padding-top: 0; }
.tiles { display: grid; gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.tiles li { display: grid; }
.tile {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  min-height: 11rem;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--brand);
  color: #ffffff;
  text-decoration: none;
}
/* No photograph: the colour panel is the whole tile. */
.tile:not(:has(.tile-media)) { grid-template-columns: 1fr; }
.tile-media { width: 100%; height: 100%; object-fit: cover; }
.tile-panel { display: grid; align-content: end; justify-items: end; gap: 0.35rem; padding: 1.5rem 1.75rem; text-align: right; }
/* With no photograph the tile is all panel: text reads from the top left, like a page,
   instead of being pushed into the far corner of a large empty block. */
.tile:not(:has(.tile-media)) .tile-panel { align-content: start; justify-items: start; text-align: left; }
.tile-panel strong { font: 400 clamp(2.25rem, 4.2vw, 3.75rem)/0.85 var(--display); text-transform: uppercase; }
.tile-panel small { font-size: clamp(1rem, 1.6vw, 1.5rem); line-height: 1.1; }
.tile-body { max-width: 40ch; font-size: 0.9rem; line-height: 1.4; }
.tiles li:nth-child(even) .tile { background: var(--accent); color: var(--on-accent); }
a.tile:hover { filter: brightness(1.12); }

@media (min-width: 48em) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem clamp(2rem, 5.5vw, 5rem); }
  .tile { min-height: clamp(14rem, 20vw, 18.375rem); }
  .tile:not(:has(.tile-media)) { min-height: 0; }
  /* Two columns: the colours run as a checkerboard, not in stripes. */
  .tiles li:nth-child(4n + 1) .tile, .tiles li:nth-child(4n + 4) .tile { background: var(--brand); color: #ffffff; }
  .tiles li:nth-child(4n + 2) .tile, .tiles li:nth-child(4n + 3) .tile { background: var(--accent); color: var(--on-accent); }
  /* An odd last tile stands alone, centred, in both colours. */
  .tiles li:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - clamp(1rem, 2.75vw, 2.5rem)); }
  .tiles li:last-child:nth-child(odd) .tile { background: linear-gradient(90deg, var(--accent), var(--brand) 65%); color: #ffffff; }
}

/* ---------------------------------------------------------------- programs */

.programs { background: var(--tint); }
.band-media { width: 100%; height: clamp(14rem, 40vw, 26rem); object-fit: cover; }
.program-list { display: grid; gap: 3rem; }
.program-list h3 { margin-bottom: 0.3em; color: var(--soft); font-size: clamp(2.5rem, 5.5vw, 5rem); line-height: 0.85; text-transform: uppercase; }
.program-list p { max-width: 30rem; color: var(--muted); font-size: 1.15em; }

@media (min-width: 60em) {
  /* Photograph left and staying in view; the programs run down the right. */
  .programs.has-media { display: grid; grid-template-columns: minmax(0, 43fr) minmax(0, 57fr); align-items: start; }
  .programs.has-media .band-media { position: sticky; top: 0; height: min(100svh, 56rem); border-bottom-right-radius: var(--curve); }
  .programs.has-media .panel { padding-left: clamp(3rem, 7vw, 6.25rem); }
  .programs:not(.has-media) .program-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4rem; }
}

/* ------------------------------------------------------------------- stats */

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin: 0; }
.stat {
  display: flex;
  /* The figure above its label, both at the foot of the tile. */
  flex-direction: column-reverse;
  justify-content: flex-start;
  gap: 0.4rem;
  min-height: clamp(10rem, 22vw, 19rem);
  padding: 2rem 1.75rem;
  border-radius: var(--radius);
  background: var(--brand);
  color: #ffffff;
}
.stat:nth-child(3n + 2) { background: var(--accent); color: var(--on-accent); }
.stat:nth-child(3n) { background: var(--tint); color: var(--brand); }
.stat dd { margin: 0; font: 400 clamp(3rem, 5.5vw, 4.5rem)/0.9 var(--display); }
.stat dt { font-size: clamp(1rem, 1.5vw, 1.375rem); line-height: 1.25; }

@media (min-width: 60em) {
  /* Tiles left, in two staggered columns; the heading right, staying in view. */
  .stats:has(> .head) { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; gap: clamp(3rem, 8vw, 7.5rem); }
  .stats > .head { position: sticky; top: 2rem; order: 2; margin: 0; }
  .stats:has(> .head) .stat-grid { padding-bottom: 1.875rem; }
  .stats:has(> .head) .stat:nth-child(even) { translate: 0 1.875rem; }
  /* No heading: one row across. */
  .stats:not(:has(> .head)) .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats:not(:has(> .head)) .stat { min-height: 12rem; }
}

/* ----------------------------------------------------------------- stories */

.stories > .head { text-align: center; }
.stories .lead { margin-inline: auto; }
.story-list { display: grid; gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.story-list figure {
  height: 100%;
  margin: 0;
  padding: 2.25rem 2rem;
  border-radius: var(--radius);
  background: var(--tint);
  box-shadow: 0 2.5rem 2.5rem -2rem rgb(0 0 0 / 0.25);
}
.story-list blockquote { margin: 0 0 1rem; font-size: 1.15em; font-style: italic; }
.story-list blockquote p { margin: 0; }
.story-list figcaption { color: var(--muted); font-size: 0.9em; }
.story-list figcaption strong { display: block; color: var(--brand); }

@media (min-width: 60em) {
  /* Three across, the middle one raised. */
  .story-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; padding-top: 2.5rem; }
  .story-list li:nth-child(3n + 2) { translate: 0 -2.5rem; }
  /* One story alone is a single large card. */
  .story-list:has(> li:only-child) { grid-template-columns: minmax(0, 56rem); justify-content: center; padding-top: 0; }
  .story-list li:only-child figure { padding: 3.5rem 4rem; text-align: center; }
  .story-list li:only-child blockquote { font-size: clamp(1.4rem, 2.2vw, 2rem); }
}

/* ----------------------------------------------------------------- gallery */

.gallery {
  display: grid;
  gap: 2.5rem;
  padding-right: 0;
  border-top-left-radius: var(--curve);
  background: var(--brand);
  color: #ffffff;
}
.gallery > .head { margin: 0; padding-right: var(--gutter); }
.gallery h2, .gallery .lead { color: #ffffff; }
.gallery .eyebrow, .tone-dark .eyebrow, .cta .eyebrow { color: rgb(255 255 255 / 0.8); }
/* min-width: 0 lets the row scroll inside its grid cell instead of widening the page. */
.gallery-row {
  display: flex;
  gap: 2rem;
  min-width: 0;
  margin: 0;
  padding: 0 var(--gutter) 0.75rem 0;
  overflow-x: auto;
  list-style: none;
  scroll-snap-type: x mandatory;
}
.gallery-row > li { flex: 0 0 clamp(14rem, 22vw, 20rem); scroll-snap-align: start; }
.gallery-row > li:not(.card) { aspect-ratio: 1; }
.gallery-media { width: 100%; height: 100%; border-radius: var(--radius); object-fit: cover; }
.gallery .card { background: var(--surface); color: var(--ink); }

@media (min-width: 60em) {
  .gallery { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); align-items: center; gap: 4rem; }
  .gallery > .head { padding-right: 0; }
}

/* --------------------------------------------------------------------- cta */

.cta {
  position: relative;
  padding-block: calc(var(--band) * 1.5);
  overflow: hidden;
  border-bottom: 4px solid var(--accent);
  background: var(--brand-dark);
  color: #ffffff;
  text-align: center;
}
/* The photograph shows through the school's colour, not over it. */
.cta-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.22; mix-blend-mode: luminosity; }
.cta > :not(.cta-media) { position: relative; }
.cta h2, .cta .lead { color: #ffffff; }
.cta .lead { margin-inline: auto; }
.cta .head { margin-bottom: 2rem; }
.cta .buttons { justify-content: center; gap: 1rem 2.5rem; }
/* Here the links are underlined words, not filled buttons. */
.cta .buttons .button, .cta .buttons .button:not(:first-child) {
  padding: 0 0 0.3em;
  border-radius: 0;
  background: none;
  box-shadow: inset 0 -3px 0 var(--accent);
  color: #ffffff;
  font-size: 1.5rem;
}

/* ------------------------------------------------------------------ footer */

.site-footer {
  display: grid;
  justify-items: center;
  gap: 1.75rem;
  padding: var(--band) var(--gutter) 2.5rem;
  background: var(--brand);
  color: #ffffff;
  text-align: center;
}
.site-footer a { color: #ffffff; }
.site-footer .wordmark { margin: 0; font-size: clamp(1.75rem, 3vw, 2.5rem); }
.site-footer .logo { height: clamp(4rem, 7vw, 6rem); }
/* A logo lettered in the school's colour needs a white ground on the coloured footer too. */
.light-header .site-footer .logo { box-sizing: content-box; height: clamp(2.75rem, 4.5vw, 3.75rem); padding: 1rem 1.5rem; border-radius: 12px; background: #ffffff; }
.site-footer address { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem 2.5rem; font-style: normal; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.75rem; }
.social { font: 400 1.25rem/1.1 var(--display); letter-spacing: 0.06em; text-transform: uppercase; }
.social a { padding-bottom: 0.2em; box-shadow: inset 0 -2px 0 var(--accent); text-decoration: none; }
.site-footer nav[aria-label="Footer"] { font-size: 0.9em; }
.site-footer .strip { justify-content: center; margin: 0.5rem 0 0; }
.site-footer .strip-media { box-sizing: content-box; padding: 0.6rem 1rem; border-radius: 8px; background: #ffffff; }
.footer-note { max-width: 60ch; margin: 0; font-size: 0.8em; opacity: 0.85; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
