/*
 * Visitor colour palettes. Theme file (ports to WordPress as-is).
 * The default palette (Sherbet) lives in theme.json; the others override the
 * WordPress preset variables when <html data-palette="…"> is set by palette-switcher.js.
 *
 * Accent slots (same slugs as theme.json):
 *   accent-1 → Enquiries   accent-2 → Data entry   accent-3 → Reports   accent-4 → Private AI
 * accent-N is the strong colour (text, lines); accent-N-soft is for panels, dots and shapes.
 */

:root[data-palette="seaside"] {
	--wp--preset--color--base: #F6FAFB; --wp--preset--color--surface: #E4EEF1; --wp--preset--color--surface-strong: #D5E3E8;
	--wp--preset--color--white: #FFFFFF; --wp--preset--color--contrast: #0E2230; --wp--preset--color--muted: #34495A;
	--wp--preset--color--subtle: #5A6E7D; --wp--preset--color--faint: #7B8A94; --wp--preset--color--line: #DDE8EC;
	--wp--preset--color--accent-1: #1D4ED8; --wp--preset--color--accent-1-soft: #9DC2F5;
	--wp--preset--color--accent-2: #0F766E;   --wp--preset--color--accent-2-soft: #99E2D0;
	--wp--preset--color--accent-3: #8A6420;  --wp--preset--color--accent-3-soft: #EDD39C;
	--wp--preset--color--accent-4: #C2410C;   --wp--preset--color--accent-4-soft: #FFB199;
}

:root[data-palette="allotment"] {
	--wp--preset--color--base: #F8F8F1; --wp--preset--color--surface: #EAEBDD; --wp--preset--color--surface-strong: #DDDFCC;
	--wp--preset--color--white: #FFFFFF; --wp--preset--color--contrast: #1F2614; --wp--preset--color--muted: #434A35;
	--wp--preset--color--subtle: #686F58; --wp--preset--color--faint: #858976; --wp--preset--color--line: #E3E5D5;
	--wp--preset--color--accent-1: #3F7D20; --wp--preset--color--accent-1-soft: #B5DE8C;
	--wp--preset--color--accent-2: #9D174D;   --wp--preset--color--accent-2-soft: #EBA4C2;
	--wp--preset--color--accent-3: #C2410C;  --wp--preset--color--accent-3-soft: #FDBA74;
	--wp--preset--color--accent-4: #2563A8;   --wp--preset--color--accent-4-soft: #A8CBEF;
}

:root[data-palette="blueprint"] {
	--wp--preset--color--base: #F5F8FF; --wp--preset--color--surface: #E3EAFB; --wp--preset--color--surface-strong: #D2DCF5;
	--wp--preset--color--white: #FFFFFF; --wp--preset--color--contrast: #0B1F4D; --wp--preset--color--muted: #2D4373;
	--wp--preset--color--subtle: #546791; --wp--preset--color--faint: #7786A3; --wp--preset--color--line: #DCE4F7;
	--wp--preset--color--accent-1: #1D4ED8; --wp--preset--color--accent-1-soft: #93B4FA;
	--wp--preset--color--accent-2: #0369A1;   --wp--preset--color--accent-2-soft: #7DD3FC;
	--wp--preset--color--accent-3: #4338CA;  --wp--preset--color--accent-3-soft: #B4B9F8;
	--wp--preset--color--accent-4: #C2410C;   --wp--preset--color--accent-4-soft: #FDBA74;
}

:root[data-palette="retro"] {
	--wp--preset--color--base: #FBF5E9; --wp--preset--color--surface: #F1E6CF; --wp--preset--color--surface-strong: #E6D7B9;
	--wp--preset--color--white: #FFFDF8; --wp--preset--color--contrast: #2B1D10; --wp--preset--color--muted: #52402C;
	--wp--preset--color--subtle: #7A6650; --wp--preset--color--faint: #94856E; --wp--preset--color--line: #EADDC2;
	--wp--preset--color--accent-1: #B4400F; --wp--preset--color--accent-1-soft: #F4A66B;
	--wp--preset--color--accent-2: #5F6B12;   --wp--preset--color--accent-2-soft: #C9D27A;
	--wp--preset--color--accent-3: #8F6400;  --wp--preset--color--accent-3-soft: #F2C14E;
	--wp--preset--color--accent-4: #8C2F1C;   --wp--preset--color--accent-4-soft: #E59B85;
}

