/* The pages around the viewer: why themes, the evidence, and questions.
   Colours come from themes.css, one set per theme, made and checked by
   tools/site_assets.py. Type follows the viewer. Sizes are in rem, so a
   reader's own default text size is kept. */
:root {
  --font-display: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --font-ui: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-code: "Source Code Pro", ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1.0625rem/1.6 var(--font-ui); }
.wrap { max-width: 1080px; margin: 0 auto; padding-inline: 16px; }
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible,
.scroll:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.875rem, 4.6vw, 2.875rem); line-height: 1.1; }
h2 { font-size: clamp(1.5rem, 3vw, 1.875rem); }
h3 { font-size: 1.25rem; }
p { margin: 0; max-width: 68ch; }
ul, ol { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; max-width: 72ch; }
.muted { color: var(--muted); }
.eyebrow { font-size: .875rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
code { font-family: var(--font-code); font-size: .88em; }
img { max-width: 100%; height: auto; }
figure { margin: 0; display: grid; gap: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
                   clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Header: the site's name, its pages, and the page colours */
header.top { border-bottom: 1px solid var(--rule); }
header.top .wrap { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; justify-content: space-between; padding-block: 12px; }
.brand { font-family: var(--font-display); font-weight: 600; font-size: 1.1875rem; color: var(--ink); text-decoration: none; }
nav.site { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .9375rem; min-width: 0; }
@media (max-width: 720px) { nav.site { flex-basis: 100%; } }
nav.site a { color: var(--muted); text-decoration: none; }
nav.site a:hover { color: var(--ink); text-decoration: underline; }
nav.site a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.colours { display: flex; align-items: center; gap: 8px; font-size: .9375rem; color: var(--muted); }
.colours select { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--muted); border-radius: 6px; padding: 3px 6px; }

/* Page sections */
main > .intro { padding-block: 44px 28px; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.intro .lede { font-size: 1.1875rem; max-width: 64ch; }
section { border-top: 1px solid var(--rule); padding-block: 40px; }
section > .wrap { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.toc { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .9375rem; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-block; font-weight: 600; font-size: .9375rem; text-decoration: none; padding: 8px 14px; border-radius: 6px;
       background: var(--accent); color: var(--paper); border: 1px solid transparent; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--muted); }

/* Short points in a grid, and the evidence cards */
.points { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.point { display: grid; gap: 6px; align-content: start; }
.point p + p { margin-top: .6em; }
.point h3 { font-size: 1.125rem; }
.keys { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.key { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.key p { font-size: 1rem; }
.k { font-size: .8125rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.k.est { color: var(--est); } .k.meas { color: var(--meas); } .k.open { color: var(--open); }
/* The marks before the labels are decoration: the second content value gives them empty alternative text. */
.k.est::before { content: "\25CF\00a0"; content: "\25CF\00a0" / ""; }
.k.meas::before { content: "\25A0\00a0"; content: "\25A0\00a0" / ""; }
.k.open::before { content: "\25CB\00a0"; content: "\25CB\00a0" / ""; }

/* Tables: a panel that scrolls sideways on a narrow screen, row headers, and a mark before each verdict */
.scroll { overflow-x: auto; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 2px 14px; }
table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: .9375rem; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--rule); }
tr:last-child td, tr:last-child th { border-bottom: 0; }
thead th { font-size: .875rem; font-weight: 700; color: var(--muted); }
tbody th { font-size: inherit; font-weight: 600; color: var(--ink); }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td.yes::before { content: "\2713\00a0"; content: "\2713\00a0" / ""; font-weight: 700; }
td.no::before { content: "\2717\00a0"; content: "\2717\00a0" / ""; font-weight: 700; }
td.part::before { content: "\25D0\00a0"; content: "\25D0\00a0" / ""; }
/* The standards table says in words what each standard means for themes, so its cells carry no mark. */
#standards td::before { content: none; }
.scroll-hint { display: none; }
@media (max-width: 700px) { .scroll-hint { display: block; } }
.note { font-size: .9375rem; color: var(--muted); max-width: 76ch; }
ol.refs { font-size: .9375rem; gap: 8px; max-width: 92ch; padding-left: 2em; grid-template-columns: minmax(0, 1fr); }
ol.refs li { padding-left: 4px; }
ol.refs a { overflow-wrap: anywhere; }

/* Questions */
.qa { display: grid; gap: 12px; }
.qa h2 { font-size: clamp(1.375rem, 2.6vw, 1.6875rem); }
.qa .short { font-size: 1.1875rem; }
.qa .more { font-size: .9375rem; color: var(--muted); }

/* The demo: a chart and a picture, as the author made them or as a PDF app changes them */
.demo { margin: 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.demo-controls { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; }
.segmented { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--muted); border-radius: 8px; overflow: hidden; }
.segmented button { font: inherit; font-size: .9375rem; color: var(--muted); background: var(--paper); border: 0; padding: 7px 12px; cursor: pointer; }
.segmented button + button { border-left: 1px solid var(--rule); }
.segmented button[aria-pressed="true"] { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: inset 0 -3px 0 var(--accent); }
/* Drawn inside the button, so the group's rounded clip and the next button don't hide it. */
.segmented button:focus-visible { outline-offset: -4px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: .9375rem; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.stage { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: center;
         border: 1px solid var(--rule); border-radius: 8px; padding: 14px; background: var(--paper); }
@media (max-width: 760px) { .stage { grid-template-columns: minmax(0, 1fr); } }
.stage-picture img { display: block; width: 100%; border-radius: 4px; }
.demo-note { font-size: 1rem; min-height: 3.2em; }
.demo figcaption, figure figcaption { font-size: .9375rem; color: var(--muted); max-width: 76ch; }

.chart { display: block; width: 100%; height: auto; }
.chart text { font-family: var(--font-ui); font-size: 15px; fill: var(--ink); }
/* On a phone the chart is drawn at about half size, so its text (in the chart's own units) is set larger. */
@media (max-width: 560px) { .stage { padding: 8px; } .chart text { font-size: 27px; } }
.chart .grid line { stroke: var(--grid); stroke-width: var(--fig-grid-w); }
.chart .axis { fill: none; stroke: var(--ink); stroke-width: var(--fig-axis-w); }
.chart .s1 { --c: var(--s1); } .chart .s2 { --c: var(--s2); } .chart .s3 { --c: var(--s3); }
.chart .line, .chart .key line { fill: none; stroke: var(--c); stroke-width: var(--fig-line-w); stroke-linejoin: round; stroke-linecap: butt; }
.chart .s2 .line { stroke-dasharray: var(--fig-dash2); }
.chart .s3 .line { stroke-dasharray: var(--fig-dash3); }
.chart .marks > * { fill: var(--c); stroke: var(--paper); stroke-width: 1.5; }
.chart .end-label { font-weight: 600; }
.chart .key { display: none; }
.demo[data-cues="off"] .chart .marks, .demo[data-cues="off"] .chart .end-label { display: none; }
.demo[data-cues="off"] .chart .line { stroke-dasharray: none; }
.demo[data-cues="off"] .chart .key { display: inline; }
.demo[data-view="recoloured"] .chart .line, .demo[data-view="recoloured"] .chart .key line,
.demo[data-view="recoloured"] .chart .grid line { stroke: var(--ink); }
.demo[data-view="recoloured"] .chart .grid line { stroke-width: 0.6; }
.demo[data-view="recoloured"] .chart .marks > * { fill: var(--ink); }

/* The theme lab's page in eight themes */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; max-width: none; }
@media (max-width: 760px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .tiles.three { grid-template-columns: minmax(0, 1fr); } }
.tiles li { display: grid; gap: 6px; align-content: start; }
.tiles img { display: block; width: 100%; border: 1px solid var(--rule); border-radius: 3px; }
.tiles span { font-size: .875rem; color: var(--muted); }

/* Tint swatches: the colours themselves, the same in every theme */
.swatches { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.swatch { border-radius: 6px; border: 1px solid var(--rule); min-height: 74px; padding: 8px 10px; display: grid; align-content: end;
          color: #000; font-size: .875rem; line-height: 1.35; }
.swatch code { font-size: .8125rem; }
/* Each swatch's colour is set here, not in the page, so the Content Security Policy needs no inline styles */
.swatch-site-cream { background: #FDF6E3; }
.swatch-site-peach { background: #FDE7DC; }
.swatch-site-yellow { background: #FFF7C2; }
.swatch-site-turquoise { background: #E3EEFA; }
.swatches-tested { margin-top: 10px; }
.swatch-tested-cream { background: #FAFAC8; }
.swatch-tested-peach { background: #EDD1B0; }
.swatch-tested-yellow { background: #F8FD89; }
.swatch-tested-turquoise { background: #A5F7E1; }
.swatch-tested-orange { background: #EDDD6E; }

footer { border-top: 1px solid var(--rule); padding-block: 26px 44px; font-size: .875rem; color: var(--muted); }
footer .wrap { display: grid; gap: 8px; }

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

/* Windows contrast themes and other forced colours: keep the chart readable on the system's own
   background, show which demo view is chosen, and keep the swatches as the colours they show. */
@media (forced-colors: active) {
  .chart text { fill: CanvasText; }
  .chart .axis { stroke: CanvasText; }
  .chart .grid line { stroke: GrayText; }
  .chart .marks > * { stroke: Canvas; }
  .demo[data-view="recoloured"] .chart .line, .demo[data-view="recoloured"] .chart .key line,
  .demo[data-view="recoloured"] .chart .grid line { stroke: CanvasText; }
  .demo[data-view="recoloured"] .chart .marks > * { fill: CanvasText; }
  .segmented button[aria-pressed="true"] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .segmented button[aria-pressed="true"]:focus-visible { outline-color: HighlightText; }
  .swatch { forced-color-adjust: none; }
}

/* Printing: no controls, nothing split across a page, tables at full width. */
@media print {
  header.top nav, header.top .colours, .cta, .demo-controls, .toc, .scroll-hint { display: none; }
  .stage, figure, .tiles li, .point, .key, tr { break-inside: avoid; }
  h2, h3, .eyebrow { break-after: avoid; }
  .scroll { overflow: visible; }
  table { min-width: 0; }
}
