/* ==========================================================================
   Hibiscus International Schools — design system
   Mobile-first rebuild of the Claude Design prototype.
   Breakpoints: 640 (sm) / 900 (md) / 1120 (lg)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* ---- Foundation -----------------------------------------------------
     Navy is the structural colour: nav, headings, footer, dark panels.
     Red is reserved for primary actions. Everything else is white or the
     light grey. Accents appear only in small, controlled places. */
  --navy: #172033;
  --navy-soft: #24304A;    /* hover/secondary surfaces on navy */
  --red: #E53935;          /* brand red — fills, borders, decoration */
  --red-btn: #D32F2F;      /* button fill: white text on this is 4.98:1 */
  --red-ink: #C62828;      /* red text on white: 5.62:1 (brand red is 4.23:1, fails AA) */
  --white: #FFFFFF;
  --bg-light: #F6F8FB;
  --body: #4B5563;         /* body copy on white: 7.56:1 */

  /* ---- Accents --------------------------------------------------------
     Each has a display value (dots, bars, fills) and an `-ink` value for
     text. The display values are far too light for text on white —
     #29A8DF is 2.70:1 and #55B957 is 2.48:1 — so never use them for copy. */
  --purple: #8E44AD;  --purple-ink: #8E44AD;  /* 5.87:1, safe as-is */
  --blue: #29A8DF;    --blue-ink: #1B7FA8;    /* 4.52:1 */
  --green: #55B957;   --green-ink: #2E7D32;   /* 5.13:1 */
  --orange: #F47A35;  --orange-ink: #C05617;  /* 4.58:1 */

  /* ---- Neutrals -------------------------------------------------------- */
  --black: var(--navy);
  --ink: #374151;
  --ink-2: var(--body);
  --muted: #6B7280;
  --faint: #6B7280;
  --line: #E3E8EF;
  --line-2: #E8ECF2;
  --line-3: #EEF1F6;
  --border-strong: #CBD2DC;
  --surface: var(--bg-light);
  --hover: var(--bg-light);

  /* Type — fluid, clamped so nothing overflows a 320px phone */
  --font: 'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Poppins', var(--font);
  --t-hero:    clamp(2.25rem, 1.30rem + 4.20vw, 4.25rem);  /* 36 → 68 */
  --t-page:    clamp(2.00rem, 1.35rem + 2.90vw, 3.50rem);  /* 32 → 56 */
  --t-h2:      clamp(1.75rem, 1.30rem + 2.00vw, 2.875rem); /* 28 → 46 */
  --t-h2-sm:   clamp(1.50rem, 1.20rem + 1.35vw, 2.25rem);  /* 24 → 36 */
  --t-h3:      clamp(1.25rem, 1.10rem + 0.65vw, 1.4375rem);/* 20 → 23 */
  --t-body:    clamp(0.9375rem, 0.90rem + 0.18vw, 1.0625rem);
  --t-lead:    clamp(1.0rem, 0.94rem + 0.30vw, 1.09rem);
  --t-sm:      0.90625rem;   /* 14.5 */
  --t-xs:      0.84375rem;   /* 13.5 */
  --t-label:   0.6875rem;    /* 11 */

  /* Radii */
  --r-xl: 32px;
  --r-lg: 24px;
  --r-md: 20px;
  --r-sm: 14px;
  --r-pill: 999px;

  /* Rhythm */
  --gutter: clamp(1.25rem, 0.6rem + 2.6vw, 3rem);
  --section: clamp(3.5rem, 2.2rem + 5.2vw, 6.75rem);
  --shell: 1280px;

  --shadow-card: 0 30px 60px -30px rgba(23, 32, 51, 0.45);
  --shadow-red: 0 8px 20px -10px rgba(211, 47, 47, 0.55);
  --ease: 0.18s ease;
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

/* The header is sticky, so anchor targets need clearance or the heading
   lands underneath it. */
[id] { scroll-margin-top: 120px; }

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

body {
  margin: 0;
  background: var(--white);
  color: var(--body);          /* Open Sans, medium grey, for paragraphs */
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--t-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* Headings are Poppins and navy — never accent-coloured. */
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-head);
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.15;
  font-weight: 700;
}
h1 { font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; }
h2 { font-weight: 700; }
h3, h4 { font-weight: 600; line-height: 1.3; }
p { margin: 0; text-wrap: pretty; }
button { font: inherit; }
::selection { background: #FBD7D6; }

:focus-visible {
  outline: 3px solid var(--blue-ink);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--black); color: var(--white);
  padding: 14px 20px; border-radius: 0 0 var(--r-sm) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.shell { max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-top: var(--section); }
.section--flush { padding-top: 0; }

.stack > * + * { margin-top: 1rem; }

.grid { display: grid; gap: clamp(1rem, 0.6rem + 1.2vw, 1.375rem); }
@media (min-width: 640px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1120px) { .grid--4 { grid-template-columns: repeat(4, 1fr); } }

/* Section header: stacked on mobile, split on desktop */
.sec-head { display: grid; gap: 1.25rem; }
@media (min-width: 900px) {
  .sec-head {
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  }
  .sec-head--top { align-items: start; }
}

.eyebrow {
  font-size: 0.71875rem; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; margin: 0;
}
.label {
  font-size: var(--t-label); font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--muted);
}
.lead { font-size: var(--t-lead); line-height: 1.7; color: var(--ink-2); }
.note { font-size: 0.8125rem; color: var(--faint); }

