/*
 * Reading pages: the explainers (violations, brokers' rules, guides), the letter checker, the monthly report, partner
 * pages, policies, how it works, about, examples, search and the kind error pages. Plain and easy to read on a phone:
 * a clear title, body at 18px in one comfortable column, generous space, sources and dates quiet but present. No dark
 * panels; a code or a count is plain bold text. Tokens: brand.css. Shared parts: site.css. Gallery: /dev/gallery.
 * Linked from each reading template's head block, after site.css, so it may refine site.css parts for these pages.
 */

/* ---------- One column, sized for reading ---------- */
.read-page { max-width: 44rem; }

/* One title for the whole family: paper pages, documents on a sheet (guides, policies) and error pages. */
.read-page h1, .read-sheet h1, .read-title {
  font-size: var(--step-3); line-height: 1.2; letter-spacing: -0.015em; max-width: 20em; margin: 0 0 var(--s-3);
}
.read-page .lead, .read-page .band__lead, .read-lede {
  font-size: var(--step-1); line-height: 1.5; color: var(--ink-2); max-width: var(--measure); margin: 0 0 var(--s-5);
}
.read-page > h2, .read-page > section > h2 { font-size: var(--step-2); margin-top: var(--s-7); }
.read-page > section > h2:first-child { margin-top: 0; }
.read-page > section + section { margin-top: var(--s-7); }
/* A page's first part sits well clear of its title and lead. */
.read-page > header + :is(section, aside, nav), .read-page > article > :is(header, section) + :is(section, aside) { margin-top: var(--s-6); }
.read-page.prose-page > h2 { margin-top: var(--s-7); }
.read-page > :is(p, ul, ol, dl) { max-width: var(--measure); }

/* The words of a part keep a measure; the part's rule still runs edge to edge on a sheet. */
.read-prose > * { max-width: var(--measure); }
.read-prose > :is(h2, h3):first-child { margin-top: 0; }
.read-prose h2 { margin-top: var(--s-7); font-size: var(--step-2); }
.read-prose h3 { margin-top: var(--s-5); font-size: var(--step-1); }
.read-prose :is(p, li) { line-height: 1.6; }
.read-prose :is(ul, ol) { padding-left: 1.3rem; }
.read-prose li + li { margin-top: 0.5rem; }
.read-prose li::marker { color: var(--ink-3); }
.read-prose blockquote { margin: 0 0 var(--s-4); padding: var(--s-3) var(--s-4); background: var(--paper-2); border-radius: var(--radius-small); }
.read-prose blockquote > :last-child { margin-bottom: 0; }
/* A guide's table (markdown.py): plain rows on a wide screen; on a phone each row is a small card with its column
   names beside the values, so nothing scrolls sideways at 430px. */
.read-prose > .growth-table { max-width: none; margin: var(--s-4) 0 var(--s-5); }
.growth-table table { width: 100%; border-collapse: collapse; font-size: var(--step--1, 0.95rem); }
.growth-table :is(th, td) { text-align: left; vertical-align: top; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.growth-table th { font-weight: 600; color: var(--ink-2); }
.growth-table tr:last-child td { font-weight: 600; }
@media (max-width: 47.99rem) {
  .growth-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .growth-table :is(table, tbody, tr, td) { display: block; width: 100%; }
  .growth-table tr { padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); }
  .growth-table td { border: 0; padding: 0.15rem 0; display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: var(--s-2); }
  .growth-table td::before { content: attr(data-label); color: var(--ink-3); font-weight: 400; }
}
.read-section > h2 { font-size: var(--step-2); }
.read-section > :is(p, ul, ol) { max-width: var(--measure); }
.read-section > :last-child { margin-bottom: 0; }

