/* READING rollout R3 (as-3azc): legal, FAQ, contact, community, error and moved pages.
   Loaded after /reading.css; every rule is gated on body.reading so a page that
   does not opt in keeps its dark showcase look. Tokens and primitives come from
   reading.css; this file only adds what the R3 pages need and reading.css lacks. */

/* Buttons: the READING pages use a flat gold fill with near-black ink (>= 10:1) in
   both themes (as-nuqn: theme-neutral, --gold-fill is defined in styles.css). */
body.reading .btn-primary {
  background: var(--gold-fill);
  color: #111318;
  box-shadow: none;
}
body.reading .btn-primary:hover { background: #F2C14E; color: #111318; box-shadow: none; transform: none; }
body.reading .btn-secondary { background: var(--bg-0); color: var(--text-1); border: 1px solid var(--border-strong); box-shadow: none; }
body.reading .btn-secondary:hover { background: var(--bg-1); border-color: var(--text-1); color: var(--text-1); }
body.reading .btn-ghost { color: var(--text-1); border: 1px solid var(--border-strong); }
body.reading .btn-ghost:hover { background: var(--bg-1); border-color: var(--text-1); color: var(--text-1); }

/* Gold tokens (light only): styles.css keeps --accent-1..5 on the dark theme's light
   golds (1.7:1 on white). Inline styles and page rules read these directly, so map
   them onto the AA gold (--accent, 6.9:1) for every R3 page. Dark uses styles.css. */
html[data-theme="light"] body.reading {
  --accent-1: #5E3F00;
  --accent-2: #7A5200;
  --accent-3: #7A5200;
  --accent-4: #7A5200;
  --accent-5: #5E3F00;
  --secondary-bright: var(--air);
  --danger-bg: rgba(179, 38, 30, .08);
}

/* ---- Page head shared by the plain .hero (FAQ, moved pages) ------------- */
/* site-shell.css centres/pads .hero with !important; the larger selector wins. */
body.reading .hero {
  display: block;
  min-height: 0 !important;
  padding: calc(var(--header) + clamp(28px, 3vw, 56px)) var(--shell-gutter) clamp(28px, 3vw, 48px) !important;
  overflow: visible;
  background: none !important;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
body.reading .hero-bg { display: none; }
body.reading .hero-inner { width: 100%; max-width: var(--reading-measure); margin: 0; text-align: left; }
body.reading .hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0; margin: 0; border: 0; border-radius: 0; background: none;
  color: var(--air); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
body.reading .hero-badge::before { content: none; }
body.reading .hero h1 {
  max-width: none; margin: 16px 0 0;
  font-size: clamp(32px, 2.6vw + 12px, 64px); font-weight: 700; line-height: 1.12; letter-spacing: -.035em;
  color: var(--text-1);
}
body.reading .hero-lead {
  max-width: 70ch !important; margin: 20px 0 0;
  color: var(--text-2); font-size: calc(var(--reading-size) * 1.15); line-height: 1.6;
}
body.reading .hero-actions { justify-content: flex-start; margin-top: 28px; }
body.reading .hero-foot { margin-top: 20px; color: var(--text-3); font-size: 14px; text-align: left; }

/* ---- Moved pages (legacy addresses that forward) ------------------------- */
body.legacy-moved main { min-height: 56vh; }

/* ---- FAQ ------------------------------------------------------------------ */
body.reading .faq-section { padding-inline: var(--shell-gutter); padding-top: clamp(28px, 3vw, 48px); }
body.reading .faq {
  max-width: none; margin: 0;
  display: grid; grid-template-columns: minmax(0, 1fr);
  column-gap: clamp(48px, 5vw, 128px);
  font-size: var(--reading-size);
}
body.reading .faq > :not(.faq-group) { grid-column: 1 / -1; min-width: 0; }
body.reading .faq-group { min-width: 0; }
@media (min-width: 1500px) {
  body.reading .faq { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
body.reading .faq-cat { margin: 32px 0 8px; font-size: .8em; color: var(--accent); }
body.reading .faq-item,
body.reading.editorial-ui .faq-item { margin: 0; border: 0; border-bottom: 1px solid var(--border-strong); border-radius: 0; background: none; }
body.reading .faq-item.open,
body.reading.editorial-ui .faq-item.open { background: var(--bg-1); border-color: var(--border-strong); }
body.reading .faq-q,
body.reading.editorial-ui .faq-q { padding: 18px 0; font-size: 1em; font-weight: 650; color: var(--text-1); }
body.reading .faq-item.open .faq-q,
body.reading .faq-item.open .faq-a,
body.reading.editorial-ui .faq-item.open .faq-q,
body.reading.editorial-ui .faq-item.open .faq-a { padding-inline: 16px; }
body.reading .faq-q::after { color: var(--text-2); }
body.reading .faq-a p { max-width: var(--reading-measure); font-size: 1em; line-height: 1.7; color: var(--text-2); }
body.reading .faq-a a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
body.reading .footer-cta {
  padding: clamp(40px, 5vw, 80px) var(--shell-gutter);
  text-align: left;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
}
body.reading .footer-cta h2 { font-size: clamp(26px, 1.6vw + 14px, 40px); }
body.reading .footer-cta p { max-width: var(--reading-measure); margin: 0 0 24px; font-size: var(--reading-size); }
body.reading .footer-cta > div { justify-content: flex-start !important; }

/* ---- Contact -------------------------------------------------------------- */
body.reading .contact-section { padding: calc(var(--header) + clamp(28px, 3vw, 56px)) var(--shell-gutter) clamp(56px, 6vw, 112px); }
body.reading .contact-inner { max-width: none; margin: 0; font-size: var(--reading-size); }
body.reading .contact-section .section-header { max-width: var(--reading-measure); margin: 0 0 clamp(28px, 3vw, 48px); text-align: left; }
body.reading .contact-section .section-header .eyebrow { color: var(--air); }
body.reading .contact-section .section-header h1 { font-size: clamp(32px, 2.6vw + 12px, 64px); font-weight: 700; line-height: 1.12; letter-spacing: -.035em; margin: 12px 0 0; }
body.reading .contact-section .section-header p { margin-top: 16px; color: var(--text-2); font-size: calc(var(--reading-size) * 1.15); }
/* The inline sizes on the support card and the lane copy are 12 to 15px; reading size wins. */
body.reading #supportChatCard { background: var(--bg-1) !important; border: 1px solid var(--border-strong) !important; border-radius: var(--r-md) !important; }
body.reading #supportChatCard :is(p, div, span, h2):not(#scLog *):not(#scPrevLog *) { font-size: 1em !important; }
body.reading #supportChatCard h2 { font-size: 1.25em !important; }
body.reading #supportChatCard :is(p, span, div):not(#scLog *) { max-width: var(--reading-measure); }
body.reading .contact-grid > div > :is(p, ul, h2) { font-size: 1em !important; max-width: var(--reading-measure); }
body.reading .contact-grid > div > h2 { font-size: 1.3em !important; }
body.reading .contact-grid > div li { font-size: 1em !important; }
body.reading .contact-form,
body.reading.editorial-ui .contact-form {
  background: var(--bg-1);
  border: 1px solid var(--border-strong) !important;
  border-radius: var(--r-md);
  box-shadow: none;
}
body.reading .form-flag { border: 1px solid var(--border-strong); background: var(--bg-0); color: var(--text-1); }
body.reading .field label { font-size: .8em; color: var(--text-2); }
body.reading .field :is(input, textarea, select) { font-size: 1em; }
body.reading .field input::placeholder, body.reading .field textarea::placeholder { color: var(--text-3); }
body.reading .form-privacy, body.reading .kind-hint, body.reading #identityNote { font-size: .85em !important; color: var(--text-3); }
body.reading .kind-toggle { background: var(--bg-0); border-color: var(--border-strong); }
body.reading .kind-opt { font-size: .95em; color: var(--text-2); }
body.reading .kind-opt.active { background: var(--bg-3); color: var(--text-1); box-shadow: inset 0 0 0 1px var(--text-1); }
body.reading .kind-opt.active[data-kind="bug"] { background: var(--danger); color: var(--bg-0); box-shadow: none; }
@media (min-width: 1100px) {
  /* Support card and lane copy on the left, the form on the right; the form
     keeps a working width instead of stretching across a 2560px monitor. */
  body.reading .contact-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(26rem, 48rem); column-gap: clamp(40px, 5vw, 128px); align-items: start; }
  body.reading .contact-inner > .section-header { grid-column: 1 / -1; }
  body.reading #supportChatCard { grid-column: 1; margin: 0 0 clamp(24px, 2.4vw, 40px) !important; }
  body.reading .contact-grid { display: contents; }
  body.reading .contact-grid > div { grid-column: 1; }
  body.reading .contact-grid > .contact-form { grid-column: 2; grid-row: 2 / span 2; }
}

/* ---- Legal documents (terms, privacy) -------------------------------------
   Full-width shell; the body text flows in 2 or 3 columns of at most ~80ch as
   the viewport allows, so a wide screen is used instead of one floating column.
   Wording and element order are untouched; this is layout only. */
body.reading .legal-shell {
  max-width: none; margin: 0;
  padding: calc(var(--header) + clamp(28px, 3vw, 56px)) var(--shell-gutter) clamp(56px, 6vw, 112px);
  font-size: var(--reading-size);
  columns: 30em 3;
  column-gap: clamp(40px, 4vw, 96px);
}
body.reading .legal-shell > .legal-heading { display: none; }
body.reading .legal-shell h1 {
  column-span: all; margin: 0 0 8px;
  font-size: clamp(32px, 2.6vw + 12px, 64px); font-weight: 700; line-height: 1.12; letter-spacing: -.035em; color: var(--text-1);
}
body.reading .legal-shell .effective { column-span: all; margin: 0 0 clamp(20px, 2.4vw, 40px); padding-bottom: 20px; border-bottom: 1px solid var(--border); color: var(--text-3); font-size: .85em; }
body.reading .legal-shell h2 { margin: 1.8em 0 .6em; padding-bottom: .4em; font-size: 1.2em; color: var(--text-1); border-bottom: 1px solid var(--border-strong); break-after: avoid; }
body.reading .legal-shell h3 { margin: 1.3em 0 .5em; font-size: 1em; color: var(--text-1); break-after: avoid; }
body.reading .legal-shell p, body.reading .legal-shell li { font-size: 1em; line-height: 1.7; color: var(--text-2); }
body.reading .legal-shell strong, body.reading .legal-shell b { color: var(--text-1); }
body.reading .legal-shell a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
body.reading .legal-shell :is(.legal-region, .legal-annex, .region-legal-panel, .rp-in-terms .rp-causes li) { break-inside: avoid; }
body.reading .legal-region { background: var(--bg-1); border-color: var(--border-strong); font-size: .9em; }
body.reading .legal-region a { color: var(--text-1); }
body.reading .legal-annex { border-left: 3px solid var(--air); }
body.reading .legal-shell .region-legal-panel { max-width: none; }
body.reading .legal-shell table { display: block; max-width: 100%; overflow-x: auto; }
@media (max-width: 720px) {
  body.reading .legal-shell { columns: auto; }
}

/* Plain list rows for the refund causes: no pill radius on the page. */
body.reading .legal-shell .rp-causes li { border-radius: var(--r-sm, 6px); }

/* ---- Privacy guide ---------------------------------------------------------- */
body.reading .pg-section { padding-inline: var(--shell-gutter); font-size: var(--reading-size); }
body.reading .pg-inner { max-width: none; margin: 0; }
body.reading .pg-inner > :is(p, .pg-warn, .reco, .eyebrow) { max-width: var(--reading-measure); }
body.reading .pg-inner > .eyebrow { color: var(--air); }
body.reading .pg-h1 { font-size: clamp(32px, 2.6vw + 12px, 64px); font-weight: 700; line-height: 1.12; letter-spacing: -.035em; }
body.reading .pg-h2 { font-size: clamp(24px, 1.2vw + 16px, 36px); }
body.reading .pg-lead, body.reading .pg-warn p, body.reading .lane ul, body.reading .feat .rows, body.reading .reco li { font-size: 1em; }
body.reading .pg-lead { color: var(--text-2); line-height: 1.7; }
body.reading .pg-warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 8%, var(--bg-0)); }
body.reading .pg-warn strong.title { font-size: 1em; }
body.reading .lane, body.reading .feat, body.reading .reco li { background: var(--bg-0); border-color: var(--border-strong); border-radius: var(--r-md); }
body.reading .lane.good { border-color: var(--success); }
body.reading .lane.warn { border-color: var(--warn); }
body.reading .lane .lane-title, body.reading .feat h3 { font-size: 1.05em; }
body.reading .pg-section.alt { background: var(--bg-1); }
body.reading .feat .rows dt { color: var(--text-2); }
@media (min-width: 1280px) {
  /* Feature cards flow in two columns so uneven card heights leave no gaps. */
  body.reading .pg-inner:has(> .feat) { columns: 2; column-gap: clamp(24px, 3vw, 64px); }
  body.reading .pg-inner:has(> .feat) > :not(.feat) { column-span: all; }
  body.reading .pg-inner:has(> .feat) > .feat { break-inside: avoid; }
}
