:root {
  color-scheme: light dark;
  --paper: #FAF8F3;
  --surface: #FFFFFF;
  --ink: #1D1C1A;
  --ink-muted: #57534B;
  --accent: #0A5260;
  --accent-ink: #FFFFFF;
  --border: #767168;
  --focus: #B03A00;
  --error: #A1271D;
  --leak-bg: #A1271D;
  --leak-ink: #FFFFFF;
  --rumour-bg: #F0C24B;
  --rumour-ink: #1D1C1A;
  --confirmed-bg: #1D6B3B;
  --confirmed-ink: #FFFFFF;
  --theory-bg: #3E4A6B;
  --theory-ink: #FFFFFF;
  --mark-bg: #FFF0A8;
  --mark-ink: #1D1C1A;
  --footer-bg: #1D1C1A;
  --footer-ink: #F3F1EB;
  --footer-link: #9ED3DE;
  --footer-focus: #FFB37A;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #141413;
    --surface: #1F1E1C;
    --ink: #EDEBE5;
    --ink-muted: #B8B3A9;
    --accent: #84CFDC;
    --accent-ink: #0D1F22;
    --border: #8C877E;
    --focus: #FFB37A;
    --error: #FF9A8F;
    --leak-bg: #A1271D;
    --leak-ink: #FFFFFF;
    --rumour-bg: #F0C24B;
    --rumour-ink: #1D1C1A;
    --confirmed-bg: #1D6B3B;
    --confirmed-ink: #FFFFFF;
    --theory-bg: #3E4A6B;
    --theory-ink: #FFFFFF;
    --mark-bg: #FFF0A8;
    --mark-ink: #1D1C1A;
    --footer-bg: #0A0A09;
    --footer-ink: #EDEBE5;
    --footer-link: #84CFDC;
    --footer-focus: #FFB37A;
  }
}

/* Colours come from src/tokens.mjs (prepended by the build). Fonts are the
   visitor's own system fonts: nothing is downloaded from any font service. */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
.wordmark {
  font-family: Georgia, 'Times New Roman', Times, serif;
  line-height: 1.2;
}

h1 {
  font-size: clamp(2rem, 1.4rem + 3vw, 2.75rem);
  margin: 2rem 0 1rem;
}

h2 {
  font-size: 1.6rem;
  margin: 2.25rem 0 0.75rem;
}

h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.5rem;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 0.18em;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

code {
  font-family: ui-monospace, Consolas, 'Courier New', monospace;
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

/* ---------- Focus: always visible, 3px, high contrast ---------- */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

main:focus {
  outline: none;
}

.site-footer :focus-visible {
  outline-color: var(--footer-focus);
}

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.js .nojs-only {
  display: none;
}

[hidden] {
  display: none !important;
}

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.prose {
  max-width: 44rem;
}

.lead {
  font-size: 1.25rem;
  color: var(--ink);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--surface);
  color: var(--accent);
  font-weight: 700;
  border: 2px solid var(--accent);
}

