/* SermonWave light / dark colour tokens for the site pages (includes/sw_theme.php applies the visitor's choice before the
   first paint: <html data-bs-theme="light|dark">; Auto follows prefers-color-scheme). Loaded right after css/style.css by
   includes/head_assets.php on every site page.
   The site styles (style.css, seo-pages.css, church-*.css, help.css, recovery.css, sw_account.css ...) are written with
   the variables below; this file defines them ONCE for light and ONCE for dark:
     dark = @media (prefers-color-scheme: dark) when no choice was applied (no JavaScript), or [data-bs-theme="dark"].
   Semantic tokens: --sw-link (links, accents on the page background), --sw-heading (headings / strong text).
   Brand surfaces that are dark by design (navy hero bands, footer, CTA bands) keep their colours in both themes.
   Contrast (WCAG AA, 4.5:1 body text): light text-body #3D3D56 on #fff 10.4:1, muted #5b6270 6.4:1; dark text-body
   #c9d1de on #0f1729 11.6:1, muted #a3adbf 7.6:1, link #93b4ff 8.2:1, heading #eef2fb 15.9:1. */

:root {
	color-scheme: light;
	--sw-link: var(--blue);
	--sw-heading: var(--navy);
	--text-muted: #5b6270;            /* was #6B7280 (4.8:1 on the cool background): 6.4:1 */
	--sw-surface: var(--bg-white);
	--sw-input-bg: #ffffff;
	--sw-input-text: var(--text-dark);
	--sw-focus: 0 0 0 3px rgba(18, 68, 196, 0.35);
	--sw-gold-text: #7a5200;          /* gold as text: 6.1:1 on white, 5.6:1 on cream */
	--sw-aqua-text: #00707f;          /* 5.6:1 on white */
	--sw-rose-text: #b8243a;          /* 5.8:1 on white, 4.9:1 on its soft tint */
	--sw-slate-text: #4a5160;
}

/* ---------- dark: the same tokens, dark values ---------- */
@media (prefers-color-scheme: dark) {
	:root:not([data-bs-theme="light"]) {
		color-scheme: dark;
		--bg-white: #131c2e;
		--bg-cream: #121a2b;
		--bg-cool: #0b1120;
		--text-dark: #eef2fb;
		--text-body: #c9d1de;
		--text-muted: #a3adbf;
		--border-light: rgba(255, 255, 255, 0.12);
		--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
		--shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
		--shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
		--aqua-soft: rgba(0, 188, 212, 0.18);
		--rose-soft: rgba(250, 50, 79, 0.18);
		--sw-link: #93b4ff;
		--sw-heading: #eef2fb;
		--sw-input-bg: #0f1729;
		--sw-input-text: #eef2fb;
		--sw-focus: 0 0 0 3px rgba(147, 180, 255, 0.45);
		--sw-gold-text: #f2c55c;
		--sw-aqua-text: #5fd6e6;
		--sw-rose-text: #ff8a9b;
		--sw-slate-text: #b8c0cf;
	}
}
:root[data-bs-theme="dark"] {
	color-scheme: dark;
	--bg-white: #131c2e;
	--bg-cream: #121a2b;
	--bg-cool: #0b1120;
	--text-dark: #eef2fb;
	--text-body: #c9d1de;
	--text-muted: #a3adbf;
	--border-light: rgba(255, 255, 255, 0.12);
	--shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
	--shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
	--shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
	--aqua-soft: rgba(0, 188, 212, 0.18);
	--rose-soft: rgba(250, 50, 79, 0.18);
	--sw-link: #93b4ff;
	--sw-heading: #eef2fb;
	--sw-input-bg: #0f1729;
	--sw-input-text: #eef2fb;
	--sw-focus: 0 0 0 3px rgba(147, 180, 255, 0.45);
	--sw-gold-text: #f2c55c;
	--sw-aqua-text: #5fd6e6;
	--sw-rose-text: #ff8a9b;
	--sw-slate-text: #b8c0cf;
}

/* the page itself */
html[data-bs-theme] body { background-color: var(--bg-white); color: var(--text-body); }
html[data-bs-theme="dark"] body { background-color: var(--bg-cool); }