/* Text helpers always use the -ink variants; the display values fail AA. */
.c-red { color: var(--red-ink); }
.c-green { color: var(--green-ink); }
.c-blue { color: var(--blue-ink); }
.c-purple { color: var(--purple-ink); }
.c-orange { color: var(--orange-ink); }
.c-navy { color: var(--navy); }

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
/* One primary button style only: red fill, white text. Secondary is white
   with a navy border. No third colour anywhere. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 15px 26px; border-radius: var(--r-pill);
  font-family: var(--font-head);          /* Poppins SemiBold on buttons */
  font-weight: 600; font-size: 0.96875rem; line-height: 1.2;
  border: 1.5px solid transparent; cursor: pointer;
  text-align: center; min-height: 48px;   /* touch target */
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.btn--primary { background: var(--red-btn); color: var(--white); box-shadow: var(--shadow-red); }
.btn--primary:hover { background: var(--navy); color: var(--white); }
.btn--dark { background: var(--navy); color: var(--white); }
.btn--dark:hover { background: var(--red-btn); color: var(--white); }
.btn--outline,
.btn--ink { border-color: var(--navy); color: var(--navy); background: var(--white); }
.btn--outline:hover,
.btn--ink:hover { background: var(--navy); color: var(--white); }
.btn--white { background: var(--white); color: var(--navy); }
.btn--white:hover { background: var(--navy); color: var(--white); }
.btn--ghost {
  background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.45);
  color: var(--white); backdrop-filter: blur(6px);
}
.btn--ghost:hover { background: var(--white); color: var(--black); }
.btn--block { display: flex; width: 100%; }
.btn--sm { padding: 12px 20px; font-size: var(--t-xs); min-height: 44px; }

.arrow-link {
  font-family: var(--font-head); font-weight: 600; font-size: var(--t-sm);
  display: inline-block; color: var(--navy);
}
.arrow-link:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   5. Header
   -------------------------------------------------------------------------- */
.header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.utility { border-bottom: 1px solid var(--line-3); font-size: 0.75rem; font-weight: 500; }
.utility .shell {
  min-height: 42px; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: 6px;
}
.utility a { color: var(--muted); }
.utility a:hover { color: var(--red-ink); }
.utility__group { display: flex; gap: 1.25rem; align-items: center; }
.utility__tel { color: var(--black) !important; font-weight: 600; }
@media (max-width: 639px) { .utility__group--start { display: none; } }

.masthead {
  position: relative;   /* anchor for .megamenu */
  min-height: 72px; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; padding-block: 10px;
}
@media (min-width: 900px) { .masthead { min-height: 84px; gap: 2rem; } }

.brand { flex: none; display: flex; align-items: center; }
.brand img { height: 38px; width: auto; }
@media (min-width: 900px) { .brand img { height: 44px; } }

/* Desktop nav */
.nav { display: none; }
@media (min-width: 900px) {
  .nav { display: flex; align-items: center; gap: 2px; font-weight: 600; font-size: 0.90625rem; }
}
.nav__link { font-weight: 600; color: var(--navy); padding: 10px 12px; border-radius: 10px; display: inline-flex; align-items: center; gap: 7px; }
.nav__link:hover { background: var(--hover); }
.nav__link[aria-current="page"] { background: var(--hover); }
.nav__caret { font-size: 10px; color: var(--faint); }

/* The panel is anchored to .masthead, not to the nav item, and centred in
   the shell. Anchoring it to the item pushed a 620px box past the right
   edge between 900–1100px — and because a visibility:hidden element still
   contributes to document width, that scrolled the whole page sideways
   even while the menu was closed. */
.nav__item { position: static; }
.megamenu {
  position: absolute; top: 100%; left: 50%; padding-top: 10px;
  width: min(620px, calc(100vw - 2 * var(--gutter))); z-index: 80;
  opacity: 0; visibility: hidden; transform: translate(-50%, -6px);
  transition: opacity var(--ease), transform var(--ease), visibility var(--ease);
}
.nav__item:hover .megamenu,
.nav__item:focus-within .megamenu { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.megamenu__inner {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, 0.28);
  padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
}
/* "Our schools" has three entries — one column reads better than two. */
.megamenu__inner--single { grid-template-columns: 1fr; }
.megamenu__inner--single + .megamenu__foot,
.megamenu__inner--single .megamenu__foot { grid-column: 1 / -1; }

