/* The pages that sit under the landing page: the three free tools (/free-tools/...) and the
 * accessibility statement (/accessibility). They load fonts.css, tokens.css, landing.css (header,
 * footer, buttons, skip link: one look for the whole public site) and then this file, which holds only
 * what those pages add: a narrow reading column, fields, the calculator table, the seating cards, the
 * sample wordings and the print rules. No colour is written here; every colour is a token, so the pages
 * follow light, dark and all six accents, and test/contrast.mjs (which checks the tokens) covers them.
 * test/a11y-static.mjs lints this file like the planner's.
 */

/* Buttons the page script reveals (Copy, Print) carry `hidden` until it runs, and .btn would otherwise
   win over the attribute and show them to a reader whose scripts did not load. */
[hidden] { display: none !important; }

/* ---- the top of a page ---- */
.page-head { padding-block: clamp(28px, 5vw, 56px) 8px; }
.page-head h1 { font-size: clamp(32px, 4.6vw, 46px); line-height: 1.08; }
.page-head .lead { margin-top: 16px; }
.crumbs { margin-bottom: 14px; font-size: 15px; color: var(--muted); }
.crumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0 8px; }
.crumbs li { display: flex; align-items: center; }
.crumbs li + li::before { content: "/"; margin-right: 8px; }
.crumbs a { display: inline-flex; align-items: center; min-height: 44px; }

.page-body { padding-block: 16px clamp(40px, 6vw, 72px); }
.page-body h2 { font-size: clamp(24px, 3.2vw, 30px); line-height: 1.15; margin: 40px 0 12px; }
.page-body h3 { font-size: 21px; line-height: 1.25; margin: 28px 0 6px; }
.page-body p, .page-body li { max-width: 68ch; }
.page-body p + p { margin-top: 12px; }
.page-body ul, .page-body ol { padding-left: 1.3em; }
.page-body li { margin-top: 6px; }
/* A link inside a sentence: the line stays as it is, and the tappable area grows to 44px, the way the
   planner does it for its own sentence links (css/shell.css). */
.page-body p a, .page-body li a { padding-block: 12px; margin-block: -12px; }
.page-body ul + p, .page-body ol + p { margin-top: 14px; }

/* ---- a tool: one card that holds the fields and the answer ---- */
.tool { margin-top: 24px; padding: clamp(18px, 3vw, 28px); border: 1px solid var(--border-strong); border-radius: var(--radius-card); background: var(--card); }
.tool h2 { margin-top: 0; }
.fields { display: grid; gap: 16px; }
@media (min-width: 640px) { .fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } .fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.field { display: grid; gap: 6px; align-content: start; }
.field label, .field .label { font-weight: 700; }
.field .hint, .hint { color: var(--muted); font-size: 15px; }
.input {
  width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--control); border-radius: var(--radius);
  background: var(--card); color: var(--text); font: inherit; font-size: 16px;
}
textarea.input { padding: 12px 14px; min-height: 96px; line-height: 1.5; resize: vertical; }
.fields.more { margin-top: 16px; }
.hint.after { margin-top: 12px; }
.input[aria-invalid="true"] { border-width: 2px; border-color: var(--error); }
.error-text { color: var(--error); font-size: 15px; font-weight: 600; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; font-weight: 500; cursor: pointer; }
.check input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

/* A line that says what just changed (shares add up, seats left, copied). Always words, never only colour. */
.status { margin-top: 16px; padding: 12px 16px; border-radius: var(--radius); background: var(--surface); color: var(--text); font-weight: 500; }
.status.warn { background: var(--warning-soft); color: var(--warning); border: 1px dashed var(--warning); font-weight: 600; }
.status:empty { display: none; }

/* ---- the budget table ---- */
.table-wrap { margin-top: 20px; overflow-x: auto; }
table.split { width: 100%; border-collapse: collapse; }
table.split caption { text-align: left; font-weight: 700; padding-bottom: 8px; }
table.split th, table.split td { padding: 10px 8px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border-strong); }
table.split thead th { font-size: 15px; color: var(--muted); font-weight: 600; }
table.split tbody th { font-weight: 600; }
table.split tbody th .hint { display: block; font-weight: 400; margin-top: 2px; }
table.split td.num, table.split th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.split tfoot th, table.split tfoot td { border-bottom: 0; border-top: 2px solid var(--text); font-weight: 700; }
.pct { display: inline-flex; align-items: center; gap: 4px; }
.pct .input { width: 84px; text-align: right; padding: 0 10px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 480px) {
  table.split th, table.split td { padding: 10px 4px; }
  .pct .input { width: 76px; }
}

/* ---- seating cards ---- */
.plan { display: grid; gap: 16px; margin-top: 24px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.seat-card { padding: 16px 18px 18px; border: 1px solid var(--text); border-radius: var(--radius); background: var(--card); break-inside: avoid; }
.seat-card h3 { margin: 0 0 8px; font-size: 20px; }
.seat-card ol { list-style: none; padding: 0; margin: 0; }
.seat-card li { display: flex; align-items: flex-end; gap: 8px; min-height: 34px; margin: 0; border-bottom: 1px solid var(--control); font-size: 15px; color: var(--muted); }
.seat-card li .n { flex: none; width: 2ch; text-align: right; font-variant-numeric: tabular-nums; }
.seat-card .notes-line { margin-top: 10px; min-height: 34px; border-bottom: 1px solid var(--control); font-size: 15px; color: var(--muted); }
.plan-summary { margin-top: 20px; }
/* Names on the seating template: the not-seated list, names in seats, and the drop and Seat here cues. */
.tray { margin-top: 24px; padding: 18px 20px; border: 1px solid var(--border-strong); border-radius: var(--radius-card); background: var(--card); }
.tray h2 { margin: 0 0 4px; font-size: 22px; }
.tray .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.tray .chips li { margin: 0; }
.chip { min-height: 44px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; cursor: grab; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); font-weight: 700; }
.tray-note { margin: 14px 0 0; font-size: 15px; color: var(--muted); }
.seat-card .seated { flex: 1; min-height: 34px; padding: 0 0 4px; display: flex; align-items: flex-end; border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.seat-card .seated:hover { text-decoration: line-through; color: var(--muted); }
.seat-card .seat-here { margin: 0 0 8px; min-height: 44px; }
.seat-card.drop { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); background: var(--accent-soft); }
.print-only { display: none; }

