/* =========================================================
   DARK / LIGHT MODE
   By default the site follows the device setting (js/theme.js sets <html data-theme="dark|light">);
   the header toggle lets a visitor pick their own.
   Both modes are styled here, plus the toggle button in the header and the
   WAHfamily counter.
   ========================================================= */

/* ---------- Toggle button (both modes) ---------- */

.wah-theme-toggle {
	flex: 0 0 auto;
	display: inline-grid;
	place-items: center;
	width: 42px;
	height: 42px;
	/* (margins are set below: the header's layout rules would otherwise reset them) */
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 999px;
	background: rgba(9, 25, 48, 0.35);
	color: #fff;
	cursor: pointer;
	transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.wah-theme-toggle:hover {
	background: rgba(9, 25, 48, 0.55);
	border-color: rgba(255, 225, 106, 0.55);
	box-shadow: 0 0 0 4px rgba(255, 225, 106, 0.14), 0 0 18px rgba(255, 225, 106, 0.25);
	color: var(--wah-yellow, #ffe16a);
}
.wah-theme-toggle:active { transform: scale(0.94); }
.wah-theme-toggle:focus-visible { outline: 2px solid var(--wah-yellow); outline-offset: 3px; }
.wah-theme-toggle svg { display: block; }

/* Keep the menu on the right, next to the toggle (logo stays left). */
header.wp-block-template-part .alignwide.has-background > .wp-block-navigation { margin-left: auto; }
header.wp-block-template-part .alignwide.has-background > .wah-theme-toggle {
	margin: 0 clamp(6px, 2.6vw, 38px) 0 10px !important; /* right: clear of the decorative star at the end of the bar */
}

/* Smooth change when the visitor switches (not on page load). */
.wah-theme-switching body,
.wah-theme-switching body * {
	transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* ---------- Dark mode: colours ---------- */

html[data-theme="dark"] {
	color-scheme: dark;

	--wah-surface: #0f2237;          /* the big page card */
	--wah-surface-2: #142b44;        /* boxes on the page */
	--wah-surface-3: #1a3554;        /* inputs, raised bits */
	--wah-line: rgba(160, 205, 240, 0.16);
	--wah-ink: #e6f0fa;              /* main text */
	--wah-ink-soft: rgba(230, 240, 250, 0.74);

	/* The site's heading colour, as a dark-mode version */
	--wah-blue-dark: #cfe6ff;

	/* WordPress colour presets used all over the pages */
	--wp--preset--color--background: var(--wah-surface);
	--wp--preset--color--foreground: var(--wah-ink);
	--wp--preset--color--primary: var(--wah-ink);
	--wp--preset--color--secondary: var(--wah-ink-soft);
	--wp--preset--color--custom-green: var(--wah-surface-2);
	--wp--preset--color--custom-navy: #cfe6ff;
}

html[data-theme="dark"] body {
	color: var(--wah-ink);
}

/* The big page card (home + every other page) */
html[data-theme="dark"] body:not(.home) .wp-site-blocks > .wp-block-group > .alignwide.has-background-background-color,
html[data-theme="dark"] .home .wp-site-blocks > .alignwide.has-background-background-color {
	background:
		radial-gradient(700px 400px at 0% 0%, rgba(125, 225, 212, 0.10), transparent 65%),
		radial-gradient(600px 400px at 100% 100%, rgba(248, 157, 50, 0.07), transparent 65%),
		var(--wah-surface) !important;
	color: var(--wah-ink);
}

/* General text colours: low priority (:where), so any colour a page sets on purpose still wins. */
html[data-theme="dark"] :where(.wp-site-blocks) :where(h1, h2, h3, h4) {
	color: var(--wah-blue-dark);
}

html[data-theme="dark"] :where(.wp-site-blocks) :where(p, li, td, th, label, dd, dt) {
	color: var(--wah-ink-soft);
}

html[data-theme="dark"] :where(.wp-site-blocks) :where(strong, b) {
	color: var(--wah-ink);
}

html[data-theme="dark"] body .wp-site-blocks hr,
html[data-theme="dark"] body .wp-site-blocks .wp-block-separator {
	border-color: var(--wah-line) !important;
	background-color: var(--wah-line) !important;
	color: var(--wah-line) !important;
}

html[data-theme="dark"] body .wp-site-blocks input,
html[data-theme="dark"] body .wp-site-blocks select,
html[data-theme="dark"] body .wp-site-blocks textarea {
	background-color: var(--wah-surface-3);
	color: var(--wah-ink);
	border-color: var(--wah-line);
}

/* Top picture frame on inner pages */
html[data-theme="dark"] body:not(.home) .wp-block-post-featured-image img {
	box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
}

/* Mobile menu panel */
html[data-theme="dark"] .wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wah-surface) !important;
	color: var(--wah-ink) !important;
}

/* ---------- Dark mode: boxes and cards (light glass in light mode) ---------- */

html[data-theme="dark"] body .wah-price-section,
html[data-theme="dark"] body .wah-package-card,
html[data-theme="dark"] body .wah-package-note,
html[data-theme="dark"] body .wah-spot-card,
html[data-theme="dark"] body .wah-tos-intro,
html[data-theme="dark"] body .wah-timeline-sub,
html[data-theme="dark"] body .wah-care-intro,
html[data-theme="dark"] body .wah-journey-card,
html[data-theme="dark"] body .wah-final-box,
html[data-theme="dark"] body .wah-care-step-card,
html[data-theme="dark"] body .wah-care-final-box,
html[data-theme="dark"] body .wah-care-box,
html[data-theme="dark"] body .wah-box {
	background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)), var(--wah-surface-2) !important;
	border-color: var(--wah-line) !important;
	box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32) !important;
}

