/* ==========================================================================
   Adhyayan School — Layout
   Page structure and global chrome (mobile-first, BEM).
   Breakpoints (PRD §1.1), written as media-query range syntax:
     Mobile   < 768px            → hamburger drawer
     Tablet   (width >= 768px)   → hamburger drawer, wider grids
     Desktop  (width > 1024px)   → top bar, full primary nav with sub-menus, wider layouts
                                   (1025–1199px packs the nav tighter; 1024px and below use the drawer)

   Contents
     1. Containers & sections
     2. Grid
     3. Flow & layout primitives (stack, measure, button-row, split)
     4. Global header (top bar, masthead, brand, primary nav)
     5. Mobile navigation drawer
     6. Global footer (columns, bottom bar, initiative badge, social links)
   ========================================================================== */

/* ==========================================================================
   1. Containers & sections
   ========================================================================== */

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

.site-main {
  flex: 1 0 auto;
}

.site-main:focus {
  outline: none;
}

.section {
  padding-block: var(--space-16);
}

.section--light {
  /* Warm (cream) sections: cards go white, and what sits inside them goes back to sand */
  --color-surface-card: var(--color-white);
  --color-surface-card-hover: #F3F0EB;  /* the grey card surface */
  --color-surface-inset: var(--color-sand);

  background-color: var(--color-bg-light);
}

/* Navy sections carry two soft glows (logo red-orange, lighter navy) for depth */
.section--primary {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(40rem 28rem at 100% 0%, rgb(239 65 35 / 0.16), transparent 70%),
    radial-gradient(36rem 30rem at 0% 100%, rgb(30 53 102 / 0.9), transparent 70%),
    var(--color-primary);
  color: var(--color-white);
}

.section--primary :is(h1, h2, h3, h4) {
  color: var(--color-white);
}

.section__header {
  max-width: var(--measure);
  margin-bottom: var(--space-12);
}

.section__header > * + * {
  margin-top: var(--space-4);
}

.section__header .lead {
  max-width: var(--measure-tight);
}

.section__header--center {
  margin-inline: auto;
  text-align: center;
}

.section__header--center .lead {
  margin-inline: auto;
}

/* Playful hand-drawn underline beneath centred section titles */
.section__header--center h2::after {
  content: '';
  display: block;
  width: 7.5rem;  /* Two wave periods */
  height: 0.75rem;
  margin: var(--space-4) auto 0;
  background-color: var(--color-secondary);
  mask: var(--shape-squiggle) left center / auto 100% no-repeat;
}

@media (width >= 768px) {
  .section {
    padding-block: var(--space-24);
  }
}

@media (width > 1024px) {
  .section {
    padding-block: var(--space-32);
  }
}

/* The first section under a page hero or sub-nav: the banner already separates it,
   so the full top padding only reads as an empty band before the content */
@media (width >= 768px) {
  :is(.page-hero, .subnav) + .section {
    padding-block-start: var(--space-16);
  }
}

/* Short sections (a single row of links) don't need the full vertical rhythm */
.section.section--compact {
  padding-block: var(--space-16);
}

/* ==========================================================================
   2. Grid
   ========================================================================== */

.grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: minmax(0, 1fr);
}

/* Tight gutters between cards (Home pillars) */
.grid--tight {
  gap: var(--space-3);
}

