/* ==========================================================================
   Brown's Karate - shared stylesheet
   Every page links this one file. Colors, fonts and spacing are set once in
   :root, so a change here updates the whole site.

   The school's brown is one line, --brown, in part 1. It is an accent: it
   colors only the bar under the header and the current page in the menu.
   Everything else is white, light grey and navy.

   The file has three parts:
     1. Base     - fonts, colors, spacing, text. Used by everything.
     2. Content  - everything inside <main class="content">: page heading,
                   lists, tables, photos, videos. Does not depend on part 3.
     3. Chrome   - the frame around the content: the white sheet, the header
                   with the logo, the menu and the footer. To give the site a
                   different header/menu/footer, replace part 3 only.
   ========================================================================== */


/* ==========================================================================
   1. BASE
   ========================================================================== */

/* Fonts are stored in CSS/fonts (Google Fonts, SIL Open Font License; see CSS/fonts/OFL.txt).
   Every page preloads alegreya.woff2 and source-sans-3.woff2 in its <head>, so they
   download alongside this stylesheet instead of after it. If you rename or move a
   font file, update those two <link rel="preload"> lines on every page as well. */
@font-face {
  font-family: "Alegreya";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/alegreya.woff2") format("woff2");
}
@font-face {
  font-family: "Alegreya";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/alegreya-italic.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/source-sans-3.woff2") format("woff2");
}

/* Stand-in fonts, sized to match.
   If a page is drawn before the real fonts have arrived (a first visit or a slow
   connection), the browser shows the text in a font already on the computer for a
   moment. Those fonts are a different size from Alegreya and Source Sans 3, so the
   name and text used to grow and then shrink back when the real fonts took over:
   the "flicker" on clicking a link. These rules size Times New Roman and Arial (or
   their look-alikes) to the same widths, so nothing moves. They only affect that
   moment; leave them alone. */
@font-face {
  font-family: "Alegreya stand-in";
  font-style: normal;
  font-weight: 100 599;
  src: local("Times New Roman"), local("TimesNewRomanPSMT"), local("Liberation Serif"), local("LiberationSerif"), local("Tinos");
  size-adjust: 100%;
  ascent-override: 101.6%;
  descent-override: 34.5%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Alegreya stand-in";
  font-style: normal;
  font-weight: 600 900;
  src: local("Times New Roman Bold"), local("TimesNewRomanPS-BoldMT"), local("Liberation Serif Bold"), local("LiberationSerif-Bold"), local("Tinos Bold");
  size-adjust: 95.7%;
  ascent-override: 106.2%;
  descent-override: 36.1%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Alegreya stand-in";
  font-style: italic;
  font-weight: 100 900;
  src: local("Times New Roman Italic"), local("TimesNewRomanPS-ItalicMT"), local("Liberation Serif Italic"), local("LiberationSerif-Italic"), local("Tinos Italic");
  size-adjust: 90.6%;
  ascent-override: 112.1%;
  descent-override: 38.1%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Source Sans stand-in";
  font-style: normal;
  font-weight: 100 549;
  src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("LiberationSans"), local("Arimo");
  size-adjust: 93%;
  ascent-override: 110.1%;
  descent-override: 43%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Source Sans stand-in";
  font-style: normal;
  font-weight: 550 900;
  src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("LiberationSans-Bold"), local("Arimo Bold");
  size-adjust: 90.3%;
  ascent-override: 113.4%;
  descent-override: 44.3%;
  line-gap-override: 0%;
}

