/*
 * OalChoudhary design tokens: semantic and component layers.
 *
 * Layer 1 (primitives) lives in theme.json -> --wp--preset--color--olive-700 etc.
 * Layer 2 (semantic) and layer 3 (component) live here and only ever point at layer 1.
 * Rebrand = change the palette in theme.json (and the brand mapping below if the
 * main hue changes). Templates and Tailwind classes use semantic names only.
 */

:root {
	/* ---- Semantic colour ---- */
	--oc-color-bg: var(--wp--preset--color--neutral-50);
	--oc-color-surface: var(--wp--preset--color--neutral-0);
	--oc-color-surface-alt: var(--wp--preset--color--olive-50);
	--oc-color-text: var(--wp--preset--color--soil-900); /* warm brown body text */
	--oc-color-text-muted: var(--wp--preset--color--soil-700);
	--oc-color-heading: var(--oc-color-brand); /* section titles in brand olive */
	--oc-color-dark: var(--wp--preset--color--olive-900); /* hero, footer bands */
	--oc-color-on-dark: var(--wp--preset--color--neutral-0);
	--oc-color-border: var(--wp--preset--color--neutral-200);
	--oc-color-brand: var(--wp--preset--color--olive-700);
	--oc-color-brand-strong: var(--wp--preset--color--olive-800);
	--oc-color-brand-soft: var(--wp--preset--color--olive-100);
	--oc-color-on-brand: var(--wp--preset--color--neutral-0);
	--oc-color-accent: var(--wp--preset--color--soil-600);
	--oc-color-accent-soft: var(--wp--preset--color--soil-100);
	--oc-color-info: var(--wp--preset--color--teal-700);
	--oc-color-link: var(--wp--preset--color--teal-700);
	--oc-color-focus: var(--wp--preset--color--teal-500);
	--oc-color-cta-whatsapp: var(--wp--preset--color--whatsapp);
	--oc-color-on-whatsapp: var(--wp--preset--color--whatsapp-ink);
	--oc-color-success: var(--wp--preset--color--success);
	--oc-color-warning: var(--wp--preset--color--warning);
	--oc-color-danger: var(--wp--preset--color--danger);
	--oc-color-award: #c9a227;

	/* ---- Typography (English defaults; overridden per language below) ---- */
	--oc-font-heading: "Hind", system-ui, sans-serif; /* one humanist family for every script */
	--oc-font-body: "Hind", system-ui, sans-serif;
	--oc-size-body: 1.0625rem; /* 17px */
	--oc-leading-body: 1.6;
	--oc-leading-heading: 1.15;
	--oc-weight-regular: 400;
	--oc-weight-medium: 500;
	--oc-weight-bold: 700;

	/* ---- Shape, depth, motion (from theme.json custom) ---- */
	--oc-radius-sm: var(--wp--custom--radius--sm);
	--oc-radius-md: var(--wp--custom--radius--md);
	--oc-radius-lg: var(--wp--custom--radius--lg);
	--oc-radius-xl: var(--wp--custom--radius--xl);
	--oc-radius-pill: var(--wp--custom--radius--pill);
	--oc-shadow-sm: var(--wp--preset--shadow--sm);
	--oc-shadow-md: var(--wp--preset--shadow--md);
	--oc-shadow-lg: var(--wp--preset--shadow--lg);
	--oc-dur-fast: var(--wp--custom--motion--fast);
	--oc-dur-base: var(--wp--custom--motion--base);
	--oc-dur-slow: var(--wp--custom--motion--slow);
	--oc-ease: var(--wp--custom--motion--ease);
	--oc-touch: var(--wp--custom--touch--min);

	/* ---- Component tokens ---- */
	--oc-bottombar-h: var(--wp--custom--bottombar--height);
	--oc-bottombar-bg: var(--oc-color-surface);
	--oc-bottombar-ink: var(--oc-color-text-muted);
	--oc-bottombar-active: var(--oc-color-brand);
	--oc-header-bg: var(--oc-color-brand-strong);
	--oc-header-ink: var(--oc-color-on-brand);
	--oc-card-bg: var(--oc-color-surface);
	--oc-card-radius: 0; /* square, editorial */
	--oc-card-shadow: none;
	--oc-btn-radius: 0;
	--oc-badge-radius: 0;
	--oc-input-radius: var(--oc-radius-sm);
	--oc-section-pad: clamp(3rem, 7vw, 6rem);
	--oc-z-header: var(--wp--custom--z--header);
	--oc-z-bottombar: var(--wp--custom--z--bottombar);
	--oc-z-sheet: var(--wp--custom--z--sheet);
	--oc-z-dialog: var(--wp--custom--z--dialog);
}

/* ---- Per-language type: one family (Hind), sized for each script ---- */
:lang(hi) {
	--oc-font-heading: "Hind", "Noto Sans Devanagari", sans-serif;
	--oc-font-body: "Hind", "Noto Sans Devanagari", sans-serif;
	--oc-size-body: 1.125rem; /* 18px */
	--oc-leading-body: 1.75;
	--oc-leading-heading: 1.3;
}
:lang(te) {
	--oc-font-heading: "Hind Guntur", "Noto Sans Telugu", sans-serif;
	--oc-font-body: "Hind Guntur", "Noto Sans Telugu", sans-serif;
	--oc-size-body: 1.125rem;
	--oc-leading-body: 1.8;
	--oc-leading-heading: 1.4;
}
:lang(ta) {
	--oc-font-heading: "Hind Madurai", "Noto Sans Tamil", sans-serif;
	--oc-font-body: "Hind Madurai", "Noto Sans Tamil", sans-serif;
	--oc-size-body: 1.0625rem; /* Tamil words run long */
	--oc-leading-body: 1.8;
	--oc-leading-heading: 1.4;
}
/* Apply the script's font where a lang attribute switches language mid-page
   (language names, crop glossary on English pages). Zero specificity, so
   heading rules still win on h1-h4. */
:where([lang|="hi"], [lang|="te"], [lang|="ta"]) {
	font-family: var(--oc-font-body);
	line-height: var(--oc-leading-body);
}
/* Never letter-space or uppercase Indic text */
:lang(hi) *, :lang(te) *, :lang(ta) * { letter-spacing: normal; }

@media (prefers-reduced-motion: reduce) {
	:root { --oc-dur-fast: 0ms; --oc-dur-base: 0ms; --oc-dur-slow: 0ms; }
}
