/* =========================================================================
   CanadaDrivingTests.ca — Design System
   -------------------------------------------------------------------------
   Single source of truth for tokens, base typography, layout primitives and
   shared components. Imported at the top of every page stylesheet.

   Structural language is modelled on modern test-prep sites (heavy display
   headings, one loud primary CTA, pale alternating section bands, generous
   vertical rhythm) but the palette stays on our own teal + maple identity.
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. Tokens
   ------------------------------------------------------------------------- */
:root {
  /* Type */
  --font-sans: "Figtree", ui-sans-serif, -apple-system, system-ui, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.9375rem;                          /* 15px  fine print        */
  --step-0: 1.0625rem;                           /* 17px  body              */
  --step-1: 1.1875rem;                           /* 19px  lead paragraph    */
  --step-2: clamp(1.25rem, 1.05rem + 0.6vw, 1.5rem);      /* h3             */
  --step-3: clamp(1.75rem, 1.25rem + 2.2vw, 2.625rem);    /* h2  → 42px     */
  --step-4: clamp(2.125rem, 1.4rem + 3.2vw, 3.375rem);    /* h1  → 54px     */

  /* Ink */
  --ink-900: #0b1620;
  --ink-700: #33454f;
  --ink-500: #5a6b75;
  --ink-300: #9aa8b0;

  /* Surfaces — the alternating band palette */
  --surface: #ffffff;
  --surface-warm: #fafaf9;
  --surface-cool: #f2f8fa;
  --surface-amber: rgba(255, 234, 179, 0.32);
  --surface-blue: #f2f7ff;

  /* Brand — teal */
  --brand-900: #08313a;
  --brand-800: #0a5462;
  --brand-700: #0a6e80;                          /* primary CTA (5.3:1 on white) */
  --brand-600: #0c8296;
  --brand-400: #3f9db0;                           /* hover borders (3.2:1 on white) */
  --brand-200: #b9e2ea;
  --brand-100: #e6f4f7;

  /* Accents */
  --maple: #c8102e;
  --maple-100: #fdecef;
  --success: #067647;
  --success-100: #e7f5ee;
  --amber: #b7791f;

  /* Lines & elevation */
  --line: #e5e9eb;
  --line-strong: #d2dadd;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(11, 22, 32, 0.06), 0 1px 3px rgba(11, 22, 32, 0.05);
  --shadow: 0 4px 12px rgba(11, 22, 32, 0.07), 0 2px 4px rgba(11, 22, 32, 0.04);
  --shadow-lg: 0 18px 40px rgba(11, 22, 32, 0.1), 0 4px 12px rgba(11, 22, 32, 0.05);

  /* Layout */
  --container: 1200px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --section-y: clamp(3.5rem, 7vw, 5.5rem);
  --header-h: 72px;
}

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

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

@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;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  color: var(--ink-700);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  color: var(--ink-900);
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: var(--step-4);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.022em;
}

h2 {
  font-size: var(--step-3);
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -0.018em;
}

h3 {
  font-size: var(--step-2);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand-700); }

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

:focus-visible {
  outline: 3px solid var(--brand-600);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  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
   ------------------------------------------------------------------------- */
.ds-container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.ds-container--narrow { max-width: 820px; }

.ds-section { padding-block: var(--section-y); }

.ds-section--warm  { background: var(--surface-warm); }
.ds-section--cool  { background: var(--surface-cool); }
.ds-section--amber { background: var(--surface-amber); }
.ds-section--blue  { background: var(--surface-blue); }
.ds-section--dark  { background: var(--brand-900); color: #cfe3e8; }
.ds-section--dark h2,
.ds-section--dark h3 { color: #fff; }

.ds-section-head {
  max-width: 720px;
  margin: 0 auto clamp(2rem, 4vw, 3rem);
  text-align: center;
}

.ds-section-head p {
  font-size: var(--step-1);
  color: var(--ink-500);
}

.ds-eyebrow {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-700);
}

.ds-grid {
  display: grid;
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

.ds-grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); }
.ds-grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.ds-grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }

/* -------------------------------------------------------------------------
   4. Buttons
   ------------------------------------------------------------------------- */
.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 17px 34px;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.18s ease, transform 0.18s ease,
    box-shadow 0.18s ease, border-color 0.18s ease;
}

.ds-btn--primary {
  background: var(--brand-700);
  color: #fff;
  box-shadow: 0 8px 20px rgba(10, 110, 128, 0.24);
}

.ds-btn--primary:hover {
  background: var(--brand-800);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(10, 110, 128, 0.3);
}

.ds-btn--secondary {
  background: #fff;
  color: var(--brand-800);
  border: 2px solid var(--line-strong);
}

.ds-btn--secondary:hover {
  border-color: var(--brand-600);
  color: var(--brand-700);
  transform: translateY(-2px);
}

.ds-btn--ghost {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.ds-btn--ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.08); }

.ds-btn--sm { padding: 10px 20px; font-size: 1rem; border-radius: var(--radius-sm); }

.ds-btn:active { transform: translateY(0); }

/* -------------------------------------------------------------------------
   5. Site header
   ------------------------------------------------------------------------- */