:root {
  /* The school's brown. It is used in exactly two places: the bar along the
     bottom of the header and the current page in the menu. Change this one
     line to adjust both. */
  --brown: #94602f;

  --navy: #16253f;       /* headings, name, class days, panel edges */
  --navy-2: #2b3f63;     /* hover on navy, honorifics */
  --link: #1d4b84;       /* links inside text, keyboard focus ring */
  --tint: #f4f6f8;       /* light grey: menu column, panels, footer */
  --tint-2: #e8ecf1;     /* menu hover and quiet chips */
  --paper: #ffffff;      /* page and header: keep pure white for photo.jpg and icon.jpg */
  --text: #1e2530;
  --muted: #566070;
  --rule: #e1e5ea;       /* thin dividing lines */
  --rule-2: #c9d0d9;     /* stronger lines: the line joining the lineage */

  /* One spacing scale for the whole site. Every gap, margin and padding
     uses one of these steps, so things line up from page to page. */
  --sp-1: 0.25rem;   /*  4px */
  --sp-2: 0.5rem;    /*  8px */
  --sp-3: 0.75rem;   /* 12px */
  --sp-4: 1rem;      /* 16px: between paragraphs */
  --sp-5: 1.5rem;    /* 24px: between blocks, inside panels */
  --sp-6: 2rem;      /* 32px: between sections */
  --sp-7: 2.5rem;    /* 40px: page margins */

  /* One comfortable line of text (about 85 characters, like today's site).
     The page content is this wide, and the sheet is sized around it. */
  --measure: 46rem;

  --font-display: "Alegreya", "Alegreya stand-in", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Source Sans stand-in", "Segoe UI", Helvetica, Arial, sans-serif;
}

/* Text is the same size on every desktop screen. A bigger monitor shows
   more of the page; it doesn't make the page bigger. */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, iframe { max-width: 100%; }
img { height: auto; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--navy); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }

p { margin: 0 0 var(--sp-4); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 var(--sp-3);
  text-wrap: balance;   /* no lone word on a heading's last line */
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--paper); color: var(--navy); padding: 0.75rem 1rem;
  border-radius: 4px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }



/* ==========================================================================
   2. CONTENT - everything inside <main class="content">
   ========================================================================== */

.content { min-width: 0; }
.content > :last-child { margin-bottom: 0; }
/* Space between blocks comes from the block below, so a paragraph that ends
   a box, a list item or a section adds no extra gap of its own. */
.content p:last-child { margin-bottom: 0; }

/* Heading sizes: page heading 36px, section heading 24px, small heading 20px. */
.page-title { font-size: 2.25rem; line-height: 1.15; margin-bottom: var(--sp-4); }
.content h2 { font-size: 1.5rem; }
.content h3,
.content .h3 { font-size: 1.25rem; }

/* Comfortable reading width (see --measure in part 1). */
.prose { max-width: var(--measure); }

.lead {
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.45;
  color: var(--navy);
}

.section { margin-top: var(--sp-6); }
.rule-top { border-top: 1px solid var(--rule); padding-top: var(--sp-6); margin-top: var(--sp-6); }
.rule-gap { margin: var(--sp-4) 0; }
.note { color: var(--muted); margin-top: var(--sp-4); }

/* Mounted print: a thin white frame for real photographs (not for photo.jpg or icon.jpg). */
.framed {
  box-sizing: content-box;
  display: block;
  padding: 5px;
  background: var(--paper);
  border: 1px solid var(--rule);
  box-shadow: 0 1px 2px rgba(22, 37, 63, 0.08), 0 8px 18px -12px rgba(22, 37, 63, 0.4);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: var(--sp-2) var(--sp-4);
  border-radius: 6px;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.button:hover { background: var(--navy-2); color: #fff; text-decoration: none; }

.actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); margin: var(--sp-4) 0; }

/* Panel: light grey card with a navy edge, used for key facts. */
.panel {
  background: var(--tint);
  border-left: 3px solid var(--navy);
  border-radius: 0 6px 6px 0;
  padding: var(--sp-4);
}
.panel > :last-child { margin-bottom: 0; }
.panel > h2 { margin-bottom: var(--sp-2); }

/* Label / value rows (Signing up, Location). */
.facts { margin: 0; }
.facts > div {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: var(--sp-5);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--rule-2);
}
.facts > div:first-child { border-top: 0; padding-top: 0; }
.facts > div:last-child { padding-bottom: 0; }
.facts dt { font-weight: 700; color: var(--navy); }
.facts dd { margin: 0; }

.flags { display: flex; gap: var(--sp-2); align-items: center; }
.flags img { height: 50px; width: auto; border: 1px solid var(--rule); }

/* ---------- Home ---------- */

/* photo.jpg already has a tilted white print and shadow baked into the file,
   so it needs a pure white surface and no border, radius or shadow of its own.
   It is shown no larger than its real size. */
