/* ==========================================================================
   WCAGpatch — shared stylesheet for every page except the homepage.
   Hand written, no framework, no CDN. The homepage inlines its own copy of
   the token block (it is one self-contained file by design); every colour in
   both files comes from docs/audit-2026-09-06/audit-design.md section 2, with
   the measured WCAG ratio in the comment beside it. If a token changes here it
   changes in index.html in the same commit — scripts/a11y-check.mjs runs the
   contrast gate across all eight pages, which is what catches the drift.
   ========================================================================== */

/* --- TOKENS ------------------------------------------------------------- */
:root {
  --paper:        #FFFFFF;
  --paper-2:      #F7F9FB;
  --ink:          #0B1B2B;  /* 17.41:1 on paper, 16.50:1 on paper-2 (AAA) */
  --body:         #41556B;  /* 7.67:1 on paper, 7.27:1 on paper-2 (AAA) */
  --brand:        #0E7C5A;  /* white on it 5.19:1; as text on paper 5.19:1 */
  --brand-hover:  #0C6B4E;  /* white on it 6.50:1 */
  --brand-active: #0A5C43;  /* white on it 8.00:1 */
  --wash-mint:    #EAF3EE;  /* ink 15.39:1, brand 4.58:1 */

  --fail:         #A32020;  /* 7.54:1 on paper, 6.60:1 on wash-fail */
  --warn:         #8A4B08;  /* 6.79:1 on paper, 6.33:1 on wash-warn */
  --wash-fail:    #FDECEC;  /* ink on it 15.25:1 */
  --wash-warn:    #FDF6EC;  /* ink on it 16.23:1 */

  --rule:         #D6DEE7;  /* decorative hairlines only */
  --edge:         #7E93A6;  /* 3.18:1 — meaningful borders, inputs, cell edges */
  --focus:        #1D4ED8;  /* 6.70:1 on paper */

  --ink-panel:    #0B1B2B;
  --panel-body:   #C3D0DC;  /* 11.09:1 on ink-panel */
  --panel-accent: #8FE3C0;  /* 11.54:1 on ink-panel */

  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s6: 24px;
  --s8: 32px; --s12: 48px; --s16: 64px; --s24: 96px; --s32: 128px;

  --serif: 'Newsreader', 'Iowan Old Style', 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --container: 1200px;
  --measure: 72ch;
  --pad: 24px;
  --nav-h: 72px;
}

@font-face {
  font-family: 'Newsreader';
  src: url('/media/fonts/newsreader-var.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  size-adjust: 104%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('/media/fonts/instrument-sans-var.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

/* --- RESET -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, ul, ol, li, figure, figcaption, dl, dd, table, form, fieldset {
  margin: 0; padding: 0;
}
ul, ol { list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }

/* --- BASE TYPE ---------------------------------------------------------- */
body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--body);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
h1, h2 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--ink);
  font-optical-sizing: auto;
}
h1 {
  font-size: clamp(2.125rem, 1.5rem + 2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
h2 {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}
h3 {
  font-family: var(--sans);
  font-size: 1.125rem; font-weight: 600; line-height: 1.35;
  color: var(--ink);
}
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }
strong, b { font-weight: 600; color: var(--ink); }
code, .mono { font-family: var(--mono); font-size: 0.9375em; }
.eyebrow {
  font-size: 0.8125rem; font-weight: 600; line-height: 1.2;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--body);
}
.small { font-size: 0.875rem; line-height: 1.6; }
.lead { font-size: 1.1875rem; line-height: 1.6; }

