/*
 * Dark theme. Same tokens, swapped values. Follows prefers-color-scheme by default;
 * <html data-theme="light|dark"> forces one (handy for testing).
 * Accent fills keep the brand red (white text passes AA); text-coloured accent uses a lighter red.
 */

:root {
	color-scheme: light;
	--eamd-accent-text: var(--eamd-accent);
}

/* ---- Token values ---- */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		color-scheme: dark;
		--eamd-ink: #e6ecf4;
		--eamd-muted: #9fabbd;
		--eamd-line: #243247;
		--eamd-field-border: #6b7a91;
		--eamd-surface: #0a1424;
		--eamd-surface-2: #101d31;
		--eamd-accent-text: #ff6272;
		--eamd-shadow: 0 1px 0 rgb(0 0 0 / 0.3), 0 14px 32px -18px rgb(0 0 0 / 0.7);
	}
}

:root[data-theme="dark"] {
	color-scheme: dark;
	--eamd-ink: #e6ecf4;
	--eamd-muted: #9fabbd;
	--eamd-line: #243247;
	--eamd-field-border: #6b7a91;
	--eamd-surface: #0a1424;
	--eamd-surface-2: #101d31;
	--eamd-accent-text: #ff6272;
	--eamd-shadow: 0 1px 0 rgb(0 0 0 / 0.3), 0 14px 32px -18px rgb(0 0 0 / 0.7);
}

/* ---- Elementor global colours follow the tokens ---- */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) body[class*="elementor-kit-"] {
		--e-global-color-primary: #e6ecf4;
		--e-global-color-secondary: #9fabbd;
		--e-global-color-text: #e6ecf4;
		--e-global-color-eamd_surface2: #101d31;
		--e-global-color-eamd_line: #243247;
	}
}

:root[data-theme="dark"] body[class*="elementor-kit-"] {
	--e-global-color-primary: #e6ecf4;
	--e-global-color-secondary: #9fabbd;
	--e-global-color-text: #e6ecf4;
	--e-global-color-eamd_surface2: #101d31;
	--e-global-color-eamd_line: #243247;
}

/* ---- Accent used as text needs the lighter red on dark ---- */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) a:hover,
	:root:not([data-theme="light"]) .eamd-tier__p .elementor-heading-title,
	:root:not([data-theme="light"]) .eamd-form .wpforms-required-label,
	:root:not([data-theme="light"]) .woocommerce form .form-row .required {
		color: var(--eamd-accent-text);
	}

	/* Logos are dark artwork on an opaque white box: keep them on a light plate. */
	:root:not([data-theme="light"]) .eamd-header .eamd-logo__img,
	:root:not([data-theme="light"]) .eamd-footer .eamd-footer__logo img {
		padding: 5px 10px;
		border-radius: var(--eamd-radius);
		background: #f4f6f9;
		mix-blend-mode: normal;
	}

	:root:not([data-theme="light"]) .eamd-logowall img {
		padding: clamp(12px, 2vw, 28px);
		border-radius: var(--eamd-radius);
		background: #f4f6f9;
	}

	:root:not([data-theme="light"]) .eamd-btn--ghost:hover,
	:root:not([data-theme="light"]) .elementor-widget-button.eamd-btn-ghost .elementor-button:hover {
		color: var(--eamd-surface);
	}

	:root:not([data-theme="light"]) .elementor-widget-text-editor a {
		color: var(--eamd-ink);
	}
}

:root[data-theme="dark"] a:hover,
:root[data-theme="dark"] .eamd-tier__p .elementor-heading-title,
:root[data-theme="dark"] .eamd-form .wpforms-required-label,
:root[data-theme="dark"] .woocommerce form .form-row .required {
	color: var(--eamd-accent-text);
}

:root[data-theme="dark"] .eamd-header .eamd-logo__img,
:root[data-theme="dark"] .eamd-footer .eamd-footer__logo img {
	padding: 5px 10px;
	border-radius: var(--eamd-radius);
	background: #f4f6f9;
	mix-blend-mode: normal;
}

:root[data-theme="dark"] .eamd-logowall img {
	padding: clamp(12px, 2vw, 28px);
	border-radius: var(--eamd-radius);
	background: #f4f6f9;
}

:root[data-theme="dark"] .eamd-btn--ghost:hover,
:root[data-theme="dark"] .elementor-widget-button.eamd-btn-ghost .elementor-button:hover {
	color: var(--eamd-surface);
}

:root[data-theme="dark"] .elementor-widget-text-editor a {
	color: var(--eamd-ink);
}