.hero {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 25rem) minmax(0, 1fr);
  gap: var(--sp-6);
  align-items: center;
}
.hero img { display: block; width: 100%; background: #fff; }
.hero figcaption { border-left: 2px solid var(--rule-2); padding-left: var(--sp-5); }
.hero h2 { font-size: 1.75rem; line-height: 1.15; margin-bottom: var(--sp-3); }
.hero__name { font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 1.25rem; color: var(--navy); margin-bottom: var(--sp-1); }
.hero__note { color: var(--muted); margin: 0; }

.glance { margin-top: var(--sp-6); border-top: 1px solid var(--rule); padding-top: var(--sp-6); }
.glance .lead { max-width: var(--measure); margin-bottom: var(--sp-5); }
/* Class Schedule, Location and Contact: one light grey panel of label / value
   rows, like "Signing up" on Class Schedule, so each value reads on one or
   two full lines instead of wrapping in a narrow box. */
.glance__grid {
  margin: 0;
  background: var(--tint);
  border-left: 3px solid var(--navy);
  border-radius: 0 6px 6px 0;
  padding: var(--sp-4) var(--sp-5);
}
.glance__grid > div {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: var(--sp-5);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--rule-2);
}
.glance__grid > div:first-child { border-top: 0; padding-top: 0; }
.glance__grid > div:last-child { padding-bottom: 0; }
.glance__grid dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.35;
  color: var(--navy);
  padding-top: 0.1rem;
}
.glance__grid dt a { color: inherit; text-decoration: none; }
.glance__grid dt a::after { content: " \203A"; }
.glance__grid dt a:hover { color: var(--link); text-decoration: underline; }
.glance__grid dd { margin: 0; line-height: 1.5; }

/* ---------- Instructors ---------- */

/* Name and title run across the top. The photo starts with the biography
   and the text wraps around it, then runs the full width below it, as on
   today's site. */
.profile { display: flow-root; }
.profile + .profile { border-top: 1px solid var(--rule); margin-top: var(--sp-6); padding-top: var(--sp-6); }
/* Every photo gets the same column (Barry's 200px photo plus its frame), so
   each biography starts at the same distance from the left edge. */
.profile__photo { float: left; width: calc(200px + 12px); margin: var(--sp-1) var(--sp-6) var(--sp-3) 0; }
.profile__head { margin-bottom: var(--sp-4); }
.profile__head h2 { margin-bottom: var(--sp-1); }
.profile__role { margin: 0; color: var(--muted); font-weight: 600; letter-spacing: 0.01em; }
.honorific { font-family: var(--font-display); font-style: italic; font-weight: 500; font-size: 1.125rem; color: var(--navy-2); margin-left: 0.35rem; }

/* ---------- Program ---------- */

.areas { margin: var(--sp-4) 0; border-top: 1px solid var(--rule); }
.areas > div {
  display: grid;
  /* Wide enough for "Fighting techniques" on one line; the text column keeps
     its round-5 width so Program still fits on one screen. */
  grid-template-columns: 9.5rem minmax(0, 1fr);
  gap: var(--sp-4);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--rule);
}
.areas dt { font-family: var(--font-display); font-weight: 700; font-size: 1.125rem; line-height: 1.35; color: var(--navy); padding-top: 0.1rem; }
.areas dd { margin: 0; }

/* ---------- Class schedule ---------- */

