/* Shared stylesheet for the generated reference pages (rates, methodology, about).
   Same Ledger tokens and rules as the inline styles in index.html; see DESIGN.md.
   Structure is ruling: no cards, chips, tiles or accent rails. Red is debit only. */

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

:root {
  --ink:         #16130F;
  --ink-raised:  #1C1813;
  --bone:        #EDE7DA;
  --bone-dim:    #B8AE9E;
  --bone-faint:  #8E8375;
  --label:       #95897A;
  --red:         #D85940;
  --nil:         #8A7F70;
  --rule-hair:   rgba(237,231,218,.13);
  --rule:        rgba(237,231,218,.22);
  --rule-strong: rgba(237,231,218,.42);

  --serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono:  ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --sheet: 1180px;
  --gutter: 40px;
}

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

body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.sheet { max-width: var(--sheet); margin: 0 auto; padding-inline: var(--gutter); }

.label {
  font-family: var(--mono); font-size: 10px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--label);
}

h1, h2, h3 { font-weight: 600; letter-spacing: -.018em; text-wrap: balance; }

a { color: inherit; }
main a:not(.btn) {
  color: var(--bone); text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--rule-strong); transition: text-decoration-color .15s;
}
main a:not(.btn):hover { text-decoration-color: var(--bone); }

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

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--bone); color: var(--ink);
  padding: 12px 18px; font-family: var(--mono); font-size: 12px;
  letter-spacing: .1em; text-transform: uppercase; z-index: 200;
}
.skip:focus { left: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .13em; text-transform: uppercase;
  background: var(--bone); color: var(--ink); border: 1px solid var(--bone);
  padding: 13px 22px; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s;
}
.btn:hover { background: transparent; color: var(--bone); }
.btn-ico { width: 15px; height: 15px; flex: none; fill: currentColor; margin-top: -1.5px; }
.btn-quiet { background: transparent; color: var(--bone-dim); border: 1px solid var(--rule); }
.btn-quiet:hover { color: var(--bone); border-color: var(--bone); }

/* ---------- masthead ---------- */

.masthead { position: sticky; top: 0; z-index: 100; background: var(--ink); border-bottom: 1px solid var(--rule-strong); }
.masthead .sheet { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding-block: 14px; }
.wordmark { font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--bone); text-decoration: none; white-space: nowrap; }
.mast-nav { display: flex; align-items: baseline; gap: 28px; }
.mast-nav a {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .11em; text-transform: uppercase;
  color: var(--label); text-decoration: none; white-space: nowrap; transition: color .15s;
}
.mast-nav a:hover, .mast-nav a[aria-current="page"] { color: var(--bone); }

/* ---------- sections ---------- */

section { border-bottom: 1px solid var(--rule); }
section > .sheet { padding-block: 56px 64px; }

.sec-head { display: flex; align-items: baseline; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.sec-head h1 { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.08; }
.sec-intro { font-size: 15.5px; line-height: 1.65; color: var(--bone-dim); max-width: 68ch; margin-bottom: 32px; }

/* long-form entry: one measure, ruled facts */
.entry { max-width: calc(760px + 2 * var(--gutter)); }
.entry h1 { font-size: clamp(32px, 3.8vw, 48px); line-height: 1.06; margin: 10px 0 14px; }
.entry h2 { font-size: 21px; margin: 44px 0 12px; padding-top: 18px; border-top: 1px solid var(--rule); }
.crumbs a { color: var(--label) !important; text-decoration: none !important; }
.crumbs a:hover { color: var(--bone) !important; }
.lede { font-size: 17px; line-height: 1.6; color: var(--bone-dim); max-width: 64ch; }
.prose { font-size: 15.5px; line-height: 1.72; color: var(--bone-dim); max-width: 68ch; margin-bottom: 12px; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 28px; border-top: 1px solid var(--rule-strong); }
.facts > div { padding: 12px 18px 12px 0; border-bottom: 1px solid var(--rule-hair); }
.facts dt { font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--label); }
.facts dd { font-size: 16px; color: var(--bone); margin-top: 4px; }
.facts dd.fig { font-family: var(--mono); font-size: 20px; font-variant-numeric: tabular-nums; }
/* the About page's refusals read as sentences, so they take a two-column ledger */
.entry h2 + .facts { grid-template-columns: 140px 1fr; margin-top: 8px; }
.entry h2 + .facts > div { display: contents; }
.entry h2 + .facts dt, .entry h2 + .facts dd { padding: 11px 0; border-bottom: 1px solid var(--rule-hair); margin: 0; }
.entry h2 + .facts dd { font-size: 15px; color: var(--bone-dim); }