.ds-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.ds-header__inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  height: var(--header-h);
}

.ds-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 900;
  font-size: 1.125rem;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  text-decoration: none;
  white-space: nowrap;
}

.ds-brand img { width: 32px; height: 32px; border-radius: 7px; }

.ds-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-left: auto;
}

.ds-nav a {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-700);
  text-decoration: none;
  transition: color 0.15s ease;
}

.ds-nav a:hover { color: var(--brand-700); }

/* `.ds-nav a` outranks `.ds-btn--primary` on specificity, so buttons living in
   the nav need their colour restated or they inherit the link ink. */
.ds-nav a.ds-btn--primary { color: #fff; }
.ds-nav a.ds-btn--secondary { color: var(--brand-800); }

.ds-header .ds-btn { margin-left: 0.25rem; }

@media (max-width: 860px) {
  .ds-nav { gap: 1rem; }
  .ds-nav a { display: none; }
  .ds-nav a.ds-nav__always { display: inline-flex; }
}

/* Below ~600px the brand and the CTA start fighting for the same row */
@media (max-width: 600px) {
  .ds-header__inner { gap: 0.5rem; }

  .ds-brand {
    min-width: 0;
    font-size: 0.9375rem;
    overflow: hidden;
  }

  .ds-brand img { width: 28px; height: 28px; }

  .ds-header .ds-btn--sm {
    padding: 9px 14px;
    font-size: 0.875rem;
  }
}

@media (max-width: 480px) {
  .ds-brand__tld { display: none; }

  .ds-header .ds-btn--sm {
    padding-inline: 11px;
    font-size: 0;
  }

  .ds-header .ds-btn--sm::after {
    content: "Start test";
    font-size: 0.8125rem;
  }
}

/* -------------------------------------------------------------------------
   6. Hero
   ------------------------------------------------------------------------- */
.ds-hero {
  position: relative;
  padding-block: clamp(3rem, 7vw, 5.5rem) clamp(2.5rem, 5vw, 4rem);
  text-align: center;
  background:
    radial-gradient(1000px 420px at 12% -10%, rgba(185, 226, 234, 0.5), transparent 60%),
    radial-gradient(900px 420px at 88% 0%, rgba(255, 234, 179, 0.45), transparent 62%),
    var(--surface);
  overflow: hidden;
}

.ds-hero__inner { max-width: 900px; margin-inline: auto; }

.ds-hero h1 { margin-bottom: 1.25rem; }
.ds-hero h1 em { font-style: normal; color: var(--brand-700); }

.ds-hero__lead {
  max-width: 660px;
  margin: 0 auto 2rem;
  font-size: var(--step-1);
  color: var(--ink-500);
}

.ds-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.875rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.ds-hero__note {
  font-size: var(--step--1);
  color: var(--ink-500);
}

/* Four-up value props under the hero */
.ds-valueprops {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: clamp(1.25rem, 3vw, 2.25rem);
  max-width: 1040px;
  margin: clamp(2.5rem, 5vw, 3.5rem) auto 0;
  text-align: center;
}

.ds-valueprop__icon {
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 0.65rem;
}

.ds-valueprop h2 {
  font-size: 1.0625rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
}

.ds-valueprop p {
  font-size: var(--step--1);
  color: var(--ink-500);
  line-height: 1.55;
}

/* -------------------------------------------------------------------------
   7. Stat strip
   ------------------------------------------------------------------------- */
.ds-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.ds-stat {
  background: #fff;
  padding: 1.75rem 1.25rem;
  text-align: center;
}

.ds-stat--link {
  color: inherit;
  text-decoration: none;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.ds-stat--link:hover {
  background: var(--surface-warm);
}

.ds-stat--link:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid var(--brand-primary);
  outline-offset: -3px;
}

.ds-stat__value {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--ink-900);
}

.ds-stat__label {
  margin-top: 0.35rem;
  font-size: var(--step--1);
  color: var(--ink-500);
}

/* -------------------------------------------------------------------------
   8. Cards
   ------------------------------------------------------------------------- */
.ds-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

a.ds-card { text-decoration: none; color: inherit; }

a.ds-card:hover,
.ds-card--interactive:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-200);
}

.ds-card h3 { margin-bottom: 0.4rem; }

.ds-card p {
  font-size: var(--step--1);
  color: var(--ink-500);
  line-height: 1.6;
}

/* Province picker card */
.ds-province {
  position: relative;
  gap: 0.25rem;
  padding: 1.5rem;
}

.ds-province__flag {
  font-size: 1.75rem;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.ds-province__name {
  font-size: 1.1875rem;
  font-weight: 800;
  color: var(--ink-900);
  letter-spacing: -0.01em;
}

.ds-province__test {
  font-size: var(--step--1);
  color: var(--ink-500);
}

.ds-province__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  /* Pushes the meta + CTA block to the bottom so cards line up regardless of
     how many lines the test name wraps to. */
  margin-top: auto;
  padding-top: 1rem;
}

.ds-province__cta {
  margin-top: 1.15rem;
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--brand-700);
}

a.ds-province:hover .ds-province__cta { text-decoration: underline; }

