/*
 * IMPLEMENTATION_PLAN §4 W13; owner: public web.
 *
 * The only stylesheet on the public site. It is served same-origin (CSP `style-src 'self'`), loads
 * no font or image from a third party, and carries no `@import`. Every verdict is conveyed by a
 * glyph and by words as well as colour, so the palette is presentation only. Colour pairs are
 * chosen for WCAG AA (4.5:1 body text, 3:1 large text and borders) in both schemes.
 */

:root {
  color-scheme: light dark;

  --page: #ffffff;
  --panel: #f6f7f9;
  --ink: #1a1c1f;
  --ink-muted: #4a5058;
  --link: #0b4fa8;
  --link-visited: #5a2e91;
  --rule: #d5d8dd;
  --focus: #0b4fa8;

  --supported-bg: #e7f5ec;
  --supported-ink: #0e3d21;
  --supported-rule: #1e7a41;
  --misleading-bg: #fdf3e0;
  --misleading-ink: #4a3106;
  --misleading-rule: #9a6400;
  --not-supported-bg: #fdecec;
  --not-supported-ink: #5a1010;
  --not-supported-rule: #b02525;
  --unverifiable-bg: #eef0f3;
  --unverifiable-ink: #2a2f36;
  --unverifiable-rule: #5d6670;

  --measure: 42rem;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #14161a;
    --panel: #1c1f25;
    --ink: #e9ebee;
    --ink-muted: #adb4bd;
    --link: #8ab8ff;
    --link-visited: #c4a6f0;
    --rule: #2f343c;
    --focus: #8ab8ff;

    --supported-bg: #12301f;
    --supported-ink: #c9ecd6;
    --supported-rule: #3f9e63;
    --misleading-bg: #35280c;
    --misleading-ink: #f6e2bb;
    --misleading-rule: #c08a1e;
    --not-supported-bg: #3a1414;
    --not-supported-ink: #f7cfcf;
    --not-supported-rule: #d05656;
    --unverifiable-bg: #22262c;
    --unverifiable-ink: #dde1e6;
    --unverifiable-rule: #7b848f;
  }
}

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

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

body {
  margin: 0;
  padding: 0 1rem 4rem;
  background: var(--page);
  color: var(--ink);
  font: 1rem / 1.6 var(--sans);
  overflow-wrap: break-word;
}

main,
.site-header,
.site-footer {
  max-width: var(--measure);
  margin-inline: auto;
}

/* Wide evidence tables may use the full viewport. */
.table-scroll {
  max-width: none;
  margin-inline: calc(50% - 50vw);
  padding-inline: max(1rem, calc(50vw - var(--measure) / 2));
  overflow-x: auto;
}

a {
  color: var(--link);
  text-underline-offset: 0.15em;
}

a:visited {
  color: var(--link-visited);
}

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

.skip-link {
  position: absolute;
  left: -9999px;
}

.skip-link:focus {
  position: static;
  display: inline-block;
  margin: 0.5rem 0;
}

/* -------------------------------------------------------------------------- header and footer -- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  align-items: baseline;
  padding: 1.25rem 0 0.75rem;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.tagline {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.site-footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.875rem;
}

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

.placeholder {
  color: var(--ink-muted);
  font-style: italic;
}

/* ----------------------------------------------------------------------------------- headings -- */

h1,
h2,
h3,
h4 {
  line-height: 1.25;
  text-wrap: balance;
}

h1 {
  font-size: 1.625rem;
  margin: 1.5rem 0 0.5rem;
}

h2 {
  font-size: 1.25rem;
  margin: 2.25rem 0 0.5rem;
}

h3 {
  font-size: 1.0625rem;
  margin: 1.75rem 0 0.375rem;
}

h4 {
  font-size: 0.9375rem;
  margin: 1rem 0 0.25rem;
}

.lede {
  font-size: 1.0625rem;
}

.note {
  display: block;
  color: var(--ink-muted);
  font-size: 0.8125rem;
}

code,
pre {
  font-family: var(--mono);
  font-size: 0.875em;
}

pre.formula {
  padding: 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 0.375rem;
  background: var(--panel);
  overflow-x: auto;
}

blockquote {
  margin: 0.5rem 0;
  padding: 0.5rem 0.875rem;
  border-left: 4px solid var(--rule);
  background: var(--panel);
}

/* ------------------------------------------------------------------------------ verdict block -- */

.verdict {
  margin: 1.5rem 0;
  padding: 1rem 1.125rem;
  border: 1px solid var(--rule);
  border-left-width: 6px;
  border-radius: 0.375rem;
  background: var(--panel);
}

.verdict-glyph {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1;
}

.verdict-label {
  margin: 0.25rem 0 0;
  font-size: 1.5rem;
}

.verdict-confidence {
  margin: 0.125rem 0 0.5rem;
  font-weight: 600;
}

.verdict-reason {
  margin: 0 0 0.75rem;
}

.verdict-supported {
  background: var(--supported-bg);
  border-color: var(--supported-rule);
  color: var(--supported-ink);
}

.verdict-misleading {
  background: var(--misleading-bg);
  border-color: var(--misleading-rule);
  color: var(--misleading-ink);
}

