/* ==========================================================================
   TYPOGRAPHY SYSTEM
   - Display family: Public Sans for headings (fallback Inter)
   - Body family:    Inter
   - Serif:          Source Serif Pro for editorial / quote moments
   - Mono:           system mono for data, code, kbd
   ========================================================================== */

html {
  font-size: 100%; /* anchor 1rem to user preference */
}

@media (min-width: 80em) {
  html {
    font-size: 105%;
  }
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-normal);
  color: var(--text-body);
  letter-spacing: var(--tracking-normal);
  font-feature-settings: "ss01", "ss03", "cv11", "kern";
}

/* ----------------------------------------------------------------------
   HEADINGS
   ---------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-extrabold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--text-strong);
  text-wrap: balance;
  margin: 0;
}

h1, .h1 {
  font-size: clamp(2.25rem, 1.4rem + 4.2vw, 4.75rem);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-tighter);
  line-height: 1.02;
}

h2, .h2 {
  font-size: clamp(1.875rem, 1.25rem + 3vw, 3.5rem);
  letter-spacing: var(--tracking-tight);
  line-height: 1.08;
}

h3, .h3 {
  font-size: clamp(1.5rem, 1.05rem + 1.6vw, 2.25rem);
  line-height: 1.15;
}

h4, .h4 {
  font-size: clamp(1.25rem, 1rem + 0.8vw, 1.75rem);
  font-weight: var(--weight-bold);
  line-height: 1.2;
}

h5, .h5 {
  font-size: var(--font-size-lg);
  font-weight: var(--weight-semibold);
  line-height: 1.25;
}

h6, .h6 {
  font-size: var(--font-size-md);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Display-class headings for hero moments — larger than h1 */
.display-1 {
  font-family: var(--font-display);
  font-size: clamp(3rem, 2rem + 6vw, 7.5rem);
  font-weight: var(--weight-black);
  line-height: 0.95;
  letter-spacing: -0.05em;
  text-wrap: balance;
}
.display-2 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.6rem + 4.8vw, 5.5rem);
  font-weight: var(--weight-extrabold);
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.display-3 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 1.4rem + 3.8vw, 4.5rem);
  font-weight: var(--weight-extrabold);
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

/* Eyebrow / kicker: tiny caps label above a headline */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--text-brand);
  margin-block-end: var(--space-3);
}

.eyebrow::before {
  content: "";
  display: inline-block;
  inline-size: 1.75rem;
  block-size: 2px;
  background: currentColor;
  border-radius: var(--radius-pill);
}

.eyebrow--accent { color: var(--text-accent); }
.eyebrow--gold { color: var(--color-gold-700); }
.eyebrow--inverse { color: var(--color-gold-300); }

/* Dek / subhead: large supporting paragraph under a headline */
.dek,
.lede {
  font-size: clamp(var(--font-size-md), 0.85rem + 1vw, var(--font-size-xl));
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
  color: var(--text-muted);
  max-inline-size: var(--measure-prose);
  text-wrap: pretty;
}

.dek--xl {
  font-size: clamp(var(--font-size-lg), 1rem + 1.4vw, var(--font-size-2xl));
  font-weight: var(--weight-light);
  line-height: var(--leading-snug);
}

/* ----------------------------------------------------------------------
   BODY PROSE
   ---------------------------------------------------------------------- */

.prose {
  max-inline-size: var(--measure-prose);
  font-size: var(--font-size-md);
  line-height: var(--leading-relaxed);
  color: var(--text-body);
  text-wrap: pretty;
}

.prose > * + * {
  margin-block-start: 1.25em;
}

.prose h2,
.prose h3,
.prose h4 {
  margin-block-start: 2em;
  margin-block-end: 0.5em;
  scroll-margin-block-start: calc(var(--header-height) + 1.5rem);
}

.prose h2 {
  font-size: clamp(1.6rem, 1.2rem + 1vw, 2rem);
  line-height: 1.15;
}

.prose h3 {
  font-size: clamp(1.25rem, 1rem + 0.6vw, 1.5rem);
}

.prose p,
.prose li {
  font-size: 1.0625em;
  line-height: 1.7;
}

.prose strong {
  font-weight: var(--weight-bold);
  color: var(--text-strong);
}

.prose em {
  font-style: italic;
}

.prose a {
  color: var(--text-link);
  text-decoration: underline;
  text-decoration-thickness: 0.0625em;
  text-underline-offset: 0.18em;
  text-decoration-color: rgba(34, 83, 160, 0.5);
}

.prose a:hover {
  text-decoration-color: currentColor;
  text-decoration-thickness: 0.125em;
}