/* --- FOCUS / SKIP / HIDDEN ---------------------------------------------- */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip-link {
  position: absolute; left: 8px; top: -100px; z-index: 200;
  background: var(--paper); color: var(--ink); font-weight: 600;
  padding: 12px 16px; border-radius: 6px; border: 1px solid var(--edge);
  text-decoration: none;
}
.skip-link:focus { top: 8px; }
.vh {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.hidden { display: none; }

/* --- LAYOUT ------------------------------------------------------------- */
.wrap {
  width: 100%; max-width: var(--container);
  margin-inline: auto; padding-inline: var(--pad);
}
.wrap-narrow { max-width: 860px; }
main { flex: 1 0 auto; }

/* --- ICONS -------------------------------------------------------------- */
.icon {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.75;
  stroke-linecap: round; stroke-linejoin: round;
}
.icon-sm { width: 20px; height: 20px; }

/* --- BUTTONS ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 12px 24px;
  border: 2px solid transparent; border-radius: 6px;
  font-weight: 600; font-size: 1.0625rem; text-decoration: none; cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}
.btn-primary { background: var(--brand); color: #FFFFFF; }
.btn-primary:hover { background: var(--brand-hover); color: #FFFFFF; }
.btn-primary:active { background: var(--brand-active); }
.btn-primary:disabled { background: var(--paper-2); color: var(--body); border-color: var(--edge); cursor: not-allowed; }
.btn-secondary { background: var(--paper); color: var(--brand); border-color: var(--edge); }
.btn-secondary:hover { color: var(--brand-hover); border-color: var(--brand-hover); }
.btn-block { display: flex; width: 100%; }
.textlink { font-weight: 600; color: var(--brand); text-decoration: underline; }
.textlink:hover { color: var(--brand-hover); }

/* --- HEADER / NAV ------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--paper); border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s6); min-height: var(--nav-h);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-weight: 600; font-size: 1.375rem;
  color: var(--ink); text-decoration: none; letter-spacing: -0.01em;
  padding-block: 8px;
}
.wordmark svg { width: 26px; height: 26px; color: var(--brand); flex: none; }
.wordmark:hover { color: var(--ink); }
.nav-links { display: flex; align-items: center; gap: var(--s8); }
.nav-links a {
  color: var(--body); text-decoration: none;
  font-size: 0.9375rem; font-weight: 600; padding: 12px 2px; display: inline-block;
}
.nav-links a:hover { color: var(--ink); }
.nav-cta { padding: 10px 18px; min-height: 44px; font-size: 0.9375rem; }

/* --- FOOTER ------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: var(--s12) var(--s16);
  font-size: 0.875rem; color: var(--body);
  flex: none;
}
.footer-legal { max-width: 88ch; color: var(--body); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: var(--s6) var(--s8);
  justify-content: space-between; align-items: baseline;
  margin-top: var(--s12); padding-top: var(--s6); border-top: 1px solid var(--rule);
}
.footer-nav { display: flex; flex-wrap: wrap; gap: var(--s6); }
.footer-nav a { color: var(--body); text-decoration: underline; }
.footer-nav a:hover { color: var(--ink); }

/* --- PROSE (legal, privacy, terms, support) ----------------------------- */
.page-head { padding-block: clamp(3rem, 2.5rem + 2vw, 4.5rem) var(--s8); }
.page-head p { color: var(--body); margin-top: var(--s3); }
.prose { max-width: var(--measure); padding-bottom: clamp(3rem, 2.5rem + 2vw, 5rem); }
.prose > section + section { margin-top: var(--s12); }
.prose h2 { margin-bottom: var(--s3); }
.prose h3 { margin-top: var(--s6); margin-bottom: var(--s2); }
.prose p + p { margin-top: var(--s4); }
.prose ul, .prose ol { margin-top: var(--s4); }
.prose ul li, .prose ol li { position: relative; padding-left: var(--s6); margin-top: var(--s2); }
.prose ul li::before {
  content: ""; position: absolute; left: 4px; top: 0.72em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--brand);
}
.prose ol { counter-reset: prose-ol; }
.prose ol li { counter-increment: prose-ol; }
.prose ol li::before {
  content: counter(prose-ol) "."; position: absolute; left: 0; top: 0;
  color: var(--brand); font-weight: 600; font-variant-numeric: tabular-nums;
}
.prose hr { border: 0; border-top: 1px solid var(--rule); margin-block: var(--s12); }
.prose a { font-weight: 600; text-decoration: underline; }
.prose table { margin-top: var(--s6); border: 1px solid var(--edge); font-size: 0.9375rem; }
.prose caption { caption-side: top; text-align: left; padding-bottom: var(--s3); font-size: 0.875rem; color: var(--body); }
.prose th, .prose td { text-align: left; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--rule); }
.prose thead th { background: var(--paper-2); color: var(--ink); border-bottom: 1px solid var(--edge); }
.prose tr:last-child th, .prose tr:last-child td { border-bottom: 0; }
.callout {
  border-left: 3px solid var(--brand); background: var(--wash-mint);
  padding: var(--s6); color: var(--ink); margin-top: var(--s6);
}

/* --- CENTERED CARD PAGES (checkout, success, download) ------------------ */
.center-page {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding-block: clamp(3rem, 2rem + 4vw, 6rem);
}
.card {
  width: 100%; max-width: 540px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: clamp(24px, 4vw, 40px);
}
.card h1 { font-size: clamp(1.625rem, 1.4rem + 1vw, 2rem); margin-bottom: var(--s3); }
.card p + p, .card p + form, .card p + ol, .card * + .divider { margin-top: var(--s4); }
.card .divider { border: 0; border-top: 1px solid var(--rule); margin-block: var(--s8) var(--s6); }
.card-lead { color: var(--body); }
.after-card { width: 100%; max-width: 540px; margin-top: var(--s6); }

