/* ============================================================================
   contrast-fixes.css — site-wide text & textbox contrast fixes
   Loaded LAST in base.html. This is an override layer, so !important is used
   where the original rule is more specific (e.g. .footer-inner a beats
   footer a, and a generic h2 rule beats .pt-section h2).

   Root cause: a global fallback `--text:#f1f5f9` (light) bleeds onto LIGHT
   surfaces whose background is set via a CSS class (not inline), so the
   existing `[style*="background:#fff"]{--text:#1e293b}` override misses them.
   We re-scope theme vars on those containers, lift the faint footer/nav, fix
   dark-on-dark headings, and make an invisible search input visible.
   Only context-unambiguous cases are touched (footer/nav are always dark;
   pt-sections are always dark; the card classes below are always light).
   v=20260618b
   ============================================================================ */

/* ---- 1. Footer (always dark navy bg): links + disclaimer were too dark --- */
.footer-inner a,
footer a { color: #cbd5e1 !important; }
.footer-inner a:hover,
footer a:hover { color: #ffffff !important; }
footer h4 { color: #ffffff !important; }
footer p,
.footer-inner p,
.footer-disclaimer p { color: #9fb0c6 !important; }
.footer-disclaimer strong,
footer strong { color: #dbe4ef !important; }

/* ---- 2. Nav links on the dark nav bar --------------------------------- */
nav .nav-links a,
nav .nav-login { color: #d2dbe8; }
nav .nav-links a:hover,
nav .nav-login:hover { color: #ffffff; }

/* ---- 3. Class-styled LIGHT/white containers using var(--text) ----------
        Re-scope theme vars so descendant `var(--text)` text renders dark. */
.city-card,
.sr-section,
.sr-comp-card { --text: #1e293b; --text-muted: #64748b; }

/* city-markets: city name + median price were light on white */
.city-card .city-name,
.city-card .yield-city-name,
.city-card .metric-val { color: #0f172a; }                 /* median price */
.city-card .metric-val.yield-strong,
.city-card .metric-val.trend-up { color: #059669; }
.city-card .metric-val.trend-down { color: #dc2626; }
.city-card .metric-val.yield-low { color: #475569; }

/* sample report: headings/values were light on white sections */
.sr-section h2,
.sr-section h3,
.sr-section strong,
.sr-comp-card strong { color: #0f172a; }

/* ---- 4. pt-sections mix DARK section-heads and LIGHT cards -------------
        Dark section heads (direct children) → light heading.
        Light .pt-card forms → dark theme vars + dark heading.
        (.pt-card.dark keeps its own inline white heading.) */
.pt-section > .pt-section-head > h2 { color: #f1f5f9 !important; }
.pt-card:not(.dark) { --text: #1e293b; --text-muted: #64748b; }
.pt-card:not(.dark) h2,
.pt-card:not(.dark) .pt-section-head h2 { color: #0f172a !important; }
.pt-card:not(.dark) .pt-eyebrow { color: #1d4ed8; }   /* pale-blue eyebrow on light card */

/* ---- 5. methodology table header (light text on white) ---------------- */
.methodology-table th,
main table thead th { color: #1e293b; }

/* ---- 6. Faint accents on always-light surfaces ------------------------ */
.auth-sub { color: #475569; }

/* ---- 7. Muted text on always-dark sections — lift --------------------- */
.pa-sub, .pa-trust, .pt-proof-label { color: #aab4c4 !important; }

/* ---- 7b. More class-styled light containers using var(--text) ---------- */
.yield-bar-row,
.claim-card, .claim-row, .media-claim, .media-stat,
.pt-stat, .pt-stat-card,
.faq-item, .pt-summary-strip,
.yield-chart-section, .data-note { --text: #1e293b; --text-muted: #64748b; }

/* known light-on-white text classes (var(--text) bled light) → dark */
.yield-city-name,
.yield-bar-val,
.attribution,
.claim-text,
.claim-source,
.pt-number { color: #1e293b !important; }

/* ---- 7c. Buttons: ensure white text + AA-dark backgrounds ------------- */
.ps-btn-primary { color: #ffffff !important; }            /* some pages gave it dark text on blue */
.pt-btn.primary { background: #1670b5 !important; }       /* blue was too light for white text */
/* solid-green buttons / fills: darken so white text passes AA */
.buy-report-btn,
[style*="background:var(--accent)"],
[style*="background: var(--accent)"],
[style*="background:#10b981"],
[style*="background: #10b981"] { background: #047857 !important; }

/* ---- 7d. Badges: darken text / unify so it meets AA -------------------- */
.city-signal-badge.badge-strong { color: #047857 !important; }
.city-signal-badge.badge-moderate { color: #b45309 !important; }
.city-signal-badge.badge-healthy { color: #4338ca !important; }
.sr-risk-badge { color: #b45309 !important; }
.sr-flag-badge { color: #dc2626 !important; }
/* primary blue buttons: darken bg so white text clears AA (homepage keeps
   its softer gradient via the higher-specificity .ps-home rule below) */
.ps-btn.ps-btn-primary { background: #1d4ed8 !important; color: #ffffff !important; }

/* ---- 7e. Table headers (slate-400 on white) --------------------------- */
main table th,
table thead th { color: #475569; }

/* ---- 7f. INVERSE of the white-bg override: dark inline-bg cards need
        light text (e.g. contact's background:var(--ps-bg-page)). --------- */
[style*="background:var(--ps-bg-page)"],
[style*="background: var(--ps-bg-page)"],
[style*="background:var(--ps-bg-dark)"],
[style*="background:var(--ps-bg-panel)"],
[style*="background:#0f1b2d"],
[style*="background:#0b1628"] { color: #dbe4ef; }
[style*="background:var(--ps-bg-page)"] strong,
[style*="background:var(--ps-bg-dark)"] strong,
[style*="background:var(--ps-bg-panel)"] strong { color: #ffffff; }
[style*="background:var(--ps-bg-page)"] .ps-muted,
[style*="background:var(--ps-bg-page)"] p,
[style*="background:var(--ps-bg-dark)"] .ps-muted,
[style*="background:var(--ps-bg-panel)"] .ps-muted { color: #9fb0c6; }

/* keep the dark suburb cards' muted text at its intended light value */
.suburb-wrap .section-card,
.suburb-wrap .metric-card { --text-muted: #94a3b8; }

/* ---- 7g. Invisible-spot mop-up: light text on light cards ------------- */
/* faq answers (white .card) */
.faq-item strong,
.faq-item p,
.faq-item li,
.faq-item > div { color: #1e293b !important; }
/* tools hub feature/preview metrics (light .pt-tool-card) */
.pt-tool-card .pt-metric strong { color: #1e293b !important; }
.pt-tool-card .pt-metric span { color: #64748b !important; }
/* media-kit data claims (white .data-claim) */
.data-claim .claim-text,
.data-claim .claim-text strong { color: #1e293b !important; }
.data-claim .claim-source { color: #64748b !important; }

/* homepage: eyebrow sat dark inside the dark workflow / why-use sections */
.ps-home [style*="background:var(--ps-bg-page)"] .ps-eyebrow { color: #9db8e0; }
.ps-home [style*="background:var(--ps-bg-page)"] .ps-eyebrow::before { color: #34d399; }

/* ---- 8. Invisible search input on the dark suburb page ---------------- */
.invest-search-wrap input {
  background: #0f1b2d !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  color: #f1f5f9 !important;
}
.invest-search-wrap input::placeholder { color: #94a3b8 !important; }

/* ---- 9. Unstyled selects/inputs were near-invisible (white on near-white,
        no border). Give them a visible outline; styled fields keep theirs. */
select:not([class]),
input:not([class]):not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) {
  border: 1px solid #cbd5e1;
}
