/* Public article base. Semantic reading surface first; application behavior
   is layered by renderer or component enhancement code. */

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

html {
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  text-size-adjust: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
}

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

button,
input,
textarea,
select {
  font: inherit;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--ink);
}

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

::selection {
  background: var(--accent-wash);
}

/* Off-screen but present in the accessibility tree — for headings that structure the
   document for screen-reader navigation without a visible title (listing pages carry
   the masthead visually; the h1 is here for the outline). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Keyboard skip link: off-screen until focused, then pinned top-left so the first Tab
   on any page jumps past the masthead to the main content. */
.skip-link {
  position: absolute;
  top: -60px;
  left: 8px;
  z-index: 100;
  padding: 8px 14px;
  background: var(--surface);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-small);
  font-family: var(--font-label);
  font-size: 14px;
  text-decoration: none;
}

.skip-link:focus {
  top: 8px;
}

.site-shell {
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

.site-masthead {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  height: 56px;
  min-height: 56px;
  padding: 0 28px;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
}

.site-wordmark {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  background: var(--brand-wash);
  box-shadow: inset 0 -1px 0 var(--brand);
  padding: 0.02em 0.14em 0.06em;
  text-decoration: none;
}

.feed-filter {
  min-width: 0;
}

.feed-filter summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0;
  border-radius: var(--radius-small);
  color: var(--ink-soft);
  cursor: pointer;
  list-style: none;
}

.feed-filter summary::-webkit-details-marker {
  display: none;
}

.mast-dot {
  color: var(--ink-faint);
  font-family: var(--font-label);
}

.mast-section {
  color: var(--ink-soft);
  font-family: var(--font-label);
  font-size: 13.5px;
  white-space: nowrap;
  transition: color var(--motion-local);
}

.feed-filter:hover .mast-section {
  color: var(--ink);
}

.feed-filter[open] .mast-section {
  color: var(--ink);
}

.mast-caret {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 10px;
}

.feed-filter-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 18px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: 330px;
  padding: 16px 20px 14px;
  border: 1px solid var(--rule);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 22px 50px -20px rgba(15, 12, 8, 0.4), 0 3px 10px -5px rgba(15, 12, 8, 0.2);
  animation: feed-filter-pop 140ms ease-out;
}

.feed-filter-label {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.feed-filter-menu a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 7px 0;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.feed-filter-name {
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
  transition: color var(--motion-local);
}

.feed-filter-dots {
  flex: 1;
  border-bottom: 1px dotted var(--ink-faint);
  transform: translateY(-4px);
}

.feed-filter-count {
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.03em;
}

.feed-filter-menu a:hover .feed-filter-name {
  color: var(--accent);
}

.feed-filter-menu a[aria-current="page"] .feed-filter-name {
  color: var(--ink);
  background: var(--mark);
  box-shadow: inset 0 -1px 0 var(--accent);
  padding: 0.02em 0.14em 0.06em;
}

.feed-filter-menu a[aria-current="page"] .feed-filter-count {
  color: var(--accent);
}

.feed-filter-menu .feed-filter-settings {
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--hairline);
  color: var(--ink-soft);
  font-family: var(--font-label);
  font-size: 13px;
  text-decoration: none;
  text-decoration-color: transparent;
}

.feed-filter-menu .feed-filter-settings:hover,
.feed-filter-menu .feed-filter-settings[aria-current="page"] {
  color: var(--accent);
  text-decoration: none;
  text-decoration-color: transparent;
}

@keyframes feed-filter-pop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.article-shell {
  padding: 54px var(--page-pad) 96px;
}

.article-main {
  max-width: var(--content-measure);
  margin: 0 auto;
}

.article-header {
  margin-bottom: 34px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}

.article-kicker,
.article-meta,
.article-topics,
.component-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: var(--label-spacing);
  text-transform: uppercase;
}

.article-kicker {
  margin: 0 0 18px;
  color: var(--accent);
  font-weight: 500;
}

.article-title {
  margin: 0 0 18px;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 42px;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.article-standfirst {
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 20px;
  font-style: italic;
  line-height: 1.5;
  text-wrap: pretty;
}

.article-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--ink-faint);
}

.article-meta b {
  color: var(--ink-soft);
  font-weight: 500;
}