.caveat {
  margin-top: 22px; padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-size: 14.5px; line-height: 1.65; color: var(--bone-dim); font-style: italic;
}
.caveat .label { font-style: normal; margin-right: 10px; }

.marginalia { font-size: 13px; line-height: 1.62; color: var(--bone-faint); font-style: italic; max-width: 64ch; margin-top: 14px; }
.checked { margin-top: 26px; }
.checked a { color: var(--label) !important; }

ul.ruled { list-style: none; max-width: 68ch; margin-bottom: 12px; }
ul.ruled li { font-size: 15px; line-height: 1.65; color: var(--bone-dim); padding: 10px 0; border-bottom: 1px solid var(--rule-hair); }
ul.ruled li:first-child { border-top: 1px solid var(--rule-hair); }

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

table { width: 100%; border-collapse: collapse; margin-top: 6px; }
caption { text-align: left; padding-bottom: 9px; }
thead th {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--label); font-weight: 400; text-align: right; padding: 0 0 9px;
  border-bottom: 1px solid var(--rule-strong); white-space: nowrap;
}
thead th:first-child, thead th.al { text-align: left; }
tbody td { font-size: 15px; padding: 9px 0; border-bottom: 1px solid var(--rule-hair); text-align: right; font-variant-numeric: tabular-nums; }
tbody td:first-child { text-align: left; color: var(--bone); }
tbody tr:hover td { background: rgba(237,231,218,.035); }
tbody td a { text-decoration: none !important; }
tbody td a:hover { text-decoration: underline !important; }
.fig { font-family: var(--mono); font-size: 14px; }
.rate  { color: var(--bone-dim); }
.taken { color: var(--red); }
.kept  { color: var(--bone); }
.nil   { color: var(--nil); }
.region-cell { text-align: left !important; color: var(--bone-faint); font-size: 13.5px; padding-left: 16px; }
tfoot td {
  padding: 13px 0 0; border-top: 3px double var(--rule-strong);
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--label);
}

.close-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 34px; }

/* ---------- footer ---------- */

footer .sheet { padding-block: 34px 44px; display: grid; grid-template-columns: 1fr auto; gap: 26px 40px; align-items: start; }
.foot-note { font-size: 12.5px; color: var(--bone-faint); max-width: 48ch; line-height: 1.65; margin-top: 10px; }
.foot-credit { font-size: 12.5px; color: var(--bone-faint); margin-top: 18px; }
.foot-credit a { color: var(--label); text-decoration: none; border-bottom: 1px solid rgba(149,137,122,.4); }
.foot-credit a:hover { color: var(--bone); border-color: var(--bone); }
.foot-links { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-left: -10px; }
.foot-links a {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .11em; text-transform: uppercase;
  color: var(--label); text-decoration: none; padding: 15px 10px; transition: color .15s;
}
.foot-links a:hover { color: var(--bone); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media (max-width: 900px) {
  :root { --gutter: 24px; }
  .masthead .sheet { flex-wrap: wrap; gap: 10px 24px; padding-block: 12px; }
  .mast-nav { gap: 18px; flex-wrap: wrap; }
  .wordmark { font-size: 11px; letter-spacing: .13em; }
  .facts { grid-template-columns: repeat(2, 1fr); }
  footer .sheet { grid-template-columns: 1fr; }
  section > .sheet { padding-block: 40px 48px; }
}

@media (max-width: 620px) {
  body { font-size: 16px; }
  .col-hide { display: none; }
  .mast-nav .nav-get { display: none; }
  .entry h2 + .facts { grid-template-columns: 96px 1fr; }
  .close-actions .btn { flex: 1 1 100%; }
}