.prose ul,
.prose ol {
  padding-inline-start: 1.5em;
}

.prose ul li,
.prose ol li {
  padding-inline-start: 0.25em;
  margin-block: 0.5em;
}

.prose ul li::marker {
  color: var(--color-navy-500);
}

.prose ol li::marker {
  color: var(--text-muted);
  font-weight: var(--weight-semibold);
}

.prose blockquote {
  border-inline-start: 4px solid var(--color-gold-500);
  padding-inline-start: 1.25em;
  margin-block: 2em;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25em;
  line-height: 1.5;
  color: var(--text-strong);
}

.prose blockquote cite {
  display: block;
  margin-block-start: 0.5em;
  font-style: normal;
  font-family: var(--font-sans);
  font-size: 0.85em;
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
}

.prose hr {
  border: 0;
  block-size: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--surface-border) 20%,
    var(--surface-border) 80%,
    transparent
  );
  margin-block: 3em;
}

.prose img,
.prose figure {
  margin-block: 2em;
  border-radius: var(--radius-lg);
}

.prose figcaption {
  font-size: 0.875em;
  color: var(--text-muted);
  text-align: center;
  margin-block-start: 0.75em;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--color-ink-100);
  padding: 0.125em 0.375em;
  border-radius: var(--radius-sm);
}

.prose pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-navy-950);
  color: var(--color-ink-100);
  padding: 1.25em;
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.prose pre code {
  background: transparent;
  padding: 0;
}

.prose kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  font-weight: var(--weight-semibold);
  background: var(--color-ink-100);
  border: 1px solid var(--color-ink-300);
  border-block-end-width: 2px;
  padding: 0.125em 0.375em;
  border-radius: var(--radius-sm);
}

.prose table {
  font-size: 0.95em;
  margin-block: 2em;
}

.prose th,
.prose td {
  padding: 0.625em 0.875em;
  border-block-end: 1px solid var(--surface-border);
  text-align: start;
  vertical-align: top;
}

.prose th {
  font-weight: var(--weight-semibold);
  color: var(--text-strong);
  background: var(--surface-bg-alt);
}

.prose tbody tr:hover {
  background: var(--surface-bg-alt);
}

/* Drop cap for the opening paragraph */
.prose--with-drop-cap > p:first-of-type::first-letter {
  font-family: var(--font-display);
  float: inline-start;
  font-size: 3.75em;
  font-weight: var(--weight-black);
  line-height: 0.8;
  margin-inline-end: 0.1em;
  margin-block-start: 0.1em;
  color: var(--text-brand);
}

/* Narrow prose variant for sidebars */
.prose--narrow {
  max-inline-size: var(--measure-narrow);
}

/* Wide prose for documents like policy positions */
.prose--wide {
  max-inline-size: var(--measure-wide);
}

/* ----------------------------------------------------------------------
   UTILITY TEXT CLASSES
   ---------------------------------------------------------------------- */

.text-xs { font-size: var(--font-size-xs); line-height: 1.4; }
.text-sm { font-size: var(--font-size-sm); line-height: 1.5; }
.text-base { font-size: var(--font-size-base); }
.text-md { font-size: var(--font-size-md); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }
.text-4xl { font-size: var(--font-size-4xl); }
.text-5xl { font-size: var(--font-size-5xl); }
.text-6xl { font-size: var(--font-size-6xl); }

.font-light { font-weight: var(--weight-light); }
.font-regular { font-weight: var(--weight-regular); }
.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold { font-weight: var(--weight-bold); }
.font-extrabold { font-weight: var(--weight-extrabold); }
.font-black { font-weight: var(--weight-black); }

.font-sans { font-family: var(--font-sans); }
.font-serif { font-family: var(--font-serif); }
.font-display { font-family: var(--font-display); }
.font-mono { font-family: var(--font-mono); }

.text-tight { letter-spacing: var(--tracking-tight); }
.text-tighter { letter-spacing: var(--tracking-tighter); }
.text-normal { letter-spacing: var(--tracking-normal); }
.text-wide { letter-spacing: var(--tracking-wide); }
.text-wider { letter-spacing: var(--tracking-wider); }
.text-widest { letter-spacing: var(--tracking-widest); }
.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }

.leading-none { line-height: var(--leading-none); }
.leading-tight { line-height: var(--leading-tight); }
.leading-snug { line-height: var(--leading-snug); }
.leading-normal { line-height: var(--leading-normal); }
.leading-relaxed { line-height: var(--leading-relaxed); }
.leading-loose { line-height: var(--leading-loose); }

.text-start { text-align: start; }
.text-end { text-align: end; }
.text-center { text-align: center; }
.text-justify { text-align: justify; }

.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