.megamenu__link {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 12px;
}
.megamenu__link:hover { background: var(--hover); }
.megamenu__name { display: block; font-weight: 600; font-size: 0.90625rem; }
.megamenu__detail { display: block; font-weight: 400; font-size: 0.78125rem; color: var(--muted); margin-top: 2px; }
.megamenu__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.megamenu__foot {
  grid-column: 1 / -1; border-top: 1px solid var(--line-3); margin-top: 8px; padding-top: 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  font-size: 0.8125rem; color: var(--muted);
}

.masthead__cta { display: none; flex: none; gap: 12px; }
@media (min-width: 1120px) { .masthead__cta { display: flex; align-items: center; } }

/* Mobile menu toggle + drawer */
.burger {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 48px; height: 48px; padding: 12px; flex: none;
  background: transparent; border: 1px solid var(--line); border-radius: 12px; cursor: pointer;
}
.burger span {
  display: block; height: 2px; background: var(--black); border-radius: 2px;
  transition: transform var(--ease), opacity var(--ease);
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (min-width: 900px) { .burger { display: none; } }

.drawer {
  display: block; position: fixed; inset: 0; z-index: 90;
  background: var(--white); overflow-y: auto;
  padding: 1.5rem var(--gutter) 3rem;
  transform: translateX(100%); visibility: hidden;
  /* Visibility flips instantly on open so the first link is focusable
     immediately; on close it waits for the slide-out to finish. */
  transition: transform 0.25s ease, visibility 0s linear 0.25s;
}
.drawer[data-open="true"] {
  transform: none; visibility: visible;
  transition: transform 0.25s ease, visibility 0s linear 0s;
}
@media (min-width: 900px) { .drawer { display: none; } }

.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.drawer__nav { margin-top: 2rem; display: grid; }
.drawer__nav > a {
  padding: 16px 0; border-bottom: 1px solid var(--line);
  font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em;
}
.drawer__group { border-bottom: 1px solid var(--line); padding: 16px 0; }
.drawer__group > .label { margin-bottom: 10px; display: block; }
.drawer__sub { display: grid; gap: 2px; }
.drawer__sub a {
  padding: 10px 0; font-weight: 600; font-size: 0.96875rem;
  display: flex; align-items: center; gap: 10px;
}
.drawer__cta { display: grid; gap: 12px; margin-top: 2rem; }

body[data-locked="true"] { overflow: hidden; }

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------------------
   Scroll reveals.
   JS adds .reveal-init to <html> ONLY when IntersectionObserver exists and
   the visitor has not asked for reduced motion — so without JS, with an old
   browser, or with reduced motion, everything is simply visible.
   -------------------------------------------------------------------------- */
html.reveal-init .reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
html.reveal-init .reveal.is-in { opacity: 1; transform: none; }

html.reveal-init .reveal-stagger > * {
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
html.reveal-init .reveal-stagger.is-in > * { opacity: 1; transform: none; }
html.reveal-init .reveal-stagger.is-in > *:nth-child(2) { transition-delay: 0.08s; }
html.reveal-init .reveal-stagger.is-in > *:nth-child(3) { transition-delay: 0.16s; }
html.reveal-init .reveal-stagger.is-in > *:nth-child(4) { transition-delay: 0.24s; }
html.reveal-init .reveal-stagger.is-in > *:nth-child(5) { transition-delay: 0.30s; }
html.reveal-init .reveal-stagger.is-in > *:nth-child(6) { transition-delay: 0.36s; }
html.reveal-init .reveal-stagger.is-in > *:nth-child(n+7) { transition-delay: 0.42s; }

/* Staggered hero entrance: badge, headline, text, buttons arrive in turn. */
.hero__body > * { animation: rise 0.65s ease both; }
.hero__body > *:nth-child(1) { animation-delay: 0.05s; }
.hero__body > *:nth-child(2) { animation-delay: 0.15s; }
.hero__body > *:nth-child(3) { animation-delay: 0.28s; }
.hero__body > *:nth-child(4) { animation-delay: 0.40s; }

/* The green "now open" dot breathes. */
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(85, 185, 87, 0.5); }
  50% { box-shadow: 0 0 0 5px rgba(85, 185, 87, 0); }
}
.pill__dot { animation: pulse-dot 2.4s ease-in-out infinite; }