@media (width >= 768px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (width > 1024px) {
  .grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ==========================================================================
   3. Flow & layout primitives
   ========================================================================== */

.stack > * + * {
  margin-top: var(--space-4);
}

.stack--lg > * + * {
  margin-top: var(--space-8);
}

/* Comfortable reading width for standalone prose blocks */
.measure {
  max-width: var(--measure);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.button-row--center {
  justify-content: center;
}

/* ---------- Two-column splits ---------- */

.split {
  display: grid;
  gap: var(--space-10);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

@media (width > 1024px) {
  .split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-16);
  }

  /* Main column + narrow sidebar */
  .split--sidebar {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: var(--space-12);
  }

  /* Narrower heading column beside long-form copy */
  .split--editorial {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }

  /* Side column that stays in view while the other column scrolls */
  .split__aside--sticky,
  .split__lead--sticky {
    position: sticky;
    top: var(--sticky-offset);
  }
}

/* ==========================================================================
   4. Global header
   ========================================================================== */

/*
 * Fixed and transparent over the navy page hero (heroes reserve --site-header-offset as
 * extra top padding). Once the page scrolls, main.js adds .is-floating: the top bar and
 * motto collapse and the masthead becomes a white island floating below the viewport edge.
 * Pages without a hero get .is-floating permanently (and body padding instead).
 */
.site-header {
  --header-ink: var(--color-white);
  --header-ink-muted: var(--color-on-dark-muted);
  --header-pill: rgb(6 12 26 / 0.6);                 /* Nav item hover / open fill: near-black navy @ 60%, darkens the hero behind it */
  --header-current: var(--color-secondary-light);    /* Current section label */

  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: var(--z-header);
  transition: transform var(--transition-base);
}

.site-header.is-floating {
  --header-ink: var(--color-primary);
  --header-ink-muted: var(--color-text-light);
  --header-pill: rgb(6 12 26 / 0.12);                /* Same near-black navy as the hero overlay, light enough for navy text on white */
  --header-current: var(--color-secondary-dark);

  transform: translateY(calc(var(--space-3) - var(--topbar-height, 0px)));
}

/* Keyboard users tabbing into the collapsed top bar get it back */
.site-header.is-floating:has(.topbar:focus-within) {
  transform: none;
}

body.has-solid-header {
  padding-top: calc(var(--site-header-offset, 0px) + var(--space-3));
}

/* ---------- Notification banner (all sizes): one line of news above the top bar ----------
   Slides away with the top bar once the header floats (main.js counts it in --topbar-height). */

.announcement {
  position: relative;
  z-index: 3;  /* Above the top bar's dropdown layer */
  background-color: #5B21B6;  /* Vivid violet — off-brand, high-attention; white text ~8.8:1 */
  color: var(--color-white);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: opacity var(--transition-base);
}

.is-floating .announcement {
  opacity: 0;
}

.site-header.is-floating:has(.announcement:focus-within) {
  transform: none;
}

.is-floating .announcement:focus-within {
  opacity: 1;
}

.announcement__inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-block: var(--space-2);
}

.announcement__icon {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  opacity: 0.9;
}

.announcement__link {
  color: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.announcement__close {
  margin-left: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1);
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
  border-radius: var(--radius-sm);
  transition: opacity var(--transition-base);
}

.announcement__close:hover,
.announcement__close:focus-visible {
  opacity: 1;
}

.announcement__link,
.announcement__link:hover {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------- Top bar (desktop only; its links move into the drawer at ≤ 1024px) ---------- */

.topbar {
  display: none;
  border-bottom: 1px solid var(--color-on-dark-border);
  background-color: rgb(12 24 48 / 0.35);  /* --color-primary-dark @ 35% */
  backdrop-filter: blur(8px);
  color: var(--color-white);
  font-size: var(--font-size-sm);
  transition: opacity var(--transition-base);
}

.is-floating .topbar {
  opacity: 0;
}

.is-floating .topbar:focus-within {
  opacity: 1;
  background-color: var(--color-primary);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
}

/* Motto sits above the logo, on the left of the top bar */
.topbar__motto {
  font-size: var(--font-size-xs);
  color: var(--header-ink-muted);
  white-space: nowrap;
}

/* Motto, then the Leapfrog "Education Initiative" badge after a hairline divider */
.topbar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.initiative-badge.initiative-badge--topbar {
  padding-left: var(--space-4);
  border-left: 1px solid var(--color-on-dark-border);
  color: var(--header-ink-muted);
}

.initiative-badge--topbar .initiative-badge__mark {
  width: 1.125rem;
  height: 1.125rem;
}

.initiative-badge--topbar .initiative-badge__text {
  font-size: 0.6875rem;
}

/* Mark only until the top bar has room for the words beside its links */
@media (width < 1160px) {
  .initiative-badge--topbar .initiative-badge__text {
    display: none;
  }
}

.topbar__list {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
  padding: 0;
  white-space: nowrap;
}

/* Online Portal: a small dropdown (same panel as the primary-nav sub-menus) */
.topbar {
  position: relative;
  z-index: 2;  /* The open dropdown sits over the masthead */
}

.topbar__item {
  position: relative;
}

.topbar__link.topbar__toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  cursor: pointer;
}

.topbar__toggle svg {
  width: 0.875rem;
  height: 0.875rem;
  transition: transform var(--transition-base);
}

.topbar__item:hover .topbar__toggle svg,
.topbar__toggle[aria-expanded='true'] svg {
  transform: rotate(180deg);
}

/* Small laptops: tighter gaps so the motto and links stay on one row */
@media (1024px < width < 1200px) {
  .topbar__list {
    gap: var(--space-5);
  }
}

.topbar__link {
  display: inline-block;
  padding: var(--space-2) 0;
  background: none;
  border: 0;
  color: var(--color-white);
  text-decoration: none;
  font-weight: 500;
}

.topbar__link:hover {
  color: var(--color-secondary-light);
  text-decoration: underline;
}

/* ---------- Masthead ---------- */

.masthead {
  transition: padding-inline var(--transition-base);
}

.is-floating .masthead {
  padding-inline: var(--space-3);
}

/* Height comes from the brand block (logo only; the motto sits in the top bar) */
.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding-block: var(--space-3);
  border-radius: var(--radius-pill);
  transition: background-color var(--transition-base), box-shadow var(--transition-base), padding var(--transition-base);
}