.week {
  list-style: none;
  margin: var(--sp-4) 0 var(--sp-5);
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}
.week li {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 4.5rem;
  padding: var(--sp-2) var(--sp-1);
  border-radius: 6px;
  text-align: center;
  line-height: 1.2;
}
.week__day { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; text-decoration: none; }
.week__status { font-size: 0.8125rem; margin-top: var(--sp-1); }
.week .is-class { background: var(--navy); color: #fff; }
.week .is-class .week__status { color: #c9d3e3; }
.week .is-off { background: var(--tint); color: var(--muted); box-shadow: inset 0 0 0 1px var(--rule); }

/* ---------- Location ---------- */

/* The photo of the sign sits beside the opening sentence; the address
   panel runs the full width below them, matching Class Schedule. */
.location {
  display: grid;
  grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  gap: var(--sp-5) var(--sp-6);
  align-items: center;
}
.location > div { display: contents; }
.location figure { margin: 0; grid-column: 1; grid-row: 1; }
.location .lead { margin: 0; grid-column: 2; grid-row: 1; }
.location .panel { grid-column: 1 / -1; grid-row: 2; }
.location img { width: 100%; box-sizing: border-box; }

/* Wide and a little short on desktop, so the whole map shows on the first
   screen of a big monitor; 16:9 on phones. */
.map {
  margin: var(--sp-4) 0 0;
  aspect-ratio: 2 / 1;
  background: var(--tint-2);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
}
.map iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ---------- News and events ---------- */

.exam-index { margin: 0 0 var(--sp-6); }
.exam-index ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.exam-index a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: var(--sp-1) var(--sp-3);
  border-radius: 999px;
  background: var(--tint);
  box-shadow: inset 0 0 0 1px var(--rule);
  color: var(--navy);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
}
.exam-index a:hover { background: var(--tint-2); }

.exam { scroll-margin-top: var(--sp-5); }
.exam + .exam { border-top: 1px solid var(--rule); margin-top: var(--sp-6); padding-top: var(--sp-6); }
.exam > p { max-width: var(--measure); }
.exam .videos-intro { margin: var(--sp-5) 0 0; color: var(--muted); }
.exam--latest {
  background: var(--tint);
  border-left: 3px solid var(--navy);
  border-radius: 0 6px 6px 0;
  padding: var(--sp-5);
}
.exam--latest + .exam { border-top: 0; padding-top: 0; }

.promotions {
  list-style: none;
  margin: 0 0 var(--sp-5);
  padding: 0;
  columns: 2 15rem;
  column-gap: var(--sp-7);
  max-width: var(--measure);
}
.promotions li {
  break-inside: avoid;
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--rule);
}
.promotions strong { font-weight: 600; color: var(--navy); }
.promotions span { color: var(--muted); font-weight: 600; white-space: nowrap; }
.promotions + .videos-intro { margin-top: 0; }

.videos { display: grid; gap: var(--sp-4); grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: var(--sp-4); }
/* An odd video out is centered under the pair above it; a single video stays a comfortable size. */
.videos > :last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - var(--sp-4) / 2); }
.videos > :first-child:last-child { justify-self: start; width: 100%; max-width: var(--measure); }

.video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--navy);
  border-radius: 6px;
  overflow: hidden;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Vertical YouTube Shorts (9:16). */
.videos--shorts { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: var(--sp-5); }
.videos--shorts > :last-child:nth-child(odd) { grid-column: auto; width: auto; }
.videos--shorts .video { aspect-ratio: 9 / 16; }

/* ---------- School lineage ---------- */

.lineage { list-style: none; margin: 0; padding: 0; }
.lineage > li {
  position: relative;
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  grid-template-areas: "photo head" "photo text";
  grid-template-rows: auto 1fr;
  column-gap: var(--sp-6);
  padding-bottom: var(--sp-6);
}
/* A line joining each generation. */
.lineage > li::before {
  content: "";
  position: absolute;
  left: 4rem;
  top: var(--sp-2);
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--rule-2);
}
.lineage > li:last-child { padding-bottom: 0; }
.lineage > li:last-child::before { display: none; }
.lineage__photo { grid-area: photo; position: relative; justify-self: center; align-self: start; }
.lineage__head { grid-area: head; margin-bottom: var(--sp-4); }
.lineage__text { grid-area: text; }
.lineage__photo .framed { margin: 0 auto; }
.lineage__meta {
  display: inline-block;
  margin: 0 0 var(--sp-3);
  padding: 0.125rem var(--sp-3);
  border-radius: 999px;
  background: var(--tint);
  box-shadow: inset 0 0 0 1px var(--rule);
  color: var(--navy);
  font-size: 0.9375rem;
  font-weight: 600;
}
.lineage h2 { margin-bottom: var(--sp-2); }
.nowrap { white-space: nowrap; }

.see-also {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4) var(--sp-6);
}
.see-also p { margin: 0; }

/* ---------- Links ---------- */