/* Arrow links nudge their arrow on hover. */
.arrow-link, .card__more { transition: transform var(--ease); }
a:hover > .card__more, .arrow-link:hover { transform: translateX(4px); }

/* Buttons lift slightly on hover and press down on click. */
.btn { transition: background var(--ease), color var(--ease), border-color var(--ease), transform var(--ease), box-shadow var(--ease); }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn--primary:hover { box-shadow: 0 12px 26px -10px rgba(211, 47, 47, 0.6); }

/* Nav links get a sliding underline. */
.nav__link { position: relative; }
.nav__link::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: 5px;
  height: 2px; background: var(--red); border-radius: 2px;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.22s ease;
}
.nav__link:hover::after, .nav__link[aria-current="page"]::after { transform: scaleX(1); }

/* Hero photo gets a slow parallax drift (JS-driven, reduced-motion gated). */
.hero__media img { will-change: transform; }

/* Soft photo zoom on card hover — pairs with the existing lift. */
.card--flat { overflow: hidden; }
.card--flat .card__media { transition: transform 0.5s ease; }
a.card--flat:hover .card__media { transform: scale(1.045); }

/* --------------------------------------------------------------------------
   Full-bleed hero (home page only)
   Photo edge-to-edge with the copy laid over it. Interior pages keep the
   light split hero below — a full-screen photo on every page gets tiring
   and pushes real content down.
   -------------------------------------------------------------------------- */
.hero-full {
  position: relative;
  min-height: clamp(500px, 84svh, 780px);
  display: flex; align-items: flex-end;
  overflow: hidden;
  isolation: isolate;              /* keeps the scrim under the copy */
}
.hero-full__img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
}
/* Scrim. Measured against the actual photo: white copy sits over roughly
   #1B2436 or darker, which is >12:1. Two layers so the top of the photo
   stays bright and only the copy area darkens. */
.hero-full::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(23,32,51,0.15) 0%, rgba(23,32,51,0.55) 45%, rgba(23,32,51,0.95) 100%),
    linear-gradient(90deg, rgba(23,32,51,0.80) 0%, rgba(23,32,51,0.35) 55%, rgba(23,32,51,0) 100%);
}
@media (max-width: 899px) {
  /* No room to dodge left on a phone, so darken the whole lower half. */
  .hero-full::after {
    background: linear-gradient(180deg, rgba(23,32,51,0.30) 0%, rgba(23,32,51,0.72) 45%, rgba(23,32,51,0.96) 100%);
  }
}
.hero-full__inner {
  width: 100%;
  padding-block: clamp(2.5rem, 1.5rem + 4vw, 4.5rem);
}
.hero-full .hero__body { max-width: 34ch; }
/* Scoped under .hero-full on purpose: .hero__title and .hero-full__title are
   both single-class selectors, so the split-hero rules further down the file
   would otherwise win on source order and paint this copy navy-on-photo. */
.hero-full .hero__title { color: var(--white); }
.hero-full .hero__text { color: rgba(255, 255, 255, 0.9); max-width: 42ch; }
.hero-full .pill {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.45);
  color: var(--white);
  backdrop-filter: blur(6px);
}

/* Intake facts sit just under the hero, overlapping it slightly on desktop
   so the two read as one unit without anything covering the photo's subject. */
.intake-bar {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  box-shadow: 0 24px 50px -34px rgba(23, 32, 51, 0.55);
  display: grid; gap: 1.25rem;
}
@media (min-width: 900px) {
  .intake-bar {
    grid-template-columns: auto 1fr auto;
    align-items: center; gap: clamp(1.5rem, 1rem + 2vw, 3rem);
    margin-top: -3.5rem; position: relative; z-index: 2;
  }
}
.intake-bar__lead .intake__date { font-size: 1.75rem; margin-top: 2px; }
.intake-bar__facts { display: grid; gap: 0.65rem; }
@media (min-width: 640px) {
  .intake-bar__facts { grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
  .intake-bar__facts .intake__row { display: block; }
  .intake-bar__facts .intake__row span { display: block; color: var(--muted); font-size: var(--t-xs); }
  .intake-bar__facts .intake__row b { display: block; margin-top: 2px; color: var(--navy); }
}

/* Light split hero: navy heading on white, photograph alongside.
   This replaces the prototype's white-text-on-dark-scrim hero, which cannot
   work with photography shot on a white background. */
.hero {
  display: grid;
  gap: clamp(1.5rem, 1rem + 2.5vw, 3rem);
  align-items: center;
  padding-block: clamp(1rem, 0.5rem + 1.5vw, 2rem);
}
@media (min-width: 900px) {
  .hero { grid-template-columns: 1.02fr 0.98fr; align-items: start; }
}

.hero__media { position: relative; display: grid; gap: 1.25rem; align-content: start; }
/* The frame clips its image, so the parallax transform can never spill over
   the card beneath it. */
.hero__frame {
  overflow: hidden; border-radius: var(--r-xl);
  border: 1px solid var(--line); background: var(--bg-light);
  aspect-ratio: 4 / 3; max-height: 460px;
}
.hero__media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.hero__body { max-width: 640px; animation: rise 0.7s ease both; }
.hero__title {
  font-size: var(--t-hero);
  font-weight: 800;              /* Poppins ExtraBold */
  color: var(--navy);
  margin-top: 1.25rem;
}
.hero__text {
  color: var(--body); font-size: var(--t-lead); line-height: 1.7;
  max-width: 46ch; margin-top: 1.25rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2rem; }

/* Small accent label — one of the few sanctioned uses of a logo colour. */
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-radius: var(--r-pill);
  background: var(--bg-light); border: 1px solid var(--line);
  color: var(--navy); font-size: 0.78125rem; font-weight: 600;
}
.pill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }
.pill--solid { border: 0; color: var(--white); }