/* Warning boxes keep a warm tint */
html[data-theme="dark"] body .wah-box.warning,
html[data-theme="dark"] body .wah-care-box.warning {
	background: linear-gradient(180deg, rgba(248, 157, 50, 0.14), rgba(248, 157, 50, 0.05)), var(--wah-surface-2) !important;
	border-color: rgba(248, 157, 50, 0.35) !important;
}
html[data-theme="dark"] body .wah-box.info,
html[data-theme="dark"] body .wah-care-box.info {
	background: linear-gradient(180deg, rgba(125, 225, 212, 0.12), rgba(125, 225, 212, 0.04)), var(--wah-surface-2) !important;
	border-color: rgba(125, 225, 212, 0.3) !important;
}

/* Credits: the pictures sit straight on the card (see polish.css, "CREDITS") */

/* ---------- Dark mode: text that was set to a fixed dark colour ---------- */

html[data-theme="dark"] body .wah-about h1,
html[data-theme="dark"] body .wah-about h2,
html[data-theme="dark"] body .wah-package-header h2 {
	color: var(--wah-blue-dark) !important;
}

html[data-theme="dark"] body .wah-about p,
html[data-theme="dark"] body .wah-about-intro,
html[data-theme="dark"] body .wah-package-header p {
	color: var(--wah-ink-soft) !important;
}

html[data-theme="dark"] body .wah-about-small,
html[data-theme="dark"] body .wah-package-header .wah-package-kicker {
	color: var(--wah-aqua) !important;
}

html[data-theme="dark"] body .wah-pattern-item span {
	color: var(--wah-ink-soft) !important;
}

/* Text inside those boxes */
html[data-theme="dark"] body :is(.wah-price-section, .wah-package-card, .wah-package-note, .wah-tos-intro, .wah-timeline-sub,
	.wah-care-intro, .wah-journey-card, .wah-final-box, .wah-care-step-card, .wah-care-final-box, .wah-care-box, .wah-box)
	:is(p, li, span:not(.wah-package-badge):not(.wah-step-number), .wah-note, .wah-care-note),
html[data-theme="dark"] body :is(.wah-tos-intro, .wah-timeline-sub, .wah-care-intro, .wah-package-note) {
	color: var(--wah-ink-soft) !important;
}

html[data-theme="dark"] body :is(.wah-box, .wah-care-box).important h3 {
	color: #b9c4ff !important;
}

html[data-theme="dark"] body .wah-package-badge,
html[data-theme="dark"] body .wah-step-number {
	color: var(--wah-aqua) !important;
}

/* Page-specific text that is dark on purpose in light mode */
html[data-theme="dark"] body .wah-world .wah-header,
html[data-theme="dark"] body .wah-world .wah-description,
html[data-theme="dark"] body .wah-spotlight .wah-sub,
html[data-theme="dark"] body .wah-spot-text p,
html[data-theme="dark"] body .wah-price-section label,
html[data-theme="dark"] body .wah-price-section .wah-option span {
	color: var(--wah-ink-soft) !important;
}

html[data-theme="dark"] body .wah-package-card h3,
html[data-theme="dark"] body .wah-package-note strong,
html[data-theme="dark"] body .wah-price-section strong,
html[data-theme="dark"] body .wah-spot-text h2 {
	color: var(--wah-blue-dark) !important;
}