.verdict-not-supported {
  background: var(--not-supported-bg);
  border-color: var(--not-supported-rule);
  color: var(--not-supported-ink);
}

.verdict-unverifiable {
  background: var(--unverifiable-bg);
  border-color: var(--unverifiable-rule);
  color: var(--unverifiable-ink);
}

/* A tinted band keeps its own ink colour for muted text, or contrast drops below AA. */
.verdict .note,
.verdict dt {
  color: inherit;
  opacity: 0.85;
}

body.verdict-supported,
body.verdict-misleading,
body.verdict-not-supported,
body.verdict-unverifiable {
  background: var(--page);
  color: var(--ink);
}

.claim-verdict {
  margin: 0.5rem 0 0.25rem;
  padding: 0.375rem 0.625rem;
  border-left: 5px solid var(--rule);
  border-radius: 0.25rem;
}

.verdict-meta {
  display: grid;
  grid-template-columns: minmax(8rem, auto) 1fr;
  gap: 0.125rem 0.75rem;
  margin: 0;
  font-size: 0.875rem;
}

.verdict-meta dt,
.versions dt {
  font-weight: 600;
}

.verdict-meta dd,
.versions dd {
  margin: 0;
}

.versions {
  display: grid;
  grid-template-columns: minmax(9rem, auto) 1fr;
  gap: 0.125rem 0.75rem;
  font-size: 0.875rem;
}

/* ------------------------------------------------------------------------------------ notices -- */

.notice {
  margin: 0.75rem 0;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--rule);
  border-left-width: 5px;
  border-radius: 0.375rem;
  background: var(--panel);
}

.notice h2,
.notice h4 {
  margin-top: 0;
}

.notice-correction,
.notice-misrepresentation {
  border-color: var(--misleading-rule);
  background: var(--misleading-bg);
  color: var(--misleading-ink);
}

.notice-withheld {
  border-color: var(--unverifiable-rule);
  background: var(--unverifiable-bg);
  color: var(--unverifiable-ink);
}

/* ------------------------------------------------------------------------------------- claims -- */

.claim {
  margin: 2rem 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule);
}

.claim-text {
  font-size: 1.0625rem;
}

.claim-counts {
  color: var(--ink-muted);
  font-size: 0.875rem;
}

.claim-limits ul,
.limitations ul {
  margin: 0.25rem 0;
  padding-left: 1.25rem;
}

.marker-image,
.marker-implied {
  font-style: italic;
}

.label-key,
.timeline {
  padding-left: 1.25rem;
}

.label-key {
  list-style: none;
  padding-left: 0;
}

.label-key li {
  margin: 0.25rem 0;
  padding: 0.25rem 0.5rem;
  border-left: 5px solid var(--rule);
  border-radius: 0.25rem;
}

.how-to-read dt {
  margin-top: 0.75rem;
  font-weight: 650;
}

.how-to-read dd {
  margin: 0.125rem 0 0;
}

/* ------------------------------------------------------------------------------------- tables -- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

caption {
  padding-bottom: 0.375rem;
  color: var(--ink-muted);
  font-size: 0.8125rem;
  text-align: left;
}

th,
td {
  padding: 0.4375rem 0.5rem;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

thead th {
  border-bottom: 2px solid var(--rule);
  white-space: nowrap;
}

.evidence .col-index {
  width: 2rem;
  color: var(--ink-muted);
}

.evidence .col-source {
  min-width: 14rem;
}

.evidence .outlet {
  display: block;
  color: var(--ink-muted);
  font-size: 0.8125rem;
}

.badge {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.0625rem 0.375rem;
  border: 1px solid var(--rule);
  border-radius: 0.75rem;
  font-size: 0.75rem;
}

.origin,
.derivative,
.origin-unclustered {
  font-weight: 600;
}

details summary {
  cursor: pointer;
}

details[open] summary {
  margin-bottom: 0.25rem;
}

.contents ol {
  padding-left: 1.25rem;
}

.timeline li {
  margin: 0.5rem 0;
}

.change-kind,
.change-verdict,
.change-reason {
  display: block;
  font-size: 0.8125rem;
}

.change-kind {
  font-weight: 600;
}

.change-verdict,
.change-reason {
  color: var(--ink-muted);
}

/* -------------------------------------------------------------------------------------- print -- */

@media print {
  :root {
    --page: #ffffff;
    --panel: #ffffff;
    --ink: #000000;
    --ink-muted: #333333;
    --link: #000000;
    --link-visited: #000000;
    --rule: #999999;
  }

  body {
    padding: 0;
    font-size: 11pt;
  }

  .skip-link,
  .footer-links,
  .contents {
    display: none;
  }

  /* Expandable quotes must be on the page when it is printed. */
  details > *:not(summary) {
    /* biome-ignore lint/complexity/noImportantStyles: overriding the UA rule that hides the
     * contents of a closed `details`. A printed report has to show every evidence quote, and
     * nothing can open the disclosure widgets first — the site ships no JavaScript. */
    display: block !important;
  }

  .table-scroll {
    margin-inline: 0;
    padding-inline: 0;
    overflow-x: visible;
  }

  .verdict,
  .notice,
  .claim,
  table {
    break-inside: avoid;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    word-break: break-all;
  }
}
