/* Sprint 11 — accessibility fixes addressing Sprint 10 axe-core findings.
   Bumps muted-text contrast to WCAG AA (4.5:1 body, 3:1 large). */

/* Muted body text — bump from #737373/#a3a3a3 (often-failing on light bg)
   to #525252 (passes 4.5:1 on #fff, 4.27:1 on #fafafa). */
.muted,
.gm-author-meta .muted,
.gm-author-meta,
.last-updated,
.gm-eyebrow .name,
.gmp-footer-colophon-sub,
.gm-footer-bottom,
cite {
  color: #525252 !important;
}

/* §-numerals + opener numbers — these use warm orange #f55a23.
   At display sizes (≥24px = "large text") AA needs 3:1.
   #f55a23 on white is ~3.5:1 — passes large. But axe-core checks computed
   font-size; if the rendered size is < 24px somewhere, it fails.
   Solution: at small sizes use the darker warm-orange variant. */
.gm-opener-num,
.p-found-year,
.gm-section-num,
.p-comp-tile-num {
  color: #c64a1f !important;  /* warm-orange-bold: 5.34:1 on #fff, passes AA body */
}

/* Pillar-page founding-card meta + timeline strip text */
.p-found-meta,
.p-tl-strip .p-tl-year,
.p-tl-strip .p-tl-label {
  color: #525252 !important;
}

/* Scrollable timeline strip — give it keyboard focus + describable role. */
.p-tl-strip {
  /* These don't render visually; they're picked up by AT.
     The tabindex must be set on the element via HTML — see the
     scripts/fix-pillar-scrollable-strip.mjs script. */
}

/* Footer fine-link row — the dotted-underline links should pass AA */
.gmp-footer-fine-link {
  color: #c4c4c4 !important;
}
.gmp-footer-fine-link:hover {
  color: #f55a23 !important;
}

/* Header drawer secondary text — italic small caps were failing on dark bg.
   Apply only when the drawer is on a light background. */
.gmp-drawer .gmp-drawer-secondary {
  color: #525252;
}

/* Sprint 11 round-2 — additional contrast bumps for pillar/TOC text */
.p-entry-num,
.p-tl-strip .p-tl-year,
.p-tl-strip .p-tl-name {
  color: #525252 !important;
}
.gm-toc h4 {
  color: #525252 !important;
}
section[aria-label="Newsletter"] > div > div:first-of-type {
  color: #c64a1f !important;
}

/* Sprint 11 round-3 — additional bumps for remaining axe-core findings */
.is-loomis td,
.gm-example-fig,
.gm-cite-list h4,
.p-mosaic-tile-num,
.gm-table th,
.gm-table td.is-loomis {
  color: #525252 !important;
}

/* Inline link contrast — `p > a[href]` was failing on light gray text */
p > a:not([class]):not(.gm-btn) {
  color: #c64a1f !important;
}
p > a:not([class]):not(.gm-btn):hover {
  color: #a03a16 !important;
}

/* Sprint 12 — final 8 residual axe-core contrast nodes.
   Targets per axe-findings.json: `cite`, table cells, citation lists,
   mosaic-tile numerals, inline `p > a`. Tightening to #404040 / #c64a1f. */

/* cite + Newsreader-italic small bylines — push from #525252 → #404040 (10.4:1) */
.cite,
cite,
.gm-cite-list cite,
.gm-cite-list li,
.gm-cite-list a,
.gm-citation-list li,
.gm-attribution,
figcaption cite {
  color: #404040 !important;
}

/* Table cells across pillar/leaf — keep above 7:1 for AAA where reasonable */
table.gm-table td,
table.gm-table th,
.gm-decision-matrix td,
.gm-decision-matrix th,
.p-comparison-matrix td,
.p-comparison-matrix th,
.gm-table-wrap td,
.gm-table-wrap th {
  color: #404040 !important;
}

/* Citation lists — heading + author runs */
.gm-cite-list h4,
.gm-cite-list .gm-cite-author,
.p-citations li {
  color: #404040 !important;
}

/* Mosaic-tile numerals — when the warm-orange shows on tinted aida/parchment */
.gm-mosaic-tile-num,
.p-mosaic-tile-num,
.gc-tile h4,
.sg-tile h4,
.ty-tile h4,
.xs-aida-card-count,
.qu-block-card h3,
.qu-block-card-meta {
  color: #404040 !important;
}
.xs-aida-card-count,
.xs-aida-card-count sup {
  color: #c64a1f !important;
}
.qu-block-card-meta {
  color: #525252 !important;
}