/* ---- sample wordings ---- */
.wording-jump ul { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 0 0 8px; padding: 0; list-style: none; }
/* Plain underlined links, not pills (the owner prefers underlined words to rows of pills). */
.wording-jump ul { gap: 0 20px; }
.wording-jump a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.wording-group { margin-top: 40px; scroll-margin-top: 90px; }
.wording-group > h2 { margin-bottom: 4px; }
.wording-group > .when { color: var(--muted); margin: 0; }
.wordings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; margin-top: 16px; }
.wording { display: flex; flex-direction: column; padding: 18px 20px 20px; border: 1px solid var(--border-strong); border-radius: var(--radius-card); background: var(--card); }
.wording h2, .wording h3 { margin: 0 0 10px; font-size: 19px; }
.wording .when { color: var(--muted); font-size: 15px; margin-bottom: 12px; }
.sample { margin: 0; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); font: inherit; font-size: 16px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.wording .sample { flex: 1; }
.wording .actions { margin-top: 14px; align-items: center; }
.wording .copied { font-weight: 600; }
.wording .copied:empty { display: none; }

/* ---- the quiet line at the end of a tool, and the other tools ---- */
.plug { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border-strong); color: var(--muted); }
.plug p { max-width: 68ch; }
.also { margin-top: 28px; }
.also h2 { font-size: 22px; margin: 0 0 8px; }
.also ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.also li { margin: 0; }
.also a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---- the accessibility statement ---- */
.draft-note { margin-top: 20px; padding: 14px 18px; border-radius: var(--radius); background: var(--warning-soft); color: var(--warning); border: 1px dashed var(--warning); font-weight: 600; max-width: 68ch; }
.updated { color: var(--muted); font-size: 15px; margin-top: 12px; }
.facts-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 16px; }
.facts-table caption { text-align: left; font-weight: 700; padding-bottom: 8px; }
.facts-table th, .facts-table td { text-align: left; vertical-align: top; padding: 12px 10px; border-bottom: 1px solid var(--border-strong); }
.facts-table thead th { font-size: 15px; color: var(--muted); font-weight: 600; }
.facts-table tbody th { font-weight: 700; width: 30%; }
.facts-table td p + p { margin-top: 8px; }

/* On a phone each row becomes a small card: the area leads, and each cell names itself, so nothing scrolls sideways. */
@media (max-width: 640px) {
  .facts-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .facts-table, .facts-table tbody, .facts-table tr, .facts-table th, .facts-table td { display: block; width: auto; }
  .facts-table caption { display: block; }
  .facts-table tr { padding: 14px 0; border-bottom: 1px solid var(--border-strong); }
  .facts-table th, .facts-table td { border-bottom: 0; padding: 4px 0; }
  .facts-table tbody th { width: auto; font-size: 18px; }
  .facts-table td::before { content: attr(data-label); display: block; font-size: 14px; font-weight: 700; color: var(--muted); }
}

/* ---- paper: tools print as a plain sheet, in black on white whatever the theme ---- */
@media print {
  :root, :root[data-theme="dark"] { color-scheme: light; }
  .crumbs, .page-head .lead, .wording-jump, .tool .fields, .tool .actions, .tool .hint, .plug, .also, .status, .wording .actions, .noprint { display: none; }
  .print-only { display: block; }
  .tool, .wording { border: 0; padding: 0; background: none; }
  .page-head { padding: 0 0 8pt; }
  .page-head h1 { font-size: 20pt; }
  .page-body { padding: 0; }
  .input { border: 0; background: none; padding: 0; min-height: 0; width: auto; color: CanvasText; font-size: 11pt; -webkit-appearance: none; appearance: none; text-align: right; }
  .pct .input { width: 4ch; }
  table.split th, table.split td { border-bottom-color: CanvasText; padding: 5pt 4pt; }
  table.split tfoot th, table.split tfoot td { border-top-color: CanvasText; }
  table.split tbody th .hint { display: block; color: CanvasText; font-size: 9pt; }
  .table-wrap { overflow: visible; }
  .plan { grid-template-columns: repeat(2, 1fr); gap: 10pt; margin-top: 8pt; }
  .seat-card { border-color: CanvasText; padding: 8pt 10pt; }
  .seat-card li, .seat-card .notes-line { border-bottom-color: CanvasText; color: CanvasText; min-height: 22pt; font-size: 10pt; }
  .seat-card .seated { color: CanvasText; font-size: 10pt; min-height: 0; }
  .seat-card .seat-here { display: none; }
  .print-only.foot { margin-top: 12pt; font-size: 9pt; }
  .facts-table th, .facts-table td { border-bottom-color: CanvasText; }
  .draft-note { border-color: CanvasText; background: none; color: CanvasText; }
}

/* What's new (/whats-new): one block per version, newest first. */
.whats-new .release { padding-top: 8px; }
.whats-new .release + .release { margin-top: 28px; border-top: 1px solid var(--border); }
.release-date { margin-left: 8px; font-family: var(--font-family); font-size: 15px; font-weight: 600; color: var(--muted); }
.whats-new li + li { margin-top: 8px; }