/* The island: same box as the transparent masthead, so only the surface fades in */
/* Insets match the pill: the CTA sits concentric (8px), the square logo clears the curve (16px) */
.is-floating .masthead__inner {
  padding-block: var(--space-2);
  padding-inline: var(--space-4) var(--space-2);
  background-color: rgb(255 255 255 / 0.92);
  box-shadow: var(--shadow-elevated);
  backdrop-filter: blur(12px) saturate(1.4);
}

.masthead__inner .masthead__cta {
  display: none;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ---------- Brand (logo + motto) ---------- */

/* Grid rows let the motto collapse smoothly (auto 1fr → auto 0fr) without a fixed height,
   so the motto can wrap onto two lines on narrow screens. */
.brand {
  display: grid;
  grid-template-rows: auto 1fr;
  justify-items: start;
  row-gap: var(--space-1);
  text-decoration: none;
  color: var(--color-primary);
  line-height: var(--line-height-tight);
  transition: grid-template-rows var(--transition-base), row-gap var(--transition-base);
}

.brand:hover {
  color: var(--color-primary);
}

.brand__logo {
  width: auto;
  height: var(--control-size);
}

/* Header has two stacked logos: white lettering over the hero, navy once floating */
.brand__logo--dark,
.brand__logo--light {
  grid-area: 1 / 1;
  transition: opacity var(--transition-base);
}

.brand__logo--dark,
.is-floating .brand__logo--light {
  opacity: 0;
}

.is-floating .brand__logo--dark {
  opacity: 1;
}

.site-header .brand,
.site-header .brand:hover {
  color: var(--header-ink);
}

.brand__motto {
  min-height: 0;
  overflow: hidden;
  font-size: var(--font-size-xs);
  color: var(--color-text-light);
  text-wrap: balance;
  transition: opacity var(--transition-base);
}

.brand__motto-np {
  color: var(--color-secondary-dark);
  font-weight: 600;
}

.site-header:not(.is-floating) .brand__motto-np {
  color: var(--color-secondary-light);
}

/* On narrow screens the motto wraps after the "|" rather than mid-phrase */
.brand__motto-en {
  display: inline-block;
}

/* The header brand is logo-only (its motto lives in the top bar) */
.masthead .brand {
  grid-template-rows: auto;
  row-gap: 0;
}

/* ---------- Primary navigation ---------- */

/* Nav and CTA keep their width; when space is tight the brand motto wraps instead */
.primary-nav {
  display: none;
  flex-shrink: 0;
}

.primary-nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  padding: 0;
}

.primary-nav__link {
  display: inline-block;
  padding-block: var(--space-2);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--header-ink);
  text-decoration: none;
  white-space: nowrap;
  transition: color 150ms ease;
}

/* Hover keeps the text colour (overrides the global a:hover); only the item's pill fill changes */
.primary-nav__link:is(:hover, :active) {
  color: var(--header-ink);
}