/* Inline `p > a` fallback for any link still on light-gray background */
p a,
.gm-faq-body p a,
.gm-section p a {
  color: #c64a1f !important;
}

/* Newsreader italic eyebrow text (small caps) — was #737373 on white = 4.43:1, bump to 4.5:1+ */
.gm-eyebrow .name,
.gm-eyebrow .part-name,
.gmp-kicker .name {
  color: #525252 !important;
}

/* Sprint 14 — remaining axe contrast nodes measured 2026-05-26.
   `.p-misc-num` on the flagship pillar was at #a3a3a3 / 2.52 contrast (15 nodes).
   `#c64a1f` on tinted backgrounds (#fff5ed, #f5f5f7) sat at 4.38-4.43 — just below
   AA's 4.5:1 threshold. Bumping to #b03e15 (5.20:1 on #fff5ed, 5.17:1 on #f5f5f7). */

.p-misc-num,
.p-misc-card .p-misc-num,
.p-misc-card:nth-child(1) > .p-misc-num,
.p-misc-card:nth-child(2) > .p-misc-num,
.p-misc-card:nth-child(3) > .p-misc-num,
.p-misc-card:nth-child(4) > .p-misc-num,
.p-misc-card:nth-child(5) > .p-misc-num,
.p-misc-card:nth-child(n) > .p-misc-num {
  color: #525252 !important;
}

/* p > a with overlay deep-link href, on tinted backgrounds */
p > a[href^="/?overlay="],
p > a[href="/?overlay=loomisHeadGrid"],
.p-leaf p > a,
.gm-leaf p > a,
section[class*="tinted"] p > a {
  color: #b03e15 !important;
}

/* .muted > a pointing to methodology/about — on #f5f5f7 */
.muted > a,
.muted > a[href$="methodology/"],
.muted > a[href*="methodology"],
.gm-muted > a,
.gmp-muted > a {
  color: #b03e15 !important;
}

/* Author avatar initials letter — on #fff5ed cream tint */
.gm-author-avatar,
.gmp-author-avatar,
.gm-byline-avatar {
  color: #b03e15 !important;
}

/* Comparison table cells on tinted-cream backgrounds */
th, td {
  /* leave default unless overridden — but bump warm-orange table cells */
}
/* #4 (2026-06-08): scoped down from the over-broad `table th` + bare `th:nth-child(3)`
   globals — which tinted EVERY table's header row AND every 3rd-column header rust
   site-wide (a documented leak: it forced rust onto unrelated comparison tables, e.g.
   the sacred-geometry tool's, requiring a per-page workaround). The rust is only the
   .gm-table highlight column (e.g. /tools/golden-ratio/'s "Golden Ratio (Phi)" 3rd col,
   which IS a .gm-table). Other tables fall back to the #404040 cell rule above (10:1). */
.gm-table th:nth-child(3),
.gm-comparison-table th,
.gm-comparison-table td.is-mark,
.gm-decision-matrix th[scope] {
  color: #b03e15 !important;
}

/* /learn/loomis-method-step-by-step/ — inline overlay anchors on tinted bg */
section p > a[href*="overlay="],
.gm-section p > a[href*="overlay="],
.gm-prose p > a[href*="overlay="] {
  color: #b03e15 !important;
}

/* /learn/{golden-ratio,sacred-geometry}-* — figcaption in .ln-domain-svg.
   #86868b on #fbfbfd was 3.5:1. Push to #525252 (7.5:1). */
.ln-domain-svg figcaption,
figure.ln-domain-svg > figcaption,
figure[class*="ln-"] figcaption {
  color: #525252 !important;
}

/* Flagship pillar — .p-aud-label on dark #0a0a0a was #525252 (2.53:1).
   Push to #d4d4d4 (11.5:1). */
.p-aud-label,
.p-aud .p-aud-label {
  color: #d4d4d4 !important;
}

/* Flagship pillar — .p-audience-coda is on dark #0a0a0a; the global
   p a { color: #c64a1f !important } above flipped its mailto link to orange.
   Restore to near-white for the dark background. */
.p-audience-coda a,
.p-audience-coda p > a,
p.p-audience-coda > a {
  color: #fafafa !important;
}

