/* Content pages. Loaded after /app.css and built from its tokens: the same four colours,
   the same two fonts, no lines, no boxes, no italics, no tracking. */

/* ---------- head: the field, a wordmark, the page title ---------- */
.page-head { padding-block: 20px clamp(40px, 6vw, 88px); }
.page-head .topbar .wordmark {
  margin-left: 0;
  font-family: var(--display);
  font-weight: 760;
  font-stretch: 112%;
  font-size: var(--t3);
  text-decoration: none;
}
.page-head .topbar .wordmark:hover { text-decoration: underline; }
.head-body { display: grid; gap: 18px; padding-top: clamp(28px, 5vw, 72px); justify-items: start; }
.eyebrow { font-size: var(--t1); font-weight: 600; }
.notice { font-size: var(--t2); font-weight: 600; max-width: 44ch; }
.byline { font-size: var(--t1); max-width: 56ch; }
.byline a { text-decoration-thickness: 1px; }
.title {
  font-family: var(--display);
  font-weight: 760;
  font-stretch: 112%;
  font-size: min(var(--t6), calc((100vw - 32px) / 9));
  line-height: 1.02;
  hyphens: manual;
  text-wrap: balance;
  overflow-wrap: break-word;
  max-width: 18ch;
}
.head-fig { display: grid; gap: 10px; padding-top: 12px; }
.head-fig .cap { color: inherit; max-width: 46ch; }

/* ---------- reading column ---------- */
.page { padding-block: clamp(48px, 7vw, 104px) calc(var(--dock-space) + 24px); display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(56px, 7vw, 96px); }
.prose { max-width: 44rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-content: start; }
.prose td, .prose th { overflow-wrap: anywhere; }
.page.wide .prose { max-width: 60rem; }
.prose > * { max-width: 44rem; }
.page.wide .prose > table, .page.wide .prose > .tpl { max-width: none; }
.prose p, .prose li { font-size: var(--t2); }
.prose > p:first-child { font-size: var(--t3); line-height: 1.45; }
/* Inner pages: one step down from the home page's poster heads, with more room above. The width cap
   keeps the longest word in any head ("Methodology", "Immigration") on one line at 280px. */
.prose h2 {
  grid-column: auto;
  font-size: min(var(--t4), calc((100vw - 32px) / 7));
  font-weight: 760;
  font-stretch: 108%;
  line-height: 1.1;
  margin-top: clamp(40px, 5vw, 72px);
}
.prose h3 {
  font-family: var(--display);
  font-weight: 680;
  font-stretch: 104%;
  font-size: min(var(--t3), calc((100vw - 32px) / 10));
  line-height: 1.2;
  margin-top: 16px;
}
.prose h4 { font-size: var(--t2); font-weight: 700; margin-top: 12px; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: -6px; }
.prose ul, .prose ol { display: grid; gap: 10px; padding-left: 1.25em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose ul.tasks { list-style: none; padding-left: 0; }
.prose li::marker { color: var(--muted); }
.prose li > p { margin: 0; }
strong, b { font-weight: 680; }
em, i, cite, dfn, address { font-style: normal; }
hr { display: none; }
blockquote { margin: 0; font-family: var(--display); font-weight: 600; font-size: var(--t3); line-height: 1.3; }
code { font-family: inherit; }
.nd { color: var(--muted); }
.cap { color: var(--muted); font-size: var(--t1); }

/* ---------- tables: whitespace only ---------- */
table { border-collapse: collapse; width: 100%; font-size: var(--t1); font-variant-numeric: lining-nums; }
caption { text-align: left; font-weight: 600; padding-bottom: 12px; font-size: var(--t2); }
th, td { text-align: left; vertical-align: top; padding: 10px 20px 10px 0; font-weight: 400; }
thead th { color: var(--muted); font-weight: 600; padding-top: 0; }
tbody th[scope="row"] { font-weight: 650; }
.cost tr.total th, .cost tr.total td { font-weight: 700; padding-top: 18px; }
.cost td { white-space: nowrap; }
@media (max-width: 760px) {
  table.data, table.data tbody, table.data tr, table.data th, table.data td { display: block; }
  table.data thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.data caption { display: block; }
  table.data tr { padding-bottom: 22px; }
  table.data th, table.data td { padding: 2px 0; }
  table.data tbody th[scope="row"] { font-size: var(--t2); padding-bottom: 4px; }
  table.data td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
  .cost td { white-space: normal; }
  .cost th[scope="row"] { padding-right: 12px; }
}

/* ---------- templates ---------- */
.copy-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.copy { font-weight: 600; font-size: var(--t2); min-height: 44px; display: inline-flex; align-items: center; transform-origin: 0 60%; }
.copy-status { font-size: var(--t1); color: var(--muted); }
.tpl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding-left: clamp(0px, 3vw, 32px); }
.tpl > * { max-width: 44rem; }
.tpl table { max-width: 44rem; }

