/* Site layout rules: the readable measure, in one file.
 *
 * WHY (2026-11-20). `.section` is centred and 1200px wide, and every text block
 * inherited that width. Reported from /compare: comparison tables spanned the
 * whole section with their columns pinned left, and prose ran to 1100-1160px
 * (100-176 characters per line).
 *
 * THREE RULES, each one earned by a measurement on the live site:
 *
 *  1. ONE MEASURE, IN PX. Every text block in a section ends at the same x.
 *     `ch` was tried first and failed: it scales with font-size, so a 16px lead
 *     stopped at x=888 while the 13.5px footnote below it stopped at x=770 and
 *     the stack came out with a ragged right edge.
 *  2. `min(100%, Npx)`, never a bare cap. A bare cap also shortens copy that
 *     already sits in a 345px card, which measured as a 258px line inside a
 *     card and looked broken. `min()` can only ever shorten a box that is
 *     already wider than the measure.
 *  3. GRIDS KEEP THEIR COLUMN. A capped grid leaves a 280px empty gutter on a
 *     1160px section; a grid collapsed to one column at 768 leaves a 728px card
 *     around a 596px paragraph. Neither is a measure problem, so neither is
 *     capped here; the cards are split into two columns instead.
 *
 * Tables use the same px measure as the prose, so a section's copy, its tables
 * and its cards all end at one edge. Deliberate full-bleed things (hairline
 * sections, the yellow CTA band, the hero frame) are not touched. Loaded by
 * every static page through tools/site-chrome.mjs.
 */

/* Widows on headings are handled by `text-wrap: balance`, which is safe on a
   single-line-per-break heading but NOT on paragraphs: on paragraphs it
   reflows long copy unpredictably. Kept to h1/h2/h3 only. */
h1, h2, h3, .h-title {
  text-wrap: balance;
}

/* ── prose: the readable measure ────────────────────────────────────────── */
/* Prose is measured in EM, so a 16px paragraph and a 12px fine-print line both
   land at ~90 characters. 45em = 720px at 16px. */

.section > p,
.section > .lead,
.section > .h-sub,
.section > ol,
.section > ul,
.faq p,
details p,
.cond p,
.nc-row p,
.card p,
.card li,
.step p,
.step small,
.section .grid3 p,
.section .steps p,
.section .steps3 p,
.section .two-col > div > p,
.section .two-col > div > .lead,
.section .two-col > div > ul,
.section .two-col > div > ol,
.section .two-col > div > ul > li,
.section .two-col > div > ol > li {
  /* Three-way cap: never the container, never more characters than the measure
     allows at this font size, and never wider than the heading it sits under. */
  max-width: min(100%, 45em, 720px);
}

/* ONE LEFT EDGE, for every block in a section. Reported from screenshots of
   the home page and /guarantee: a heading sat 180px right of the cards and the
   rule directly under it, the dark guarantee band carried 180px of padding on
   each side, a split's panel hung 180px past the prose, and the top bar's logo
   stood 40px left of every section. Four left edges on one page.

   The culprit was the old `--axis` inset: running prose was shifted onto the
   hero's 720px column while grids, rules and splits stayed on the section's
   edge, so every section carried two grids and every panel a dead gutter. The
   hero is a centred module of its own; below it there is ONE edge, the
   section's, and every heading, paragraph, grid, split, table and figure
   starts there (x180 at 1440).

   Text keeps its readable measure by CAPPING the right edge, never by moving
   the left one: a cap cannot misalign anything. `body >` raises specificity
   above each page's inline `.section{max-width:var(--grid)}`, which is later in
   the document. The top bar and the footer take the same width, so the logo,
   the nav's right edge and the footer row sit on the section edges too. */
body > .section {
  max-width: 1120px;
}
body > .topbar .topbar-inner,
body > footer {
  max-width: 1120px;
}

/* Headings are measured in PX (their own font size is 26-44px, so an `em`
   measure would be 1200-2000px and cap nothing). Applies inside wrappers as
   well: a heading in a bare <div> must not run the full 1080 while the copy
   under it stops at 720. */
.section :is(h1, h2, h3, h4, .h2, .h-title) {
  max-width: min(100%, 720px);
}

/* Splits fill the shell: the text column starts on the section's left edge
   like every heading above it, and the panel ends on the section's right edge.
   The panel is fluid, not the fixed 375-470px it used to be: the fixed panel
   plus the axis inset left the prose 375px wide and the panel 180px proud of
   the section rule. */
