/* base.css — Editorial reset + typography */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  font-weight: var(--fw-r);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'kern', 'liga', 'onum';
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  word-break: normal;
  overflow-wrap: anywhere;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
}

/* === Touch targets — minimum 44×44 for actionable elements ===
   WCAG 2.5.5 / 2.5.8 — interactive controls must offer 44×44 hit area.
   Inline <a> in body copy keeps its natural text flow (display: inline);
   block-level CTAs (.cta-block, .btn, nav links) set their own min-height.
   Standalone form controls + button-like elements are normalized here. */
button,
[role="button"],
summary,
label,
input[type="submit"],
input[type="button"],
input[type="reset"] {
  min-height: var(--touch-target-min);
}
button,
[role="button"],
input[type="submit"],
input[type="button"],
input[type="reset"] {
  min-width: var(--touch-target-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Block-level / standalone <a> CTA links — apply min-height when used as
   button-styled controls. Inline anchors inside <p> stay unaffected. */
a.btn,
a.cta-block,
a.cta-sticky,
a.compare__cta,
a.rank-row__cta,
a.site-header__cta {
  min-height: var(--touch-target-min);
}

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

/* === Editorial typography === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: var(--fw-k);
  letter-spacing: -0.02em;
  line-height: var(--lh-tight);
  margin: 0 0 var(--s4);
  font-feature-settings: 'kern', 'liga', 'ss01';
}
h1 {
  font-size: var(--fs-5xl);
  font-weight: var(--fw-x);
  letter-spacing: -0.035em;
  line-height: 0.96;
  margin-bottom: var(--s5);
}
h2 {
  font-size: var(--fs-3xl);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin-top: var(--s9);
}
h3 {
  font-size: var(--fs-xl);
  letter-spacing: -0.018em;
  line-height: 1.15;
  margin-top: var(--s7);
}
h4 { font-size: var(--fs-lg); margin-top: var(--s6); }
h5 { font-size: var(--fs-md); }
h6 {
  font-family: var(--font-caption);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
}

/* Body paragraphs — editorial serif */
p {
  margin: 0 0 var(--s4);
  color: var(--ink);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  max-width: 70ch;
}

p.lead, .lead {
  font-size: var(--fs-md);
  line-height: 1.45;
  color: var(--ink-soft);
  font-style: italic;
  max-width: 60ch;
}

p.standfirst {
  font-size: var(--fs-lg);
  line-height: 1.4;
  font-weight: var(--fw-m);
  color: var(--ink-soft);
  max-width: 56ch;
  margin-bottom: var(--s7);
}

/* Drop cap for first paragraph of long-form articles */
.dropcap::first-letter,
p.dropcap::first-letter {
  font-family: var(--font-display);
  font-weight: var(--fw-x);
  float: left;
  font-size: 5em;
  line-height: 0.86;
  margin: 8px 12px -4px 0;
  color: var(--rust);
  letter-spacing: -0.04em;
}

/* Links */
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rust);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color var(--t-fast) var(--ease), text-decoration-color var(--t-fast) var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  a:hover {
    color: var(--rust);
    text-decoration-color: currentColor;
    text-decoration-thickness: 2px;
  }
}
a:visited { color: var(--ink); }
.site-header__brand,
.site-header__brand:hover,
.site-footer__brand,
.site-footer__brand:hover { text-decoration: none !important; }

ul, ol {
  margin: 0 0 var(--s5);
  padding-left: var(--s6);
  font-family: var(--font-body);
}
li { margin-bottom: var(--s2); }
li::marker { color: var(--rust); }

ol { list-style-type: decimal; }
ol li::marker { color: var(--rust); font-weight: var(--fw-b); font-family: var(--font-mono); }

strong, b { font-weight: var(--fw-b); color: var(--ink); }
em, i { font-style: italic; }

abbr[title] { text-decoration: underline dotted; cursor: help; }

code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
}
:not(pre) > code {
  padding: 1px 6px;
  background: var(--paper-tone);
  color: var(--ink);
  border-radius: var(--r-xs);
  font-size: 0.88em;
}
pre {
  margin: var(--s6) 0;
  padding: var(--s5);
  background: var(--ink-bg);
  color: var(--paper);
  border-radius: var(--r-sm);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  border-left: 4px solid var(--rust);
}
pre code { background: transparent; padding: 0; }

/* Editorial pull quote */
blockquote {
  margin: var(--s8) 0;
  padding: 0;
  border: 0;
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: var(--fw-b);
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 22ch;
}
blockquote::before {
  content: "\201C";
  display: block;
  font-size: var(--fs-5xl);
  line-height: 0.5;
  color: var(--rust);
  margin-bottom: var(--s3);
  font-family: var(--font-display);
}
blockquote cite {
  display: block;
  margin-top: var(--s4);
  font-family: var(--font-caption);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  font-style: normal;
  font-weight: var(--fw-s);
}

hr {
  margin: var(--s8) 0;
  border: 0;
  height: 1px;
  background: var(--ink-line);
}

::selection { background: var(--rust); color: var(--paper); }

.skip-link {
  position: absolute; top: -48px; left: var(--s4);
  padding: var(--s2) var(--s4);
  background: var(--ink); color: var(--paper);
  font-family: var(--font-caption);
  font-weight: var(--fw-s); z-index: var(--z-modal);
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: var(--s4); text-decoration: none; }

/* === Container ===
   Container must ALWAYS center horizontally within parent.
   !important on margin-inline because many editorial components
   (.dossier, .verdict, .stat-band etc.) use margin shorthand
   `margin: var(--sN) 0;` which zeros out horizontal centering. */
.container {
  width: 100%;
  max-width: var(--w-base);
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: max(var(--container-pad-mobile), env(safe-area-inset-left));
  padding-right: max(var(--container-pad-mobile), env(safe-area-inset-right));
  box-sizing: border-box;
}
.container--reading { max-width: var(--w-reading); }
.container--tight   { max-width: var(--w-tight); }
.container--wide    { max-width: var(--w-wide); }
.container--mega    { max-width: var(--w-mega); }

@media (min-width: 640px) {
  .container {
    padding-left: max(var(--container-pad-tablet), env(safe-area-inset-left));
    padding-right: max(var(--container-pad-tablet), env(safe-area-inset-right));
  }
}
@media (min-width: 1024px) {
  .container {
    padding-left: max(var(--container-pad-desktop), env(safe-area-inset-left));
    padding-right: max(var(--container-pad-desktop), env(safe-area-inset-right));
  }
}

/* === Base tables === */
table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: var(--s6) 0;
  font-family: var(--font-caption);
  font-size: var(--fs-sm);
}
th, td {
  padding: var(--s3) var(--s4);
  text-align: left;
  border-bottom: 1px solid var(--ink-line);
}
th {
  font-family: var(--font-caption);
  background: transparent;
  color: var(--ink);
  font-size: var(--fs-xxs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: var(--fw-s);
  border-bottom: 2px solid var(--ink);
}
@media (hover: hover) and (pointer: fine) {
  tbody tr:hover { background: var(--paper-dark); }
}

/* Numeric columns — tabular */
td[data-num], .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