/* A short heading over a list (sources, contents, more pages). */
.read-label { font-weight: 700; font-size: var(--step-1); line-height: 1.3; color: var(--ink); margin: 0 0 var(--s-3); }
.read-dates { margin: 0; color: var(--ink-3); font-size: 1rem; line-height: 1.5; }
.read-small { font-size: 1rem; line-height: 1.5; color: var(--ink-2); max-width: var(--measure); }
.read-facts { margin: 0; color: var(--ink-2); font-size: 1rem; }
/* A plain answer in bold, where the old look used a coloured badge. */
.read-answer { font-weight: 700; font-size: var(--step-1); margin-bottom: var(--s-3); }

/* ---------- Sources: a plain list, each with the day we read it ---------- */
.read-sources ol { margin: 0; padding-left: 1.4rem; max-width: var(--measure); }
.read-sources li { padding: 0.35rem 0; overflow-wrap: anywhere; line-height: 1.45; }
.read-sources li::marker { color: var(--ink-3); }
.read-sources .src, .read-when { font-family: var(--font-sans); font-size: 1rem; color: var(--ink-3); }
.read-sources .src { display: block; }

/* ---------- Lists of pages: rows with an arrow, the whole row is the target ---------- */
.read-list { list-style: none; margin: 0 0 var(--s-4); padding: 0; border-top: 1px solid var(--rule); max-width: 44rem; }
.read-list > li { border-bottom: 1px solid var(--rule); }
.read-list a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.15rem var(--s-4); align-items: center; min-height: 60px;
  padding: var(--s-3) var(--s-1); color: var(--ink); text-decoration: none;
}
.read-list a:hover { background: var(--paper-2); color: var(--ink); }
.read-list a:hover .read-list__title { text-decoration: underline; text-underline-offset: 0.18em; }
.read-list__title { grid-column: 1; font-weight: 600; font-size: var(--step-0); line-height: 1.35; }
.read-list__text { grid-column: 1; color: var(--ink-2); font-size: 1rem; line-height: 1.45; }
.read-list__meta { grid-column: 1; color: var(--ink-3); font-size: 1rem; line-height: 1.45; }
.read-list a > svg { grid-column: 2; grid-row: 1 / span 3; width: 1.2rem; height: 1.2rem; color: var(--ink-2); }
.read-list a:hover > svg { color: var(--brand); }

/* ---------- Check your own number: one light panel at the end of a page, offered once ---------- */
.read-check { background: var(--desk); border-radius: var(--radius); padding: var(--s-5) var(--s-4); max-width: 44rem; }
@media (min-width: 48rem) { .read-check { padding: var(--s-6); } }
.read-check__title { margin: 0 0 var(--s-2); font-size: var(--step-2); line-height: 1.25; }
.read-check__lead { margin: 0 0 var(--s-4); color: var(--ink-2); }
.read-check .lookup { max-width: 36rem; }
.paper-page__inner > .read-check, .read-page > .read-check { margin-top: var(--s-7); }
.read-check + .read-private, .read-check + p { margin-top: var(--s-6); }
/* On a page set on the page colour (examples), the panel is a white card like the rest. */
.read-page--desk .read-check { background: var(--paper); border: 1px solid var(--rule); box-shadow: var(--shadow); }

/* ---------- The one next step at the end of a page (the blue .sign from site.css) ---------- */
.read-next .sign { max-width: 30rem; }
.read-next__text { max-width: var(--measure); color: var(--ink-2); margin: 0 0 var(--s-3); }
.paper-page__inner > .read-next, .read-page > .read-next { margin-top: var(--s-7); }

/* ---------- The closing line every reading page carries ---------- */
.read-private { margin: 0; color: var(--ink-2); font-size: 1rem; line-height: 1.5; max-width: var(--measure); }
.paper-page__inner > .read-private { margin-top: var(--s-6); }

/* ---------- Kind error pages: what happened, what to do, and the DOT number box where it helps ---------- */
.read-trouble { max-width: 38rem; padding: 0 0 var(--s-4); }
.read-trouble .trouble__code { margin: 0 0 var(--s-2); }
.read-trouble .lead { font-size: var(--step-1); line-height: 1.5; color: var(--ink-2); max-width: var(--measure); }
.read-trouble .cluster { margin-top: var(--s-5); }
.read-trouble > .lookup { margin-top: var(--s-5); max-width: 36rem; }