/* Intake card — under the image on desktop, stacked on mobile */
.intake {
  background: var(--white); border: 1px solid var(--line);
  border-radius: 22px; padding: 24px 26px;
  box-shadow: 0 18px 40px -32px rgba(23, 32, 51, 0.5);
}
.intake__date { font-weight: 800; font-size: 2rem; line-height: 1.08; letter-spacing: -0.02em; margin-top: 10px; }
.intake__rule { height: 1px; background: var(--line); margin: 18px 0; }
.intake__rows { display: grid; gap: 10px; font-size: var(--t-xs); color: var(--ink); }
.intake__row { display: flex; justify-content: space-between; gap: 1rem; }
.intake__row b { font-weight: 600; }

/* --------------------------------------------------------------------------
   7. Stat strip
   -------------------------------------------------------------------------- */
.stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: 18px; overflow: hidden; margin-top: 26px;
}
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--white); padding: 22px 24px; }
.stat__num { font-weight: 800; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.125rem); letter-spacing: -0.02em; }
.stat__label { font-size: var(--t-sm); color: var(--muted); margin-top: 5px; }

/* --------------------------------------------------------------------------
   8. Cards
   -------------------------------------------------------------------------- */
.card {
  /* Set explicitly: cards nest inside dark panels, where inheriting the
     panel's white text made the card's own copy invisible. */
  color: var(--body);
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 26px;
  transition: border-color var(--ease), box-shadow var(--ease), transform var(--ease);
}
.card--flat { padding: 0; overflow: hidden; }
.card--surface { background: var(--surface); border-color: var(--line-2); }
.card--top { border-top: 4px solid var(--line); }
a.card:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -28px rgba(0,0,0,0.4); }
.card__media { height: 218px; background-size: cover; background-position: center; }
.card__body { padding: 26px; }
.card__kicker {
  display: flex; align-items: center; gap: 9px;
  font-size: var(--t-label); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
}
.card__kicker .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.card__title { font-size: var(--t-h3); font-weight: 700; margin-top: 14px; }
.card__text { font-size: var(--t-sm); line-height: 1.7; color: var(--ink-2); margin-top: 10px; }
.card__more {
  margin-top: 18px; font-family: var(--font-head); font-weight: 600;
  font-size: var(--t-sm); color: var(--navy);
}

/* Numbered step cards */
.step__num { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; }
.step__title { font-weight: 700; font-size: 1.25rem; margin-top: 12px; }

/* --------------------------------------------------------------------------
   9. Panels (dark / red full-bleed blocks)
   -------------------------------------------------------------------------- */
.panel { border-radius: var(--r-xl); padding: clamp(1.75rem, 1rem + 3vw, 3.75rem); }
.panel--dark { background: var(--navy); color: var(--white); }
.panel--outline { border: 1px solid var(--line); background: var(--white); }
.panel--dark .panel__text { color: rgba(255, 255, 255, 0.85); }
.panel--dark .card,
.panel--dark .intake,
.panel--dark .aside { color: var(--body); }
.panel--dark .card .label { color: var(--muted); }
.panel--dark h1, .panel--dark h2, .panel--dark h3 { color: var(--white); }

.panel-split { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) {
  .panel-split { grid-template-columns: 1.2fr 0.8fr; gap: 3rem; }
  .panel-split--even { grid-template-columns: 1fr 1fr; }
}
.panel-actions { display: grid; gap: 12px; }
@media (min-width: 480px) { .panel-actions { grid-auto-flow: column; justify-content: start; } }
@media (min-width: 900px) { .panel-actions--stack { grid-auto-flow: row; width: 260px; } }

