/* Mobility Rankings — brand tokens from brand-identity.md */
:root {
  --navy: #0A2240;
  --red: #C8102E;          /* on white */
  --red-on-navy: #E8384F;  /* on navy */
  --gold: #F2B705;         /* price buttons only */
  --ink: #1B1F24;
  --muted: #4A5361;        /* 7.9:1 on white */
  --line: #D5DAE1;
  --paper: #FFFFFF;
  --tint: #F3F5F8;
  --focus: #C8102E;
  --font-head: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --measure: 46rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 125%; -webkit-text-size-adjust: 100%; } /* 20px base: large text for older readers on tablets */
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); line-height: 1.6; }
img { max-width: 100%; height: auto; }

h1, h2, h3, .eyebrow, .btn, .site-nav, .byline, .score, .rank-num, caption, th, .card-meta, .rank-meta, .breadcrumbs, .site-footer nav, .filters {
  font-family: var(--font-head);
}
h1, h2, h3 { color: var(--navy); line-height: 1.2; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; margin: 1.2rem 0 .6rem; }
h2 { font-size: 1.35rem; font-weight: 700; margin: 2.2rem 0 .6rem; }
h3 { font-size: 1.1rem; font-weight: 700; margin: 1.4rem 0 .4rem; }
p, ul, ol, dl { max-width: var(--measure); }
a { color: var(--navy); text-decoration-thickness: .08em; text-underline-offset: .15em; }
a:hover { color: var(--red); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.wrap { max-width: 72rem; margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--navy); color: #fff; padding: .6rem 1rem; z-index: 10; }
.skip-link:focus { left: 0; }

/* Sample-data banner: impossible to miss */
.sample-banner { background: #FFF4CC; border-bottom: 3px solid #8A6100; color: #3D2B00; padding: .8rem 16px; text-align: center; font-family: var(--font-head); }

/* Header (logo slot lives in templates/partials/logo.html) */
.site-header { border-bottom: 4px solid var(--navy); background: var(--paper); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.5rem; padding-top: .9rem; padding-bottom: .9rem; }
.brand { text-decoration: none; color: var(--navy); display: inline-flex; align-items: flex-start; gap: .3rem; min-height: 44px; }
.logo-mark { width: 2.3rem; height: 2.3rem; flex-shrink: 0; margin-top: -.15rem; }
.brand-text { display: flex; flex-direction: column; gap: .2rem; padding-top: .35rem; }
.logo-word { font-family: "Libre Caslon Text", Georgia, serif; font-weight: 700; font-size: 1.45rem; line-height: 1.05; letter-spacing: -0.015em; color: var(--navy); white-space: nowrap; }
.logo-i { position: relative; display: inline-block; }
.logo-i::after { content: ""; position: absolute; left: 50%; top: .14em; width: .2em; height: .2em; margin-left: -.1em; border-radius: 50%; background: var(--red); }
.brand-tagline { font-family: var(--font-head); font-weight: 600; font-size: .5rem; line-height: 1; letter-spacing: .34em; text-transform: uppercase; color: #2E3F5C; white-space: nowrap; }
.brand-footer { margin-bottom: .6rem; }
.brand-footer .logo-word { color: #fff; font-size: 1.2rem; }
.brand-footer .logo-i::after { background: var(--red-on-navy); }
.brand-footer .logo-mark { width: 1.9rem; height: 1.9rem; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .2rem .4rem; }
.site-nav a { display: inline-block; padding: .45rem .55rem; min-height: 44px; line-height: 1.6; font-size: .8rem; font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; }
.site-nav a[aria-current="page"] { border-bottom-color: var(--red); }

.breadcrumbs ol { list-style: none; padding: 0; margin: .8rem 0 0; display: flex; flex-wrap: wrap; font-size: .7rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin: 0 .4rem; }
.breadcrumbs a[aria-current="page"] { color: var(--muted); text-decoration: none; }

main { padding-bottom: 3rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .7rem; font-weight: 700; color: var(--red); margin: 1.6rem 0 0; }
.lede { font-size: 1.1rem; color: var(--ink); }
.note, .fine { font-size: .8rem; color: var(--muted); }

/* Brand signature: red dot = "measured by us" */
.dot { display: inline-block; width: .55em; height: .55em; border-radius: 50%; background: var(--red); margin-right: .35em; vertical-align: .08em; }

.hero { padding: 1rem 0 .5rem; }
.cta-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .7rem; }
.btn { display: inline-block; padding: .7rem 1.1rem; min-height: 44px; border: 2px solid var(--navy); border-radius: 6px; font-weight: 700; font-size: .85rem; text-decoration: none; color: var(--navy); background: var(--paper); }
.btn:hover { background: var(--tint); color: var(--navy); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: #142f55; color: #fff; }
.btn-price { background: var(--gold); border-color: var(--gold); color: var(--ink); } /* gold: price buttons only */

/* Answer-first box */
.answer { background: var(--tint); border-left: 6px solid var(--navy); padding: .4rem 1.2rem 1rem; margin: 1.5rem 0; border-radius: 0 6px 6px 0; }
.answer h2 { margin-top: .8rem; }
.status-note { background: #FFF4CC; border: 1px solid #E2C766; padding: .8rem 1rem; border-radius: 6px; }

.byline { display: flex; flex-wrap: wrap; gap: .2rem 1.4rem; font-size: .75rem; color: var(--muted); margin: .4rem 0 .8rem; }
.byline p { margin: 0; }
.byline .label { font-weight: 700; color: var(--navy); }
.tbd { color: var(--muted); font-style: italic; }
.disclosure-note { font-size: .8rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: .3rem 0; margin-bottom: 1rem; }
.disclosure-note p { margin: .4rem 0; }
.disclosure-extra { color: var(--red); }

.card-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; max-width: none; }
.card { border: 1px solid var(--line); border-top: 4px solid var(--navy); border-radius: 6px; padding: .4rem 1rem .8rem; background: var(--paper); }
.card h3 { margin-top: .6rem; }
.card-meta { font-size: .75rem; color: var(--muted); }
.team { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; max-width: none; }

.proof-list li { margin-bottom: .5rem; }
.proof-line { font-family: var(--font-head); font-weight: 800; color: var(--navy); font-size: 1.1rem; }
.question-list > li { margin-bottom: 1.2rem; }
.question-list h2 { font-size: 1.15rem; margin-top: 1.2rem; }

/* Rankings */
.rank-list { list-style: none; padding: 0; max-width: var(--measure); }
.rank-item { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.rank-head { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.rank-head h3 { margin: 0; flex: 1 1 12rem; }
.rank-num { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; }
.score { font-weight: 800; color: var(--navy); white-space: nowrap; }
.score-num { font-size: 1.3rem; }
.score-of { font-size: .75rem; color: var(--muted); margin-left: .1rem; }
.rank-meta { font-size: .75rem; color: var(--muted); }
.mini-specs { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: .4rem 0; }
.mini-specs dt { font-family: var(--font-head); font-size: .7rem; color: var(--muted); }
.mini-specs dd { margin: 0; font-weight: 600; }
.pros-cons { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 0 2rem; }
.vs-box { border: 2px solid var(--navy); border-radius: 8px; padding: 0 1rem 1rem; margin: 2rem 0; }
.diff { color: var(--muted); font-size: .8rem; }
.checks div { margin-bottom: .8rem; }
.checks dt { font-family: var(--font-head); font-weight: 700; color: var(--navy); }
.checks dd { margin: 0; }
.standard { font-size: .8rem; color: var(--muted); font-style: italic; margin-top: 0; }

/* Tables: real HTML tables with units in headers */
.table-scroll { overflow-x: auto; max-width: 100%; }
.table-scroll:focus-visible { outline-offset: 4px; }
.data-table { border-collapse: collapse; font-size: .8rem; margin: .6rem 0 1rem; min-width: 100%; }
.data-table caption { text-align: left; font-weight: 700; color: var(--navy); padding: .3rem 0; caption-side: top; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: .5rem .6rem; text-align: left; vertical-align: top; }
.data-table thead th { background: var(--navy); color: #fff; font-size: .72rem; white-space: nowrap; }
.data-table tbody th { font-weight: 600; min-width: 9rem; }
.data-table.weights { min-width: 0; }
.sortable thead th button { all: inherit; cursor: pointer; display: inline-flex; gap: .3rem; align-items: center; min-height: 24px; }
.sortable thead th button:focus-visible { outline: 3px solid var(--red-on-navy); outline-offset: 2px; }
.sortable thead th[aria-sort="ascending"] button::after { content: "▲"; font-size: .6rem; }
.sortable thead th[aria-sort="descending"] button::after { content: "▼"; font-size: .6rem; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: flex-end; font-size: .75rem; }
.filters label { display: flex; flex-direction: column; font-weight: 600; color: var(--navy); }
.filters select { font: inherit; font-weight: 400; padding: .35rem; min-height: 44px; border: 1px solid var(--muted); border-radius: 4px; }
.filter-status { margin: 0; color: var(--muted); }
.print-btn { font-family: var(--font-head); font-size: .8rem; font-weight: 700; padding: .6rem 1rem; min-height: 44px; border: 2px solid var(--navy); border-radius: 6px; background: var(--paper); color: var(--navy); cursor: pointer; }
.changelog > li { margin-bottom: 1rem; }

/* Footer */
.site-footer { background: var(--navy); color: #fff; padding: 1.5rem 0; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #fff; text-decoration-color: var(--red-on-navy); }
.site-footer .fine { color: #C9D3E0; }
.site-footer nav ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font-size: .8rem; }
.signoff { font-size: 1rem; }

@media (max-width: 40rem) {
  html { font-size: 112.5%; }
  .logo-word { font-size: 1.25rem; }
  .logo-mark { width: 2rem; height: 2rem; }
  .site-nav a { font-size: .85rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Printable version to take to a therapist */
@media print {
  html { font-size: 11pt; }
  .site-header nav, .skip-link, .breadcrumbs, .print-btn, .filters, .site-footer nav { display: none !important; }
  .site-footer { background: none; color: #000; border-top: 1px solid #000; }
  .site-footer a, a { color: #000; }
  main a[href^="/"]::after { content: " (mobilityrankings.com" attr(href) ")"; font-size: .8em; }
  .data-table thead th { background: none; color: #000; border-bottom: 2px solid #000; }
  .answer, .vs-box { border-color: #000; background: none; }
  .table-scroll { overflow: visible; }
  h2, h3 { break-after: avoid; }
  tr, .rank-item { break-inside: avoid; }
}

/* Spec library */
ul.mini-specs { list-style: none; padding: 0; }
.mini-specs li { display: flex; flex-direction: column; font-weight: 600; }
.mini-specs .label { font-family: var(--font-head); font-size: .7rem; font-weight: 400; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.flag { font-family: var(--font-head); font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--red); border: 1px solid currentColor; border-radius: 3px; padding: 0 .3rem; white-space: nowrap; }
.toc ul { list-style: none; padding: .8rem 1rem; margin: 1rem 0; background: var(--tint); border-left: 4px solid var(--navy); display: flex; flex-direction: column; gap: .3rem; font-family: var(--font-head); font-size: .9rem; }
.spec-list { display: flex; flex-direction: column; gap: .4rem; }
.spec-list.cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .3rem 1.5rem; list-style: none; padding: 0; max-width: none; }
.data-table th[scope="row"] .flag { margin-left: .3rem; }

/* Product photos (slot stays empty until we have a photo we may use) */
.spec-top { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: 1.4rem; align-items: start; margin: 1.5rem 0; }
.spec-top .answer { margin: 0; }
@media (max-width: 720px) { .spec-top { grid-template-columns: 1fr; } }
.photo { margin: 0; }
.photo img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.photo figcaption { font-family: var(--font-head); font-size: .7rem; color: var(--muted); margin-top: .3rem; }
.photo-slot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; aspect-ratio: 1; width: 100%; max-width: 100%; background: var(--tint); border: 1px dashed var(--line); border-radius: 6px; color: #9AA5B4; font-family: var(--font-head); font-size: .75rem; }
.photo-slot svg { width: 2.4rem; height: 2.4rem; }
.photo-large .photo-slot svg { width: 3.2rem; height: 3.2rem; }
.photo-thumb { width: 3rem; flex: none; }
.photo-thumb .photo-slot svg { width: 1.4rem; height: 1.4rem; }
.chair-cell { display: flex; gap: .6rem; align-items: center; }