.color-strong { color: var(--text-strong); }
.color-body { color: var(--text-body); }
.color-muted { color: var(--text-muted); }
.color-subtle { color: var(--text-subtle); }
.color-brand { color: var(--text-brand); }
.color-accent { color: var(--text-accent); }
.color-on-brand { color: var(--text-on-brand); }
.color-inverse { color: var(--text-inverse); }
.color-success { color: var(--color-success); }
.color-warning { color: var(--color-warning); }
.color-danger { color: var(--color-danger); }

.text-flag-gold {
  background: linear-gradient(120deg, var(--color-gold-400), var(--color-gold-600));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-flag-navy {
  background: linear-gradient(120deg, var(--color-navy-700), var(--color-navy-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.text-flag-red {
  background: linear-gradient(120deg, var(--color-red-700), var(--color-red-500));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Numeric tabular figures for stats */
.tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.lining-figures {
  font-variant-numeric: lining-nums;
}

.no-orphans p {
  text-wrap: pretty;
}

/* Highlighter — yellow swipe behind text */
.highlight {
  background-image: linear-gradient(
    180deg,
    transparent 0%,
    transparent 60%,
    rgba(239, 177, 42, 0.35) 60%,
    rgba(239, 177, 42, 0.35) 92%,
    transparent 92%
  );
  padding-inline: 0.1em;
  display: inline;
}

.highlight--blue {
  background-image: linear-gradient(
    180deg,
    transparent 0%,
    transparent 60%,
    rgba(53, 106, 180, 0.18) 60%,
    rgba(53, 106, 180, 0.18) 92%,
    transparent 92%
  );
}

.highlight--red {
  background-image: linear-gradient(
    180deg,
    transparent 0%,
    transparent 60%,
    rgba(207, 45, 45, 0.18) 60%,
    rgba(207, 45, 45, 0.18) 92%,
    transparent 92%
  );
}

/* Underline animated on hover */
.link-underline-animated {
  position: relative;
  text-decoration: none;
}

.link-underline-animated::after {
  content: "";
  position: absolute;
  inset-block-end: -0.2em;
  inset-inline-start: 0;
  inline-size: 100%;
  block-size: 2px;
  background-color: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--motion-base) var(--ease-out);
}

.link-underline-animated:hover::after,
.link-underline-animated:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Lists with custom markers */
.list-bullet {
  list-style: none;
  padding-inline-start: 0;
}

.list-bullet li {
  position: relative;
  padding-inline-start: 1.75rem;
  margin-block: 0.5rem;
}

.list-bullet li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0.25rem;
  inset-block-start: 0.5rem;
  inline-size: 0.625rem;
  block-size: 0.625rem;
  background: var(--color-navy-600);
  transform: rotate(45deg);
  border-radius: 1px;
}

.list-check {
  list-style: none;
  padding-inline-start: 0;
}

.list-check li {
  position: relative;
  padding-inline-start: 2rem;
  margin-block: 0.625rem;
}

.list-check li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0.45em;
  inline-size: 1.125rem;
  block-size: 1.125rem;
  border-radius: 50%;
  background: var(--color-sage-500);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: 0.875rem;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: 0.875rem;
}

.list-numbered {
  list-style: none;
  padding-inline-start: 0;
  counter-reset: numlist;
}

.list-numbered li {
  position: relative;
  padding-inline-start: 2.5rem;
  margin-block: 0.75rem;
  counter-increment: numlist;
}

.list-numbered li::before {
  content: counter(numlist, decimal-leading-zero);
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 0;
  font-family: var(--font-mono);
  font-weight: var(--weight-bold);
  font-size: 0.875em;
  color: var(--text-accent);
  letter-spacing: var(--tracking-tight);
}

/* Footnote-style citation */
.cite {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  letter-spacing: var(--tracking-wide);
}

.cite a {
  color: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 0.18em;
}

.cite a:hover {
  color: var(--text-link);
  text-decoration-style: solid;
}

/* ----------------------------------------------------------------------
   PRINT TYPOGRAPHY (deliberate, not just "remove color")
   ---------------------------------------------------------------------- */

@media print {
  body {
    font-family: Georgia, "Times New Roman", serif;
    color: #000;
    background: #fff;
    font-size: 11pt;
    line-height: 1.5;
  }

  h1, h2, h3, h4, h5, h6 {
    font-family: Helvetica, Arial, sans-serif;
    color: #000;
    page-break-after: avoid;
    break-after: avoid;
  }

  h1 { font-size: 28pt; }
  h2 { font-size: 22pt; }
  h3 { font-size: 16pt; }

  a {
    color: #000;
    text-decoration: underline;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #444;
  }
}