/* Pills / badges */
.ds-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--brand-100);
  color: var(--brand-800);
  white-space: nowrap;
}

.ds-pill--maple   { background: var(--maple-100); color: var(--maple); }
.ds-pill--success { background: var(--success-100); color: var(--success); }
.ds-pill--neutral { background: var(--surface-warm); color: var(--ink-500); border: 1px solid var(--line); }

/* -------------------------------------------------------------------------
   9. Numbered timeline
   ------------------------------------------------------------------------- */
.ds-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  counter-reset: ds-step;
}

.ds-step { counter-increment: ds-step; }

.ds-step::before {
  content: counter(ds-step);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--brand-700);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 900;
}

.ds-step h3 { font-size: 1.125rem; margin-bottom: 0.35rem; }

.ds-step p { font-size: var(--step--1); color: var(--ink-500); }

/* -------------------------------------------------------------------------
   10. Testimonials
   ------------------------------------------------------------------------- */
.ds-quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: clamp(1rem, 2.5vw, 1.75rem);
}

.ds-quote {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.35rem, 2.5vw, 1.85rem);
  box-shadow: var(--shadow-sm);
}

.ds-quote__stars {
  color: #c17c00;   /* 3.4:1 on white — stars convey a rating, so WCAG 1.4.11 applies */
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
}

.ds-quote blockquote {
  margin: 0 0 1rem;
  font-size: var(--step-0);
  color: var(--ink-900);
  line-height: 1.6;
}

.ds-quote__author {
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--ink-900);
}

.ds-quote__source {
  font-size: 0.8125rem;
  color: var(--ink-500);
  font-weight: 400;
}

/* -------------------------------------------------------------------------
   11. Closing CTA band
   ------------------------------------------------------------------------- */
.ds-cta-band {
  background: linear-gradient(135deg, var(--brand-900), var(--brand-700));
  color: #d7ebef;
  text-align: center;
  padding-block: clamp(3rem, 6vw, 4.5rem);
}