.article-prose {
  hanging-punctuation: first allow-end;
}

.article-prose > * {
  max-width: var(--content-measure);
  margin-left: auto;
  margin-right: auto;
}

.article-prose p,
.article-prose li {
  font-size: calc(var(--body-size) * var(--reader-scale));
  line-height: var(--body-leading);
  text-wrap: pretty;
  -webkit-hyphens: auto;
  hyphens: auto;
  hyphenate-limit-chars: 7 4 3;
}

.article-prose p {
  margin-top: 0;
  margin-bottom: 1.25em;
}

.article-prose h2,
.article-prose h3,
.article-prose h4 {
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
}

.article-prose h2 {
  margin-top: 1.8em;
  margin-bottom: 0.72em;
  font-size: calc(28px * var(--reader-scale));
}

.article-prose h3 {
  margin-top: 1.55em;
  margin-bottom: 0.66em;
  font-size: calc(22px * var(--reader-scale));
}

.article-prose h4 {
  margin-top: 1.35em;
  margin-bottom: 0.55em;
  font-size: calc(18px * var(--reader-scale));
}

.article-prose blockquote {
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  padding-left: 22px;
  border-left: 2px solid var(--rule);
  color: var(--ink-soft);
  font-style: italic;
}

.article-prose ul,
.article-prose ol {
  padding-left: 1.25em;
}

.article-prose li + li {
  margin-top: 0.36em;
}

.article-prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--accent-wash);
  padding: 0.08em 0.28em;
  border-radius: var(--radius-small);
}

.article-prose pre {
  overflow-x: auto;
  padding: 18px 20px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.article-prose pre code {
  display: block;
  padding: 0;
  background: none;
  border-radius: 0;
  font-size: 13px;
  line-height: 1.65;
}

.article-prose hr {
  width: min(160px, 44%);
  margin-top: 2.4em;
  margin-bottom: 2.4em;
  border: 0;
  border-top: 1px solid var(--rule);
}

.article-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: calc(16px * var(--reader-scale));
  line-height: 1.5;
}

.article-prose th,
.article-prose td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  vertical-align: top;
}

.article-prose th {
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.article-footnotes {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 15px;
}

@media print {
  /* .mode-dark / .mode-sepia are listed alongside :root so their token overrides are
     unquestionably beaten here (equal specificity would otherwise leave it to source
     order). `.theme-editorial.mode-dark` is listed too: it is the one selector that
     re-tunes --accent at (0,2,0) (tokens.css, the dark-lifted #5e9ac0 — only ~3:1 on
     white paper), so this reset must match its specificity to win. base.css loads after
     tokens.css, so equal (0,2,0) resolves here by source order. Charts and now --accent /
     --accent-wash are reset to the LIGHT system: a page printed from dark mode must not
     carry dark-tuned fills or a dark-lifted accent onto white paper. */
  :root,
  .mode-sepia,
  .mode-dark,
  .theme-editorial.mode-dark {
    --paper: #ffffff;
    --surface: #ffffff;
    --ink: #000000;
    --ink-soft: #333333;
    --ink-faint: #666666;
    --rule: rgba(0, 0, 0, 0.28);
    --hairline: rgba(0, 0, 0, 0.16);
    /* Byrne blue on white = 6.5:1 (AA). One canonical print accent for every theme×mode,
       matching how ink/paper already flatten to a single black-on-white presentation. */
    --accent: #0e638e;
    --accent-wash: rgba(14, 99, 142, 0.10);
    --chart-1: #0e638e;
    --chart-2: #d42a20;
    --chart-3: #e0a92b;
    --chart-4: #2b2924;
    --chart-5: #0f9293;
    --chart-6: #a9705a;
    --chart-7: #8e62bc;
    --chart-8: #647025;
    --chart-diverging-low: #0f68a2;
    --chart-diverging-mid: #ece7df;
    --chart-diverging-high: #bd4238;
    --chart-sequential-from: #e0edf8;
    --chart-sequential-to: #004d74;
    --chart-emphasis: #d42a20;
    --chart-muted: #8d8881;
  }

  .site-masthead,
  .no-print {
    display: none !important;
  }

  .article-shell {
    padding: 0;
  }

  .article-main,
  .article-prose > * {
    max-width: none;
  }

  a {
    color: inherit;
  }
}