.association { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4) var(--sp-6); }
.association p { margin: 0; flex: 1 1 20rem; }

.promotion {
  display: grid;
  grid-template-columns: 222px minmax(0, 1fr);
  column-gap: var(--sp-6);
  align-items: start;
}
.promotion + .promotion { border-top: 1px solid var(--rule); margin-top: var(--sp-6); padding-top: var(--sp-6); }
.promotion figure { margin: 0; }
.promotion h2 { margin-bottom: var(--sp-2); }

/* ---------- Hall of fame ---------- */

.honor__text { font-family: var(--font-display); font-size: 1.25rem; line-height: 1.5; color: var(--navy); max-width: var(--measure); }
/* Column widths follow each photo's shape, so the three photos line up at one height
   without being stretched past their real size. */
.gallery { display: grid; grid-template-columns: 4fr 4.5fr 4.5fr; gap: var(--sp-4); margin-top: var(--sp-6); align-items: start; max-width: 60rem; }
.gallery figure { margin: 0; }
.gallery .framed { box-sizing: border-box; width: 100%; }

/* ---------- Content on narrower screens ---------- */

@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; gap: var(--sp-5); }
  .hero img { max-width: 25rem; }
  .hero figcaption { border-left: 0; padding-left: 0; }
  .videos--shorts { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 36rem; }
}

@media (max-width: 860px) {
  .page-title { font-size: 2rem; margin-bottom: var(--sp-4); }
  .content h2 { font-size: 1.375rem; }
  .hero h2 { font-size: 1.5rem; }

  .glance { margin-top: var(--sp-5); padding-top: var(--sp-5); }

  /* Phones: a small photo beside the name, the biography below. */
  .profile {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "photo head" "bio bio";
    column-gap: var(--sp-4);
    align-items: center;
  }
  .profile__photo { grid-area: photo; float: none; width: auto; margin: 0; }
  .profile__photo img { max-width: 104px; }
  .profile__head { grid-area: head; margin-bottom: 0; }
  .profile__bio { grid-area: bio; margin-top: var(--sp-4); }
  .honorific { display: block; margin-left: 0; }

  .areas > div,
  .glance__grid > div { grid-template-columns: minmax(0, 1fr); gap: var(--sp-1); }
  .glance__grid { padding: var(--sp-4); }

  .week { gap: 4px; }
  .week li { min-height: 4.25rem; padding: 0.4rem 0; }
  .week__day { font-size: 1rem; }
  .week__status { font-size: 0.6875rem; }

  .facts > div { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }
  .map { aspect-ratio: 16 / 9; }

  .location { grid-template-columns: minmax(0, 1fr); }
  .location .lead { grid-column: 1; grid-row: 1; }
  .location .panel { grid-column: 1; grid-row: 2; }
  .location figure { grid-column: 1; grid-row: 3; max-width: 30rem; }
  .panel { padding: var(--sp-4); }

  .exam--latest { padding: var(--sp-4); }
  .promotions { columns: 1; }
  .videos { grid-template-columns: minmax(0, 1fr); }
  .videos > :last-child:nth-child(odd) { width: 100%; }
  .exam-index ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
  .exam-index a { display: flex; justify-content: center; min-height: 2.75rem; padding: var(--sp-1); border-radius: 6px; font-size: 0.9375rem; white-space: nowrap; }
  .videos--shorts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }

  .lineage > li {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "photo head" "text text";
    column-gap: var(--sp-4);
  }
  .lineage > li::before { left: 2.75rem; top: var(--sp-2); }
  .lineage__photo { grid-area: photo; justify-self: start; width: 5.5rem; }
  .lineage__photo .framed { max-width: 76px; }
  .lineage__head { grid-area: head; align-self: center; margin-bottom: 0; }
  .lineage__text { grid-area: text; margin-top: var(--sp-4); padding-left: 4.25rem; }

  .promotion { grid-template-columns: minmax(0, 1fr); row-gap: var(--sp-4); }
  .promotion figure { max-width: 222px; }

  .gallery { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .gallery figure { width: 100%; max-width: 312px; }
}


