/* ============================================================
   ATRIUM CONTRAST FIX v3 — WCAG 2.1 AA (4.5:1 text / 3:1 large)
   2026-06-01. Loaded LAST. html[...] prefix raises specificity.
   Selectors match BOTH spaced and non-spaced inline-style formats.
   ============================================================ */

/* COOKIE BUTTON (theme-split) */
html[data-atrium-theme="dark"] button[aria-label="Manage cookie preferences"]{ color:#94a3b8 !important; }
html[data-atrium-theme="light"] button[aria-label="Manage cookie preferences"]{ color:#475569 !important; }

/* ---------- DARK MODE ---------- */
/* Related-article white-glass cards -> solid light so dark text reads */
html[data-atrium-theme="dark"] .atrium-related a{ background:#e8ebef !important; border-color:rgba(15,23,42,0.18) !important; }
html[data-atrium-theme="dark"] .atrium-related a p{ color:#232c39 !important; }
html[data-atrium-theme="dark"] .atrium-related > p{ color:#5cc4e6 !important; }

/* ---------- LIGHT MODE ---------- */
/* 1) Brand cyan accents on light surfaces (exclude cyan-bg buttons) */
html[data-atrium-theme="light"] [style*="color:#33BDE8"]:not([style*="background"]),
html[data-atrium-theme="light"] [style*="color: #33BDE8"]:not([style*="background"]),
html[data-atrium-theme="light"] [style*="color:#33bde8"]:not([style*="background"]),
html[data-atrium-theme="light"] [style*="color:#1a7fa0"]:not([style*="background"]){ color:#0a5f7a !important; }

/* 2) Muted subtitle variable on light cards */
html[data-atrium-theme="light"] [style*="var(--at-subtle"]{ color:#4f5966 !important; }

/* 2b) Small pill badges (py-1 px-3) — not CTA buttons */
html[data-atrium-theme="light"] [class*="py-1"][class*="px-3"][class*="inline-flex"]:not([href]){ color:#454e5b !important; }

/* 3) Footer in light mode: white bg keeps light text + cyan links */
html[data-atrium-theme="light"] footer p,
html[data-atrium-theme="light"] footer div,
html[data-atrium-theme="light"] footer span,
html[data-atrium-theme="light"] footer li,
html[data-atrium-theme="light"] footer address,
html[data-atrium-theme="light"] footer [class*="text-slate"],
html[data-atrium-theme="light"] footer [class*="text-white"]{ color:#334155 !important; }
html[data-atrium-theme="light"] footer h2,
html[data-atrium-theme="light"] footer h3,
html[data-atrium-theme="light"] footer strong{ color:#0f172a !important; }
html[data-atrium-theme="light"] footer a{ color:#0a5f7a !important; }
html[data-atrium-theme="light"] footer a:hover{ color:#063f52 !important; }

/* 4) Header nav pills (anchor chips) */
html[data-atrium-theme="light"] header a[class*="h-10"]{ color:#454e5b !important; }

/* 5) Green CTA: dark-green text on light-green gradient */
html[data-atrium-theme="light"] a[data-automa-trigger][class*="text-slate-950"],
html[data-atrium-theme="light"] a[style*="9BEAA6"][style*="color:#1d7a3f"]{ color:#0c4a23 !important; }

/* 6) Glass cards (inline navy bg) -> SOLID light in light mode so they do not
      blend with dark backdrops into mid-gray. Match spaced + non-spaced formats. */
html[data-atrium-theme="light"] [style*="background-color:rgba(8,19,33"]:not(a):not(button),
html[data-atrium-theme="light"] [style*="background-color: rgba(8, 19, 33"]:not(a):not(button),
html[data-atrium-theme="light"] [style*="background:rgba(8,19,33"]:not(a):not(button),
html[data-atrium-theme="light"] [style*="background: rgba(8, 19, 33"]:not(a):not(button),
html[data-atrium-theme="light"] [style*="background-color:rgba(7,17,31"]:not(a):not(button),
html[data-atrium-theme="light"] [style*="background-color: rgba(7, 17, 31"]:not(a):not(button){ background-color:#eef3f7 !important; }
/* and ensure their text is dark on the now-light card */
html[data-atrium-theme="light"] [style*="rgba(8, 19, 33, 0.76)"] h1,
html[data-atrium-theme="light"] [style*="rgba(8, 19, 33, 0.76)"] h2,
html[data-atrium-theme="light"] [style*="rgba(8, 19, 33, 0.76)"] h3,
html[data-atrium-theme="light"] [style*="rgba(8,19,33,0.76)"] h3{ color:#0a1224 !important; }

/* 7) Secondary brand cyan #2F90AF (badge text) — too dim on dark cards (4.05),
      too light on light surfaces. Brighten in dark / darken in light. */
html[data-atrium-theme="dark"] [style*="color:#2f90af" i]{ color:#7fd0ee !important; }
html[data-atrium-theme="light"] [style*="color:#2f90af" i]{ color:#0a5f7a !important; }

/* 8) Small numbered/icon circles with cyan bg (h-8 w-8) — dark number on cyan
      = 1.81. In light mode: deep-teal circle + white number (readable + elegant). */
html[data-atrium-theme="light"] [class*="h-8"][class*="w-8"][style*="background-color:#33BDE8"],
html[data-atrium-theme="light"] [class*="h-8"][class*="w-8"][style*="background-color:#1a7fa0"],
html[data-atrium-theme="light"] [class*="h-9"][class*="w-9"][style*="background-color:#33BDE8"],
html[data-atrium-theme="light"] [class*="h-10"][class*="w-10"][style*="background-color:#33BDE8"]{
  background-color:#0a5f7a !important; color:#ffffff !important;
}

/* 9) DARK MODE: article-meta/body text using light-first dark inline colors
      (byline, TOC .atrium-quick-context, intro, author bio) renders dark-on-dark
      and is invisible. Lighten in dark. Related light-cards keep dark text below. */
html[data-atrium-theme="dark"] [style*="color:#0a1224"],
html[data-atrium-theme="dark"] [style*="color: #0a1224"],
html[data-atrium-theme="dark"] [style*="color:#1e293b"],
html[data-atrium-theme="dark"] [style*="color: #1e293b"],
html[data-atrium-theme="dark"] [style*="color:#475569"],
html[data-atrium-theme="dark"] [style*="color: #475569"],
html[data-atrium-theme="dark"] [style*="color:#64748b"],
html[data-atrium-theme="dark"] [style*="color: #64748b"]{ color:#dbe3ec !important; }
html[data-atrium-theme="dark"] [style*="color:#1a7fa0"]:not([style*="background"]),
html[data-atrium-theme="dark"] [style*="color: #1a7fa0"]:not([style*="background"]){ color:#5cc4e6 !important; }
/* re-assert dark text on the solid-light related cards (higher specificity wins) */
html[data-atrium-theme="dark"] .atrium-related a [style*="color:#0a1224"],
html[data-atrium-theme="dark"] .atrium-related a [style*="color:#1e293b"],
html[data-atrium-theme="dark"] .atrium-related a p{ color:#232c39 !important; }

/* 10) CTA BUTTONS — contrast fixes (both themes unless scoped) */
/* A. Solid bright cyan->green gradient CTAs: inline intends dark text (#020617) but
      it is overridden to white -> white on bright gradient fails (~2). Restore dark. */
html body [style*="linear-gradient(90deg, #33BDE8"][style*="color:#020617"],
html body [style*="linear-gradient(90deg,#33BDE8"][style*="color:#020617"]{ color:#04121f !important; }
/* B. "See If You Qualify" ghost CTA (subtle rgba gradient + white text): in light mode
      its near-transparent bg sits on a light card -> white invisible. Use dark text. */
html[data-atrium-theme="light"] [style*="linear-gradient(90deg, rgba(51,189,232,0.14"],
html[data-atrium-theme="light"] [style*="linear-gradient(90deg,rgba(51,189,232,0.14"]{ color:#073a4b !important; }

/* C. Chat widget header + send button: white text on bright cyan (~2.19).
      Deepen the cyan so white text reads (>=4.5). */
.aiw-header{ background:#0a5f7a !important; }
.aiw-send, .aiw-send:hover{ background:#0a5f7a !important; color:#ffffff !important; }
.aiw-button{ background:#0a5f7a !important; }