.code-box {
  background: var(--paper-2); border: 1px solid var(--edge);
  border-radius: 6px; padding: var(--s6); margin-block: var(--s8) var(--s6);
}
.code-label {
  font-size: 0.75rem; font-weight: 600; color: var(--body);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: var(--s2);
}
.code {
  font-family: var(--mono); font-size: 1.25rem; font-weight: 600;
  color: var(--ink); letter-spacing: 2px; word-break: break-all;
}

.steps { margin-top: var(--s6); }
.steps li { position: relative; padding-left: var(--s8); margin-top: var(--s3); counter-increment: st; }
.steps { counter-reset: st; }
.steps li::before {
  content: counter(st); position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--wash-mint); color: var(--brand);
  font-size: 0.75rem; font-weight: 600; line-height: 22px; text-align: center;
}

/* --- FORMS -------------------------------------------------------------- */
label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--ink); margin-bottom: var(--s2); }
input[type="text"], input[type="email"] {
  width: 100%;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--edge); border-radius: 6px;
  padding: 12px 14px; font-size: 1rem;
  transition: border-color 120ms ease;
}
input:hover { border-color: var(--ink); }
input.error { border-color: var(--fail); border-width: 2px; }
.msg { font-size: 0.875rem; min-height: 20px; margin-top: var(--s3); }
.msg.error { color: var(--fail); }        /* 7.54:1 on paper */
.msg.success { color: var(--brand); }     /* 5.19:1 on paper */
.field + .field, .field + button, .field + .btn { margin-top: var(--s4); }

details.resend { margin-top: var(--s6); border-top: 1px solid var(--rule); padding-top: var(--s4); }
details.resend > summary {
  display: flex; align-items: center; gap: var(--s2);
  min-height: 44px; cursor: pointer; list-style: none;
  font-size: 0.9375rem; font-weight: 600; color: var(--ink);
}
details.resend > summary::-webkit-details-marker { display: none; }
details.resend > summary::marker { content: ''; }
details.resend > summary .icon { color: var(--brand); transition: transform 120ms ease; }
details.resend[open] > summary .icon { transform: rotate(180deg); }
details.resend > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* --- SPINNER ------------------------------------------------------------ */
.spinner {
  width: 32px; height: 32px; margin: var(--s6) auto;
  border: 3px solid var(--rule); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- RESPONSIVE --------------------------------------------------------- */
@media (min-width: 1024px) { :root { --pad: 32px; } }
@media (max-width: 767px) {
  .nav-inner { flex-wrap: wrap; padding-block: 8px; }
  .nav-links {
    order: 3; width: 100%; gap: var(--s6);
    border-top: 1px solid var(--rule); padding-top: 2px;
  }
  .nav-links a { font-size: 0.875rem; padding-block: 10px; }
  .site-footer { padding-block: var(--s8) var(--s12); }
  .footer-bottom { margin-top: var(--s8); }
  /* Tables in prose become stacked rows rather than a clipped column. */
  .prose table, .prose tbody, .prose th, .prose td, .prose caption { display: block; width: auto; }
  .prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .prose tbody tr { border-bottom: 1px solid var(--edge); }
  .prose tbody tr:last-child { border-bottom: 0; }
  .prose tbody td { border-bottom: 0; padding-block: var(--s1); }
  .prose tbody td::before {
    content: attr(data-col); display: block;
    font-size: 0.75rem; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--body);
  }
  .prose tbody th { background: var(--paper-2); border-bottom: 1px solid var(--rule); }
}

/* --- REDUCED MOTION ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner { animation: none; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- GUIDE / CONTENT PAGES ----------------------------------------------
   The long-form pages (/accessibe-alternative, /ada-website-compliance-wordpress)
   use the homepage's 12-column container with a sticky table of contents in the
   left three columns and the article in the right eight, held to a 68ch measure.
   Below 900px the grid collapses to one column and the contents list sits above
   the article, in reading order. Every colour is a token from the block at the
   top of this file; nothing new is introduced here.
   ------------------------------------------------------------------------ */
.g12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 32px;
  row-gap: var(--s12);
  align-items: start;
}
.guide {
  padding-block: clamp(2.5rem, 2rem + 2vw, 4rem) clamp(3rem, 2.5rem + 2vw, 5rem);
  row-gap: var(--s8);
}
.guide-head { grid-column: 1 / -1; }
.guide-head h1 { max-width: 14em; }
.guide-head .eyebrow { margin-bottom: var(--s3); }
.guide-lead { margin-top: var(--s6); font-size: 1.1875rem; line-height: 1.6; max-width: 62ch; }
.guide-meta {
  margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--rule);
  font-size: 0.875rem; color: var(--body); max-width: 62ch;
}

