/*
 * ICI design system 2026 (redesign, 20 October 2026).
 *
 * Direction: the founder's concept image and the ICI logo kit. A bright, editorial civic-data look:
 * light grounds, white cards, large real photography, a calm serif for headlines and Inter for the interface.
 * The palette is the logo kit's own colours. Loaded after the existing stylesheets; it restyles the shared
 * chrome (header, footer, buttons, links, forms) for every page and adds the "ds-" components used by
 * redesigned templates. Existing page components keep working underneath it.
 */

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

:root {
  /* palette: ICI logo kit */
  --ds-navy: #092A40;        /* ink, primary actions */
  --ds-storm: #0F4C6B;       /* links, secondary ink */
  --ds-blue: #2387B7;        /* large accents and strokes only (3.9:1 on white) */
  --ds-sky: #50B8DC;
  --ds-pale: #A9DAE7;
  --ds-teal: #127F83;        /* evidence available, positive state */
  --ds-teal-ink: #0B5F62;    /* teal for text: 6.3:1 or better on every light ground in the system (AA) */
  --ds-sage: #84A67A;
  --ds-amber: #F5A32B;       /* the sun: one short rule under a page title, the logo's disc */
  --ds-terracotta: #D96749;  /* heat only */
  --ds-cloud: #E8ECEF;
  --ds-stone: #B5ADA2;
  --ds-ground: #F4F7F9;      /* page ground between white cards */
  --ds-card: #FFFFFF;
  --ds-line: #DCE4EA;
  --ds-muted: #4A6070;       /* secondary text: 6.4:1 on white */
  --ds-shadow: 0 1px 2px rgba(9, 42, 64, 0.06), 0 8px 24px rgba(9, 42, 64, 0.07);
  --ds-shadow-lift: 0 2px 4px rgba(9, 42, 64, 0.08), 0 18px 40px rgba(9, 42, 64, 0.12);

  /* type */
  --ds-serif: "Source Serif 4 Variable", Georgia, "Times New Roman", serif;
  --ds-sans: "Inter Variable", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;

  /* scale: 1.25 steps from 1rem, display steps fluid */
  --ds-t-xs: 0.8125rem;
  --ds-t-s: 0.9375rem;
  --ds-t-m: 1.0625rem;
  --ds-t-l: 1.25rem;
  --ds-t-xl: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
  --ds-t-2xl: clamp(1.9rem, 1.3rem + 2.2vw, 2.75rem);
  --ds-t-3xl: clamp(2.5rem, 1.4rem + 4.2vw, 4.5rem);

  /* space */
  --ds-wrap: 76rem;
  --ds-gutter: clamp(1rem, 3.5vw, 2.5rem);
  --ds-section: clamp(3.5rem, 7vw, 6.5rem);
  --ds-r-s: 8px;
  --ds-r-m: 14px;
  --ds-r-l: 22px;

  /* carry the new palette into the existing tokens so untouched templates follow the identity */
  --ink: var(--ds-navy);
  --ink-deep: #061F30;
  --ici-navy: var(--ds-navy);
  --teal: var(--ds-storm);
  --paper: var(--ds-ground);
  --focus-ring: var(--ds-navy);
}

/* ---------- base ---------- */
body { background: var(--ds-ground); color: var(--ds-navy); font-family: var(--ds-sans); }
:where(h1, h2) { font-family: var(--ds-serif); font-optical-sizing: auto; font-weight: 600; letter-spacing: -0.01em; color: var(--ds-navy); }
:where(a) { color: var(--ds-storm); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
:where(a:hover) { color: var(--ds-navy); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ds-amber); outline-offset: 2px; }
.ds-wrap { width: min(100% - 2 * var(--ds-gutter), var(--ds-wrap)); margin-inline: auto; }
.ds-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons ---------- */
.ds-btn { display: inline-flex; align-items: center; gap: 0.55rem; min-height: 2.9rem; padding: 0 1.35rem; border-radius: 999px;
  font: 600 var(--ds-t-s)/1 var(--ds-sans); text-decoration: none; border: 1.5px solid transparent; cursor: pointer; white-space: nowrap; }
