/**
 * Chaya Suite — shared front-end tokens and base.
 *
 * Every front-end component lives under .chaya and reads these tokens. Light by
 * default; dark when the visitor's system asks for it (data-theme="auto") or
 * when a shortcode forces it (data-theme="dark").
 *
 * Palette from the live site: teal #004643, rose #d56688, sage #e1e6e0,
 * mauve #b48198, ink #0b1f1d. Headings follow the theme (Trirong).
 *
 * Contrast (checked at token time): ink on surface 19:1; ink-2 on surface
 * 7.4:1; rose-deep on paper 6:1; white on teal 10:1. Dark: ink 15:1,
 * ink-2 8:1, dark teal ink on rose 6.5:1.
 *
 * Flatsome styles bare elements (button, select, label, ul, h1–h6)
 * aggressively, so components reset what they use with scoped classes rather
 * than !important.
 */

.chaya {
	--chaya-teal: #004643;
	--chaya-rose: #d56688;
	--chaya-rose-deep: #a23a5c;
	--chaya-mauve: #8a5a72;
	--chaya-sage: #c0c1c4;

	--chaya-ink: #0b1f1d;
	--chaya-ink-2: #44534f;
	--chaya-surface: #ffffff;
	--chaya-paper: #f3f5f1;
	--chaya-paper-2: #e6ebe4;
	--chaya-line: #d9e0d7;
	--chaya-line-strong: #b9c5b7;

	--chaya-accent: var(--chaya-teal);
	--chaya-accent-ink: #ffffff;
	--chaya-heading: var(--chaya-teal);
	--chaya-focus: 0 0 0 2px var(--chaya-surface), 0 0 0 4px var(--chaya-rose);

	--chaya-radius: 12px;
	--chaya-radius-sm: 8px;
	--chaya-radius-pill: 999px;
	--chaya-shadow-1: 0 1px 2px rgba(0, 70, 67, .06);
	--chaya-shadow-2: 0 1px 2px rgba(0, 70, 67, .05), 0 10px 28px rgba(0, 70, 67, .10);

	--chaya-s1: 4px;
	--chaya-s2: 8px;
	--chaya-s3: 12px;
	--chaya-s4: 16px;
	--chaya-s5: 24px;
	--chaya-s6: 32px;
	--chaya-s7: 48px;

	--chaya-text-sm: .8125rem;
	--chaya-text-base: 1rem;
	--chaya-text-lg: 1.25rem;
	--chaya-text-xl: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem);

	color: var(--chaya-ink);
	color-scheme: light;
	font-size: var(--chaya-text-base);
	line-height: 1.55;
	box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
	.chaya[data-theme="auto"] {
		--chaya-teal: #bfe0db;
		--chaya-rose-deep: #f0a9c0;
		--chaya-ink: #eef4f2;
		--chaya-ink-2: #a9bdb8;
		--chaya-surface: #071816;
		--chaya-paper: #0e2522;
		--chaya-paper-2: #143330;
		--chaya-line: #24423e;
		--chaya-line-strong: #355a55;
		--chaya-accent: #d56688;
		--chaya-accent-ink: #071816;
		--chaya-heading: #eef4f2;
		--chaya-shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
		--chaya-shadow-2: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px rgba(0, 0, 0, .45);
		color-scheme: dark;
	}
}

.chaya[data-theme="dark"] {
	--chaya-teal: #bfe0db;
	--chaya-rose-deep: #f0a9c0;
	--chaya-ink: #eef4f2;
	--chaya-ink-2: #a9bdb8;
	--chaya-surface: #071816;
	--chaya-paper: #0e2522;
	--chaya-paper-2: #143330;
	--chaya-line: #24423e;
	--chaya-line-strong: #355a55;
	--chaya-accent: #d56688;
	--chaya-accent-ink: #071816;
	--chaya-heading: #eef4f2;
	--chaya-shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
	--chaya-shadow-2: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px rgba(0, 0, 0, .45);
	color-scheme: dark;
}

.chaya *,
.chaya *::before,
.chaya *::after {
	box-sizing: inherit;
}

/* Components set display: grid/flex, which would otherwise beat the hidden attribute. */
.chaya [hidden] {
	display: none !important;
}

.chaya .chaya-icon {
	width: 1.25em;
	height: 1.25em;
	flex: none;
	vertical-align: -.25em;
}

/* Visually hidden but focusable — radios inside card and pill controls. */
.chaya .chaya-sr,
.chaya .chaya-choice__input,
.chaya .chaya-pill input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
	opacity: 0;
}

/* ---------------------------------------------------------------- buttons */

.chaya .chaya-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--chaya-s2);
	min-height: 44px;
	margin: 0;
	padding: 0 var(--chaya-s5);
	border: 1.5px solid var(--chaya-accent);
	border-radius: var(--chaya-radius-pill);
	background: var(--chaya-accent);
	color: var(--chaya-accent-ink);
	font: inherit;
	font-size: .9375rem;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: none;
	transition: background-color .15s ease-out, color .15s ease-out, border-color .15s ease-out, transform .15s ease-out;
}

.chaya .chaya-btn:hover {
	background: color-mix(in srgb, var(--chaya-accent) 86%, var(--chaya-ink));
	border-color: color-mix(in srgb, var(--chaya-accent) 86%, var(--chaya-ink));
	color: var(--chaya-accent-ink);
}

.chaya .chaya-btn:active {
	transform: translateY(1px);
}

.chaya .chaya-btn--ghost {
	background: transparent;
	color: var(--chaya-heading);
	border-color: var(--chaya-line-strong);
}

.chaya .chaya-btn--ghost:hover {
	background: var(--chaya-paper);
	border-color: var(--chaya-heading);
	color: var(--chaya-heading);
}

.chaya .chaya-btn--small {
	min-height: 40px;
	padding: 0 var(--chaya-s4);
	font-size: .875rem;
}

.chaya .chaya-btn[disabled],
.chaya .chaya-btn[aria-disabled="true"] {
	opacity: .55;
	cursor: not-allowed;
}

.chaya .chaya-link {
	display: inline-flex;
	align-items: center;
	gap: var(--chaya-s1);
	color: var(--chaya-heading);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: var(--chaya-rose);
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

.chaya .chaya-link:hover {
	color: var(--chaya-rose-deep);
}

.chaya a:focus-visible,
.chaya button:focus-visible,
.chaya select:focus-visible,
.chaya input:focus-visible + .chaya-choice__card,
.chaya .chaya-pill input:focus-visible + span {
	outline: none;
	box-shadow: var(--chaya-focus);
}

.chaya .chaya-note {
	margin: 0 0 var(--chaya-s4);
	padding: var(--chaya-s3) var(--chaya-s4);
	border-left: 3px solid var(--chaya-rose);
	border-radius: 0 var(--chaya-radius-sm) var(--chaya-radius-sm) 0;
	background: var(--chaya-paper);
	color: var(--chaya-ink);
	font-size: .9375rem;
}

@media (prefers-reduced-motion: reduce) {
	.chaya *,
	.chaya *::before,
	.chaya *::after {
		transition-duration: .01ms !important; /* user preference outranks every component transition */
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
	}
}