.ds-cta-band h2 { color: #fff; margin-bottom: 0.75rem; }

.ds-cta-band p {
  max-width: 560px;
  margin: 0 auto 2rem;
  font-size: var(--step-1);
}

.ds-cta-band .ds-btn--primary {
  background: #fff;
  color: var(--brand-800);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.ds-cta-band .ds-btn--primary:hover { background: var(--brand-100); }

/* -------------------------------------------------------------------------
   12. Footer
   ------------------------------------------------------------------------- */
.ds-footer {
  background: var(--brand-900);
  color: #9dbcc4;
  padding-block: clamp(2.5rem, 5vw, 3.5rem) 1.75rem;
  font-size: var(--step--1);
}

.ds-footer__grid {
  display: grid;
  /* min() lets both tracks shrink below their preferred width instead of
     forcing a 220 + 150 = 370px floor, which overflowed a 320px screen. */
  grid-template-columns:
    minmax(min(220px, 100%), 1.4fr)
    repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: clamp(1.75rem, 4vw, 3rem);
  padding-bottom: 2.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* Below the point where three link columns stop being readable, go single. */
@media (max-width: 560px) {
  .ds-footer__grid { grid-template-columns: 1fr; }
}

.ds-footer__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.0625rem;
  font-weight: 900;
  color: #fff;
  text-decoration: none;
  margin-bottom: 0.75rem;
}

.ds-footer__brand img { width: 30px; height: 30px; border-radius: 7px; }

.ds-footer__blurb { max-width: 34ch; line-height: 1.6; }

.ds-footer h2 {
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

.ds-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.ds-footer a {
  color: #9dbcc4;
  text-decoration: none;
  transition: color 0.15s ease;
}

.ds-footer a:hover { color: #fff; text-decoration: underline; }

.ds-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  font-size: 0.8125rem;
}

.ds-footer__legal {
  max-width: 68ch;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: #7fa3ad;
  line-height: 1.6;
}

/* Cookie-policy trigger keeps its link affordance without the raw blue */
.cookie-policy {
  color: #9dbcc4;
  text-decoration: underline;
  cursor: pointer;
}

.cookie-policy:hover { color: #fff; }

/* =========================================================================
   Legacy modernization layer
   -------------------------------------------------------------------------
   The province, quiz, chapter and blog pages carry a large amount of older
   markup whose class names we do not want to churn all at once. This layer
   re-skins those existing class names with design-system tokens, so every
   page picks up the new look without touching its HTML.

   Why every selector is prefixed with `body`:
   webpack emits the shared CSS chunks (design-system, this file) BEFORE each
   entry's own stylesheet, so source order alone would let icbc.css et al win.
   The `body` prefix raises specificity to (0,1,1) so this layer beats the
   single-class legacy rules regardless of chunk order. Keep it on new rules.
   ========================================================================= */

/* -------------------------------------------------------------------------
   Page shell
   ------------------------------------------------------------------------- */
/* `html body` (0,0,2) rather than `body` (0,0,1): the page stylesheets set
   their own `body { font-family: ... }` and webpack emits them after this
   file, so a bare `body` rule here loses the tie-break. */
html body {
  font-family: var(--font-sans);
  color: var(--ink-700);
  background: var(--surface);
}

body .first-container {
  background: var(--surface);
  padding-top: 0;
  padding-bottom: 0;
  gap: 0;
}

/* -------------------------------------------------------------------------
   Top bar → light sticky header
   ------------------------------------------------------------------------- */
body .top-bar {
  position: sticky;
  top: 0;
  height: var(--header-h);
  padding-left: var(--gutter);
  padding-right: var(--gutter);
  gap: 0.6rem;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  font-family: var(--font-sans);
  z-index: 100;
}

/* The quiz page wraps logo + title + province chip in a single anchor */
body .top-bar > a,
body .top-bar .top-bar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

body .bar-image {
  height: 32px;
  width: 32px;
  border-radius: 7px;
}

body .bar-text {
  margin: 0;
  color: var(--ink-900);
  font-size: 1.125rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* Province chip — was a squashed circle, now a proper pill */
body .bc_text {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand-800);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

body .premium-crown {
  font-size: 1.25rem;
  line-height: 1;
}

body .pay-top-btn {
  margin-left: auto;
  padding: 9px 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--brand-700);
  color: #fff;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

body .pay-top-btn:hover { background: var(--brand-800); }

body .pay-top-btn[hidden] { display: none; }

@media screen and (max-width: 600px) {
  body .top-bar { padding-left: 1rem; padding-right: 1rem; }
  body .bar-text { font-size: 1rem; }
  body .bar-image { height: 28px; width: 28px; }
}

@media screen and (max-width: 420px) {
  body .bar-text { display: none; }
  body .pay-top-btn {
    padding: 8px 11px;
    font-size: 0.8125rem;
  }
}

/* -------------------------------------------------------------------------
   BC study-topic navigation
   ------------------------------------------------------------------------- */
body .all-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 0.75rem;
  width: min(calc(100% - 2 * var(--gutter)), var(--container));
  height: auto;
  margin: clamp(1.25rem, 3vw, 2rem) auto 0.5rem;
  padding: 0;
}

body .all-buttons > a {
  display: block;
  min-width: 0;
  text-decoration: none;
}

body .all-buttons button {
  width: 100%;
  height: 100%;
  min-height: 52px;
  margin: 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--brand-800);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.3;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.18s ease, border-color 0.18s ease,
    color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

body .all-buttons button:hover {
  border-color: var(--brand-400);
  background: var(--surface-cool);
  color: var(--brand-900);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

body .all-buttons > :nth-child(2) {
  border-color: var(--brand-700);
  background: var(--brand-700);
  color: #fff;
  box-shadow: 0 8px 20px rgba(10, 110, 128, 0.2);
}

body .all-buttons > :nth-child(2):hover {
  border-color: var(--brand-800);
  background: var(--brand-800);
  color: #fff;
}

body .all-buttons button:focus-visible {
  outline: 3px solid var(--maple-100);
  outline-offset: 3px;
}

@media screen and (max-width: 600px) {
  body .all-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body .all-buttons > :nth-child(2) {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

@media screen and (max-width: 380px) {
  body .all-buttons { grid-template-columns: 1fr; }
  body .all-buttons > :nth-child(2) { grid-column: auto; }
}

/* -------------------------------------------------------------------------
   Province hero
   ------------------------------------------------------------------------- */
body .top-container-combine {
  width: 100%;
  max-width: none;
  margin: 0;
  /* Full-bleed background, but the content itself stays on the 1200px grid.
     The max() keeps a normal gutter on narrow screens. */
  padding: clamp(2.5rem, 6vw, 4.5rem)
           max(var(--gutter), calc((100% - var(--container)) / 2));
  gap: clamp(1.5rem, 4vw, 3rem);
  border-radius: 0;
  box-shadow: none;
  background:
    radial-gradient(900px 400px at 10% -10%, rgba(185, 226, 234, 0.5), transparent 60%),
    radial-gradient(800px 400px at 90% 0%, rgba(255, 234, 179, 0.42), transparent 62%),
    var(--surface);
}

body .top-container-text {
  max-width: 620px;
  padding: 0;
}

body .top-main-heading {
  font-size: var(--step-4);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.022em;
  color: var(--ink-900);
  margin-bottom: 1rem;
}

body .top-sub-heading {
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink-500);
  margin-bottom: 1rem;
}

body .top-container-text p {
  font-size: var(--step-0);
  color: var(--ink-500);
}

body .top-button-container { margin-top: 1.75rem; }

body .top-button {
  padding: 17px 34px;
  border-radius: var(--radius);
  background: var(--brand-700);
  color: #fff;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(10, 110, 128, 0.24);
  transition: background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

body .top-button:hover {
  background: var(--brand-800);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(10, 110, 128, 0.3);
}

body .top-image { border-radius: var(--radius-lg); }

/* -------------------------------------------------------------------------
   Province hero — eyebrow, secondary CTA, reassurance note
   ------------------------------------------------------------------------- */
body .prov-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.9rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body .prov-eyebrow__place { color: var(--brand-700); }
body .prov-eyebrow__sep { color: var(--ink-500); }
body .prov-eyebrow__year { color: var(--maple); }

/* As a flex row the two labels wrap independently and strand the separator
   in the gap between them. Fall back to inline text so it wraps as one line. */
@media screen and (max-width: 520px) {
  body .prov-eyebrow {
    display: block;
    font-size: 0.6875rem;
    letter-spacing: 0.1em;
  }

  body .prov-eyebrow__sep {
    margin-left: 0.35rem;
    margin-right: 0.35rem;
  }
}

body .top-sub-heading em {
  font-style: normal;
  font-weight: 700;
  color: var(--ink-900);
}

body .top-button--secondary {
  background: #fff;
  color: var(--brand-800);
  border: 2px solid var(--line-strong);
  box-shadow: none;
  text-decoration: none;
}

body .top-button--secondary:hover {
  background: #fff;
  border-color: var(--brand-600);
  color: var(--brand-700);
  box-shadow: none;
}

body .prov-hero-note {
  margin-top: 1rem;
  font-size: var(--step--1);
  color: var(--ink-500);
}

/* The hero CTAs carry 34px of side padding, which at 1.25rem type overflows a
   375px viewport and gives the whole page a horizontal scrollbar. Stack them
   full-width on phones instead. */
@media screen and (max-width: 520px) {
  body .top-button-container {
    flex-direction: column;
    align-items: stretch;
  }

  body .top-button {
    display: block;
    width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    font-size: 1.0625rem;
    /* nowrap is right on desktop, but once these are stacked full-width a long
       label (e.g. "Open the official Alberta Driver's Guide") can't fit on a
       320px screen and pushes the page sideways. Let them wrap here. */
    white-space: normal;
  }
}

body .instruction-lede {
  max-width: 720px;
  margin: 0 auto 1.5rem;
  text-align: center;
  font-size: var(--step-0);
  color: var(--ink-500);
}

/* -------------------------------------------------------------------------
   Province study plan — numbered stages
   ------------------------------------------------------------------------- */
body .prov-plan {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-left: auto;
  margin-right: auto;
  padding: clamp(2.5rem, 5vw, 4rem) var(--gutter);
}

body .prov-plan__head {
  max-width: 720px;
  margin: 0 auto clamp(2rem, 4vw, 3rem);
  text-align: center;
}

body .prov-plan__lede {
  font-size: var(--step-1);
  color: var(--ink-500);
}

body .prov-stage {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0 clamp(1rem, 2.5vw, 1.75rem);
}

body .prov-stage__marker {
  display: flex;
  flex-direction: column;
  align-items: center;
}

body .prov-stage__num {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-700);
  color: #fff;
  font-size: 1.125rem;
  font-weight: 900;
}

/* Vertical rule joins one stage to the next */
body .prov-stage__rule {
  flex: 1;
  width: 2px;
  margin: 0.6rem 0;
  background: var(--line);
}

body .prov-stage__body { padding-bottom: clamp(2rem, 4vw, 3rem); }
body .prov-stage--last .prov-stage__body { padding-bottom: 0; }

body .prov-stage__title {
  margin: 0.5rem 0 0.4rem;
  font-size: var(--step-2);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink-900);
}

body .prov-stage__desc {
  max-width: 60ch;
  margin-bottom: 1.35rem;
  font-size: var(--step-0);
  color: var(--ink-500);
}

body .prov-stage__aside {
  margin-top: 1rem;
  font-size: var(--step--1);
  color: var(--ink-500);
}

body .prov-stage__aside a {
  color: var(--brand-700);
  font-weight: 600;
}

@media screen and (max-width: 600px) {
  body .prov-stage {
    grid-template-columns: 34px 1fr;
    gap: 0 0.85rem;
  }
  body .prov-stage__num {
    width: 34px;
    height: 34px;
    font-size: 0.9375rem;
  }
}

/* -------------------------------------------------------------------------
   Trust strip
   ------------------------------------------------------------------------- */
/* (No .trust-stars rule here: the trust strips link to the live Play Store
   rating rather than printing stars, so nothing renders them.) */

body .trust-strip {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--gutter);
}

body .trust-strip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

body .trust-strip-card,
body .trust-strip-card-static {
  display: block;
  padding: 1.5rem 1.25rem;
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-align: center;
  text-decoration: none;
  transition: background-color 0.18s ease;
}

body a.trust-strip-card:hover { background: var(--surface-cool); }

body .trust-strip-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-700);
  margin-bottom: 0.5rem;
}

body .trust-strip-metric {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--ink-900);
  line-height: 1.25;
}

body .trust-strip-note {
  margin-top: 0.35rem;
  font-size: var(--step--1);
  color: var(--ink-500);
}

/* WCAG 2.5.8 wants a 24px minimum target; these were as short as 18px. */
body .trust-strip-link {
  color: var(--brand-700);
  display: inline-block;
  min-height: 24px;
  padding-block: 2px;
}

/* -------------------------------------------------------------------------
   Shared content section widths
   ------------------------------------------------------------------------- */
body .instruction-section,
body .chapter-intro,
body .download-section,
body .other_product_container,
body .test-container,
body .chapter-test-container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

body .instruction-section {
  max-width: var(--container);
  padding-top: clamp(2rem, 4vw, 3rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--surface-cool);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

body .instruction-section.plain-section {
  background: transparent;
  border: none;
  padding-top: clamp(2rem, 4vw, 3rem);
  padding-bottom: 0;
  margin-top: 0;
  margin-bottom: 0;
}

body .instruction-heading,
body .test-heading,
body .chapters-heading,
body .flashcards-heading,
body .download-heading,
body .other_product_heading,
body .process-heading,
body .testimonial-heading {
  font-size: var(--step-3);
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -0.018em;
  color: var(--ink-900);
}

body .chapters-subheading {
  font-size: var(--step-1);
  color: var(--ink-500);
}

body .instruction-list {
  display: grid;
  gap: 0.75rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  font-size: var(--step-0);
  color: var(--ink-700);
}

body .instruction-list {
  list-style: none;
  padding-left: 0;
}

body .instruction-list li {
  position: relative;
  margin-bottom: 0;
  padding: 0.85rem 1.1rem 0.85rem 2.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Legacy pins the bullet dot to the li's left edge — move it inside the card */
body .instruction-list li::before {
  left: 1.1rem;
  top: 1.4rem;
  width: 8px;
  height: 8px;
  background-color: var(--brand-700);
}

body .instruction-list li:hover::before { background-color: var(--brand-600); }

body .instruction-list strong { color: var(--ink-900); }

/* -------------------------------------------------------------------------
   Practice test cards
   ------------------------------------------------------------------------- */
body .test-container {
  display: block;
  padding-top: clamp(1rem, 2.5vw, 1.5rem);
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

body .test-card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

body .test-card {
  width: auto;
  height: auto;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body .test-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-200);
}

body .test-color-pattern {
  height: 96px;
  border-radius: 0;
}

body .test-icon { font-size: 32px; }

body .test-content {
  padding: 1rem 1rem 1.25rem;
  margin-top: 0;
}

body .test-text {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink-900);
}

body .test-details,
body .test-question-total {
  font-size: var(--step--1);
  color: var(--ink-500);
}

/* Locked tests should read as locked, not merely decorated */
body .test-card.locked .test-color-pattern { filter: saturate(0.45) brightness(0.9); }

body .test-card.locked::after {
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  border-radius: 50%;
  background: rgba(11, 22, 32, 0.55);
  backdrop-filter: blur(4px);
}

@media screen and (max-width: 800px) {
  body .test-text { font-size: 1.0625rem; }
}

/* -------------------------------------------------------------------------
   Chapter cards
   ------------------------------------------------------------------------- */
body .chapter-test-container {
  padding-top: 0;
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}

body .chapter-card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  max-width: none;
}

body .chapter-card {
  width: auto;
  min-height: 0;
  height: 100%;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body .chapter-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-200);
}