.ds-btn-primary { background: var(--ds-navy); color: #fff; }
.ds-btn-primary:hover { background: var(--ds-storm); color: #fff; }
.ds-btn-ghost { background: #fff; color: var(--ds-navy); border-color: var(--ds-line); }
.ds-btn-ghost:hover { border-color: var(--ds-navy); color: var(--ds-navy); }
.ds-btn-light { background: #fff; color: var(--ds-navy); }
.ds-btn-light:hover { background: var(--ds-cloud); color: var(--ds-navy); }
.ds-btn svg { width: 1.05em; height: 1.05em; flex: none; }
.ds-textlink { font-weight: 600; color: var(--ds-storm); text-decoration: none; display: inline-flex; gap: 0.4rem; align-items: center; }
.ds-textlink:hover { text-decoration: underline; }
.ds-textlink svg { width: 1em; height: 1em; }

/* the focused skip link shows at the top of the viewport wherever the page is scrolled, above the sticky header */
.skip-link:focus { position: fixed; top: 0.5rem; left: 0.5rem; z-index: 100; }

/* the icon sprite is a definitions-only SVG; a class, because the site CSP (style-src 'self') blocks inline style attributes */
.ds-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- header ---------- */
.ds-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, 0.96); backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--ds-line); }
.ds-header-inner { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2.5rem); min-height: 4.5rem; }
.ds-brand { display: inline-flex; align-items: center; gap: 0.7rem; text-decoration: none; color: var(--ds-navy); flex: none; }
.ds-brand img { width: 2.75rem; height: 2.75rem; }
.ds-brand-ici { font: 700 2rem/1 var(--ds-serif); letter-spacing: -0.02em; }
.ds-brand-name { font: 600 0.62rem/1.25 var(--ds-sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ds-navy);
  padding-left: 0.7rem; border-left: 1px solid var(--ds-line); }
.ds-nav { display: none; gap: 0.25rem; margin-left: auto; }
.ds-nav a { padding: 0.55rem 0.8rem; border-radius: 999px; font: 500 var(--ds-t-s)/1 var(--ds-sans); color: var(--ds-navy); text-decoration: none; }
.ds-nav a:hover { background: var(--ds-cloud); }
.ds-nav a[aria-current="page"] { background: var(--ds-cloud); font-weight: 600; }
.ds-header-actions { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.ds-menu-toggle { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0 0.95rem; border-radius: 999px;
  border: 1.5px solid var(--ds-line); background: #fff; color: var(--ds-navy); font: 600 var(--ds-t-s)/1 var(--ds-sans); cursor: pointer; }
.ds-menu-toggle .nav-toggle-mark, .ds-menu-toggle .nav-toggle-mark::before, .ds-menu-toggle .nav-toggle-mark::after { width: 1rem; }
.ds-header .ds-cta { display: none; }
@media (min-width: 64rem) {
  .ds-nav { display: flex; }
  .ds-header-actions { margin-left: 0.5rem; }
  .ds-header .ds-cta { display: inline-flex; }
}
@media (max-width: 30rem) { .ds-brand-name { display: none; } }

/* the full site map behind "Menu" (driven by the existing nav.js: #site-menu, .nav-toggle) */
.ds-menu { background: #fff; border-top: 1px solid var(--ds-line); box-shadow: var(--ds-shadow-lift); max-height: calc(100vh - 4.5rem); overflow: auto; }
.ds-menu[hidden] { display: none; }
/* the legacy stylesheet hides .nav-menu at 84rem and wider (where the old inline links took over); the full site map
   behind "Menu" opens at every width */
.ds-menu.nav-menu:not([hidden]) { display: block; }
/* account controls that nav.js adds when accounts are available */
.ds-nav .nav-account { display: inline-flex; align-items: center; gap: 0.25rem; }
.ds-menu .nav-account { display: grid; gap: 0.15rem; }
.ds-menu-grid { display: grid; gap: 1.75rem 2rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); padding-block: 2rem 2.5rem; }
/* the six WEB-02 groups sit in two rows of three on wide screens */
@media (min-width: 64rem) { .ds-menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ds-menu-h { font: 600 var(--ds-t-xs)/1.2 var(--ds-sans); color: var(--ds-muted); margin: 0 0 0.75rem; }
.ds-menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.ds-menu a { display: block; padding: 0.4rem 0; color: var(--ds-navy); text-decoration: none; font-weight: 500; }
.ds-menu a:hover { color: var(--ds-storm); text-decoration: underline; }
.ds-menu .ds-tag { font: 600 0.7rem/1 var(--ds-sans); color: var(--ds-teal-ink); background: #E3F2F2; border-radius: 999px; padding: 0.2rem 0.45rem; margin-left: 0.35rem; vertical-align: 0.1em; }

/* ---------- hero ---------- */
.ds-hero { position: relative; isolation: isolate; color: var(--ds-navy); }
.ds-hero-photo { position: absolute; inset: 0; z-index: -2; }
.ds-hero-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 70% 55%; }
.ds-hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.9) 34%, rgba(255, 255, 255, 0.35) 62%, rgba(255, 255, 255, 0) 80%),
              linear-gradient(0deg, var(--ds-ground) 0%, rgba(244, 247, 249, 0) 22%); }