/* aria-current="page" on the current page, "true" on the parent of the current sub-page */
.primary-nav__link[aria-current] {
  color: var(--header-current);
}

/* ---------- Items (soft pill on hover / while the sub-menu is open; parents wrap link + chevron) ---------- */

.primary-nav__item {
  position: relative;
  display: flex;
  align-items: center;
  padding-inline: var(--space-3);
  border-radius: var(--radius-pill);
  transition: background-color 150ms ease;
}

.primary-nav__item:hover,
.primary-nav__item:has(> .primary-nav__toggle[aria-expanded='true']) {
  background-color: var(--header-pill);
}

.primary-nav__item--parent {
  gap: 2px;
  padding-right: var(--space-2);
}

.primary-nav__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.5rem;
  padding: 0;
  background: none;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--header-ink);
}

.primary-nav__toggle svg {
  width: 1rem;
  height: 1rem;
  transition: transform var(--transition-base);
}

/* Caret faces up while the sub-menu is showing (hover or open) */
.primary-nav__item--parent:hover .primary-nav__toggle svg,
.primary-nav__toggle[aria-expanded='true'] svg {
  transform: rotate(180deg);
}

/* The transparent top padding bridges the gap so the menu survives the pointer moving down.
   (Scoped under .primary-nav so it outranks the ul[role='list'] reset in main.css.)
   Style follows alignui.com: soft layered panel, rows with the label and a faint chevron. */
:is(.primary-nav, .topbar) .submenu {
  --submenu-gap: var(--space-4);
  position: absolute;
  top: 100%;
  left: calc(-1 * var(--space-4));
  z-index: 1;
  display: grid;
  gap: 2px;
  width: max-content;
  padding: calc(var(--submenu-gap) + var(--space-2)) var(--space-2) var(--space-2);
  list-style: none;
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--transition-base), visibility 0s linear 200ms;
}

/* Panel: 20px radius, hairline ring and a soft layered navy shadow */
.submenu::before {
  content: '';
  position: absolute;
  inset: var(--submenu-gap) 0 0;
  z-index: -1;
  border-radius: var(--radius-menu);
  background-color: var(--color-white);
  box-shadow: var(--shadow-menu);
}

.primary-nav__item--parent:hover > .submenu,
.topbar__item:hover > .submenu,
:is(.primary-nav__toggle, .topbar__toggle)[aria-expanded='true'] + .submenu {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

/* Rows: label and chevron; a light cream fill on hover */
.submenu__link {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: 0.625rem var(--space-3);
  border-radius: var(--radius-menu-item);
  color: var(--color-text-dark);
  font-size: var(--font-size-sm);
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 150ms linear, color 150ms linear;
}

.submenu__link:is(:hover, :active, :focus-visible) {
  background-color: var(--color-bg-light);
  color: var(--color-text-dark);
}

/* External links end with a faint new-tab mark (internal rows have no trailing icon: a chevron read as "more levels") */
.submenu li > .submenu__link[target='_blank']::after {
  content: '';
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-left: auto;
  background-color: currentColor;
  mask: var(--icon-external) center / 0.75rem no-repeat;
  opacity: 0.3;
  transition: opacity 150ms linear;
}

.submenu li > .submenu__link[target='_blank']:is(:hover, :focus-visible)::after {
  opacity: 0.6;
}

.submenu__link[aria-current='page'] {
  color: var(--color-secondary-dark);
  font-weight: 600;
}

/* Grouped sub-menu (Academics): a small label over each group, a hairline before the items that follow */
.submenu__group,
.submenu__group > ul {
  display: grid;
  gap: 2px;
}

.submenu__group > ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.submenu__label {
  padding: var(--space-3) var(--space-3) var(--space-1);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-light);
}

.submenu__group:first-child .submenu__label {
  padding-top: var(--space-2);
}

.submenu__group + li:not(.submenu__group) {
  margin-top: var(--space-1);
  padding-top: var(--space-1);
  border-top: 1px solid var(--color-border);
}