/* Only in the stacked (image-on-top) layout. Below 850px the legacy CSS flips
   these cards to image-left/text-right with percentage widths, and a 170px
   flex-basis there squeezes the text column to ~98px and clips it. */
@media screen and (min-width: 851px) {
  body .chapter_img { flex: 0 0 170px; }
}

body .chapter_img img { border-radius: 0; }

body .chapter-info {
  padding: 1.15rem 0 1.35rem;
  justify-content: flex-start;
}

body .chapter-text {
  padding: 0 1.25rem 0.35rem;
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--ink-900);
}

body .chapter-p-text {
  padding: 0 1.25rem;
  font-size: var(--step--1);
  line-height: 1.55;
  color: var(--ink-500);
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

/* In the side-by-side layout the text column is narrow, so 20px of side
   padding on each edge is most of it. Tighten up. */
@media screen and (max-width: 550px) {
  body .chapter-info { padding-top: 0.85rem; padding-bottom: 0.85rem; }
  body .chapter-text { padding-left: 0.85rem; padding-right: 0.85rem; }
  body .chapter-p-text {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
}

/* -------------------------------------------------------------------------
   Licensing steps ("How to get your licence") — connector line
   -------------------------------------------------------------------------
   The original drew a single line on the <ul> at left:32px, which assumed the
   old content-box node (40px width + 20px padding + 4px border = 64px wide,
   centre 32px). The design-system `box-sizing: border-box` reset makes that
   node 40px wide, so its centre moved to 20px while the line stayed at 32px —
   the line then ran through the right edge of every icon. The same reset also
   squeezed a 30px glyph into a 16px content box.

   Fixed by drawing one segment per step, anchored to the node's real centre,
   so the geometry can't drift out of sync again.
   ------------------------------------------------------------------------- */
body .process-section { text-align: left; }

body .process-heading { text-align: center; }

body .process-list {
  max-width: 720px;
  font-size: var(--step-0);
}

/* Replaced by the per-step segments below. */
body .process-list::before { display: none; }

body .process-list li {
  align-items: flex-start;
  margin: 0 0 1.5rem;
  position: relative;
}

body .process-list li:last-child { margin-bottom: 0; }

body .process-list li::before {
  content: '';
  position: absolute;
  left: 23px;              /* (48px node ÷ 2) − (2px line ÷ 2) */
  top: 48px;               /* starts just below the node */
  bottom: -1.5rem;         /* bridges the gap to the next node */
  width: 2px;
  background: var(--line-strong);
  z-index: 0;
}

body .process-list li:last-child::before { display: none; }

body .process-icon {
  width: 48px;
  height: 48px;
  padding: 0;
  margin-right: 1rem;
  font-size: 1.125rem;
  color: var(--brand-700);
  background: #fff;
  border: 2px solid var(--brand-200);
  z-index: 1;               /* sits above the connector segment */
}

body .process-text {
  padding: 0.6rem 0 0;
  color: var(--ink-500);
}

body .process-text strong {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--ink-900);
  margin-bottom: 0.2rem;
}

@media screen and (max-width: 520px) {
  body .process-icon {
    width: 40px;
    height: 40px;
    margin-right: 0.75rem;
  }
  body .process-list li::before { left: 19px; top: 40px; }
  body .process-text { padding-top: 0.35rem; }
}

/* -------------------------------------------------------------------------
   Flashcards promo
   ------------------------------------------------------------------------- */
body .flashcards-section {
  max-width: var(--container);
  margin: clamp(1.5rem, 3vw, 2.5rem) auto;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  background: var(--surface-cool);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body .flashcards-section:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-200);
}