/* Bulletin cards on dark */
.bulletin { display: grid; gap: 1.25rem; margin-top: 30px; }
@media (min-width: 900px) { .bulletin { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1120px) { .bulletin { grid-template-columns: 1.3fr 1fr 1fr; } }
.bulletin__card {
  background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--r-md); padding: 26px; display: flex; flex-direction: column;
}
.bulletin__card .card__text { color: rgba(255, 255, 255, 0.78); }

.dl-list { display: grid; margin-top: 14px; }
.dl-list a {
  font-size: var(--t-sm); font-weight: 500; padding: 12px 0;
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
  border-bottom: 1px solid var(--line);
}
.dl-list a:last-child { border-bottom: 0; }
.dl-list a:hover { color: var(--red-ink); }
.dl-list .ext {
  flex: none; font-size: 0.625rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 3px 9px; line-height: 1.5;
}
.panel--dark .dl-list a { border-color: rgba(255, 255, 255, 0.16); color: var(--white); }
.panel--dark .dl-list a:hover { color: var(--blue); }
.panel--dark .dl-list .ext {
  color: rgba(255, 255, 255, 0.78);
  border-color: rgba(255, 255, 255, 0.28);
}
.dl-list a { transition: color var(--ease), padding-left var(--ease); }
.dl-list a:hover { padding-left: 4px; }

/* --------------------------------------------------------------------------
   10. Campus finder
   -------------------------------------------------------------------------- */
.filters {
  display: flex; gap: 6px; background: var(--hover); padding: 6px;
  border-radius: var(--r-pill); overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.filters::-webkit-scrollbar { display: none; }
.filters button {
  padding: 11px 18px; border-radius: var(--r-pill); border: 0; cursor: pointer;
  font-weight: 600; font-size: var(--t-xs); white-space: nowrap;
  background: transparent; color: var(--muted); min-height: 44px;
  transition: background var(--ease), color var(--ease);
}
.filters button[aria-pressed="true"] { background: var(--black); color: var(--white); }

.finder { display: grid; gap: 1.5rem; margin-top: 2.25rem; align-items: start; }
@media (min-width: 900px) { .finder { grid-template-columns: 1fr 1.05fr; } }

.finder__list { display: grid; gap: 12px; }
.campus-row {
  --accent: var(--navy);
  --accent-tint: var(--bg-light);
  position: relative; overflow: hidden;
  width: 100%; text-align: left; background: var(--white);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 20px 22px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  transition: border-color var(--ease), box-shadow var(--ease),
              background var(--ease), transform var(--ease);
}
/* Campus-coloured edge that wipes in on hover / selection. */
.campus-row::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.2s ease;
}
.campus-row:hover,
.campus-row:focus-visible,
.campus-row[data-selected="true"] {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.campus-row:hover { transform: translateX(2px); }
.campus-row:hover::before,
.campus-row:focus-visible::before,
.campus-row[data-selected="true"]::before { transform: scaleX(1); }
.campus-row[data-selected="true"] { box-shadow: 0 10px 30px -18px rgba(23, 32, 51, 0.35); }
.campus-row__arrow { transition: transform var(--ease), color var(--ease); }
.campus-row:hover .campus-row__arrow,
.campus-row[data-selected="true"] .campus-row__arrow {
  transform: translateX(3px); color: var(--accent);
}
.campus-row__text { display: block; }
.campus-row__name {
  display: block;                      /* was inline — ran into the detail text */
  font-family: var(--font-head); font-weight: 600;
  font-size: 1.1875rem; letter-spacing: -0.01em; color: var(--navy);
}
.campus-row__detail {
  display: block; font-size: var(--t-xs); color: var(--muted); margin-top: 4px;
}
.campus-row__meta { display: flex; align-items: center; gap: 12px; flex: none; }
.campus-row__arrow { font-weight: 700; font-size: 1.125rem; color: #C4C4BF; }
@media (max-width: 479px) { .campus-row__tag { display: none; } }

.tag {
  font-size: var(--t-label); font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; padding: 7px 12px; border-radius: var(--r-pill); white-space: nowrap;
}

.finder__panel {
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line); background: var(--white);
}
@media (min-width: 900px) { .finder__panel { position: sticky; top: 150px; } }
.finder__map {
  aspect-ratio: 16 / 10; width: 100%; object-fit: cover;
  max-height: 420px;          /* never let the map dominate the section */
  background: var(--bg-light);
  border: 0; display: block;  /* also covers the <iframe> embed */
}
.finder__map { transition: opacity 0.25s ease; }
.finder__map[data-loading="true"] { opacity: 0.45; }
.finder__reset {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--font-head); font-weight: 600; font-size: var(--t-xs);
  color: var(--navy); text-decoration: underline; text-underline-offset: 3px;
}
.finder__reset[hidden] { display: none; }