.read-ref { margin: var(--s-5) 0 0; font-size: 1rem; color: var(--ink-3); }
.read-ref code { font-size: 1rem; }

/* ---------- The report's key numbers: each count in plain bold text over what it counts ---------- */
.read-keys { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); max-width: 44rem; }
@media (min-width: 40rem) { .read-keys { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.read-key { display: grid; gap: 0.2rem; align-content: start; padding: var(--s-4); border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); }
.read-key__value { font-weight: 700; font-size: var(--step-3); line-height: 1.15; letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.read-key__value--words { font-size: var(--step-1); line-height: 1.3; letter-spacing: 0; }
.read-key__unit { font-size: var(--step-0); font-weight: 600; letter-spacing: 0; color: var(--ink-2); margin-left: 0.25em; }
.read-key__name { font-weight: 600; line-height: 1.4; }
.read-key__note { font-size: 1rem; color: var(--ink-3); line-height: 1.45; }

/* ---------- Tables on a reading page: 16px and up; a table too wide for a phone becomes one card per row ---------- */
.read-table table { font-size: 1rem; }
.read-table th, .read-table tbody th { font-size: 1rem; }
.read-table td.numeric { font-family: var(--font-sans); font-weight: 600; }
@media (max-width: 33.99rem) {
  .read-table--stack { border: 0; background: none; overflow: visible; }
  .read-table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .read-table--stack :is(table, tbody, tr, td) { display: block; }
  .read-table--stack tr { border: 1px solid var(--rule); border-radius: var(--radius-small); background: var(--paper); padding: var(--s-3) var(--s-4); }
  .read-table--stack tr + tr { margin-top: var(--s-2); }
  .read-table--stack td { border: 0; padding: 0.15rem 0; text-align: left; }
  .read-table--stack td.numeric { text-align: left; font-size: var(--step-1); }
  .read-table--stack td[data-label]::before { content: attr(data-label) ": "; font-weight: 400; color: var(--ink-3); font-size: 1rem; }
  .read-table--stack td:first-child::before { content: none; }
  .read-table--stack td:first-child { font-weight: 600; }
  .read-table--stack tbody tr:hover td { background: none; }
}

/* ---------- Site reading pages: how it works, examples, search ---------- */
.read-page .meaning { gap: var(--s-4); margin-top: var(--s-4); }
.read-page .meaning__row { align-items: start; padding: var(--s-4); border: 1px solid var(--sig-edge); border-radius: var(--radius); background: var(--sig-wash); }
.read-page .meaning__row .light { margin-top: 0.1rem; }
.read-page .meaning__word { margin: 0 0 0.25rem; font-weight: 700; font-size: var(--step-1); color: var(--ink); }
.read-page .meaning__row p { color: var(--ink); }
.read-page .meaning__row p + p { color: var(--ink-2); }
.read-plain-list { list-style: none; margin: 0 0 var(--s-5); padding: 0; border-top: 1px solid var(--rule); max-width: var(--measure); }
.read-plain-list > li { padding: var(--s-3) 0; border-bottom: 1px solid var(--rule); }
.read-plain-list strong { display: block; }
.read-plain-list span { color: var(--ink-2); }
/* /how-it-works: the steps, numbered by the list itself (the numbers are not part of the words to translate). */
.hiw-steps { counter-reset: hiw; }
.hiw-steps > li { counter-increment: hiw; }
.hiw-steps h3 { font-size: var(--step-1); margin: 0 0 var(--s-2); }
.hiw-steps h3::before { content: counter(hiw) ". "; color: var(--ink-2); }
.hiw-steps p { margin: 0 0 var(--s-2); color: var(--ink-2); }
.hiw-steps p:last-child { margin-bottom: 0; }
.read-page .never .mark { color: var(--ink-2); }
.paper-page__inner .results-wrap .part-title { font-size: var(--step-2); }
.paper-page__inner .result__name { font-size: var(--step-1); line-height: 1.3; letter-spacing: 0; }
/* A long company name breaks rather than push the page sideways on a small phone. */
.paper-page__inner .result a > * { min-width: 0; overflow-wrap: anywhere; }
.paper-page__inner .log { max-width: 56rem; }

/* ---------- The example carriers: plain white cards; the whole card is the target ---------- */
.example-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); max-width: 44rem; }
/* A desk shows the examples two across, not the phone's column centred. */
@media (min-width: 64rem) { .read-page--desk { max-width: 72rem; } .read-page--desk .example-cards { max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-4); } .read-page--desk .example-cards > li { display: grid; } }
.example-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-3); align-items: start;
  padding: var(--s-4); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--ink); text-decoration: none;
}
@media (min-width: 48rem) { .example-card { padding: var(--s-5); } }
.example-card > * { grid-column: 1; }
.example-card:hover { border-color: var(--brand); color: var(--ink); }
.example-card:hover .example-card__name { text-decoration: underline; text-underline-offset: 0.18em; }
.example-card__name { font-weight: 700; font-size: var(--step-1); line-height: 1.3; overflow-wrap: anywhere; }
.example-card__meta { margin-top: 0.1rem; color: var(--ink-3); font-size: 1rem; line-height: 1.45; }
.example-card__status { display: flex; align-items: center; gap: 0.5rem; margin-top: var(--s-3); }
.example-card__word { font-weight: 700; color: var(--sig); }
.example-card__line { margin-top: 0.15rem; color: var(--ink-2); line-height: 1.45; }
.example-card__tag { margin-top: var(--s-3); }
.example-card__arrow { grid-column: 2; grid-row: 1; align-self: center; color: var(--ink-2); }
.example-card__arrow svg { display: block; width: 1.3rem; height: 1.3rem; }
.example-card:hover .example-card__arrow { color: var(--brand); }