/* Opens with a short drop and fade */
@media (prefers-reduced-motion: no-preference) {
  :is(.primary-nav, .topbar) .submenu {
    transform: translateY(-0.75rem);
    transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out), visibility 0s linear 300ms;
  }

  .primary-nav__item--parent:hover > .submenu,
  .topbar__item:hover > .submenu,
  :is(.primary-nav__toggle, .topbar__toggle)[aria-expanded='true'] + .submenu {
    transform: none;
    transition-delay: 0s;
  }
}

/* Hamburger: a soft pill like the nav hover fills (frosted white over the hero, navy tint once floating) */
.menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--control-size);
  height: var(--control-size);
  padding: 0;
  background-color: var(--header-pill);
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--header-ink);
  transition: background-color 150ms ease, transform 150ms ease;
}

.site-header:not(.is-floating) .menu-toggle {
  background-color: var(--color-on-dark-surface);
  box-shadow: inset 0 0 0 1px var(--color-on-dark-border);
}

.menu-toggle:hover {
  background-color: var(--color-surface-card-hover);
}

.site-header:not(.is-floating) .menu-toggle:hover {
  background-color: var(--color-on-dark-hover);
}

.menu-toggle:active {
  transform: scale(0.94);
}

.menu-toggle svg {
  width: 1.375rem;
  height: 1.375rem;
}

@media (width > 1024px) {
  .topbar {
    display: block;
  }

  .brand__logo {
    height: 3rem;
  }
}

@media (width > 1024px) {
  .primary-nav {
    display: block;
  }

  .masthead__inner .masthead__cta {
    display: inline-flex;
  }

  .menu-toggle {
    display: none;
  }
}

/* Small laptops (1025–1199px): the same nav, packed tighter so it fits beside the logo and CTA */
@media (1024px < width < 1200px) {
  .masthead__inner {
    gap: var(--space-4);
  }

  .primary-nav__list {
    gap: 0;
  }

  .primary-nav__item {
    padding-inline: var(--space-2);
  }

  .primary-nav__item--parent {
    padding-right: var(--space-1);
  }

  .masthead__inner .masthead__cta {
    padding-inline: var(--space-5);
  }
}

/* ==========================================================================
   5. Mobile navigation drawer
   popover="manual" + scroll-snap swipe surface + scroll-driven backdrop
   ========================================================================== */

.drawer {
  --drawer-width: 100%; /* full-screen sheet; 100dvw would include the scrollbar and overflow the popover */
  --drawer-backdrop: 0;

  width: auto;
  height: auto;
  padding: 0;
  background: transparent;
  border: 0;
  overflow: visible;
}

.drawer::backdrop {
  background: var(--color-primary-dark);
  opacity: calc(var(--drawer-backdrop) * 0.6);
}

.drawer__scroller {
  position: relative;
  display: grid;
  grid-template-columns: var(--drawer-width) 100%;
  overflow-x: scroll;
  overscroll-behavior: none;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
}

.drawer__scroller::-webkit-scrollbar {
  display: none;
}

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

.drawer__scroller::after {
  content: '';
  scroll-snap-align: end;
  scroll-initial-target: nearest;
}

.drawer__sheet {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  height: 100svh;
  padding: var(--space-6);
  background-color: var(--color-white);
  color: var(--color-text-dark);
  overflow-y: auto;
  scroll-snap-align: start;
  scrollbar-width: none;
  box-shadow: var(--shadow-elevated);
}

.drawer__sheet:focus {
  outline: none;
}

@supports (animation-timeline: scroll()) {
  .drawer {
    timeline-scope: --drawer-fade;
    animation: fade-drawer-backdrop linear both;
    animation-timeline: --drawer-fade;
  }

  .drawer__scroller {
    scroll-timeline: --drawer-fade x;
  }

  @property --drawer-backdrop {
    syntax: '<number>';
    inherits: true;
    initial-value: 0;
  }

  @keyframes fade-drawer-backdrop {
    0% { --drawer-backdrop: 1; }
    100% { --drawer-backdrop: 0; }
  }
}

.drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

/* Close: round sand pill, the same size as the hamburger */
.drawer__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--control-size);
  height: var(--control-size);
  padding: 0;
  background-color: var(--color-sand);
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--color-primary);
  transition: background-color 150ms ease;
}