/* forms on site pages (contact, signup, claim, removal, account, help search) */
html[data-bs-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]),
html[data-bs-theme="dark"] select,
html[data-bs-theme="dark"] textarea {
	background-color: var(--sw-input-bg);
	color: var(--sw-input-text);
	border-color: rgba(255, 255, 255, 0.22);
}
html[data-bs-theme="dark"] ::placeholder { color: #8d97a8; opacity: 1; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: none; box-shadow: var(--sw-focus); }

/* tables (legal pages, pricing, comparisons) */
html[data-bs-theme="dark"] table { color: var(--text-body); border-color: var(--border-light); }
html[data-bs-theme="dark"] th, html[data-bs-theme="dark"] td { border-color: var(--border-light) !important; }
html[data-bs-theme="dark"] thead th, html[data-bs-theme="dark"] tr:nth-child(even) td { background-color: rgba(255, 255, 255, 0.04); }
html[data-bs-theme="dark"] code, html[data-bs-theme="dark"] pre { background-color: #0f1729; color: #e2e8f0; }
html[data-bs-theme="dark"] hr { border-color: var(--border-light); }


/* ---------- surfaces that were hard-coded light tints ---------- */
html[data-bs-theme="dark"] .rec-crisis { background: #2b2210; border-color: #6b5321; }
html[data-bs-theme="dark"] .sw-acct-why { background: #241d10; border-color: #5c4a22; color: var(--text-body); }
html[data-bs-theme="dark"] .sw-acct-why__emails { color: var(--text-muted); }
html[data-bs-theme="dark"] .addon--soon { background: var(--bg-white); }
html[data-bs-theme="dark"] .help-badge--beta { background: rgba(232, 163, 23, 0.16); border-color: rgba(245, 195, 65, 0.4); }
html[data-bs-theme="dark"] .help-badge--soon { border-color: var(--border-light); }
html[data-bs-theme="dark"] .help-callout--tip { background: rgba(30, 158, 106, 0.14); }
html[data-bs-theme="dark"] .help-callout--warning { background: rgba(250, 50, 79, 0.12); }
html[data-bs-theme="dark"] .help-callout--beta { background: rgba(232, 163, 23, 0.12); }
html[data-bs-theme="dark"] .dir-pop__g { border-color: var(--border-light); }

/* badges on the always-dark hero bands (church profile): the dark-theme colours in both themes */
.dir-hero .dir-badge--sermons, .seo-hero .dir-badge--sermons { color: #5fd6e6; }
.dir-hero .dir-badge--live, .seo-hero .dir-badge--live { color: #ff8a9b; }
.dir-hero .dir-badge--es, .seo-hero .dir-badge--es { color: #f2c55c; }
.dir-hero .dir-badge--limited, .seo-hero .dir-badge--limited { color: #d5dbe6; }

/* a church's sermon list on site pages (listen/css/sermon_list.css, standalone): its tokens in dark */
html[data-bs-theme="dark"] .sw-sermon-list--standalone {
	--listener-bg-card: #131c2e; --listener-bg-card-hover: #1a2438; --listener-border: rgba(255, 255, 255, 0.1); --listener-border-strong: rgba(255, 255, 255, 0.18);
	--listener-text: #eef2fb; --listener-text-muted: #a3adbf; --listener-text-faint: #8d97a9; --listener-accent: #f59e0b;
	--listener-accent-glow: rgba(245, 158, 11, 0.25); --listener-accent-subtle: rgba(245, 158, 11, 0.1);
}
html[data-bs-theme="dark"] .sw-sermon-list--standalone .listener-scripture-badge { color: #a5b4fc; }
.listener-topic-badge[style*="--tc"] { color: color-mix(in srgb, var(--tc) 45%, var(--listener-text, var(--text-dark))) !important; }

/* the Bible study pages, the account screens and the verse bubble on site pages (css/sw_bible*.css, sw_account.css use
   the --swb-* tokens): their dark values */
html[data-bs-theme="dark"] {
	--swb-bg: #131c2e;
	--swb-bg-soft: #0f1729;
	--swb-text: #eef2fb;
	--swb-muted: #a3adbf;
	--swb-border: rgba(255, 255, 255, 0.14);
	--swb-accent: #93b4ff;
	--swb-accent-soft: rgba(147, 180, 255, 0.12);
	--swb-link: #5fd6e6;
	--swb-highlight: rgba(245, 195, 65, 0.22);
	--swb-highlight-edge: #f5c341;
	--swb-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}
html[data-bs-theme="dark"] .sw-acct__btn--primary { color: #0b1120; }
html[data-bs-theme="dark"] .bible-btn--primary, html[data-bs-theme="dark"] .bible-btn--primary * { color: #0b1120; }
html[data-bs-theme="dark"] .sw-sermon-list--standalone .sw-sermon-list__play-all { color: #1f1300; }
html[data-bs-theme="dark"] .rec-crisis a { color: #ffb36b; }
html[data-bs-theme="dark"] .lang-quality-pill--excellent { color: #6ee7a8; }
html[data-bs-theme="dark"] .lang-quality-pill--good { color: #7cc4f5; }
html[data-bs-theme="dark"] .lang-quality-pill--fair { color: #f2c55c; }
html[data-bs-theme="dark"] .lang-quality-pill--limited { color: #b8c0cf; }
html[data-bs-theme="dark"] .lang-quality-pill--beta { color: #c9d1de; }