body .flashcards-container {
  gap: 1.5rem;
  max-width: none;
}

body .flashcards-text {
  flex: 1 1 320px;
  text-align: left;
}

body .flashcards-description {
  font-size: var(--step-0);
  color: var(--ink-500);
}

@media screen and (max-width: 640px) {
  body .flashcards-text { text-align: center; }
}

/* -------------------------------------------------------------------------
   App download + cross-promo
   ------------------------------------------------------------------------- */
body .download-section,
body .other_product_container {
  padding-top: clamp(2rem, 4vw, 3rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

/* Legacy made the section itself a white card, which then nests another white
   card inside it. Flatten the outer one and let the inner card carry the look. */
body .download-section {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  margin-top: 0;
  margin-bottom: 0;
}

body .download-container,
body .other_product_download-section {
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  gap: 1.25rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

body .download-description,
body .other_product_download-description {
  font-size: var(--step--1);
  color: var(--ink-500);
}

body .other_product_download-heading {
  color: var(--brand-800);
  font-weight: 800;
  font-size: var(--step-2);
}

/* The legacy row squeezes the text column to a sliver when only one promo is
   present — give it room and left-align it. */
body .other_product_download-section {
  flex: 1 1 520px;
  max-width: 680px;
  align-items: center;
}

body .other_product_download-text {
  flex: 1 1 58%;
  margin-right: 0;
  text-align: left;
}

body .other_product_download-image {
  flex: 1 1 38%;
}

body .other_product_download-image img { width: 100%; }

@media screen and (max-width: 800px) {
  body .other_product_download-text { text-align: center; }
}

body .other_product_button-visit-website {
  padding: 10px 20px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--brand-700);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

body .other_product_button-visit-website:hover { background: var(--brand-800); }

body .website-link-text { color: var(--brand-700); }

/* -------------------------------------------------------------------------
   Blog / related-post cards
   -------------------------------------------------------------------------
   These kept a rigid 280x320 box with side margins, which overflowed any
   viewport under ~360px. Same card treatment as the practice tests.
   ------------------------------------------------------------------------- */
body .blog-test-container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-left: auto;
  margin-right: auto;
  display: block;
  padding: 0 var(--gutter) clamp(2rem, 4vw, 3rem);
}

/* auto-FIT, not auto-fill: with three posts in a 1200px row, auto-fill leaves a
   dead fourth track and the group hangs to the left. auto-fit collapses the
   empty track so the posts share the full width evenly. */
body .blog-test-card-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  justify-content: center;
  max-width: none;
}

/* The <a> wrapper is the grid item and stretches to the row height; the card
   inside must fill it or shorter posts leave a ragged bottom edge. */
body .blog-test-card-container > a {
  display: block;
  height: 100%;
}

body .blog-test-card {
  /* max-width guards the degenerate case: one post shouldn't span 1200px. */
  max-width: 460px;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

body .blog-test-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-200);
}