.drawer__close:hover {
  background-color: #EADFD1;  /* --color-sand, one step deeper (as .filter-tab) */
}

.drawer__close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.drawer__list {
  display: flex;
  flex-direction: column;
  list-style: none;
  padding: 0;
}

/* Main list: one hairline per item (below the sub-list when a section is open) */
.drawer__list:not(.drawer__list--secondary) > li {
  border-bottom: 1px solid var(--color-border);
}

.drawer__link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 3.25rem;
  padding: var(--space-2) 0;
  background: none;
  border: 0;
  font-size: var(--font-size-lg);
  font-weight: 600;
  text-align: start;
  text-decoration: none;
  color: var(--color-primary);
}

.drawer__link[aria-current] {
  color: var(--color-secondary-dark);
}

/* Section rows: the link, then a chevron that opens its sub-pages (main.js › initDrawerSections) */
.drawer__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.drawer__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--control-size);
  height: var(--control-size);
  margin-right: calc(-1 * var(--space-2));
  padding: 0;
  background: none;
  border: 0;
  border-radius: var(--radius-pill);
  color: var(--color-primary);
  transition: background-color 150ms ease;
}

.drawer__toggle:hover {
  background-color: var(--color-sand);
}

.drawer__toggle svg {
  width: 1.125rem;
  height: 1.125rem;
  transition: transform var(--transition-base);
}

.drawer__toggle[aria-expanded='true'] svg {
  transform: rotate(180deg);
}

/* Sub-pages: rounded rows like the desktop sub-menus (sand on hover, sand + orange for the current page) */
.drawer .drawer__sublist {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: calc(-1 * var(--space-1)) 0 var(--space-3);
  padding: 0;
  list-style: none;
}

.drawer .drawer__sublist[hidden] {
  display: none;
}

.drawer__sublink {
  display: block;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--color-text-dark);
  text-decoration: none;
  transition: background-color 150ms ease;
}

.drawer__sublink:hover {
  background-color: var(--color-sand);
  color: var(--color-text-dark);
}

.drawer__sublink[aria-current='page'] {
  background-color: var(--color-sand);
  color: var(--color-secondary-dark);
  font-weight: 600;
}

/* Grouped sub-pages (Academics), as in the desktop sub-menu */
.drawer__group > ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.drawer__label {
  display: block;
  padding: var(--space-3) var(--space-4) var(--space-1);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-light);
}

.drawer__group + li:not(.drawer__group) {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}

/* Secondary links: quiet, smaller links that wrap as a row under the main menu (each stays on one line) */
.drawer__list--secondary {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
}

.drawer__list--secondary li {
  white-space: nowrap;
}

.drawer__list--secondary .drawer__link {
  display: block;
  min-height: 0;
  padding: var(--space-2) 0;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text-light);
}

.drawer__list--secondary .drawer__link:hover {
  color: var(--color-primary);
}

/* Logo and motto, then the Leapfrog badge (the top bar's copy is hidden at this width) */
.drawer__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
}

.initiative-badge.initiative-badge--drawer {
  color: var(--color-text-light);
}

.initiative-badge.initiative-badge--drawer:hover {
  color: var(--color-primary);
}

/* Apply Online stays in view at the bottom of the sheet */
.drawer__cta {
  position: sticky;
  bottom: calc(-1 * var(--space-6));
  margin: auto calc(-1 * var(--space-6)) calc(-1 * var(--space-6));
  padding: var(--space-4) var(--space-6) calc(var(--space-6) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-border);
  background-color: var(--color-white);
}

/* ==========================================================================
   6. Global footer
   ========================================================================== */

/*
 * Rounded top corners like the heroes' bottoms. The footer tucks up over the last section by the
 * corner radius, and that section grows by the same amount (a transparent border its background
 * paints under), so the corners show the section's own colour rather than a white gap.
 */
.site-main > :last-child {
  border-bottom: var(--radius-xl) solid transparent;
}

.site-footer {
  position: relative;
  margin-top: calc(-1 * var(--radius-xl));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  background:
    radial-gradient(44rem 26rem at 100% 0%, rgb(239 65 35 / 0.12), transparent 70%),
    var(--color-primary-dark);
  color: var(--color-white);
  font-size: var(--font-size-sm);
}