.ds-hero-inner { padding-block: clamp(3rem, 8vw, 6.5rem) clamp(9rem, 16vw, 12rem); }
.ds-hero h1 { font-size: var(--ds-t-3xl); line-height: 1.02; letter-spacing: -0.025em; font-weight: 600; max-width: 12ch; margin: 0; }
.ds-rule { display: block; width: 3rem; height: 4px; border-radius: 2px; background: var(--ds-amber); margin: 1.5rem 0 1.25rem; }
.ds-hero-lede { font-size: var(--ds-t-m); line-height: 1.6; max-width: 34rem; margin: 0; color: #22394A; }
@media (max-width: 47.99rem) {
  .ds-hero::before { background: linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.86) 55%, rgba(244, 247, 249, 1) 100%); }
  .ds-hero-inner { padding-bottom: 2rem; }
}

/* the area search, overlapping the hero */
.ds-search { margin-top: 2rem; max-width: 46rem; background: #fff; border-radius: var(--ds-r-l); box-shadow: var(--ds-shadow-lift); padding: 0.5rem; }
.ds-search form { display: flex; gap: 0.5rem; align-items: stretch; flex-wrap: wrap; }
.ds-search-field { flex: 1 1 16rem; display: flex; align-items: center; gap: 0.6rem; padding: 0 0.9rem; border-radius: calc(var(--ds-r-l) - 6px); }
.ds-search-field svg { width: 1.25rem; height: 1.25rem; color: var(--ds-muted); flex: none; }
.ds-search-field label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ds-search-field input { flex: 1; min-width: 0; min-height: 3.1rem; border: 0; background: transparent; font: 500 var(--ds-t-m)/1.2 var(--ds-sans); color: var(--ds-navy); }
.ds-search-field input:focus { outline: none; }
.ds-search-field:focus-within { box-shadow: inset 0 0 0 2px var(--ds-storm); }
.ds-search .ds-btn { min-height: 3.1rem; flex: 0 0 auto; }
@media (max-width: 30rem) { .ds-search .ds-btn { flex: 1 1 100%; justify-content: center; } }
.ds-search-help { margin: 0.65rem 0.25rem 0; font-size: var(--ds-t-xs); color: var(--ds-muted); max-width: 46rem; }
.ds-search-help.is-error { color: #A33A1E; }
.ds-search-examples { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; margin: 0.75rem 0.25rem 0; font-size: var(--ds-t-xs); color: var(--ds-muted); }
.ds-search-examples button { border: 0; background: none; padding: 0; font: inherit; color: var(--ds-storm); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }

/* ---------- feature cards (overlap the hero's lower edge) ---------- */
.ds-features { position: relative; margin-top: clamp(-8.5rem, -12vw, -6rem); }
@media (max-width: 47.99rem) { .ds-features { margin-top: 0; } }
.ds-feature-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr)); }
.ds-card { background: var(--ds-card); border-radius: var(--ds-r-l); box-shadow: var(--ds-shadow); border: 1px solid rgba(220, 228, 234, 0.7); }
.ds-feature { display: flex; flex-direction: column; overflow: hidden; color: inherit; text-decoration: none; transition: box-shadow var(--dur-base, 200ms) ease, transform var(--dur-base, 200ms) ease; }
.ds-feature:hover { box-shadow: var(--ds-shadow-lift); color: inherit; }
.ds-feature-body { padding: 1.5rem 1.5rem 1.1rem; display: grid; grid-template-columns: auto 1fr auto; gap: 0.35rem 1rem; align-items: start; }
.ds-feature-icon { grid-row: span 2; width: 3rem; height: 3rem; color: var(--ds-navy); }
.ds-feature h2 { font-size: var(--ds-t-xl); line-height: 1.1; margin: 0; }
.ds-feature p { grid-column: 2 / 4; margin: 0; color: var(--ds-muted); font-size: var(--ds-t-s); line-height: 1.5; }
.ds-feature-go { width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 1.5px solid var(--ds-line); display: grid; place-items: center; color: var(--ds-navy); }
.ds-feature:hover .ds-feature-go { background: var(--ds-navy); border-color: var(--ds-navy); color: #fff; }
.ds-feature-go svg { width: 1rem; height: 1rem; }
.ds-feature-visual { position: relative; margin: 0 1rem 1rem; border-radius: var(--ds-r-m); overflow: hidden; aspect-ratio: 16 / 9; background: var(--ds-cloud); }
.ds-feature-visual img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ds-chiplist { position: absolute; right: 0.75rem; bottom: 0.75rem; top: 0.75rem; width: min(12rem, 52%); background: rgba(255, 255, 255, 0.96);
  border-radius: var(--ds-r-s); padding: 0.6rem 0.75rem; list-style: none; margin: 0; display: grid; align-content: center; gap: 0.15rem; box-shadow: var(--ds-shadow); }
.ds-chiplist li { display: flex; gap: 0.5rem; align-items: center; font-size: var(--ds-t-xs); color: var(--ds-navy); padding: 0.25rem 0; }
.ds-chiplist li + li { border-top: 1px solid var(--ds-cloud); }
.ds-chiplist svg { width: 1rem; height: 1rem; color: var(--ds-storm); flex: none; }
.ds-note-card { position: absolute; right: 0.75rem; bottom: 0.75rem; max-width: 15rem; background: #fff; border-radius: var(--ds-r-s); padding: 0.7rem 0.85rem;
  box-shadow: var(--ds-shadow); font-size: var(--ds-t-xs); line-height: 1.45; color: var(--ds-muted); }
.ds-note-card strong { display: block; color: var(--ds-navy); font-size: var(--ds-t-s); margin-bottom: 0.15rem; }
.ds-note-card .ds-stage { display: inline-block; font-weight: 600; color: #8A4B00; background: #FFF1DC; border-radius: 999px; padding: 0.1rem 0.45rem; margin-bottom: 0.35rem; }
.ds-feature-map { background: linear-gradient(180deg, #EAF4F8, #F6FAFB); }
.ds-feature-map svg { width: 100%; height: 100%; }

/* mini condition profile (illustrates the real output; labelled as an example) */
.ds-mini-profile { position: absolute; inset: 0.75rem; display: grid; gap: 0.4rem; align-content: center; }
.ds-mini-row { display: grid; grid-template-columns: 4px 1fr auto; gap: 0.6rem; align-items: center; background: #fff; border-radius: var(--ds-r-s); padding: 0.45rem 0.65rem; box-shadow: var(--ds-shadow); font-size: var(--ds-t-xs); }
.ds-mini-row i { align-self: stretch; border-radius: 2px; background: var(--ds-teal); }
.ds-mini-row.is-best i { background: var(--ds-amber); }
.ds-mini-row.is-gap i { background: repeating-linear-gradient(180deg, var(--ds-muted) 0 3px, transparent 3px 6px); }
.ds-mini-row b { color: var(--ds-navy); font-weight: 600; }
.ds-mini-row span { color: var(--ds-muted); }
.ds-mini-row em { font-style: normal; font: 700 1.05rem/1 var(--ds-serif); color: var(--ds-navy); }

/* ---------- tools strip ---------- */
.ds-tools { margin-top: 1.25rem; padding: 1rem clamp(1rem, 2vw, 1.5rem); display: grid; gap: 0.25rem; grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr)); align-items: stretch; }
.ds-tools-h { font: 600 var(--ds-t-s)/1.3 var(--ds-sans); color: var(--ds-navy); margin: 0; align-self: center; padding: 0.5rem; }
.ds-tool { display: grid; grid-template-columns: 2.25rem 1fr; gap: 0.1rem 0.75rem; padding: 0.7rem 0.6rem; border-radius: var(--ds-r-m); text-decoration: none; color: var(--ds-navy); align-items: center; }
.ds-tool:hover { background: var(--ds-ground); color: var(--ds-navy); }
.ds-tool svg { grid-row: span 2; width: 2rem; height: 2rem; color: var(--ds-storm); }
.ds-tool b { font: 600 var(--ds-t-s)/1.2 var(--ds-sans); }
.ds-tool span { font-size: var(--ds-t-xs); color: var(--ds-muted); line-height: 1.35; }

/* ---------- sections ---------- */
.ds-section { padding-block: var(--ds-section); }
.ds-section-white { background: #fff; }
.ds-section-head { max-width: 44rem; margin-bottom: clamp(1.75rem, 3vw, 2.5rem); }
.ds-section-head h2 { font-size: var(--ds-t-2xl); line-height: 1.08; margin: 0 0 0.85rem; }
.ds-section-head p { margin: 0; color: var(--ds-muted); font-size: var(--ds-t-m); line-height: 1.6; }
.ds-section-head .ds-rule { margin: 0 0 1.1rem; }

/* local conditions example */
.ds-local { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 64rem) { .ds-local { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr) minmax(0, 0.9fr); } }
.ds-local-intro h2 { font-size: var(--ds-t-2xl); line-height: 1.08; margin: 0 0 1rem; }
.ds-local-intro p { color: var(--ds-muted); line-height: 1.6; }
.ds-place { display: inline-flex; gap: 0.5rem; align-items: center; padding: 0.5rem 0.9rem; border-radius: 999px; background: #fff; border: 1px solid var(--ds-line); font-weight: 600; margin: 0.25rem 0 1rem; }
.ds-place svg { width: 1rem; height: 1rem; color: var(--ds-storm); }
.ds-local-photo { position: relative; border-radius: var(--ds-r-l); overflow: hidden; min-height: 22rem; box-shadow: var(--ds-shadow); }
.ds-local-photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ds-readings { position: absolute; top: 1rem; right: 1rem; width: min(19rem, calc(100% - 2rem)); background: #fff; border-radius: var(--ds-r-m); padding: 1rem 1.1rem; box-shadow: var(--ds-shadow-lift); }
@media (max-width: 40rem) { .ds-local-photo { min-height: 0; } .ds-local-photo > img { position: static; aspect-ratio: 4 / 3; height: auto; }
  .ds-readings { position: static; width: auto; border-radius: 0; box-shadow: none; } }
.ds-readings h3 { font: 600 var(--ds-t-s)/1.3 var(--ds-sans); margin: 0 0 0.15rem; }
.ds-readings .ds-src { font-size: var(--ds-t-xs); color: var(--ds-muted); margin: 0 0 0.75rem; line-height: 1.4; }
.ds-readings dl { margin: 0; display: grid; }
.ds-readings dl > div { display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 0.75rem; padding: 0.55rem 0; border-top: 1px solid var(--ds-cloud); }
.ds-readings dt { font-size: var(--ds-t-xs); color: var(--ds-muted); }
.ds-readings dd { margin: 0; font: 700 var(--ds-t-m)/1.1 var(--ds-serif); text-align: right; white-space: nowrap; }
.ds-readings dd small { font: 500 0.7rem/1 var(--ds-sans); color: var(--ds-muted); display: block; margin-top: 0.15rem; }
.ds-readings .ds-textlink { margin-top: 0.75rem; font-size: var(--ds-t-s); }
.ds-meaning { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
.ds-meaning h3 { font: 600 var(--ds-t-m)/1.3 var(--ds-sans); margin: 0 0 0.5rem; }
.ds-meaning li { display: grid; grid-template-columns: 2.5rem 1fr; gap: 0.15rem 0.85rem; padding: 0.85rem 0; border-top: 1px solid var(--ds-line); }
.ds-meaning li svg { grid-row: span 2; width: 2.25rem; height: 2.25rem; color: var(--ds-storm); }
.ds-meaning b { font-weight: 600; }
.ds-meaning span { color: var(--ds-muted); font-size: var(--ds-t-s); line-height: 1.5; }

/* condition tiles */
.ds-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14.5rem), 1fr)); }
.ds-tile { display: flex; flex-direction: column; overflow: hidden; height: 100%; }
.ds-tile picture, .ds-tile > img { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.ds-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ds-tile-body { padding: 1rem 1.1rem 1.15rem; display: grid; gap: 0.4rem; flex: 1; align-content: start; }
.ds-tile h3 { font: 600 var(--ds-t-m)/1.25 var(--ds-sans); margin: 0; }
.ds-tile p { margin: 0; color: var(--ds-muted); font-size: var(--ds-t-s); line-height: 1.5; }
/* each condition says what it may touch and what to check (W2-04) */
.ds-tile dl { margin: 0; display: grid; gap: 0.45rem; }
.ds-tile dt { font: 600 var(--ds-t-xs)/1.3 var(--ds-sans); color: var(--ds-muted); margin: 0; }
main#main .ds-tile h3 { font-size: 1.1875rem; margin-bottom: 0.15rem; }
.ds-tile dd { margin: 0; color: var(--ds-muted); font-size: var(--ds-t-s); line-height: 1.5; }
.ds-tile .ds-textlink { margin-top: auto; padding-top: 0.4rem; font-size: var(--ds-t-s); }
.ds-caption { margin-top: 1rem; font-size: var(--ds-t-xs); color: var(--ds-muted); }

/* principles */
.ds-principles { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.ds-principle { padding: 1.5rem; }
.ds-principle svg { width: 2.25rem; height: 2.25rem; color: var(--ds-teal); margin-bottom: 0.85rem; }
.ds-principle h3 { font: 600 var(--ds-t-l)/1.25 var(--ds-serif); margin: 0 0 0.5rem; }
.ds-principle p { margin: 0; color: var(--ds-muted); line-height: 1.6; font-size: var(--ds-t-s); }

/* profile example (reuses the real sample) */
.ds-split { display: grid; gap: clamp(1.75rem, 4vw, 3.5rem); align-items: center; }
@media (min-width: 56rem) { .ds-split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); } }
.ds-evidence-key { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 0.75rem; }
.ds-evidence-key li { display: grid; grid-template-columns: 4px 1fr; gap: 0.9rem; }
.ds-evidence-key i { border-radius: 2px; background: var(--ds-teal); }
.ds-evidence-key li:nth-child(2) i { background: var(--ds-amber); }
.ds-evidence-key li:nth-child(3) i { background: repeating-linear-gradient(180deg, var(--ds-muted) 0 3px, transparent 3px 6px); }
.ds-evidence-key b { display: block; }
.ds-evidence-key span { color: var(--ds-muted); font-size: var(--ds-t-s); }
.ds-profile-shot { padding: 1.25rem; }
.ds-profile-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-bottom: 0.9rem; border-bottom: 1px solid var(--ds-cloud); margin-bottom: 0.9rem; }
.ds-profile-head b { font: 600 var(--ds-t-l)/1.2 var(--ds-serif); }
.ds-profile-head span { font-size: var(--ds-t-xs); color: var(--ds-muted); }
.ds-profile-rows { display: grid; gap: 0.6rem; }
.ds-profile-rows .ds-mini-row { font-size: var(--ds-t-s); padding: 0.8rem 0.9rem; box-shadow: none; border: 1px solid var(--ds-cloud); }
.ds-profile-rows .ds-mini-row em { font-size: 1.5rem; }

/* closing band */
.ds-band { position: relative; isolation: isolate; color: #fff; background: var(--ds-navy); overflow: hidden; }
.ds-band > picture { position: absolute; inset: 0; z-index: -2; }
.ds-band > picture img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: 0.32; }
.ds-band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(9, 42, 64, 0.96) 0%, rgba(9, 42, 64, 0.78) 55%, rgba(9, 42, 64, 0.55) 100%); }
.ds-band-inner { display: grid; gap: 2rem; padding-block: clamp(3rem, 6vw, 4.5rem); align-items: center; }
@media (min-width: 56rem) { .ds-band-inner { grid-template-columns: minmax(0, 1fr) auto; } }
.ds-band h2 { color: #fff; font-size: var(--ds-t-2xl); line-height: 1.08; margin: 0 0 0.75rem; max-width: 20ch; }
.ds-band p { margin: 0; color: #CFE0EA; max-width: 36rem; line-height: 1.6; }
.ds-band-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.ds-band .ds-btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.5); }
.ds-band .ds-btn-ghost:hover { border-color: #fff; color: #fff; }

/* ---------- footer ---------- */
.ds-footer { background: #fff; border-top: 1px solid var(--ds-line); font-size: var(--ds-t-s); }
.ds-footer-top { display: grid; gap: 2rem; padding-block: 3rem 2rem; grid-template-columns: 1fr; }
@media (min-width: 64rem) { .ds-footer-top { grid-template-columns: minmax(14rem, 1fr) minmax(0, 3fr); } }
/* the footer groups come from the WEB-02 registry (scripts/web02/chrome.py) */
.ds-footer-cols { display: grid; gap: 1.75rem 2rem; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
@media (min-width: 64rem) { .ds-footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ds-footer-brand p { color: var(--ds-muted); line-height: 1.6; max-width: 22rem; margin: 0.9rem 0 0; }
.ds-footer h2 { font: 600 var(--ds-t-xs)/1.2 var(--ds-sans); color: var(--ds-muted); margin: 0 0 0.75rem; }
.ds-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.ds-footer a { color: var(--ds-navy); text-decoration: none; }
.ds-footer a:hover { text-decoration: underline; color: var(--ds-storm); }
.ds-footer-base { border-top: 1px solid var(--ds-line); padding-block: 1.25rem 1.75rem; display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; justify-content: space-between; color: var(--ds-muted); font-size: var(--ds-t-xs); }
.ds-footer-base p { margin: 0; }
.ds-footer-base ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
/* links in the base line are distinguishable without colour (WCAG 1.4.1), as the old colophon note's were */
.ds-footer-base a { text-decoration: underline; text-underline-offset: 0.15em; }

@media (prefers-reduced-motion: reduce) { .ds-feature { transition: none; } }
/* print output carries no site chrome: header, menu, footer, icon sprite, skip link */
@media print { .ds-sprite, .skip-link, .ds-header, .ds-menu, .ds-footer, .ds-band, .ds-search { display: none !important; } }

/* ---------- page templates ---------- */
.ds-page-hero { background: #fff; border-bottom: 1px solid var(--ds-line); padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 4vw, 3rem); }
.ds-page-hero h1 { font-size: var(--ds-t-3xl); line-height: 1.04; letter-spacing: -0.025em; margin: 0; max-width: 18ch; }
.ds-split-top { align-items: start; }
.ds-prose { max-width: 40rem; }
.ds-prose h2 { font-size: var(--ds-t-xl); line-height: 1.15; margin: 2rem 0 0.6rem; }
.ds-prose h2:first-child { margin-top: 0; }
.ds-prose p { line-height: 1.7; color: #22394A; }
.ds-aside { padding: 1.5rem; position: sticky; top: 6rem; }
.ds-aside-h { font: 600 var(--ds-t-l)/1.25 var(--ds-serif); margin: 0 0 0.75rem; }
.ds-list { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.6rem; line-height: 1.5; color: #22394A; }
.ds-section-title { font-size: var(--ds-t-2xl); line-height: 1.08; margin: 0 0 1rem; }
.ds-lede { color: var(--ds-muted); font-size: var(--ds-t-m); line-height: 1.6; margin: 0; max-width: 38rem; }
.ds-coverage-svg { position: absolute; inset: 0.5rem 0.5rem 0.5rem 0.5rem; width: calc(100% - 1rem); height: calc(100% - 1rem); }
.ds-feature-map .ds-note-card { left: 0.75rem; right: auto; top: 0.75rem; bottom: auto; max-width: 12.5rem; }

/* ---------- precedence over the legacy stylesheets ---------- */
/* serif display for page and section titles everywhere; the legacy h1/h2 element rules are (0,0,1) */
body h1, body h2 { font-family: var(--ds-serif); font-optical-sizing: auto; font-weight: 600; letter-spacing: -0.015em; }
body h1 { letter-spacing: -0.025em; }
/* the legacy orange underline after section titles is replaced by the .ds-rule mark in redesigned sections */
main.ici-main section.ds-section h2::after, main.ici-main section.ds-features h2::after, main.ici-main section.ds-band h2::after,
main.ici-main section.ds-page-hero h1::after, main.ici-main section.ds-hero h1::after, main.ici-main section.ds-section h1::after { content: none; display: none; }
/* everywhere else the legacy title underline takes the brand's sun colour */
main.ici-main section h2::after, main.doc-page section h2::after { background: var(--ds-amber); }
.ds-search-field input[type="text"] { border: 0; border-radius: 0; padding: 0; background: transparent; box-shadow: none; height: auto; }
.ds-hero h1 { max-width: 15ch; }
/* body text in main never goes below 1rem (legacy accessibility floor main#main p, li, dd, dt); components are sized for it */
.ds-note-card { max-width: 16rem; }
.ds-legend-scale { display: flex; gap: 2px; margin-top: 0.5rem; }
.ds-legend-scale i { flex: 1; height: 0.5rem; background: var(--c); border-radius: 1px; }
/* the four map steps (home-ds.js STEP); classes, because the site CSP blocks inline style attributes */
.ds-legend-scale .ds-sw-1 { --c: #CDE7EF; } .ds-legend-scale .ds-sw-2 { --c: #7FC3DD; } .ds-legend-scale .ds-sw-3 { --c: #2387B7; } .ds-legend-scale .ds-sw-4 { --c: #0F4C6B; }
.ds-legend-ends { display: flex; justify-content: space-between; font-size: 0.8rem; margin-top: 0.2rem; }
.ds-chiplist { top: auto; left: 0.75rem; right: 0.75rem; bottom: 0.75rem; width: auto; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; padding: 0.6rem 0.8rem; }
.ds-chiplist li + li { border-top: 0; }
.ds-chiplist li { padding: 0.1rem 0; }
main#main .ds-chiplist li, main#main .ds-note-card { font-size: 0.9375rem; }
main#main .ds-readings dt, main#main .ds-readings .ds-src { font-size: 0.9375rem; }
/* lists in redesigned components are layout, not prose: no legacy measure */
main#main :is(.ds-tiles, .ds-meaning, .ds-chiplist, .ds-evidence-key, .ds-feature-grid, .ds-principles), .ds-footer ul, .ds-menu ul { max-width: none; }
main#main :is(.ds-section-head, .ds-local-intro, .ds-band) p { max-width: 40rem; }
/* coverage map: map fills the visual, the legend sits along the bottom */
.ds-feature-map { aspect-ratio: 16 / 10; }
.ds-coverage-svg { inset: 0.25rem 0.25rem 3.4rem; width: calc(100% - 0.5rem); height: calc(100% - 3.65rem); }
.ds-legend { position: absolute; left: 0.75rem; right: 0.75rem; bottom: 0.6rem; margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0 0.75rem; align-items: center; color: var(--ds-muted); }
main#main .ds-legend { font-size: 0.8125rem; max-width: none; }
.ds-legend strong { grid-row: span 2; color: var(--ds-navy); font-size: 0.875rem; max-width: 9rem; line-height: 1.2; }
.ds-legend-scale { margin-top: 0; }
@media (min-width: 64rem) { .ds-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ds-tile picture { aspect-ratio: 16 / 9; } }
.ds-local-photo { min-height: 31rem; }
.ds-place { white-space: nowrap; }
main#main .ds-place { font-size: 0.9375rem; }
main.ici-main.ds-home, main.ici-main:has(> .ds-band:last-child) { padding-bottom: 0; margin-bottom: 0; }
/* a page that closes on the dark band meets the footer directly (the legacy footer rule adds a top margin) */
main.ici-main.ds-home + .ds-footer, main.ici-main:has(> .ds-band:last-child) + .ds-footer { margin-top: 0; }
.ds-band > picture img { opacity: 0.42; }
@media (max-width: 63.99rem) { .ds-footer-top { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 30rem) { .ds-legend strong { display: none; } .ds-legend { grid-template-columns: minmax(0, 1fr); } }

/* =====================================================================================================
 * Legacy bridge (redesign checkpoint 2): existing templates take the new identity without rewriting them.
 * Repeated class selectors raise specificity above the legacy rules (up to main.ici-main .x, 0,2,1) without
 * !important, so a template that is later redesigned with ds- components is unaffected.
 * ===================================================================================================== */
:root {
  --logo-navy: var(--ds-navy); --logo-teal: var(--ds-teal); --logo-slate: #4A6F86; --logo-slate-text: #45667B; --logo-mist: var(--ds-pale);
  --action: var(--ds-navy); --action-deep: var(--ds-storm);
  --ici-teal: var(--ds-teal); --ici-teal-ink: #0E6A6D; --ici-sun: var(--ds-amber);
  --ember: var(--ds-amber); --ember-soft: #FFF3E0; --ember-border: #D98A1A; --ember-on-wash: #8A4B00; --ember-ink: #8A4B00;
}
/* the old four-dot logo rule becomes the brand's sun rule */
.mark-rule.mark-rule { display: block; width: 3rem; height: 4px; border-radius: 2px; background: var(--ds-amber); gap: 0; }
.mark-rule.mark-rule i { display: none; }
/* buttons: pills, navy primary, white secondary */
body .btn.btn.btn { border-radius: 999px; font-family: var(--ds-sans); font-weight: 600; min-height: 2.9rem; padding-inline: 1.35rem; }
body .btn-primary.btn-primary.btn-primary { background: var(--ds-navy); border-color: var(--ds-navy); color: #fff; }
body .btn-primary.btn-primary.btn-primary:hover { background: var(--ds-storm); border-color: var(--ds-storm); color: #fff; }
body .btn-primary.btn-primary.btn-primary[disabled], body .btn-primary.btn-primary.btn-primary[aria-disabled="true"] { background: var(--ds-cloud); border-color: var(--ds-cloud); color: #4A5B64; }
body .btn-secondary.btn-secondary.btn-secondary, body .btn-tertiary.btn-tertiary.btn-tertiary { background: #fff; color: var(--ds-navy); border: 1.5px solid var(--ds-line); }
body .btn-secondary.btn-secondary.btn-secondary:hover, body .btn-tertiary.btn-tertiary.btn-tertiary:hover { border-color: var(--ds-navy); color: var(--ds-navy); background: #fff; }
body .btn-on-photo.btn-on-photo.btn-on-photo { background: #fff; color: var(--ds-navy); }
/* form controls: calmer borders, rounded, visible focus */
body :is(input[type="text"], input[type="email"], input[type="number"], input[type="search"], select, textarea, .field):not(.ds-search-field input) {
  border-radius: 10px; border-color: #B7C6D1; }
body :is(input[type="text"], input[type="email"], input[type="number"], input[type="search"], select, textarea, .field):focus { border-color: var(--ds-storm); box-shadow: 0 0 0 3px rgba(35, 135, 183, 0.18); }
/* eyebrow labels above titles: sentence case in the new system */
body :is(.hero-eyebrow, .eyebrow, .rp-kicker, .th-kicker, .alm-eyebrow).hero-eyebrow, body .eyebrow.eyebrow { text-transform: none; letter-spacing: 0; color: var(--ds-teal-ink); font-family: var(--ds-sans); }
/* panels and cards: the system's softer radius and shadow */
body :is(.card, .tool, .panel, .w2-cond, .rec, .record, .ba-card).card, body .tool.tool, body .w2-cond.w2-cond { border-radius: var(--ds-r-m); }
/* on dark photographs and dark panels the primary action is white */
body :is(.ici-hero-photo, .closer-inner, .closing-band, .alm-find, .ds-band) .btn-primary.btn-primary.btn-primary { background: #fff; border-color: #fff; color: var(--ds-navy); }
body :is(.ici-hero-photo, .closer-inner, .closing-band, .ds-band) :is(.btn-secondary, .btn-tertiary).btn.btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.6); }

/* Page hero B: title and lede left, image panel right (About; other pages use their own page stylesheets) */
.ds-page-hero-b { display: grid; gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
@media (min-width: 48rem) { .ds-page-hero-b { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.ds-page-hero-media { display: block; border-radius: var(--ds-r-l); overflow: hidden; box-shadow: var(--ds-shadow); }
.ds-page-hero-media img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; }
.ds-local-photo > picture { position: absolute; inset: 0; }
.ds-local-photo > picture img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 60%; }
@media (max-width: 40rem) { .ds-local-photo > picture { position: static; } .ds-local-photo > picture img { aspect-ratio: 4 / 3; height: auto; } }