/* Standardized byline meta-line (site-wide, 200+ pages). Caption-size text used
   var(--c-ink-4) (≈3.x:1) and its links were distinguishable by colour only.
   Bump text to #525252 (7.4:1 on white) and underline the links so they pass
   "links must be distinguishable" without relying on colour. (axe 2026-06-08) */
.gmp-byline-meta { color: #525252 !important; }
/* specificity must beat the earlier `p > a:not([class]):not(.gm-btn)` rule (0,2,2) */
p.gmp-byline-meta > a:not([class]):not(.gm-btn) { color: #b03e15 !important; text-decoration: underline; text-underline-offset: 2px; }

/* axe color-contrast sweep (2026-06-08) — global editorial components whose
   secondary/meta text or accent colour fell just under WCAG AA (4.5:1) at
   caption sizes. All recur across leaves/pillars, so fixing them here clears
   the bulk of the site-wide contrast debt. Each new value is verified ≥4.5:1
   on its measured background. */
.gmp-hero-eyebrow { color: #c64a1f !important; }              /* #f55a23 3.19 → ~4.6 on #fbfbfd */
.gmp-quickstats dt { color: #5f5f5f !important; }             /* #737373 4.35 → ~5.3 on #f5f5f7 */
.gmp-demo-tab { color: #595959 !important; }                  /* inactive tab #737373 4.13 → ~5.6 */
.gmp-mistake-fix strong { color: #0f7a52 !important; }        /* green #10b981 2.13 → ~4.8 on #e3eee9 */
.gmp-updatelog { color: #5f5f5f !important; }                 /* #737373 4.35 → ~5.3 */
.gmp-glossary-rail span { color: #5f5f5f !important; }        /* #737373 4.35 → ~5.3 */
.gmp-pillar-studio-note { color: #6a6a6a !important; }        /* #8a8a8a 3.3 → ~4.7 on #fafafa */

/* Cookie-consent banner sits on a dark #0e1116 panel; the broad `p a` rule above
   forced its privacy link to #c64a1f (3.96:1, fails on dark). Use a lighter warm
   orange that passes on the dark panel (#ff8a5c ≈ 7:1). Class beats `p a` (0,0,2). */
.cookie-privacy-link { color: #ff8a5c !important; }

/* Bespoke learn-pillar secondary text (ns-/tt-/cn-/ca-/fp-/mg-/qx-`-pillar`
   articles) used #737373, which is 4.45:1 on their off-white #f8f8f6 sections —
   0.05 under AA. Nudge the secondary-text element types to #6d6d6d (≈4.8:1).
   Element/structural selectors only, so it applies regardless of prefix. */
article[class$="-pillar"] dt,
article[class$="-pillar"] figcaption,
article[class$="-pillar"] [class$="-byline"] span,
article[class$="-pillar"] [class$="-rail"] a span,
article[class$="-pillar"] [class$="-toc"] h2 { color: #6d6d6d !important; }

/* /about/marcus-reid/ contact links were colour-only distinguishable in a text
   block — underline them so they pass "links must be distinguishable". */
.mr-contact a { text-decoration: underline; text-underline-offset: 2px; }

/* link-in-text-block (axe 2026-06-08 r2) — inline prose links that relied on
   colour alone. These contexts (glossary body, gallery artist bios, the
   comparison closing paragraph) get a real underline. Scoped, not broad, so
   they don't leak onto card/chip links. The global `p a` rule above already
   supplies a passing colour (#c64a1f); this only adds the underline. */
.gl-page p a,
.gmp-artist-bio a,
.gmp-bottom-text a { text-decoration: underline; text-underline-offset: 2px; }

/* --c-text-3 was #86868b — only ~3.62:1 on #fff, so EVERY small-text use of the
   "tertiary/muted" token (the gm-toc heading, gm-section eyebrow h2s, gm-cite-list,
   etc.) fails WCAG AA on the gm-family /learn pillars. Darken the token itself to
   #636366 (≈6:1) so all those uses pass at once — darkening muted text only ever
   improves contrast. Caught by tests/smoke.spec.ts axe scan; missed by
   run-axe-full (its pillar rep is the bespoke flagship, not a gm-toc page).
   The `html:root` selector (specificity 0,1,1) is required to beat the plain
   `:root` token in body-loaded gmp.css — same trick responsive.css uses. */
html:root { --c-text-3: #636366 !important; }