.site-footer a,
.site-footer .site-footer__button {
  color: var(--color-white);
  text-decoration: none;
}

.site-footer a:hover,
.site-footer .site-footer__button:hover {
  color: var(--color-secondary-light);
  text-decoration: underline;
}

.site-footer__grid {
  display: grid;
  gap: var(--space-10);
  grid-template-columns: minmax(0, 1fr);
  padding-block: var(--space-12) var(--space-16);
}

/* Logo and motto above the link columns, behind the same hairline as the bottom bar */
.site-footer__brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4) var(--space-8);
  padding-block: var(--space-24) var(--space-10);
  border-bottom: 1px solid var(--color-on-dark-border);
}

.site-footer__logo img {
  display: block;
  width: 167px;
  height: auto;
}

.site-footer__motto {
  font-size: var(--font-size-sm);
  color: var(--color-on-dark-muted);
}

.site-footer__motto .brand__motto-np {
  color: var(--color-secondary-light);  /* 6.6:1 on navy */
}

/* Small caps-style labels keep the footer quiet; the links carry the weight */
.site-footer__heading {
  margin-bottom: var(--space-5);
  font-family: var(--font-body);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-on-dark-muted);
  white-space: nowrap;
}

.site-footer__list {
  font-size: var(--font-size-base);
}

.site-footer__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  list-style: none;
  padding: 0;
}

/* Padding lifts each link to a ≥ 24px tap target (WCAG 2.5.8) */
.site-footer__list :is(a, .site-footer__button) {
  display: inline-block;
  padding-block: var(--space-1);
}

.site-footer__button {
  padding-inline: 0;
  background: none;
  border: 0;
  text-align: start;
}

.site-footer__address {
  font-style: normal;
}

.site-footer__contact-link {
  margin-top: var(--space-5);
}

.site-footer__address li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

/* Contact values are inline text, so they skip the list-link tap padding and align with their icon */
.site-footer__address .site-footer__list a {
  display: inline;
  padding-block: 0;
}

.site-footer__address .icon {
  width: 1rem;
  height: 1rem;
  margin-top: 0.2em;
  color: var(--color-secondary-light);
}

/* ---------- Bottom bar ---------- */

.site-footer__bottom {
  border-top: 1px solid var(--color-on-dark-border);
}

.site-footer__bottom-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-block: var(--space-6);
  color: var(--color-on-dark-muted);
}

@media (width >= 768px) {
  .site-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer__bottom-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media (width > 1024px) {
  /* Contact column is wider so the address and phone numbers don't wrap */
  .site-footer__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.5fr);
  }
}

/* ---------- Copyright + legal links (bottom bar, left) ---------- */

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-6);
}

.site-footer__legal-links {
  display: flex;
  gap: var(--space-5);
  padding: 0;
  list-style: none;
}

.site-footer__legal-links a {
  color: var(--color-on-dark-muted);
  text-decoration: none;
  text-underline-offset: 0.2em;
  transition: color 150ms ease;
}

.site-footer__legal-links a:hover {
  color: var(--color-white);
  text-decoration: underline;
}

/* ---------- Leapfrog "Education Initiative" badge (header top bar and mobile menu; variants above) ---------- */

.initiative-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-on-dark-muted);
  text-decoration: none;
}

.initiative-badge:hover {
  color: var(--color-white);
}

.initiative-badge__mark {
  width: 1.5rem;
  height: 1.5rem;
}

.initiative-badge__text {
  font-size: var(--font-size-xs);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  /* Box hugs the capitals so flex centring lines them up with the logo */
  text-box: trim-both cap alphabetic;
}

/* ---------- Social links ---------- */

.social-links {
  display: flex;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
}

.site-footer .social-links__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-circle);
  background-color: var(--color-on-dark-surface);
  color: var(--color-white);
  transition: background-color var(--transition-base), color var(--transition-base);
}

.site-footer .social-links__link:hover {
  background-color: var(--color-secondary-dark);
  color: var(--color-white);
  text-decoration: none;
}

.social-links__link svg {
  width: 1.125rem;
  height: 1.125rem;
}