.aside__map {
  width: 100%; aspect-ratio: 16 / 10; border: 0; display: block;
  border-radius: 16px; margin-top: 22px; background: var(--bg-light);
}
.finder__foot {
  padding: 22px 24px; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 1rem;
}

/* --------------------------------------------------------------------------
   11. Split / feature sections
   -------------------------------------------------------------------------- */
.band {
  margin-top: var(--section); background: var(--bg-light);
  border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
}
.band__inner { padding-block: clamp(3rem, 2rem + 4vw, 5rem); display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) {
  .band__inner { grid-template-columns: 0.85fr 1.15fr; gap: 4rem; }
  .band__inner--even { grid-template-columns: 1fr 1fr; }
}

.figure { border-radius: 28px; aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }

/* Chip list — the daily programme / clubs, which read as a set, not prose */
.chip-list {
  list-style: none; margin: 16px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.chip-list li {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 8px 14px;
  font-size: var(--t-xs); font-weight: 500;
}

/* Tick list — facilities and support services */
.tick-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.tick-list li {
  position: relative; padding-left: 28px;
  font-size: var(--t-sm); line-height: 1.55; color: var(--ink-2);
}
.tick-list li::before {
  content: ''; position: absolute; left: 0; top: 0.35em;
  width: 16px; height: 9px; border-left: 2.5px solid var(--green);
  border-bottom: 2.5px solid var(--green); transform: rotate(-45deg);
}
@media (min-width: 640px) {
  .tick-list--two { grid-template-columns: repeat(2, 1fr); gap: 10px 24px; }
}

/* --------------------------------------------------------------------------
   12. Breadcrumb
   -------------------------------------------------------------------------- */
.crumb {
  font-size: 0.8125rem; font-weight: 500; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 1.5rem;
}
.crumb a:hover { color: var(--red-ink); }
.crumb [aria-current] { color: var(--black); font-weight: 600; }

/* --------------------------------------------------------------------------
   13. Campus detail
   -------------------------------------------------------------------------- */
.spec {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line);
  border-radius: 18px; overflow: hidden; margin-top: 24px;
}
@media (min-width: 900px) { .spec { grid-template-columns: repeat(4, 1fr); } }
.spec__cell { background: var(--white); padding: 20px 22px; }
.spec__val { font-weight: 700; font-size: 1.1875rem; margin-top: 8px; }

.aside {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 28px; background: var(--surface);
}
@media (min-width: 1120px) { .aside { position: sticky; top: 150px; } }
.aside__rows { display: grid; gap: 16px; margin-top: 22px; font-size: 0.9375rem; color: var(--ink); }
.aside__val { margin-top: 5px; font-weight: 500; }

.layout-aside { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 1120px) { .layout-aside { grid-template-columns: 1.1fr 0.9fr; gap: 4rem; } }
.layout-aside--wide { }
@media (min-width: 1120px) { .layout-aside--wide { grid-template-columns: 1.2fr 0.8fr; gap: 2.5rem; } }