/* ==========================================================================
   3. CHROME - the white sheet, header with logo, menu and footer
   One white sheet on a light grey page, about as wide as today's site.
   The header is white with the logo and name on the left and the phone and
   address on the right; a brown bar runs along its bottom edge. The menu
   column and the footer are light grey, and the current page is marked in
   brown. Nothing runs behind the sheet. Colors come from part 1.
   ========================================================================== */

:root {
  --backdrop: #eceff3;   /* around the sheet on wide screens */
  --menu: 12.5rem;       /* menu column on desktop */
  --pad: 2.5rem;         /* space either side of the page content */
  --inset: 1.5rem;       /* left edge shared by the logo, menu words and footer name */
  --bar: 6px;            /* the brown bar under the header */
}

/* Keep room for the scrollbar on every page, so the sheet never shifts
   sideways between a short page and a long one. */
html { scrollbar-gutter: stable; }

body {
  min-height: 100vh;
  padding: var(--sp-5);
  background: var(--backdrop);
}

/* The sheet is exactly the menu, the margins and one line of text wide
   (about the width of today's site), and stays that size on bigger
   screens. */
.sheet {
  max-width: calc(var(--menu) + 2 * var(--pad) + var(--measure));
  margin: 0 auto;
  background: var(--paper);
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(22, 37, 63, 0.07), 0 24px 48px -28px rgba(22, 37, 63, 0.35);
}

/* ---------- Header: logo, name, phone ---------- */

.site-header {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-2) var(--pad) var(--sp-2) var(--inset);
  background: var(--paper);
  border-bottom: var(--bar) solid var(--brown);
  border-radius: 10px 10px 0 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  margin-right: auto;
  color: var(--navy);
  text-decoration: none;
}
.brand:hover { color: var(--navy); }
.brand__logo { display: block; width: auto; height: 4.75rem; }
.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.5rem;
  line-height: 1;
  letter-spacing: 0.005em;
}

.header-contact { text-align: right; line-height: 1.35; color: var(--muted); font-size: 0.9375rem; }
.header-contact p { margin: 0; }
.header-contact .phone {
  display: inline-block;
  color: var(--navy);
  font-weight: 700;
  font-size: 1.375rem;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.header-contact .phone:hover { color: var(--link); text-decoration: underline; }
.header-contact__address { margin-top: 0.125rem; }

.menu-toggle { display: none; }

/* ---------- Menu column + page area ---------- */

.sheet__body {
  display: grid;
  grid-template-columns: var(--menu) minmax(0, 1fr);
}

.sidebar {
  background: var(--tint);
  border-right: 1px solid var(--rule);
}
/* The menu starts level with the page heading beside it. */
.sidebar__inner { position: sticky; top: 0; padding: var(--sp-6) var(--sp-3); }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }

.site-nav a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: var(--sp-2) var(--sp-3);
  border-radius: 6px;
  color: var(--text);
  font-weight: 600;
  font-size: 1.0625rem;
  line-height: 1.25;
  text-decoration: none;
}
.site-nav a:hover { background: var(--tint-2); color: var(--navy); }
/* The current page, in the school's brown. */
.site-nav a[aria-current="page"],
.site-nav a[aria-current="page"]:hover {
  background: var(--brown);
  color: #fff;
  font-weight: 700;
}

.sheet .content { padding: var(--sp-6) var(--pad); }

/* ---------- Footer ---------- */

/* One quiet, centered line of small grey text, like a return address:
   name · address · phone · email. The name is the same size and weight as
   the rest, so it reads as a signature, not a second header. The dots are
   drawn here, not written in the page, and screen readers skip them. */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  padding: var(--sp-4) var(--pad);
  background: var(--paper);
  border-top: 1px solid var(--rule);
  border-radius: 0 0 10px 10px;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.5;
  text-align: center;
}
.site-footer > * { margin: 0; white-space: nowrap; }
.site-footer > * + *::before {
  content: "\00B7" / "";
  display: inline-block;
  margin: 0 var(--sp-3);
  color: var(--muted);
}
.site-footer__name { font: inherit; color: inherit; }
/* Address, phone and email are links, kept quiet: grey text with a faint underline. */
.site-footer a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule-2);
  text-underline-offset: 0.2em;
}
.site-footer a:hover { color: var(--link); text-decoration-color: currentColor; }

