/* schoolweb.page look "Photo-led". A studio template that opens every page on a photo.
   One family (DM Sans, variable, optical sizes) at a strict scale. Desktop runs on one
   12-column grid: headings in columns 1-4, content in 5-12. The hero photo starts on the
   grid's edge and runs off the right of the screen; each inner page opens the same way,
   on its own photo, or on a plate of the school's deep colour. The home photos are a
   composed gallery hung on a wall of the school's colour. Sections part by space alone,
   not by rules. */
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 100 1000; font-display: swap;
  src: url("../../fonts/DMSans.a1f7d3846c58.woff2") format("woff2"); }
@font-face { font-family: "Rare Latin"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../../fonts/NotoSansRare.746d07864173.woff2") format("woff2");
  unicode-range: U+0149, U+0300-036F, U+1E00-1EFF; }

:root {
  --serif: "DM Sans", "Rare Latin", "DM Sans fallback", system-ui, sans-serif;
  --sans: "DM Sans", "Rare Latin", "DM Sans fallback", system-ui, sans-serif;
  --ink: #16191F;
  --line: #DDDFE3;
  --muted: #565B66;
  /* the gallery wall: the school colour, thin */
  --wall: var(--accent-tint);
  /* the scale on a phone: 15 / 17 / 20 / 28 / 36 / 44 */
  --t1: .9375rem; --t2: 1.0625rem; --t3: 1.25rem; --t4: 1.75rem; --t5: 2.25rem; --t6: 2.75rem;
  --gap: 16px;
  --space: 44px;
  --r: 3px;
  --prose: 31.5em;
}
@supports (color: color-mix(in srgb, red, red)) { :root { --wall: color-mix(in oklab, var(--accent) 11%, #fff); } }
body { font-size: var(--t2); line-height: 1.55; font-optical-sizing: auto; }
h1, h2, h3 { font-weight: 600; letter-spacing: -.03em; line-height: 1.06; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 1px; }

/* ---------- header ---------- */
.top { min-height: 64px; border-bottom: 0; }
.top .name { font-weight: 640; font-size: var(--t2); letter-spacing: -.02em; }
.top .name.long { font-size: var(--t1); }
.top .menu { font-weight: 560; }
.nav > nav { box-shadow: 0 24px 32px rgb(20 25 40 / .1); border-top: 1px solid var(--line); }
.nav > nav a { font-weight: 560; font-size: var(--t3); letter-spacing: -.02em; }
.nav > nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--link); text-decoration-thickness: 2px; text-underline-offset: 8px; }

/* ---------- hero, phone: the photo first, edge to edge, then the name across the
   page under it ---------- */
.hero { display: flex; flex-direction: column; justify-content: flex-start; min-height: 0; overflow: visible; background: none; }
.hero img { position: static; order: -1; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.hero-text { padding: 20px var(--pad) 0; color: var(--ink); background: none; }
.hero h1 { color: var(--ink); text-shadow: none; font-size: var(--t5); font-weight: 650; line-height: 1.02; letter-spacing: -.04em; }
.hero .town { align-items: flex-start; }
.hero:not(.bare) h1.long { font-size: var(--t4); line-height: 1.06; letter-spacing: -.03em; }
.hero h1.long { font-size: var(--t4); line-height: 1.08; letter-spacing: -.03em; }
.hero .town { margin-top: 12px; font-size: var(--t1); font-weight: 500; color: var(--muted); }
.hero .town .ic { width: 16px; height: 16px; color: var(--link); }

/* no photo: a plate of the school's deep tone takes the photo's place and holds the name */
.hero.bare { display: grid; grid-template-columns: minmax(0, 1fr); min-height: clamp(200px, 56vw, 300px); background: var(--deep); align-content: end; }
.hero.bare h1 { font-size: var(--t5); }
.hero.bare h1.long { font-size: var(--t4); }
.hero.bare .hero-text { grid-column: 1; grid-row: 1; display: block; padding: 28px var(--pad) 24px; }
.hero.bare h1, .hero.bare .hero-text, .hero.bare .town, .hero.bare .town .ic { color: var(--on-deep); }
.hero.bare :focus-visible { outline-color: var(--on-deep); }

/* the floor site: one tall photo */
.hero.tall { min-height: 0; }
.hero.tall img { aspect-ratio: 1; }

/* ---------- the first screen ---------- */
.first { padding: 14px var(--pad) 4px; }
.hero + .first { padding-top: 20px; padding-bottom: 28px; }
/* the status: a square field, a square marker, no pill */
.status { min-height: 48px; padding: 8px 14px; border-radius: var(--r); font-size: var(--t2); font-weight: 620; letter-spacing: -.01em; display: grid; grid-template-columns: 8px minmax(0, 1fr); column-gap: 12px; row-gap: 0; align-items: baseline; }
.status::before { width: 8px; height: 8px; border-radius: 0; transform: translateY(-.1em); }
.status span, .first .status span { grid-column: 2; margin-left: 0; justify-self: start; font-weight: 450; }
.lines { margin-top: 10px; font-size: var(--t2); line-height: 1.45; }
.acts { margin-top: 12px; gap: 8px; }
.btn { min-height: 52px; border-radius: var(--r); font-weight: 620; font-size: var(--t2); letter-spacing: -.01em; padding: 0 18px; }
/* the main button's edge is the link colour, which passes 4.5:1 on white for any school
   colour (a yellow school's --edge passes 3:1 only just) */
.btn.main { box-shadow: inset 0 0 0 1.5px var(--link); }
.btn.alt { box-shadow: inset 0 0 0 1.5px var(--link); }
.btn .ic { width: 19px; height: 19px; }
.share { justify-content: flex-start; font-size: var(--t1); font-weight: 560; min-height: 44px; }
.next { margin-top: 8px; padding: 16px 0 4px; border: 0; border-top: 1px solid var(--line); border-radius: 0; }

/* dates: the day large, the month small in the school colour; no box */
.date { grid-template-columns: 3rem 1fr; gap: 16px; align-items: start; }
.tile { width: 3rem; min-height: 0; padding: 0; background: none; border-radius: 0; place-items: start; color: var(--ink); }
.tile small { order: 0; font-size: var(--t1); font-weight: 620; color: var(--link); }
.tile b { font-size: 2.25rem; font-weight: 560; letter-spacing: -.05em; margin-top: 2px; line-height: .9; }
.date h3, .date h2 { font-size: var(--t3); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.date p { font-size: var(--t1); }

/* ---------- blocks: white, parted by space ---------- */
.block, .block.band, .block.band-wide { margin-inline: var(--pad); padding: var(--space) 0; background: none; }
.opening + .block, main > .page-head + .first + .block { padding-top: 32px; }
main > .page-head + .block { padding-top: 32px; }
.block h2 { font-size: var(--t4); font-weight: 600; letter-spacing: -.035em; }
.block h2 + * { margin-top: 16px; }
.lede { font-size: var(--t3); line-height: 1.5; letter-spacing: -.015em; max-width: 31em; font-weight: 420; }
.prose, .block .text, .block > p:not(.lede):not(.note), .note { max-width: 34em; }
.more { font-weight: 600; font-size: var(--t1); }
.head2 a { font-size: var(--t1); }

.facts { border-top: 0; margin-top: 24px; grid-template-columns: 1fr 1fr; gap: 20px var(--gap); }
.facts div, .facts div:nth-child(odd), .facts div:nth-child(even) { padding: 12px 0 0; border: 0; border-top: 1px solid var(--ink); }
.facts b { font-size: var(--t4); font-weight: 560; letter-spacing: -.04em; }
.facts span { font-size: var(--t1); }

.dates li { padding: 18px 0; }
.dates li:last-child { border-bottom: 0; }
.dates li:first-child { border-top: 0; padding-top: 0; }

.letter { padding: 0; border: 0; border-radius: 0; background: none; grid-template-columns: 76px 1fr; gap: 20px; }
.letter svg { width: 76px; height: 100px; border-radius: 0; box-shadow: 0 0 0 1px var(--line); }
.block .letter h2 { font-size: var(--t3); }
.letter p { font-size: var(--t1); }
.letter span { font-weight: 600; }

/* ---------- the wall: the photos hang on the school's colour, edge to edge ---------- */
.block:has(> .photos, > .gallery) { margin-inline: 0; padding-inline: var(--pad); background: var(--wall); }
.block:has(> .photos, > .gallery) + .block { background: none; }
.block:has(> .photos, > .gallery) a:not(.btn) { color: var(--ink); text-decoration-color: var(--link); }
.block:has(> .photos, > .gallery) .btn.alt { background: #fff; }

/* the home photos: a composed gallery, not a grid of squares */
.photos { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; border-radius: 0; overflow: visible; margin-top: 20px; }
.photos img, .photos .wide { width: 100%; height: 100%; aspect-ratio: auto; grid-row: auto; object-fit: cover; }
.photos img:nth-child(1) { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
.photos img:nth-child(2) { grid-column: 1 / 4; aspect-ratio: 4 / 5; }
.photos img:nth-child(3) { grid-column: 4 / -1; aspect-ratio: 4 / 5; }
.photos img:nth-child(4) { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.photos img:nth-child(5) { grid-column: 1 / 3; aspect-ratio: 2 / 3; }
.photos img:nth-child(6) { grid-column: 3 / -1; aspect-ratio: auto; }
.photos img:nth-child(2):last-child, .photos img:nth-child(5):last-child { grid-column: 1 / -1; aspect-ratio: 3 / 2; }
.photos.two img { grid-column: auto; aspect-ratio: 3 / 4; }
.photos.two { grid-template-columns: 1fr 1fr; }

.gallery { gap: 20px 8px; }
.gallery img { border-radius: 0; }
.gallery figcaption { font-size: var(--t1); color: var(--ink); }
/* composed: the first photo and an even last photo run across */
/* second#DES-78: only the gallery itself; the photos behind Show more photos continue its
   rows, so they do not start the pattern again. Their odd last photo runs across. */
.block > .gallery > figure:first-child:not(:last-child), .block > .gallery > figure:last-child:nth-child(even) { grid-column: 1 / -1; }
.block > .gallery > figure:first-child:not(:last-child) img { aspect-ratio: 3 / 2; }
.more-photos .gallery > figure:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* ---------- lists and tables ---------- */
.table, .list { border-top: 1px solid var(--line); }
.table dt { font-weight: 400; }
.table dd { font-size: var(--t3); font-weight: 600; letter-spacing: -.02em; }
.table dd small { font-size: var(--t1); }
.table.plain dd { font-size: var(--t2); font-weight: 450; letter-spacing: 0; }
.list li { font-weight: 560; }
.steps li { grid-template-columns: 2.25rem 1fr; padding: 14px 0; }
.steps li::before { width: auto; min-height: 0; place-items: start; background: none; box-shadow: none; color: var(--link); font-size: var(--t3); font-weight: 620; letter-spacing: -.02em; line-height: 1.3; }
.items li { grid-template-columns: 44px 1fr; }
.items li:last-child, .steps li:last-child { border-bottom: 0; }
.items .mark { width: 44px; height: 44px; border-radius: var(--r); }
.items .mark .ic { width: 22px; height: 22px; }
.items h3 { font-size: var(--t3); }
.items p.sub { font-size: var(--t1); }
.doc .cover { border-radius: 0; box-shadow: 0 0 0 1px var(--line); }
.doc small { font-size: var(--t1); }
.byline b { font-size: var(--t3); }
.welcome { border-left: 0; padding-left: 0; max-width: 34em; }
.welcome p { font-size: var(--t3); line-height: 1.5; letter-spacing: -.012em; }
.note { font-size: var(--t1); }

/* ---------- inner page title: with no photo, on the deep plate Home uses ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; min-height: clamp(160px, 40vw, 220px); padding: 36px var(--pad) 24px; background: var(--deep); border-bottom: 0; }
.page-head h1 { font-size: var(--t6); font-weight: 650; letter-spacing: -.045em; line-height: .98; color: var(--on-deep); }
/* second#DES-70: the tight tracking would close the gap between words */
.page-head h1, .hero h1 { word-spacing: .08em; }
main > .page-head + .first { padding-top: 24px; }
/* with a photo, the page opens on it as Home does: the photo edge to edge, the title
   under it on white */
.page-head:has(> .head-photo) { display: block; min-height: 0; padding: 0; background: none; }
.page-head:has(> .head-photo) h1 { color: var(--ink); }
.page-head > .head-photo { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.page-head:has(> .head-photo) h1 { padding: 24px var(--pad) 0; }

.visit address { font-size: var(--t3); line-height: 1.4; letter-spacing: -.015em; }
.visit .hours { font-size: var(--t1); }
.rows a { font-weight: 560; }
.rows a small { font-size: var(--t1); }

/* ---------- footer: the deep tone, edge to edge ---------- */
.foot { padding: 40px var(--pad) 32px; }
.foot .who b { font-size: var(--t4); font-weight: 600; letter-spacing: -.035em; }
/* the pages: a small plain list under the name, so it never reads as a second header */
.foot nav { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: 10px; border-top: 0; }
.foot nav a { min-height: 44px; border-bottom: 0; font-weight: 400; font-size: var(--t1); }
.foot nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.foot nav a[aria-current="page"] { text-decoration: none; }
.foot .small, .foot details { font-size: var(--t1); }

/* phone, home: the name stands large right under the header, so the header keeps only
   the logo; the name is clipped to 1 px and still read aloud */
@media (max-width: 959px) {
  body:has(> main > .opening) .top .home:has(> .logo) .name { position: absolute; left: 0; top: 0; width: 1px; height: 1px; font-size: 1px; line-height: 1; clip-path: inset(50%); white-space: nowrap; }
  body:has(> main > .opening) .top .home:has(> .logo) { min-width: 44px; }
  body:has(> main > .opening) .top .logo { max-width: 70vw; }
}
/* an odd number of facts never leaves the last alone on a row: one fact a row, its note
   beside it, on a phone; three across from 600px */
@media (max-width: 599px) {
  .facts:has(> :last-child:nth-child(odd)) { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .facts:has(> :last-child:nth-child(odd)) div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; column-gap: 16px; }
  .facts:has(> :last-child:nth-child(odd)) span { margin-top: 0; }
}
@media (min-width: 600px) and (max-width: 959px) {
  .facts:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .facts:has(> :nth-child(3):last-child) div:last-child { grid-column: auto; }
}

/* ---------- desktop: one 12-column grid ---------- */
@media (min-width: 960px) {
  :root { --pad: 40px; --side: max(var(--pad), calc((100% - 1200px) / 2)); --gap: 24px; --space: 64px;
    --t1: 1rem; --t2: 1.125rem; --t3: 1.375rem; --t4: 2.25rem; --t5: 4rem; --t6: 5rem;
  }
  .top { min-height: 80px; padding: 10px var(--side); }
  .top .name { font-size: 1.1875rem; }
  .top .name.long { font-size: 1.0625rem; }
  .top-links { gap: 4px; }
  .top-links a { padding: 0 12px; font-size: 1rem; font-weight: 520; color: var(--muted); }
  .top-links a:hover { color: var(--ink); }
  .top-links a[aria-current="page"] { color: var(--ink); }
  .top-links a[aria-current="page"]::after { left: 12px; right: 12px; bottom: 4px; height: 2px; border-radius: 0; background: var(--link); }

  /* the opening on the 12-column grid. Columns 1-4: the name and town, then the first
     screen. Columns 5-12: the photo, from the top of the opening to its
     foot, running off the right of the screen. The hero is a
     subgrid, so its photo and name sit on the opening's own tracks. The type holds either way: */
  /* the name shrinks with its four columns, so a long word never breaks */
  .hero:not(.bare) h1 { font-size: clamp(2.25rem, 4.5vw, 3.25rem); letter-spacing: -.04em; line-height: 1; }
  .hero:not(.bare) h1.long { font-size: 2.25rem; letter-spacing: -.035em; line-height: 1.05; }
  .hero:not(.bare) .town { margin: 16px 0 0; font-size: 1.0625rem; }
  /* a one-page site: the opening fills the page down to the footer, so the photo does too */
  main:has(> .opening:only-child) { display: flex; flex-direction: column; }
  main > .opening:only-child { flex: 1 0 auto; }
  /* without subgrid the opening stays stacked: the photo across the page, then the name
     and the first screen on the grid's edge */
  @supports not (grid-template-columns: subgrid) {
    .hero:not(.bare) > img { height: clamp(360px, 60vh, 620px); aspect-ratio: auto; }
    .hero:not(.bare) > .hero-text { padding: 40px var(--side) 0; }
  }
  @supports (grid-template-columns: subgrid) {
    .opening:has(> .hero:not(.bare)) { display: grid; column-gap: var(--gap); grid-template-rows: auto 1fr;
      grid-template-columns: [full-start] calc(var(--side) - var(--gap)) [grid-start] repeat(12, minmax(0, 1fr)) [grid-end] calc(var(--side) - var(--gap)) [full-end]; }
    .opening > .hero:not(.bare) { grid-column: full-start / full-end; grid-row: 1 / 3; display: grid; grid-template-columns: subgrid; grid-template-rows: subgrid; }
    /* second#DES-47: the photo stretches over both rows and has its own floor, not a
       percentage height, which Chromium and Firefox resolve differently in a subgrid */
    .hero:not(.bare) > img { grid-column: 6 / full-end; grid-row: 1 / 3; align-self: stretch; width: 100%; height: auto; aspect-ratio: auto; min-height: clamp(420px, calc(100vh - 280px), 640px); contain: size; }
    .hero:not(.bare) > .hero-text { grid-column: grid-start / 6; grid-row: 1; display: block; align-self: start; padding: 48px 0 28px; }
    .opening > .hero:not(.bare) + .first.first.first { position: relative; grid-column: grid-start / 6; grid-row: 2; display: block; padding: 0 0 56px; }
    /* the floor site's tall photo takes the row's height, not its own square */
    .hero.tall:not(.bare) > img { aspect-ratio: auto; }
    .hero:not(.bare) + .first .acts { margin-top: 16px; }
    .hero:not(.bare) + .first .share { justify-content: flex-start; margin-top: 4px; }
    .hero:not(.bare) + .first .next { margin-top: 20px; padding: 20px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  }

  /* no photo: the name on a deep plate that starts on the grid's edge and runs off the right */
  .hero.bare { grid-template-columns: var(--side) repeat(12, minmax(0, 1fr)) var(--side); column-gap: 0; grid-template-rows: 1fr; min-height: clamp(300px, 44vh, 520px); background: none; }
  .hero.bare .hero-text { grid-column: 2 / -1; grid-row: 1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); padding: 48px var(--side) 44px 48px; background: var(--deep); align-self: stretch; align-content: end; }
  .hero.bare h1 { grid-column: 1 / 11; font-size: var(--t5); letter-spacing: -.042em; line-height: .98; }
  .hero.bare h1.long { font-size: 2.875rem; letter-spacing: -.04em; line-height: 1.04; }
  .hero.bare .town { grid-column: 1 / 11; justify-self: start; margin: 16px 0 0; font-size: 1.0625rem; }

  .first, .first.touch, :is(.first:not(.touch):not(:has(> .next))) { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); padding: 28px var(--side) 56px; border-bottom: 0; }
  .first .status { grid-column: 1 / 5; }
  .first .lines { grid-column: 1 / 5; }
  .first .acts { grid-column: 5 / 9; }
  .first .share { grid-column: 5 / 9; }
  .first .next { grid-column: 9 / 13; grid-row: 1 / span 2; margin-top: 0; padding: 0 0 0 24px; border-top: 0; border-left: 1px solid var(--line); }
  .first:not(:has(> .next)) .acts { grid-column: 5 / 10; }
  .first:not(:has(> .next)) .share { grid-column: 5 / 10; }
  /* Contact: the buttons, then the rows, in the content columns under the photo */
  .first.touch .acts { grid-column: 5 / 10; grid-row: 1; }
  .first.touch .share { grid-column: 5 / 10; grid-row: 2; justify-self: start; }
  .first.touch .rows { grid-column: 5 / 13; grid-row: 3; }
  .opening + .block, main > .page-head + .block, main > .page-head + .first + .block { padding-top: var(--space); }

  /* every block: heading in columns 1-4, content in 5-12 */
  .block, .block.band, .block.band-wide, .pair > .block { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-content: start; margin-inline: var(--side); padding: var(--space) 0; }
  .block > *, .block.intro > *, .block.visit > * { grid-column: 5 / -1; }
  .block.block.block > h2 { grid-column: 1 / 5; grid-row: 1 / span 30; align-self: start; padding-right: 24px; }
  .block > h2 + * { margin-top: 0; }
  .block:not(:has(> h2)) > * { grid-column: 5 / -1; }
  .block.intro.intro.intro.intro, .block.visit.visit { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: none; column-gap: var(--gap); }
  .block.intro > * { max-width: none; }
  .block.intro > .lede, .block.intro > .prose { max-width: 32em; }
  /* second#DES-69: the paragraphs under the lede are set smaller, so they keep their own measure */
  .block.intro > .prose > p:not(.lede) { max-width: 34em; }
  /* the facts sit under the words, in a row across the content columns */
  .block.intro.intro.intro > h2 { grid-row: 1 / span 6; }
  .block.intro .facts, .intro .facts { grid-column: 5 / -1; grid-row: auto; margin-top: 40px; padding-right: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px var(--gap); align-self: start; }
  .intro .facts div:last-child:nth-child(odd) { grid-column: auto; }
  .facts b { font-size: 1.75rem; }

  /* photos, galleries and lists take the whole width under their heading */
  .block:has(> .photos, > .head2, > .gallery, > .list, > .more-photos) > * { grid-column: 1 / -1; }
  .block.block.block:has(> .photos, > .head2, > .gallery, > .list, > .more-photos) > h2 { grid-column: 1 / -1; grid-row: auto; margin-bottom: 28px; }
  .head2 { align-items: baseline; margin-bottom: 28px; }

  /* the wall runs edge to edge; its content keeps the grid */
  .block.block:has(> .photos, > .gallery) { margin-inline: 0; padding-inline: var(--side); background: var(--wall); }

  /* Coming up and the newsletter: two rows of the same grid */
  .pair, .pair.band-wide { display: block; padding: 0; background: none; }
  .pair > .block:first-child { padding-bottom: 24px; }
  .pair > .block:last-child { padding-top: 0; background: none; }
  .pair > .block:last-child > .letter { grid-column: 5 / 11; }

  /* rows that grow with the screen and tiles of four columns or more, so every photo keeps
     near a camera's shape and the centre crop keeps faces: the first photo over two rows,
     two beside it, then three in a row (two with five photos, a pair of rows with four) */
  .photos { gap: var(--gap); margin-top: 0; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: clamp(220px, 22vw, 320px); }
  .photos img, .photos .wide { aspect-ratio: auto; }
  .photos img:nth-child(1) { grid-column: 1 / 8; grid-row: span 2; }
  .photos img:nth-child(2), .photos img:nth-child(3) { grid-column: 8 / 13; }
  .photos img:nth-child(4) { grid-column: 1 / 5; }
  .photos img:nth-child(5) { grid-column: 5 / 9; grid-row: span 1; }
  .photos img:nth-child(6) { grid-column: 9 / 13; }
  .photos img:nth-child(2):last-child { grid-row: span 2; }
  .photos.n5 img:nth-child(4) { grid-column: 1 / 7; }
  .photos.n5 img:nth-child(5) { grid-column: 7 / 13; }
  .photos.n4 { grid-auto-rows: clamp(300px, 30vw, 440px); }
  .photos.n4 img:nth-child(1) { grid-row: auto; }
  .photos.n4 img:nth-child(3) { grid-column: 1 / 6; }
  .photos.n4 img:nth-child(4) { grid-column: 6 / 13; }
  .photos.n1 img { grid-column: 1 / -1; grid-row: auto; height: 520px; }
  .photos.two { grid-template-columns: 7fr 5fr; grid-auto-rows: 440px; }
  .photos.two img { grid-column: auto; grid-row: auto; }

  .gallery { grid-template-columns: repeat(3, 1fr); gap: 32px var(--gap); }
  /* composed: the first photo takes two columns and two rows */
  .block > .gallery > figure:last-child:nth-child(even), .more-photos .gallery > figure:last-child:nth-child(odd) { grid-column: auto; }
  .block > .gallery > figure:first-child:nth-last-child(n+3) { grid-column: span 2; grid-row: span 2; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
  .block > .gallery > figure:first-child:nth-last-child(n+3) img { height: 100%; min-height: 0; aspect-ratio: auto; }
  .block > .gallery > figure:first-child:nth-last-child(-n+2) { grid-column: auto; }
  /* second#DES-45: four photos are two rows of two with no feature; with five the first runs
     over two cells of the first row */
  .block > .gallery:has(> figure:nth-child(4):last-child) > figure:first-child { grid-column: auto; grid-row: auto; display: block; }
  .block > .gallery:has(> figure:nth-child(5):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .block > .gallery:has(> figure:nth-child(5):last-child) > figure:first-child { grid-column: span 2; grid-row: auto; display: block; }
  .block > .gallery:has(> figure:nth-child(4):last-child) > figure:first-child img { height: auto; aspect-ratio: 4 / 3; }
  .block > .gallery:has(> figure:nth-child(5):last-child) > figure:first-child img { height: auto; aspect-ratio: 8 / 3; }

  /* a block without a heading (About's opening): the lede across 1-9, the rest in 5-12 */
  .block.prose { max-width: none; }
  .block.prose > .lede { grid-column: 5 / -1; font-size: 1.75rem; line-height: 1.35; letter-spacing: -.025em; max-width: none; font-weight: 400; }
  .block.prose > :not(.lede) { grid-column: 5 / 12; max-width: 34em; }
  .block.prose > .lede + * { margin-top: 32px; }

  /* Visit us: the address in 5-8, the buttons in 9-12 at their own height,
     the contact rows across 5-12 so an email fits on one line */
  .block.visit.visit { grid-template-rows: auto auto auto 1fr; }
  .block.visit > address { grid-column: 5 / 9; grid-row: 1; }
  .block.visit > .map { grid-column: 5 / 9; grid-row: 2; }
  .block.visit > .hours { grid-column: 5 / 9; grid-row: 3; }
  .block.visit > .acts { grid-column: 9 / 13; grid-row: 1 / span 3; align-self: start; margin-top: 0; max-width: none; }
  .block.visit.visit > .rows { grid-column: 5 / 13; grid-row: 4; margin-top: 28px; max-width: none; }
  .block.visit:not(:has(> .acts)) > address { grid-column: 5 / 13; }
  .block.visit.visit:not(:has(> address)) > .rows { grid-row: 1; margin-top: 0; }
  /* campuses across 5-12 first; the hours and buttons under them */
  .block.visit.visit > .campuses { grid-column: 5 / 13; grid-row: 1; margin: 0 0 40px; }
  .block.visit.visit:has(> .campuses) > .hours { grid-row: 2; margin-top: 0; }
  .block.visit.visit:has(> .campuses) > .acts { grid-row: 2 / span 2; }
  .block.visit.visit:has(> .campuses) > .rows { grid-row: 4; margin-top: 40px; }
  .block.visit.visit:has(> .campuses):not(:has(> .acts)) > .rows { grid-row: 3; }

  /* inner pages share the home grid */
  main:has(> .page-head) { --side: max(var(--pad), calc((100% - 1200px) / 2)); }
  main:has(> .page-head) .block:has(> .gallery, > .list) { --side: max(var(--pad), calc((100% - 1200px) / 2)); }
  main:has(> .page-head) .block:has(> .gallery, > .list) > :not(.gallery, .list, .more-photos) { margin-inline: 0; }
  .block > .acts, .block > .rows, .block > .status, .block > .next { max-width: 560px; }
  .page-head h1 { font-size: var(--t6); }
  main > .page-head + .first.first { padding-top: var(--space); }
  .first.touch .rows { margin-top: 24px; }

  /* an inner page opens as Home does: the title in columns 1-4, its photo from column 5
     off the right of the screen (line 6 here, as the outer track counts first) */
  main > .page-head:has(> .head-photo) { display: grid; column-gap: var(--gap); padding: 0; background: none;
    grid-template-columns: [full-start] calc(var(--side) - var(--gap)) [grid-start] repeat(12, minmax(0, 1fr)) [grid-end] calc(var(--side) - var(--gap)) [full-end]; }
  /* near 16:9, so a centre crop keeps a standing person's head */
  .page-head > .head-photo { grid-column: 6 / full-end; grid-row: 1; width: 100%; height: auto; max-height: 640px; aspect-ratio: 16 / 9; }
  /* the title shrinks with its four columns, so a word as long as "Admissions" never breaks */
  .page-head:has(> .head-photo) h1 { grid-column: grid-start / 6; grid-row: 1; align-self: end; padding: 64px 24px 0 0; font-size: clamp(2.5rem, 5vw, var(--t5)); line-height: 1; }
  /* no photo: the deep plate starts on the grid's edge and runs off the right */
  main > .page-head:not(:has(> .head-photo)) { min-height: 280px; margin-left: var(--side); padding: 72px var(--side) 44px 48px; }
  .table dd { font-size: var(--t3); }

  .foot { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gap); align-items: start; padding: 56px var(--side) 40px; }
  /* the name across 1-7, the pages in a small row under it; the small print under both */
  .foot .who { grid-column: 1 / 8; grid-row: 1; }
  .foot .who b { font-size: 1.75rem; text-wrap: balance; }
  .foot nav { grid-column: 1 / -1; grid-row: 2; justify-self: start; gap: 0 28px; margin-top: 12px; }
  .foot .small, .foot details { grid-column: 1 / -1; }
  .foot .who + .small { margin-top: 24px; }
  .foot nav + .small { margin-top: 12px; }

  /* inner pages keep Home's columns: the heading in 1-4, everything else in 5-12.
     Tables, steps, documents and items flow in two columns there */
  main:has(> .page-head) .block:has(> .list) > * { grid-column: 5 / -1; }
  main:has(> .page-head) .block.block.block:has(> .list) > h2 { grid-column: 1 / 5; grid-row: 1 / span 30; margin-bottom: 0; }
  main:has(> .page-head) .block:has(> .list) > .list { grid-template-columns: repeat(2, 1fr); }
  main:has(> .page-head) .block > .table { display: grid; grid-template-columns: 1fr 1fr; column-gap: calc(2 * var(--gap)); }
  /* a table in one column keeps each label near its value */
  main:has(> .page-head) .block > :is(.table:not(:has(> :nth-child(4))), .table.plain) { grid-template-columns: 1fr; max-width: 560px; }
  main:has(> .page-head) .block > :is(.rows, .next) { max-width: none; }
  /* fees read down one column, with their note and schedule under them */
  main:has(> .page-head) #fees.block > :is(.table, .docs) { grid-template-columns: 1fr; max-width: 560px; }
  main:has(> .page-head) .block > .docs, main:has(> .page-head) .block > .items { display: grid; grid-template-columns: 1fr 1fr; column-gap: calc(2 * var(--gap)); border-top: 1px solid var(--line); }
  /* in two columns every item closes on its own rule, so the pair stays even */
  main:has(> .page-head) .items li { border-top: 0; border-bottom: 1px solid var(--line); }
  /* one item (Contact's opening hours) takes the whole column (audit-public-css) */
  main:has(> .page-head) .block > .items:has(> li:only-child) { grid-template-columns: 1fr; }
  main:has(> .page-head) .docs li:nth-child(-n+2) .doc { border-top: 0; }
  main:has(> .page-head) .docs li:last-child .doc { border-bottom: 1px solid var(--line); }
  main:has(> .page-head) .block > .steps { columns: 2; column-gap: calc(2 * var(--gap)); border-top: 1px solid var(--line); }
  main:has(> .page-head) .steps li { break-inside: avoid; max-width: none; }
  main:has(> .page-head) .steps li:first-child { border-top: 0; }
  /* Visit us on an inner page (Contact's Address): one column under the photo's edge */
  main:has(> .page-head) .block.visit.visit.visit > :not(h2) { grid-column: 5 / -1; grid-row: auto; }
  main:has(> .page-head) .block.visit.visit { grid-template-rows: none; }
  /* a closing contact block: words, buttons, then the rows */
  main:has(> .page-head) .block:has(> .acts) > .rows { margin-top: 24px; max-width: none; }
}
/* on a small laptop the four columns Home gives the buttons hold one label a line */
@media (min-width: 960px) and (max-width: 1099px) {
  .first .acts:not(.one), .block.visit > .acts:not(.one) { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