body .blog_img { height: auto; flex: 0 0 150px; }
body .blog_img img { border-radius: 0; }

body .blog-info { padding: 1.15rem 1.25rem 1.35rem; }

/* -------------------------------------------------------------------------
   Testimonials
   ------------------------------------------------------------------------- */
body .testimonial-section {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 4rem) var(--gutter);
}

body .testimonial-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
  justify-content: initial;
}

body .testimonial {
  width: auto;
  min-width: 0;
  margin: 0;
  padding: clamp(1.35rem, 2.5vw, 1.85rem);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  text-align: left;
}

body .testimonial-quote {
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink-900);
}

body .testimonial-author {
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--ink-500);
}

/* -------------------------------------------------------------------------
   Quiz page
   -------------------------------------------------------------------------
   quiz.css already themes itself from its own custom properties, so most of
   the restyle is just repointing those at design-system tokens.
   ------------------------------------------------------------------------- */
/* `:root:root` doubles the specificity so these beat quiz.css's own `:root`
   block regardless of which stylesheet webpack emits last. */
:root:root {
  --clr-primary: #0a6e80;
  --clr-primary-dark: #0a5462;
  --clr-bg: #ffffff;
  --clr-surface: #ffffff;
  --clr-success: #067647;
  --clr-error: #c8102e;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(11, 22, 32, 0.06), 0 1px 3px rgba(11, 22, 32, 0.05);
}