/* ---------- FAQ, sources, footer links ---------- */
.faq { gap: 28px; }
.faq .qa { display: grid; gap: 8px; }
.faq h3 { margin-top: 0; }
.sources ul { list-style: none; padding-left: 0; gap: 14px; }
.sources li { font-size: var(--t1); }
.sources .m { color: var(--muted); }
.updated { color: var(--muted); font-size: var(--t1); }


/* ---------- calculator ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 40px clamp(32px, 5vw, 80px); align-items: start; max-width: none; }
.calc .inputs { display: grid; gap: 22px; }
.calc label { display: grid; gap: 6px; font-size: var(--t1); font-weight: 600; color: var(--muted); }
.calc select {
  font: inherit;
  font-size: var(--t3);
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  border: 0;
  padding: 6px 0;
  min-height: 44px;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
  cursor: pointer;
  max-width: 100%;
}
.calc .result { display: grid; gap: 14px; align-content: start; container-type: inline-size; }
.calc .result .big { font-size: min(var(--t5), 11cqi); white-space: nowrap; }
.calc .result .med { font-family: var(--display); font-weight: 650; font-size: var(--t3); }
.calc .result ul { list-style: none; padding-left: 0; display: grid; gap: 6px; }
.calc .result li { font-size: var(--t1); color: var(--muted); }
.calc .result .sub { grid-column: auto; font-family: var(--body); font-size: var(--t1); font-weight: 600; font-stretch: 100%; line-height: 1.4; color: var(--muted); margin-top: 14px; }
.calc .result #c-survey li { color: var(--ink); font-size: var(--t2); }
.prose ul.notes { list-style: none; padding-left: 0; }
.prose ul.notes li { font-size: var(--t1); color: var(--muted); }
@media (max-width: 900px) { .calc { grid-template-columns: minmax(0, 1fr); } }

/* Single-column grids get a track that may shrink below its longest word, so a long word or
   URL wraps (body has overflow-wrap: break-word) instead of widening the page at large text sizes. */
.head-body, .head-fig, .prose ul, .prose ol, .faq .qa, .calc .inputs, .calc label, .calc .result, .calc .result ul, .lost, .lost ul {
  grid-template-columns: minmax(0, 1fr);
}

/* ---------- 404 ---------- */
.lost { display: grid; gap: 18px; }
.lost ul { list-style: none; padding-left: 0; display: grid; gap: 10px; }

@media print {
  .dock-band, .dock, .skip, .close, .copy-row { display: none !important; }
  .field { background: none; color: #000; }
}

/* without JS: no pill, so the current page is underlined instead, and nothing waits on a script */
html:not(.js) .js-only { display: none; }
html:not(.js) .dock a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.22em; }

/* ---------- index pages: a plain list, the link then one line ---------- */
.prose ul.index { list-style: none; padding-left: 0; gap: 22px; }
.prose ul.index li { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; justify-items: start; }
.prose ul.index a { font-family: var(--display); font-weight: 680; font-stretch: 104%; font-size: var(--t3); line-height: 1.2; max-width: 100%; }
.prose ul.index .m { color: var(--muted); font-size: var(--t1); }

/* ---------- template block: the copyable text ---------- */
.copy-row .copy { display: inline-flex; }
.tpl h2 { font-size: var(--t4); margin-top: 20px; }
.tpl h3 { font-size: var(--t3); }
.tpl p { white-space: pre-line; } /* keep the letter's address lines as written */

/* ---------- /now/edit ---------- */
.edit { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; max-width: 36rem; }
.edit label { font-size: var(--t1); font-weight: 600; color: var(--muted); }
.edit input {
  font: inherit; font-size: var(--t3); color: var(--ink); background: var(--bg);
  border: 0; padding: 8px 0; min-height: 44px; width: 100%;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.22em;
}
.edit input:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
.prose ul.history { list-style: none; padding-left: 0; }
.prose ul.history .m { color: var(--muted); font-size: var(--t1); }