/* =========================================================
   WAHFAMILY COUNTER ("★ 39 WAHs spotted worldwide ★")
   Same colours as the header bar, in both modes.
   ========================================================= */

body .wah-world .wah-counter {
	background: linear-gradient(100deg, rgba(74, 173, 179, 0.92) 0%, rgba(199, 223, 210, 0.85) 45%, rgba(13, 54, 114, 0.95) 100%) !important;
	border: 1px solid rgba(255, 255, 255, 0.28);
	box-shadow: 0 12px 34px rgba(3, 10, 24, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
	color: #fff !important;
	text-shadow: 0 1px 2px rgba(9, 25, 48, 0.55), 0 0 10px rgba(9, 25, 48, 0.35);
}

/* =========================================================
   LIGHT MODE: bright sky, white cards, dark text.
   The header bar, accent colours and the WAH trading cards keep their look.
   ========================================================= */

html[data-theme="light"] {
	color-scheme: light;
	--wah-l-surface: #ffffff;
	--wah-l-soft: #f3f9fd;
	--wah-l-line: rgba(23, 45, 74, 0.10);
	--wah-l-ink: #13233a;
	--wah-l-ink-soft: #3d5068;
	--wah-l-teal: #1f8f96;          /* aqua that is readable on white */
	--wah-l-orange: #c8670a;        /* orange that is readable on white */
}

/* Page background: soft sky instead of the night sky */
html[data-theme="light"] body {
	background:
		radial-gradient(1100px 700px at 8% -5%, rgba(125, 225, 212, 0.35), transparent 60%),
		radial-gradient(900px 650px at 100% 25%, rgba(248, 157, 50, 0.12), transparent 60%),
		radial-gradient(1300px 900px at 50% 115%, rgba(125, 225, 212, 0.25), transparent 60%),
		linear-gradient(180deg, #e6f3fa 0%, #f2f9fd 55%, #e9f5fa 100%) !important;
	background-attachment: fixed !important;
	color: var(--wah-l-ink);
}

/* Page cards: white with a little colour */
html[data-theme="light"] body:not(.home) .wp-site-blocks > .wp-block-group > .alignwide.has-background-background-color,
html[data-theme="light"] .home .wp-site-blocks > .alignwide.has-background-background-color,
html[data-theme="light"] .home .wp-site-blocks > .has-custom-blu-scurissimo-background-color {
	background:
		radial-gradient(700px 400px at 0% 0%, rgba(125, 225, 212, 0.18), transparent 65%),
		radial-gradient(600px 400px at 100% 100%, rgba(248, 157, 50, 0.08), transparent 65%),
		var(--wah-l-surface) !important;
	border: 1px solid var(--wah-l-line) !important;
	box-shadow: 0 24px 60px rgba(23, 45, 74, 0.10) !important;
	color: var(--wah-l-ink) !important;
}

/* "What is a WAH?" (home): bright and colourful in both modes, the first thing visitors read about a WAH. */
html[data-theme="dark"] body .wah-what.wah-dark {
	background:
		radial-gradient(720px 420px at 8% 0%, rgba(125, 225, 212, 0.42), transparent 65%),
		radial-gradient(640px 420px at 100% 100%, rgba(248, 157, 50, 0.32), transparent 65%),
		radial-gradient(500px 300px at 92% 6%, rgba(255, 225, 106, 0.16), transparent 70%),
		linear-gradient(155deg, #2584b8 0%, #1d6597 45%, #1a4c7c 100%) !important;
	border: 1px solid rgba(255, 255, 255, 0.22) !important;
	box-shadow: 0 18px 50px rgba(31, 111, 165, 0.35), 0 0 0 1px rgba(125, 225, 212, 0.12) inset !important;
}
html[data-theme="dark"] body .wah-what.wah-dark::before { opacity: 0.45; }
html[data-theme="dark"] body .wah-what .wah-section-title { text-shadow: 0 4px 24px rgba(9, 25, 48, 0.35); }
html[data-theme="dark"] body .wah-what .wah-section-text { opacity: 1; }
html[data-theme="dark"] body .wah-what .wah-kicker {
	color: #fff !important;
	background: rgba(255, 255, 255, 0.16);
	border-color: rgba(255, 255, 255, 0.3);
}
html[data-theme="dark"] body .wah-what .wah-feature-card {
	background: rgba(255, 255, 255, 0.16);
	border: 1px solid rgba(255, 255, 255, 0.28);
	box-shadow: 0 12px 30px rgba(9, 25, 48, 0.22);
}
html[data-theme="dark"] body .wah-what .wah-feature-card:hover {
	background: rgba(255, 255, 255, 0.22);
	box-shadow: 0 18px 40px rgba(9, 25, 48, 0.28), 0 0 32px rgba(125, 225, 212, 0.3);
}
html[data-theme="dark"] body .wah-what .wah-feature-card h3 { color: #ffe16a !important; }
html[data-theme="dark"] body .wah-what .wah-feature-card p { opacity: 1; }

html[data-theme="light"] body .wah-what.wah-dark {
	background:
		radial-gradient(700px 400px at 6% 0%, rgba(125, 225, 212, 0.6), transparent 68%),
		radial-gradient(640px 400px at 100% 100%, rgba(248, 157, 50, 0.32), transparent 68%),
		radial-gradient(420px 260px at 94% 4%, rgba(255, 225, 106, 0.45), transparent 70%),
		linear-gradient(150deg, #d4f3f1 0%, #e9f6ff 50%, #fff0dc 100%) !important;
	border: 1px solid rgba(31, 143, 150, 0.22) !important;
	box-shadow: 0 18px 44px rgba(31, 143, 150, 0.16) !important;
}
html[data-theme="light"] body .wah-what .wah-feature-card {
	border-color: rgba(31, 143, 150, 0.2) !important;
	box-shadow: 0 10px 26px rgba(31, 143, 150, 0.12) !important;
}

/* Big feature box that was night-blue: WAHlab (about) */
html[data-theme="light"] body .wah-lab {
	background:
		radial-gradient(600px 300px at 0% 0%, rgba(125, 225, 212, 0.22), transparent 70%),
		radial-gradient(500px 300px at 100% 100%, rgba(248, 157, 50, 0.10), transparent 70%),
		var(--wah-l-soft) !important;
	border: 1px solid var(--wah-l-line) !important;
	box-shadow: 0 18px 44px rgba(23, 45, 74, 0.08) !important;
}

/* Page banners (Price Estimator, Terms of Service, Care Manual) and the price total */
html[data-theme="light"] body .wah-price-hero,
html[data-theme="light"] body .wah-tos-hero,
html[data-theme="light"] body .wah-care-hero {
	background:
		radial-gradient(500px 260px at 0% 0%, rgba(125, 225, 212, 0.45), transparent 70%),
		radial-gradient(500px 260px at 100% 100%, rgba(248, 157, 50, 0.20), transparent 70%),
		linear-gradient(135deg, #e3f5f8, #f4fafe 60%, #fff4e6) !important;
	border: 1px solid var(--wah-l-line) !important;
	box-shadow: 0 18px 44px rgba(23, 45, 74, 0.10) !important;
}

html[data-theme="light"] body .wah-total-card {
	background: linear-gradient(180deg, #ffffff, #f2f9fd) !important;
	border: 1px solid var(--wah-l-line) !important;
	box-shadow: 0 18px 44px rgba(23, 45, 74, 0.12) !important;
}

html[data-theme="light"] body .wah-about-ending {
	background: linear-gradient(120deg, #dff4f6, #eef8fd 55%, #fff1e0) !important;
	border: 1px solid var(--wah-l-line) !important;
}

/* Footer */
html[data-theme="light"] footer.wp-block-template-part > .wp-block-group {
	background:
		radial-gradient(700px 260px at 50% 0%, rgba(125, 225, 212, 0.22), transparent 70%),
		#ffffff !important;
	border: 1px solid var(--wah-l-line) !important;
	box-shadow: 0 -10px 40px rgba(23, 45, 74, 0.06) !important;
}
html[data-theme="light"] footer.wp-block-template-part p,
html[data-theme="light"] footer.wp-block-template-part a {
	color: var(--wah-l-ink-soft) !important;
}
html[data-theme="light"] footer .wp-block-social-links .wp-social-link {
	background: #e6f2f8 !important;
	color: var(--wah-l-ink) !important;
}
html[data-theme="light"] footer .wp-block-social-links .wp-social-link a,
html[data-theme="light"] footer .wp-block-social-links .wp-social-link svg {
	color: #17787e !important;
	fill: currentColor !important;
}

/* Mobile menu panel */
html[data-theme="light"] .wp-block-navigation__responsive-container.is-menu-open {
	background-color: #ffffff !important;
	color: var(--wah-l-ink) !important;
}

/* ---------- Light mode: text that was white for the old night-blue areas ---------- */

html[data-theme="light"] body :where(.wah-commissions-card, .wah-what, .wah-pin-content, .wah-moving-gallery .wah-section-inner,
	.wah-lab, .wah-price-hero, .wah-tos-hero, .wah-care-hero, .wah-total-card, .wah-about-ending)
	:is(h1, h2, h3, p, li, .wah-section-title, .wah-section-text, .wah-sub, .wah-tos-sub, .wah-care-sub, .wah-total-note, .wah-selected-list, .wah-warning-note) {
	color: var(--wah-l-ink) !important;
	text-shadow: none !important;
}
html[data-theme="light"] body :where(.wah-what, .wah-lab, .wah-pin-content, .wah-price-hero, .wah-tos-hero, .wah-care-hero, .wah-total-card)
	:is(p, li, .wah-section-text, .wah-sub, .wah-tos-sub, .wah-care-sub, .wah-total-note, .wah-selected-list) {
	color: var(--wah-l-ink-soft) !important;
}

/* Small boxes inside those areas (were dark glass) */
html[data-theme="light"] body :is(.wah-feature-card, .wah-lab-card, .wah-lab-equipment, .wah-warning-note, .wah-selected-list) {
	background: #ffffff !important;
	border: 1px solid var(--wah-l-line) !important;
	box-shadow: 0 8px 22px rgba(23, 45, 74, 0.06) !important;
}
html[data-theme="light"] body :is(.wah-pin-tags span, .wah-pill, .wah-care-pill) {
	background: #e3f3f6 !important;
	border: 1px solid rgba(31, 143, 150, 0.25) !important;
	color: #145f64 !important;
}

/* ---------- Light mode: accent colours deep enough to read on white ---------- */

/* Aqua / teal */
html[data-theme="light"]:root body :is(.wah-kicker, .wah-small-title, .wah-price-kicker, .wah-tos-kicker, .wah-care-kicker, .wah-lab-note),
html[data-theme="light"]:root body .wah-world .wah-header h1,
html[data-theme="light"]:root body .wah-world .country-section h2,
html[data-theme="light"]:root body :is(.wah-pin-content, .wah-moving-gallery, .wah-lab) .wah-section-title,
html[data-theme="light"]:root body :is(.wah-lab-card, .wah-feature-card) h3,
html[data-theme="light"]:root body :is(.wah-tos-section, .wah-care-section) > h2,
html[data-theme="light"]:root body :is(.wah-box, .wah-care-box, .wah-journey-card, .wah-care-step-card) h3,
html[data-theme="light"]:root body :is(.wah-final-box, .wah-care-final-box) h2,
html[data-theme="light"]:root body .wah-price-section h2,
html[data-theme="light"]:root body .wah-total-card h2,
html[data-theme="light"]:root body .wah-pattern-item strong,
html[data-theme="light"]:root body .wah-package-card[data-color="aqua"] h3 {
	color: #17787e !important;
	-webkit-text-fill-color: currentColor;
	text-shadow: none !important;
}
html[data-theme="light"]:root body :is(.wah-kicker, .wah-small-title) {
	background: #e3f3f6 !important;
	border-color: rgba(31, 143, 150, 0.25) !important;
}

/* Orange */
html[data-theme="light"]:root body :is(.wah-box, .wah-care-box).warning h3,
html[data-theme="light"]:root body .wah-care-section > h2.wah-orange,
html[data-theme="light"]:root body .wah-package-card[data-color="orange"] h3,
html[data-theme="light"]:root body .wah-total,
html[data-theme="light"]:root body .has-custom-orange-color {
	color: #ad5300 !important;
	-webkit-text-fill-color: currentColor;
}

/* Yellow (pattern credit names, equipment title) */
html[data-theme="light"]:root body .wah-lab-equipment h3,
html[data-theme="light"]:root body .wah-pattern-item span a,
html[data-theme="light"]:root body .wah-pattern-thanks a {
	color: #a05a00 !important;
}

/* Light blue */
html[data-theme="light"]:root body .wah-package-card[data-color="blue"] h3 {
	color: #2c6a93 !important;
}

/* The other fursuit type colours, deep enough to read on white */
html[data-theme="light"]:root body .wah-package-card[data-color="pink"] h3 { color: #b8326f !important; }
html[data-theme="light"]:root body .wah-package-card[data-color="purple"] h3 { color: #6a3fc4 !important; }
html[data-theme="light"]:root body .wah-package-card[data-color="green"] h3 { color: #2c7a3a !important; }