/* Contents list. A plain heading plus links, not a second nav landmark. */
.toc {
  grid-column: 1 / span 3;
  align-self: start;
  position: sticky; top: calc(var(--nav-h) + var(--s6));
  max-height: calc(100vh - var(--nav-h) - var(--s12));
  overflow-y: auto;
  border-left: 3px solid var(--rule);
  padding: 2px 0 2px var(--s4);
}
.toc-title {
  font-family: var(--sans); font-size: 0.8125rem; font-weight: 600;
  line-height: 1.2; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--body);
}
.toc ul { margin-top: var(--s3); }
.toc a {
  display: block; padding: 7px 0;
  font-size: 0.875rem; line-height: 1.35;
  color: var(--body); text-decoration: none;
}
.toc a:hover { color: var(--ink); text-decoration: underline; }

.guide-body { grid-column: 5 / span 8; max-width: none; }
.guide-body > section { max-width: 68ch; }
.guide-body > section.wide { max-width: none; }
.guide-body > section + section { margin-top: var(--s12); }
.guide-body h2 { scroll-margin-top: calc(var(--nav-h) + var(--s4)); }

/* Comparison table, same structure and stacking behaviour as the homepage. */
.cmp-wrap { margin-top: var(--s6); }
.cmp { width: 100%; font-size: 0.9375rem; border: 1px solid var(--edge); margin-top: 0; }
.cmp caption { caption-side: top; text-align: left; padding-bottom: var(--s3); font-size: 0.875rem; color: var(--body); }
.cmp th, .cmp td { text-align: left; padding: var(--s4) var(--s6); border-bottom: 1px solid var(--rule); vertical-align: top; }
.cmp thead th { background: var(--paper-2); color: var(--ink); font-weight: 600; border-bottom: 1px solid var(--edge); }
.cmp tbody th { font-weight: 600; color: var(--ink); width: 22%; }
.cmp tr:last-child th, .cmp tr:last-child td { border-bottom: 0; }
.cmp .col-them { background: var(--wash-fail); color: var(--ink); }  /* ink 15.25:1 */
.cmp .col-us   { background: var(--wash-mint); color: var(--ink); }  /* ink 15.39:1 */
.cmp a { color: var(--brand-active); font-weight: 600; }             /* 7.00:1 on wash-fail */

/* FAQ disclosure rows, same chevron and behaviour as the homepage. */
.faq { margin-top: var(--s6); }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-of-type { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s6);
  min-height: 56px; padding-block: var(--s4);
  cursor: pointer; list-style: none;
  font-weight: 600; font-size: 1.0625rem; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::marker { content: ''; }
.faq summary .icon { color: var(--brand); transition: transform 120ms ease; }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq summary:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.faq .answer { padding-bottom: var(--s6); font-size: 1rem; }
.faq .answer + .answer { margin-top: var(--s4); }

/* Sources and the closing call to action. */
.sources { font-size: 0.875rem; }
.sources li { word-break: break-word; }
.guide-cta {
  border-left: 3px solid var(--brand); background: var(--wash-mint);
  padding: var(--s8); color: var(--ink);
}
.guide-cta h2 { margin-bottom: var(--s3); }
.guide-cta p { color: var(--ink); }
.cta-actions { display: flex; flex-wrap: wrap; gap: var(--s4); margin-top: var(--s6); }
.cta-actions .btn { text-decoration: none; }

@media (max-width: 899px) {
  .g12 { grid-template-columns: minmax(0, 1fr); row-gap: var(--s8); }
  .g12 > * { grid-column: 1 / -1 !important; }
  .guide-head, .guide-head h1, .guide-body > section { max-width: none; }
  .toc {
    position: static; max-height: none; overflow: visible;
    border-left: 0; border-top: 1px solid var(--rule);
    padding: var(--s4) 0 0 0;
  }
  .toc ul { columns: 2; column-gap: var(--s8); }
  .guide-body > section + section { margin-top: var(--s8); }
}

@media (max-width: 767px) {
  .toc ul { columns: 1; }
  .prose .cmp th, .prose .cmp td { padding: 10px var(--s4); }
  /* The stacked row label spans the row. Left at 22% it overflows its own box,
     which is what axe reports as a background it cannot determine. */
  .prose .cmp tbody th { width: auto; padding-block: var(--s2); }
  .faq summary { min-height: 48px; }
  .guide-cta { padding: var(--s6); }
  .cta-actions .btn { width: 100%; }
}

/* Footer guides column, shared with the homepage. */
.footer-col-title {
  font-size: 0.75rem; font-weight: 600; line-height: 1.2;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink);
  margin-bottom: var(--s3);
}
.footer-col ul { display: flex; flex-direction: column; gap: var(--s2); }
.footer-col a { color: var(--body); text-decoration: underline; }
.footer-col a:hover { color: var(--ink); }