.skip-link:focus {
  top: 1rem;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 4px double var(--ink);
  padding: 1rem 0;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.wordmark {
  color: var(--ink);
  font-size: 1.9rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
}

.wordmark-tag {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}

.main-nav {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: inline-block;
  padding: 0.35rem 0;
  min-height: 24px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.main-nav a:hover {
  border-bottom-color: var(--border);
}

.main-nav a[aria-current='page'] {
  border-bottom-color: var(--accent);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.15rem;
  border: 2px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  text-align: center;
}

.btn:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.btn-secondary {
  background: var(--surface);
  color: var(--accent);
}

.link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--footer-link);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

/* ---------- Consent banner (in page flow, never covers content) ---------- */
.consent-banner {
  background: var(--surface);
  border-bottom: 4px solid var(--accent);
  padding: 1rem 0 0.25rem;
}

.consent-banner-title {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

/* ---------- Dialog ---------- */
dialog {
  width: min(40rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  overflow: auto;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 6px;
  padding: 0.5rem 1.5rem 1rem;
}

dialog::backdrop {
  background: rgb(0 0 0 / 0.65);
}

/* ---------- Labels (Confirmed / Rumour / Leak) ---------- */
.badge {
  display: inline-block;
  padding: 0.1em 0.55em;
  border-radius: 3px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5;
  border: 1px solid transparent; /* becomes visible in Windows high contrast mode */
}

.badge-confirmed {
  background: var(--confirmed-bg);
  color: var(--confirmed-ink);
}

.badge-rumour {
  background: var(--rumour-bg);
  color: var(--rumour-ink);
}

.badge-leak {
  background: var(--leak-bg);
  color: var(--leak-ink);
}

.badge-theory {
  background: var(--theory-bg);
  color: var(--theory-ink);
}

.status {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 6px solid var(--ink);
  padding: 0.75rem 1rem 0.1rem;
  margin: 1rem 0 1.5rem;
}

.status-badge {
  margin-bottom: 0.35rem;
}

.label-key dl,
.label-defs {
  display: grid;
  gap: 0.75rem;
}

.label-key dl > div,
.label-defs > div {
  display: grid;
  gap: 0.25rem;
}

.label-key dd,
.label-defs dd {
  margin: 0;
}

.label-key {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.25rem 1.25rem 0.5rem;
  margin: 1.5rem 0 2rem;
}

.label-key h2 {
  margin-top: 1rem;
}

/* ---------- Article cards ---------- */
.card-list {
  list-style: none;
  padding: 0;
  margin: 0 0 3rem;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--ink);
  padding: 0 1.25rem 0.25rem;
}

.card-title {
  font-size: 1.35rem;
  margin: 1rem 0 0.5rem;
}

.card-title a {
  color: var(--ink);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

/* ---------- Article ---------- */
.article {
  max-width: 44rem;
  margin-bottom: 3rem;
}

.article-category {
  margin: 2rem 0 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.9rem;
}

.article-header h1 {
  margin-top: 0.25rem;
}

.standfirst {
  font-size: 1.3rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0;
}

.article-meta dt {
  font-weight: 700;
}

.article-meta dd {
  margin: 0;
}

figure {
  margin: 1.75rem 0;
}

figcaption {
  margin-top: 0.4rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

figcaption .credit {
  display: block;
  font-style: italic;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 4px solid var(--border);
}

.sources,
.corrections,
.report-error {
  border-top: 2px solid var(--ink);
  margin-top: 2.5rem;
}

.sources ol {
  overflow-wrap: anywhere;
}

/* ---------- YouTube facade ---------- */
.video-facade {
  margin: 1.75rem 0;
}

.video-facade-frame {
  aspect-ratio: 16 / 9;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 2px solid var(--border);
  text-align: center;
}

.video-facade-title {
  font-weight: 700;
  margin: 0;
}

.video-facade-consent {
  max-width: 34rem;
  margin: 0;
  font-size: 1rem;
}

.video-facade iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.video-facade-note {
  color: var(--ink-muted);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

/* ---------- Forms ---------- */
.form {
  margin: 1.5rem 0;
}

.field {
  margin-bottom: 1.5rem;
}

.field > label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.hint {
  color: var(--ink-muted);
  margin-bottom: 0.4rem;
}

input[type='email'],
input[type='text'] {
  display: block;
  width: 100%;
  max-width: 30rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.65rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 3px;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0.5rem 0;
}

/* Custom checkbox so its edge uses the tested --border colour (3:1+) in both
   themes; native checkboxes can be too faint in dark mode. */
.check input[type='checkbox'] {
  appearance: none;
  flex: none;
  position: relative;
  width: 1.6rem;
  height: 1.6rem;
  margin: 0.1rem 0 0;
  border: 2px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
  cursor: pointer;
}

.check input[type='checkbox']:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.check input[type='checkbox']:checked::before {
  content: '';
  position: absolute;
  left: 0.45rem;
  top: 0.15rem;
  width: 0.4rem;
  height: 0.8rem;
  border: solid var(--accent-ink);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.check label {
  font-weight: 600;
}

/* Errors are never shown by colour alone: there is a text prefix, a thicker
   border, a left bar and an error summary listing each problem. */
.field-has-error {
  border-left: 5px solid var(--error);
  padding-left: 1rem;
}

.field-has-error input[type='email'] {
  border-color: var(--error);
  border-width: 3px;
}

.error-message {
  color: var(--error);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.error-summary {
  border: 4px solid var(--error);
  background: var(--surface);
  padding: 0 1.25rem 0.5rem;
  margin-bottom: 1.5rem;
}

.error-summary h2 {
  margin-top: 1rem;
  font-size: 1.35rem;
}

.error-summary a {
  color: var(--error);
  font-weight: 700;
}

/* ---------- Legal pages ---------- */
.summary-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 6px solid var(--accent);
  padding: 0.25rem 1.25rem 0.25rem;
  margin: 1.5rem 0;
}

.summary-box h2 {
  margin-top: 1rem;
}

.details-list > div {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) 1fr;
  gap: 0.25rem 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.details-list dt {
  font-weight: 700;
}

.details-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 30rem) {
  .details-list > div {
    grid-template-columns: 1fr;
  }
}

.table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--border);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 40rem;
  font-size: 1rem;
  background: var(--surface);
}

caption {
  text-align: left;
  font-weight: 700;
  padding: 0.6rem 0.75rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.6rem 0.75rem;
  border-top: 1px solid var(--border);
}

thead th {
  border-top: 0;
  border-bottom: 2px solid var(--ink);
}

/* ---------- Placeholders: impossible to miss ---------- */
mark.placeholder {
  background: var(--mark-bg);
  color: var(--mark-ink);
  outline: 2px dashed var(--mark-ink);
  outline-offset: 1px;
  padding: 0 0.2em;
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-ink);
  padding: 1.5rem 0 2rem;
  margin-top: 3rem;
  font-size: 1rem;
}

.site-footer a {
  color: var(--footer-link);
}

.footer-heading {
  font-size: 1.2rem;
  margin: 0.5rem 0;
}

.footer-links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 1.5rem 0;
}

.footer-links a,
.footer-links .link-button {
  display: inline-block;
  min-height: 24px;
  padding: 0.2rem 0;
}

.copyright {
  margin: 0;
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Windows high contrast / forced colours ---------- */
@media (forced-colors: active) {
  .badge,
  .btn {
    border: 2px solid CanvasText;
  }
  mark.placeholder {
    outline-color: Highlight;
  }
  .check input[type='checkbox'] {
    appearance: auto;
  }
}

/* ---------- Print ---------- */
@media print {
  .site-header nav,
  .consent-banner,
  .skip-link,
  .video-facade-frame,
  dialog {
    display: none !important;
  }
}
