/* tokens.css from the prototype (rem written as px). Generated: don't edit. */
/*
 * NBSUK design tokens.
 *
 * Variables only: this file styles nothing by itself. The --nbs- prefix keeps them clear of
 * Bootstrap's variables (--primary, --blue, …) and the existing site CSS.
 *
 * The brand colours are the live site's: header red #d93939, heading navy #232d80.
 * Contrast ratios are WCAG 2.x. Colour roles are explained in docs/design-decisions.md (DD-05).
 */
:root {
  /* Brand: red is identity and accent; navy is structure and interaction. */
  --nbs-red-500: #d93939;   /* existing brand red. White text on it 4.57:1. As text: white backgrounds only (4.57:1); fails on --nbs-surface-muted (4.23:1). */
  --nbs-red-700: #b42828;   /* red for text and small marks: 6.41:1 on white, 5.93:1 on muted */
  --nbs-red-050: #fdf0f0;
  --nbs-navy-700: #232d80;  /* existing brand navy: 11.94:1 on white */
  --nbs-navy-900: #161c4f;  /* deep navy for dark surfaces: white text 15.99:1 */
  --nbs-navy-100: #e3e6f4;
  --nbs-navy-050: #f2f3fa;

  /* Neutrals */
  --nbs-ink: #1b1f2e;            /* body text: 16.38:1 on white */
  --nbs-ink-muted: #4a5163;      /* secondary text: 7.93:1 on white, 7.34:1 on muted */
  --nbs-surface: #ffffff;
  --nbs-surface-muted: #f5f6f9;  /* section bands, table stripes */
  --nbs-border: #dfe2ea;         /* decorative dividers only (1.30:1) */
  --nbs-border-strong: #c3c8d4;  /* decorative only (1.68:1); form-control borders need >= 3:1, so use --nbs-ink-muted */

  /* Status colours: always with a text label or icon, never colour alone. */
  --nbs-positive-700: #1e7a46;   /* 5.35:1 on white, 4.81:1 on its tint */
  --nbs-positive-050: #e9f6ee;
  --nbs-caution-700: #8a5a00;    /* 5.93:1 on white, 5.46:1 on its tint */
  --nbs-caution-050: #fdf5e3;
  --nbs-negative-700: #b42828;   /* 6.41:1 on white, 5.77:1 on its tint */
  --nbs-negative-050: #fdf0f0;

  /* Rating stars: decorative only (the rating is always given as text), so no contrast requirement. */
  --nbs-star: #e3a008;

  /* Colour roles: components use these, not the raw palette. */
  --nbs-color-text: var(--nbs-ink);
  --nbs-color-text-muted: var(--nbs-ink-muted);
  --nbs-color-heading: var(--nbs-navy-700);
  --nbs-color-link: var(--nbs-navy-700);
  --nbs-color-link-hover: var(--nbs-red-700);
  --nbs-color-accent: var(--nbs-red-500);
  --nbs-color-focus: var(--nbs-navy-700);       /* on light surfaces */
  --nbs-color-focus-inverse: #ffffff;           /* on red/navy surfaces: 4.57:1 on red, 11.94:1 on navy */

  /* Typography. Nunito Sans, the site's existing font. */
  --nbs-font-sans: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --nbs-weight-regular: 400;
  --nbs-weight-medium: 500;
  --nbs-weight-semibold: 600;
  --nbs-weight-bold: 700;
  --nbs-weight-heavy: 800;

  /* Heading weights as on the live site: H1 700, H2 and H3 500, H4 700. */
  --nbs-weight-h1: var(--nbs-weight-bold);
  --nbs-weight-h2: var(--nbs-weight-medium);
  --nbs-weight-h3: var(--nbs-weight-medium);
  --nbs-weight-h4: var(--nbs-weight-bold);

  /* Type scale: fluid between ~360px and ~1280px viewports. Values in rem (16px root). */
  --nbs-text-xs: 13px;                                    /* 13px: terms, fine print */
  --nbs-text-sm: 14px;                                     /* 14px: metadata, captions */
  --nbs-text-md: 16px;                                         /* 16px: table cells, UI text */
  --nbs-text-base: clamp(17px, 15.68px + 0.33vw, 19px); /* 17px → 19px: body copy (19px from about 1024px wide) */
  --nbs-text-lead: clamp(19px, 17.6px + 0.4vw, 21px);   /* 19px → 21px: introductions */
  --nbs-text-h4: clamp(17px, 16px + 0.3vw, 19px);       /* 17px → 19px */
  --nbs-text-h3: clamp(20px, 18.4px + 0.45vw, 24px);        /* 20px → 24px */
  --nbs-text-h2: clamp(24px, 20.8px + 0.9vw, 32px);             /* 24px → 32px */
  --nbs-text-h1: clamp(26px, 22.4px + 1vw, 36px);          /* 26px → 36px: above H2 at every width; 36px matches production's other templates */

  --nbs-leading-tight: 1.2;
  --nbs-leading-snug: 1.35;
  --nbs-leading-body: 1.65;
  /* Text width. 100% is the full container, the same width as the tables (about 120 characters a
     line at 1440px). For a narrower reading column, use calc(var(--nbs-text-base) * 37): about 700px. */
  --nbs-measure: 100%;

  /* Spacing: 4px base */
  --nbs-space-1: 4px;
  --nbs-space-2: 8px;
  --nbs-space-3: 12px;
  --nbs-space-4: 16px;
  --nbs-space-5: 24px;
  --nbs-space-6: 32px;
  --nbs-space-7: 48px;
  --nbs-space-8: 64px;
  --nbs-space-9: 96px;
  --nbs-section-space: clamp(40px, 24px + 4vw, 72px);

  /* Layout */
  --nbs-container: 1110px;   /* 1110px content width, matching the production Bootstrap container at >= 1200px */
  --nbs-gutter: clamp(16px, 9.6px + 1.8vw, 24px);

  /* Fixed and sticky elements. On the live site the 55px header scrolls away below ~991px;
     from ~991px a 56px header is fixed. */
  --nbs-header-height: 0px;           /* fixed header height at this breakpoint (0 = header not fixed) */
  --nbs-section-nav-height: 48px;     /* 48px sticky section bar */
  --nbs-sticky-offset: calc(var(--nbs-header-height) + var(--nbs-section-nav-height) + var(--nbs-space-4));
  --nbs-bottom-bar-height: 0px;       /* production's fixed mobile bottom bar (57px on narrow phones) */
  --nbs-sticky-offset-bottom: calc(var(--nbs-bottom-bar-height) + var(--nbs-space-4));

  /* Shape: radius encodes hierarchy (chips < cards < panels). */
  --nbs-radius-sm: 4px;
  --nbs-radius-md: 8px;
  --nbs-radius-lg: 12px;
  --nbs-shadow-raised: 0 1px 2px rgb(22 28 79 / 0.06), 0 2px 8px rgb(22 28 79 / 0.06);
  --nbs-shadow-overlay: 0 8px 28px rgb(22 28 79 / 0.18);

  /* Focus */
  --nbs-focus-width: 3px;
  --nbs-focus-offset: 2px;

  /* Motion: transitions are opt-in under prefers-reduced-motion: no-preference. */
  --nbs-duration-fast: 120ms;
  --nbs-duration-base: 200ms;
  --nbs-ease: cubic-bezier(0.2, 0, 0, 1);

  /* Stacking, aligned with production: Bootstrap's fixed header uses 1030, the cookie banner 9999,
     the assistant button 9. The section bar sits just below the header so header menus open over it. */
  --nbs-z-sticky: 1020;
  --nbs-z-overlay: 1040;
}

/* Production shows its fixed 57px bottom bar on narrow phones (seen at 390px, not at 575px).
   Confirm the exact breakpoint in production CSS; 575px is the Bootstrap small-screen limit. */
@media (max-width: 35.9375em) {
  :root {
    --nbs-bottom-bar-height: 57px;
  }
}

/* The live site switches to the fixed 56px desktop header at about 991px. */
@media (min-width: 61.9375em) {
  :root {
    --nbs-header-height: 56px;
  }
}