:root[data-palette="arcade"] {
	color-scheme: dark;
	--wp--preset--color--base: #0E0D16; --wp--preset--color--surface: #1A1826; --wp--preset--color--surface-strong: #2A2740;
	--wp--preset--color--white: #211F31; --wp--preset--color--contrast: #F6F5FF; --wp--preset--color--muted: #C9C6DD;
	--wp--preset--color--subtle: #9C98B5; --wp--preset--color--faint: #6E6A88; --wp--preset--color--line: #2D2A44;
	--wp--preset--color--accent-1: #FF7AC6; --wp--preset--color--accent-1-soft: #E03C9A;
	--wp--preset--color--accent-2: #5EEAD4;   --wp--preset--color--accent-2-soft: #14B8A6;
	--wp--preset--color--accent-3: #FDE047;  --wp--preset--color--accent-3-soft: #CA9A04;
	--wp--preset--color--accent-4: #B69CFF;   --wp--preset--color--accent-4-soft: #7C5CFF;
	--wp--custom--status--done: #BEF264; --wp--custom--status--done-bg: #26331C;
	--wp--custom--status--wait: #FCD34D; --wp--custom--status--wait-bg: #362B12;
	--wp--custom--status--info: #93C5FD; --wp--custom--status--info-bg: #1C2942;
}

/* Gentle cross-fade while the palette changes */
:root.is-repainting, :root.is-repainting * {
	transition: background-color .45s ease, color .45s ease, border-color .45s ease, fill .45s ease, stroke .45s ease !important;
}
@media (prefers-reduced-motion: reduce) {
	:root.is-repainting, :root.is-repainting * { transition: none !important; }
}

/* ---------- Palette switcher (header, core/html) ---------- */
.ftw-palette { position: relative; }
.ftw-palette__toggle {
	display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 10px;
	border: 1px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--white); color: var(--wp--preset--color--contrast);
	font: 500 0.875rem/1 var(--wp--preset--font-family--body); cursor: pointer;
}
.ftw-palette__toggle:hover { border-color: var(--wp--preset--color--faint); }
.ftw-palette__dots { display: inline-grid; grid-template-columns: repeat(2, 9px); gap: 2px; transition: transform .45s ease; }
.ftw-palette__dots i { width: 9px; height: 9px; border-radius: 50%; }
.ftw-palette__dots i:nth-child(1) { background: var(--wp--preset--color--accent-1-soft); }
.ftw-palette__dots i:nth-child(2) { background: var(--wp--preset--color--accent-2-soft); }
.ftw-palette__dots i:nth-child(3) { background: var(--wp--preset--color--accent-3-soft); }
.ftw-palette__dots i:nth-child(4) { background: var(--wp--preset--color--accent-4-soft); }
.ftw-palette__toggle:hover .ftw-palette__dots { transform: rotate(90deg); }

.ftw-palette__menu {
	position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
	width: min(300px, calc(100vw - 40px)); box-sizing: border-box; padding: 14px;
	border: 1px solid var(--wp--preset--color--line); border-radius: var(--wp--custom--radius--card);
	background: var(--wp--preset--color--white); box-shadow: 0 16px 40px rgba(0, 0, 0, .14);
}
.ftw-palette__menu[hidden] { display: none; }
.ftw-palette__title { margin: 0 0 10px; font-family: var(--wp--preset--font-family--heading); font-size: 1.125rem; }
.ftw-palette__list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ftw-palette__option {
	display: flex; flex-direction: column; gap: 6px; padding: 8px; min-height: 44px;
	border: 2px solid transparent; border-radius: 12px; background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast); font: 500 0.875rem/1.2 var(--wp--preset--font-family--body); text-align: left; cursor: pointer;
}
.ftw-palette__option:hover { border-color: var(--wp--preset--color--line); }
.ftw-palette__option[aria-checked="true"] { border-color: var(--wp--preset--color--contrast); }
.ftw-palette__swatch { display: flex; height: 22px; border-radius: 6px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.ftw-palette__swatch i { flex: 1; }
.ftw-palette__shuffle {
	width: 100%; min-height: 44px; margin-top: 10px; border: 0; border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base);
	font: 500 0.875rem/1 var(--wp--preset--font-family--body); cursor: pointer;
}
.ftw-header__actions { gap: 12px; }
@media (max-width: 599px) {
	.ftw-palette__menu { position: fixed; top: 76px; left: 16px; right: 16px; width: auto; }
}