/* ---------- Chrome on narrower screens ---------- */

@media (max-width: 1100px) {
  :root { --pad: 2rem; --menu: 12rem; }
  body { padding: var(--sp-4); }
  .brand__name { font-size: 2.25rem; }
  .brand__logo { height: 4.25rem; }
}

/* Phones and small tablets: one column, the menu folds behind a Menu button. */
@media (max-width: 860px) {
  :root { --pad: 1.25rem; --inset: 1.25rem; --bar: 4px; }

  body { padding: 0; background: var(--paper); }
  .sheet { border-radius: 0; box-shadow: none; }

  .site-header { padding: var(--sp-2) var(--pad); gap: var(--sp-3); border-radius: 0; }
  .brand { gap: var(--sp-3); min-width: 0; }
  .brand__logo { height: 3.5rem; }
  .brand__name { font-size: 1.75rem; }
  .header-contact { display: none; }

  .js .menu-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    flex: none;
    min-height: 2.75rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--navy);
    border-radius: 6px;
    background: var(--paper);
    color: var(--navy);
    font: 600 1rem/1 var(--font-body);
    cursor: pointer;
  }
  .js .menu-toggle:hover { background: var(--tint); }
  .js .menu-toggle[aria-expanded="true"] { background: var(--navy); color: #fff; }

  .menu-toggle__icon,
  .menu-toggle__icon::before,
  .menu-toggle__icon::after {
    display: block;
    width: 18px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.2s ease, background-color 0.2s ease;
  }
  .menu-toggle__icon { position: relative; }
  .menu-toggle__icon::before,
  .menu-toggle__icon::after { content: ""; position: absolute; left: 0; }
  .menu-toggle__icon::before { top: -6px; }
  .menu-toggle__icon::after { top: 6px; }
  .menu-toggle[aria-expanded="true"] .menu-toggle__icon { background: transparent; }
  .menu-toggle[aria-expanded="true"] .menu-toggle__icon::before { transform: translateY(6px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-toggle__icon::after { transform: translateY(-6px) rotate(-45deg); }

  .sheet__body { display: block; }

  .sidebar { border-right: 0; border-bottom: 1px solid var(--rule); }
  .sidebar__inner { position: static; padding: 0; }
  .site-nav ul { padding: var(--sp-2) var(--sp-2); }
  .site-nav a { min-height: 3rem; padding-left: calc(var(--pad) - var(--sp-2)); }

  /* Closed menu takes no space; opening it slides the list down. */
  .js .sidebar { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.25s ease; }
  .js .sidebar__inner { overflow: hidden; min-height: 0; visibility: hidden; transition: visibility 0s linear 0.25s; }
  .js .sidebar:not(.is-open) { border-bottom-color: transparent; }
  .js .sidebar.is-open { grid-template-rows: 1fr; }
  .js .sidebar.is-open .sidebar__inner { visibility: visible; transition-delay: 0s; }

  .sheet .content { padding: var(--sp-5) var(--pad) var(--sp-6); }

  /* Phones: short centered lines - name / address / phone · email. */
  .site-footer { display: block; padding: var(--sp-5) var(--pad); border-radius: 0; }
  .site-footer > :nth-child(-n+2) { display: table; margin: 0 auto; white-space: normal; }
  .site-footer > :nth-child(2)::before,
  .site-footer > :nth-child(3)::before { display: none; }
  .site-footer a { display: inline-block; padding: 0.375rem 0; }
}

@media (max-width: 400px) {
  .brand__name { font-size: 1.5rem; }
  .brand__logo { height: 3.25rem; }
}

/* The narrowest phones can't fit phone and email on one line: give each its own. */
@media (max-width: 340px) {
  .site-footer a { display: table; margin: 0 auto; }
  .site-footer > * + *::before { display: none; }
}


/* ==========================================================================
   Motion and print
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
}

@media print {
  body { padding: 0; background: #fff; }
  .sheet { box-shadow: none; }
  .menu-toggle, .sidebar, .exam-index, .videos, .videos-intro { display: none; }
  .sheet__body { display: block; }
  .sheet .content { padding: 0; }
}
