/* =====================================================================
   base.css: fonts, colour and size tokens, typography, page layout.

   TO CHANGE THE LOOK: edit the values in :root below.
   Everything else uses these names, so one change updates the whole site.
   ===================================================================== */

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("../fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* colours: the school's theme is red-maroon with a gold accent */
  --brand: #8a1c2b;        /* main colour: buttons, links, title band */
  --brand-dark: #5c121d;   /* footer, hero shade */
  --brand-tint: #f7e8ea;   /* light brand background (badges) */
  --accent: #cf9a35;       /* small highlights only (underlines, bars) */
  --accent-tint: #f8ecd6;
  --al-line: #b9801a;      /* A/L line on the pass-rate chart: gold, darker so it shows on white */
  --al-text: #8a5d0a;      /* the A/L label text next to that line */
  --ink: #261e21;          /* main text */
  --ink-soft: #5b4f53;     /* secondary text */
  --line: #e4dcdd;         /* thin borders */
  --rule: #c9b3b7;         /* the line between page sections */
  --track: #e8dfe0;        /* empty part of a chart ring */
  --mist: #f7f3f2;         /* light section background */
  --paper: #ffffff;

  /* type */
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  /* shape and size */
  --radius: 10px;
  --container: 1120px;
  --header-height: 4.5rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 1rem); /* sticky header never covers a jump target */
}

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

img { display: block; max-width: 100%; height: auto; }

/* Elements with the 'hidden' attribute must stay hidden, even when a class gives them a display value */
[hidden] { display: none !important; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.6em;
  color: var(--ink);
}
h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.55rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }
a { color: var(--brand); text-underline-offset: 0.18em; }
address { font-style: normal; }

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

/* ---------- layout ---------- */
.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* Sections have SOLID backgrounds. On the Home page the hero picture stays fixed behind
   the page, and these solid sections slide up over it as you scroll. */
.section {
  position: relative;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  background: var(--paper);
}
.section--tint { background: var(--mist); }

/* A thin line between one section and the next, centred. It is 85% of the screen's width, but never
   narrower than the page content (on a tablet 85% is narrower than the content, which looked off). */
.section + .section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: max(85vw, min(100% - 2rem, var(--container)));
  height: 2px;
  transform: translateX(-50%);
  background: var(--rule);
  border-radius: 1px;
}
@media (max-width: 599px) { .section + .section::before { width: 85vw; } }

.center { text-align: center; }

/* ---------- accessibility helpers ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--brand-dark);
  color: #fff;
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

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