/* ---------- Gallery: the v3 parts by name ---------- */
.gallery-note { color: var(--ink-2); max-width: var(--measure); }
.gallery-group { margin: var(--s-6) 0 var(--s-3); font-size: var(--step-0); color: var(--ink-2); }
.gallery-stack { display: grid; gap: var(--s-4); max-width: 44rem; }
.gallery-scale { display: grid; gap: var(--s-3); max-width: 44rem; }
.gallery-scale > div { display: grid; gap: 0.15rem; border-bottom: 1px solid var(--rule); padding-bottom: var(--s-3); }
.gallery-scale p { margin: 0; }
.gallery-scale code, .gallery-cell > code, .gallery-stack code { font-size: 1rem; color: var(--ink-3); background: none; padding: 0; }
.gallery-section code { overflow-wrap: anywhere; }
.g-step-4 { font-weight: 700; font-size: var(--step-4); line-height: 1.15; letter-spacing: -0.02em; }
.g-step-3 { font-weight: 700; font-size: var(--step-3); line-height: 1.2; letter-spacing: -0.015em; }
.g-step-2 { font-weight: 700; font-size: var(--step-2); line-height: 1.25; }
.g-step-1 { font-weight: 700; font-size: var(--step-1); line-height: 1.3; }
.g-step-0 { font-size: var(--step-0); }
.g-step--1 { font-size: var(--step--1); color: var(--ink-3); }
.chip-rule-strong { background: var(--rule-strong); } .chip-brand-strong { background: var(--brand-strong); }
.chip-brand-soft { background: var(--brand-soft); } .chip-unknown { background: var(--unknown); }
.chip-go-wash { background: var(--go-wash); } .chip-caution-wash { background: var(--caution-wash); }
.chip-stop-wash { background: var(--stop-wash); } .chip-unknown-wash { background: var(--unknown-wash); }
.chip-go-edge { background: var(--go-edge); } .chip-caution-edge { background: var(--caution-edge); }
.chip-stop-edge { background: var(--stop-edge); } .chip-unknown-edge { background: var(--unknown-edge); }
.gallery-frame { background: var(--desk); border-radius: var(--radius); padding: var(--s-4); max-width: 46rem; }
.gallery-frame > .sheet { margin: 0; }