/* The 100px top padding existed to clear the old fixed header; the header is
   sticky and in flow now, so that gap is dead space. */
body #app {
  padding-top: 0;
  padding-bottom: clamp(2rem, 5vw, 4rem);
}

body .quiz-common-container { padding-top: clamp(1.25rem, 3vw, 2rem); }

body .quiz-main-container,
body .side-panel,
body .button-side-panel,
body .result-side-panel {
  border: 1px solid var(--line);
}

body .quiz-main-container { padding: clamp(1.25rem, 2.5vw, 1.75rem); }

/* .quiz-card sits inside .quiz-main-container, which already provides the card
   surface — its own radius/shadow showed as a second card edge behind the
   Previous/Next buttons. The opaque background stays: the slide transition
   overlaps two cards and needs the incoming one to cover the outgoing one. */
body .quiz-card {
  box-shadow: none;
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
}

body .quiz-main-container:hover { box-shadow: var(--shadow); }

body .quiz-question {
  color: var(--ink-900);
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Answer options — larger tap target, clearer states */
body .quiz-option {
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink-700);
}

body .quiz-option:hover:not(.quiz-option-disabled):not(.quiz-option-correct):not(.quiz-option-incorrect) {
  background: var(--surface-cool);
  border-color: var(--brand-600);
  color: var(--ink-900);
}

body .quiz-option-selected { border-color: var(--brand-600); }

body .quiz-option-correct {
  background: var(--success-100) !important;
  border-color: var(--success);
  color: #04532f;
  font-weight: 600;
}

body .quiz-option-incorrect {
  background: var(--maple-100) !important;
  border-color: var(--maple);
  color: #8c0b20;
  font-weight: 600;
}

body .quiz-explanation-container {
  margin-top: 0.5rem;
  padding: 0.9rem 1rem;
  background: var(--surface-cool);
  border: 1px solid var(--brand-200);
  border-radius: var(--radius-sm);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink-700);
}

body .quiz-button,
body .side-panel-button {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 700;
}

body .quiz-button:hover:not(.disabled),
body .side-panel-button:hover {
  transform: translateY(-1px);
}

body .quiz-button.disabled {
  background: var(--line);
  color: var(--ink-300);
}

body .question-nav button {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--surface-warm);
  border: 1px solid var(--line);
  color: var(--ink-700);
  font-weight: 600;
}

body .question-nav button.correct,
body .question-nav button.incorrect { border-color: transparent; }

body .question-nav button.current { outline: 2px solid var(--brand-600); }

body .side-panel-stats-container .quiz-progress-bar { background: var(--line); }

body .quiz-test-text { color: var(--ink-900); }

/* 44px is Apple's minimum comfortable tap target; 35px was under it and this
   button is the primary control for ESL learners on phones. */
body .audio-button {
  flex: none;
  width: 44px;
  height: 44px;
}

@media (max-width: 640px) {
  /* The quiz header also carries a "Remove Ads" button, so something has to
     give. Drop the wordmark rather than the province chip — on a province-
     specific test, knowing you're in the BC set is the more useful signal.
     (quiz.css hides the chip here; this puts it back.) */
  body #app .bar-text { display: none; }
  body #app .bc_text  { display: inline-block; }
}

@media (max-width: 1010px) {
  /* Stacked layout puts the side panel — including a grid of up to 50 question
     buttons — above the question itself, so on a phone you scroll past a wall
     of numbers to reach question 1. Lead with the question instead. */
  body .quiz-main-container { order: -1; }

  body .combine-side-panel { margin-top: 1rem; }

  /* Bigger targets for the question-number grid on touch screens. */
  body .question-nav button {
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
  }
}

/* A quiet escape hatch for visitors who arrived on the wrong province page.
   The homepage remains the primary province directory. */
body .province-switch {
  max-width: var(--container);
  margin: clamp(1.5rem, 4vw, 2.5rem) auto 0;
  padding-inline: var(--gutter);
  text-align: center;
  font-size: var(--step--1);
}

body .province-switch a {
  color: var(--ink-500);
  font-weight: 600;
  text-underline-offset: 0.2em;
}

body .province-switch a:hover,
body .province-switch a:focus-visible {
  color: var(--brand-700);
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
body .bottom-panel {
  background: var(--brand-900);
  color: #9dbcc4;
  padding-top: clamp(2rem, 4vw, 2.75rem);
  padding-bottom: clamp(2rem, 4vw, 2.75rem);
  font-size: var(--step--1);
}

body .bottom-links {
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin-top: 0.75rem;
}

body .bottom-links a {
  color: #9dbcc4;
  font-weight: 600;
}

body .bottom-links a:hover,
body .bottom-links a:focus { color: #fff; }

body .cookie-policy {
  color: #9dbcc4;
  text-decoration: underline;
  cursor: pointer;
}

body .cookie-policy:hover { color: #fff; }