body > .section .split {
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(20px, 2.6vw, 44px);
}
/* The page's own `@media(max-width:860px){.split{grid-template-columns:1fr}}`
   is later in the document but LESS specific, so the rule above would have kept
   two columns on a phone and reintroduced the 320px overflow. Restated here. */
@media (max-width: 860px) {
  body > .section .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* A grid of exactly four cards is 2x2, never 3 + 1. The jump playbook and the
   install-problem grid both hold four items in a three-column grid, which puts
   the fourth card alone on a row with two empty cells: it reads as a mistake,
   not as rhythm. `:has()` counts the children; five or more keep 3-up because a
   last row of two still balances. */
@media (min-width: 641px) {
  .section :is(.grid3, .problems):has(> :nth-child(4):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Two-card pairs get the same breathing room as a split: 14px read as two
   columns touching, and the gap is the only place the shell's width shows. */
body > .section .two-col {
  gap: clamp(14px, 1.6vw, 24px);
}

/* The guarantee's dark band is a card on the shell, so its own edges land on
   the section edges and only its content is inset (40px, like every card). Its
   old padding was `max(40px, var(--axis))`: 180px at 1440, which pushed the
   band's copy 180px right and left a dark gutter down the whole left side. */
body > .section .guarantee {
  padding: 44px 40px;
}
@media (max-width: 640px) {
  body > .section .guarantee {
    padding: 28px 22px;
  }
}

/* Small type needs a smaller box to keep ~90 characters per line: the 14px
   closing note in the step list was 97 characters wide at 680px (measured).
   45em is 634px at 14px and 652px at 14.5px, the same characters as 720px of
   16px copy. */
.section .steps-copy p,
.section .steps-copy li {
  max-width: min(100%, 45em);
}

/* ── containers take the shell, prose keeps the measure ─────────────────── */
/* Reported 2026-11-21 from a screenshot of /gift: the versus table and the FAQ
   box stopped at 720 while the cards above and below them ran to 1080 and the
   yellow band to 1080, so the page's right edge came in three lengths and two
   blocks read as stubs. A bordered block is a CARD, not a paragraph: it takes
   the shell. What keeps a table readable is its column structure (below), and
   what keeps a FAQ answer readable is capping the answer text, which the prose
   rule above already does. */
.faq {
  max-width: none;
}
.compare,
.stub {
  width: 100%;
  max-width: none;
}

.compare-head,
.compare-row {
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr) minmax(0, 1.15fr);
  column-gap: 20px;
}

/* ── the ladder: ONE component, on every surface that shows the comparison ──
   A panel, not a run of table rows. Each rung carries its own size, the share
   of destinations it wins, and the median gap. The share is drawn as a track so
   the SHAPE of the ladder is legible before a number is read: five full-ish bars
   and one visibly shorter at 20GB is the honest picture.
   Lives in site.css because /compare renders it too (2026-11-22): the same claim
   in two different tables read as two different claims, and the old /compare
   grid rows had no bar, so the weak rung was invisible there.
   The counts are published ones; tools/check-ladder-claims.mjs recomputes every
   row (count, total, median, and the bar's own WIDTH) from the dated book on
   both pages, so a stale figure fails preflight instead of sitting live. */
.ladder{border:1px solid var(--line);border-radius:20px;background:#fff;margin-top:22px;padding:6px 22px 8px;box-shadow:0 24px 48px -40px rgba(15,17,21,.55)}
.ladder-row{display:grid;grid-template-columns:minmax(104px,.72fr) minmax(0,1.6fr) minmax(88px,auto);gap:10px 26px;align-items:center;padding:15px 0;border-bottom:1px solid var(--line)}
.ladder-row:last-child{border-bottom:0}
.ladder-head{border-bottom:1px solid var(--ink);padding:14px 0 9px}
.ladder-head span{font-family:'JetBrains Mono','JetBrains Mono Fallback',monospace;font-size:10px;letter-spacing:.13em;text-transform:uppercase;color:var(--ink-60)}
.l-size{display:block;font-family:'Instrument Serif','Instrument Serif Fallback',serif;font-size:27px;line-height:.95;letter-spacing:-.02em;color:var(--ink)}
.l-valid{display:block;margin-top:4px;font-family:'JetBrains Mono','JetBrains Mono Fallback',monospace;font-size:10.5px;letter-spacing:.09em;text-transform:uppercase;color:var(--ink-60)}
.l-count{display:block;font-size:13.5px;color:var(--ink);font-variant-numeric:tabular-nums}
.l-track{display:block;height:6px;margin-top:8px;border-radius:999px;background:#EDE9E1;overflow:hidden}
.l-fill{display:block;height:100%;border-radius:999px;background:var(--ink)}
.l-win{justify-self:end;text-align:right;font-family:'JetBrains Mono','JetBrains Mono Fallback',monospace;font-size:21px;font-weight:700;letter-spacing:-.03em;color:var(--ink);font-variant-numeric:tabular-nums}
.l-win small{display:block;margin-top:2px;font-size:9.5px;font-weight:600;letter-spacing:.11em;text-transform:uppercase;color:var(--ink-60)}

@media (max-width: 640px) {
  .ladder{padding:2px 16px 4px;border-radius:16px}
  .ladder-row{grid-template-columns:minmax(0,1fr) auto;gap:8px 12px;padding:14px 0}
  .ladder-row b{grid-column:1;grid-row:1}
  .l-cov{grid-column:1 / -1;grid-row:2}
  .l-win{grid-column:2;grid-row:1;align-self:start}
  .l-size{font-size:23px}
  .ladder-head{display:none}
}

/* The order-state ticker: four short cells, and it fills whatever column it
   sits in. Sized to content it measured 365px inside a 560px column. */
.ticker {
  width: 100%;
}
.ticker .ticker-row {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
}
/* A ticker inside a two-column split fills its own column; it has no
   section-level prose for a measure to align with. The stub is NOT here: on
   the corridor pages it is a direct child of the section and must take the
   same measure as the copy around it (it was full width, 1160px at 1440). */
.section .two-col .ticker {
  max-width: none;
}

/* ── tap targets ────────────────────────────────────────────────────────── */
/* WCAG 2.5.8 (AA) asks for 24x24 CSS px; Apple and Material both recommend 44.
   The route tables in the region hubs and the stub's "compare" link are the
   only real controls below that: measured at 16px tall on 768 and 390 (30 rows
   on /eu alone). Their text is 13.5px, so the link gets the row's height and a
   little negative margin instead of padding that would push the row apart.
   Inline links inside a sentence are exempt and stay untouched. */
.route-table td a {
  display: inline-block;
  padding: 10px 0;
  margin: -10px 0;
}
.stub-row a.st-time {
  display: inline-block;
  padding: 10px 0;
  margin: -10px 0;
}

/* ── card grids: three on a desktop, two on a tablet, one on a phone ────── */
/* Every page's inline <style> collapses its 3-up grid to ONE column at 860px,
   which at 768 handed each card the whole row around a half-empty sentence.
   Inside the 1000px column a 3-up grid is ~313px cards, which is the shape
   this content was designed for, so the collapse becomes a 2-up step only.
   Two classes deep because those inline rules come later in the document. */
@media (min-width: 641px) and (max-width: 899px) {
  .section .grid3,
  .section .steps,
  .section .steps3,
  .section .pricing,
  .section .conditions,
  .section .not-covered {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The guarantee's eight one-sentence cards (four conditions, four exclusions)
   were full-width rows around a single sentence: the card edge ran hundreds of
   pixels past the text. Two columns make the card the shape of its sentence.

   Applies at every width above 640px: one-sentence cards are never a 900px
   row, and without a lower-only bound the 861-899px range fell back to a
   single 821px column at 861px. */
@media (min-width: 641px) {
  .section .conditions,
  .section .not-covered {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

/* ── mobile: collapse only when three columns genuinely no longer fit ────── */
/* At 768px the three-column form still measures ~276px and ~318px per cell;
   collapsing there left two half-empty columns. At 390px it is real, and the
   label spans the row above its two values. */
@media (max-width: 640px) {
  .compare-head,
  .compare-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    row-gap: 6px;
  }
  .compare-head span:first-child,
  .compare-row b {
    grid-column: 1 / -1;
  }
  .ticker .ticker-row {
    grid-template-columns: 1fr auto;
    row-gap: 2px;
  }
}

/* The nav CTA's arrow. It lived only in index.html's inline CSS, so the arrow
   animation was dead on the other 56 pages that carry the same canonical
   navbar: the page-structure gate (rendered) reported "class with no stylesheet
   rule: narr" on ten of them. One rule here beats hand-editing 57 inline
   blocks, and site.css is the one stylesheet every page loads. */
body > .topbar .nav-cta .narr {
  display: inline-block;
  transition: transform .25s cubic-bezier(.22,1,.36,1);
}
body > .topbar .nav-cta:hover .narr {
  transform: translateX(3px);
}