.gallery { display: grid; gap: 1rem; margin-top: 1.5rem; grid-template-columns: repeat(2, 1fr); }
.gallery img { border-radius: 22px; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.gallery__lead { grid-column: 1 / -1; }
.gallery__lead img { aspect-ratio: 16 / 10; }
@media (min-width: 900px) {
  .gallery { grid-template-columns: 2fr 1fr 1fr; grid-template-rows: repeat(2, 1fr); }
  .gallery__lead { grid-column: 1; grid-row: 1 / 3; }
  .gallery__lead img { aspect-ratio: auto; }
  .gallery img { aspect-ratio: auto; min-height: 142px; }
  .gallery__lead img { min-height: 300px; }
}

/* --------------------------------------------------------------------------
   14. Fees table — becomes stacked cards on mobile
   -------------------------------------------------------------------------- */
.fees { margin-top: 26px; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.fees table { width: 100%; border-collapse: collapse; }
.fees thead {
  background: var(--surface); font-size: var(--t-label); font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.fees th, .fees td { padding: 16px 22px; text-align: left; }
.fees tbody tr { border-top: 1px solid var(--line); }
.fees tbody th { font-weight: 600; font-size: 0.9375rem; }
.fees td { font-size: 0.9375rem; }

@media (max-width: 639px) {
  .fees thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .fees tbody tr { display: block; padding: 6px 0; }
  .fees tbody th { display: block; padding-bottom: 4px; }
  .fees td { display: flex; justify-content: space-between; gap: 1rem; padding: 6px 22px; }
  .fees td::before { content: attr(data-th); color: var(--muted); font-size: var(--t-xs); }
}

/* Key dates list */
.dates { display: grid; margin-top: 14px; }
.dates div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--t-sm);
}
.dates div:last-child { border-bottom: 0; }
.dates b { font-weight: 600; }

/* --------------------------------------------------------------------------
   15. News
   -------------------------------------------------------------------------- */
.news-layout { display: grid; gap: 1.5rem; margin-top: 2.25rem; align-items: start; }
@media (min-width: 1120px) { .news-layout { grid-template-columns: 1.25fr 0.75fr; } }
.feature__media { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.feature__body { padding: clamp(1.5rem, 1rem + 1.6vw, 2.25rem); }
.post__media { border-radius: var(--r-md); width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.post__title { font-weight: 700; font-size: 1.1875rem; margin-top: 8px; line-height: 1.35; }
a.post:hover .post__title { text-decoration: underline; }

/* --------------------------------------------------------------------------
   16. Footer
   -------------------------------------------------------------------------- */
.footer { margin-top: var(--section); background: var(--navy); color: var(--white); }
.footer h2, .footer h3 { color: var(--white); }
.footer__inner {
  padding-top: clamp(2.5rem, 1.6rem + 3.5vw, 4rem); padding-bottom: 2.5rem;
  display: grid; gap: 2.5rem;
}
@media (min-width: 640px) { .footer__inner { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1120px) { .footer__inner { grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 3rem; } }
@media (min-width: 640px) { .footer__brand { grid-column: 1 / -1; } }
@media (min-width: 1120px) { .footer__brand { grid-column: auto; } }

.footer__logo { height: 40px; width: auto; background: var(--white); padding: 8px 12px; border-radius: 10px; }
.footer__blurb { font-size: var(--t-sm); line-height: 1.7; color: rgba(255,255,255,0.7); margin-top: 20px; max-width: 340px; }
.footer .label { color: rgba(255,255,255,0.6); }
.footer__links { display: grid; gap: 2px; margin-top: 12px; font-size: var(--t-sm); }
.footer__links a {
  color: rgba(255, 255, 255, 0.86);
  display: flex; align-items: center;
  min-height: 44px;   /* touch target */
}
.footer__links a:hover { color: var(--red); }

.social { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.social a {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--white);
  transition: background var(--ease), color var(--ease), border-color var(--ease);
}
.social a:hover { background: var(--white); color: var(--navy); border-color: var(--white); }
.social svg { width: 19px; height: 19px; fill: currentColor; display: block; }

.colophon { padding-bottom: 2.5rem; }
.colophon__inner {
  border-top: 1px solid rgba(255,255,255,0.16); padding-top: 24px;
  display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: space-between;
  font-size: 0.78125rem; color: rgba(255,255,255,0.62);
}

/* --------------------------------------------------------------------------
   17. Placeholder flagging — REVIEW BUILD ONLY
   Everything marked .ph is unverified content carried over from the
   prototype. Strip this block (and the toggle in site.js) before launch.
   -------------------------------------------------------------------------- */
.ph { position: relative; }
body[data-review="on"] .ph {
  background: rgba(255, 214, 0, 0.28);
  box-shadow: 0 0 0 1px rgba(180, 130, 0, 0.45);
  border-radius: 3px;
  cursor: help;
}
/* On navy surfaces the yellow wash sits behind white text and destroys
   contrast, so flag with an underline instead of a fill. */
body[data-review="on"] .panel--dark .ph,
body[data-review="on"] .footer .ph {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  border-bottom: 2px dashed #FFD600;
  padding-bottom: 1px;
}

/* Link states in the review build:
   [data-todo]    — goes nowhere yet, needs wiring before launch
   [data-interim] — points at the current live site until this build replaces it */
body[data-review="on"] a[data-todo] {
  outline: 1px dashed rgba(200, 140, 0, 0.8);
  outline-offset: 2px;
  cursor: not-allowed;
}
body[data-review="on"] a[data-todo]::after {
  content: ' ⚑';
  color: #B48200;
  font-size: 0.85em;
}
body[data-review="on"] a[data-interim]::after {
  content: ' ↗';
  opacity: 0.55;
  font-size: 0.85em;
}

.review-toggle {
  position: fixed; right: 16px; bottom: 16px; z-index: 120;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px; border-radius: var(--r-pill);
  background: var(--black); color: var(--white);
  border: 0; cursor: pointer; font-size: 0.78125rem; font-weight: 600;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.6); min-height: 44px;
}
.review-toggle::before {
  content: ''; width: 9px; height: 9px; border-radius: 50%; background: #FFD600;
}
body:not([data-review="on"]) .review-toggle::before { background: #6E6E67; }

.review-banner {
  background: #FFF8D6; border-bottom: 1px solid #E8D27A;
  font-size: 0.8125rem; color: #4A3B00; text-align: center;
  padding: 9px var(--gutter); line-height: 1.5;
}
body:not([data-review="on"]) .review-banner { display: none; }
