/* ==========================================================================
   Chamdon — Foundational layer (design tokens, fonts, RTL helpers).
   The token block below mirrors tailwind.config.js and keeps the component
   styles in layout.css / woocommerce.css / cafe.css working.
   ========================================================================== */

:root {
	/* Brand palette */
	--ch-wine: #721224;
	--ch-wine-deep: #500012;
	--ch-wine-soft: #881337;
	--ch-wine-tint: #f7e9ea;
	--ch-amber: #c88a3e;
	--ch-amber-deep: #b45309;
	--ch-amber-soft: #feb968;
	--ch-amber-tint: #fdf1e2;
	--ch-noir: #1a0d0f;
	--ch-noir-2: #2a171a;
	--ch-cream: #faf6f0;
	--ch-cream-2: #f5efeb;
	--ch-cream-3: #ede4da;
	--ch-white: #ffffff;
	--ch-ink: #1c1c18;
	--ch-ink-soft: #564242;
	--ch-muted: #897172;
	--ch-on-dark: #faf6f0;
	--ch-on-dark-soft: rgba(250, 246, 240, 0.62);
	--ch-danger: #b32d2e;

	/* Lines */
	--ch-line: rgba(114, 18, 36, 0.1);
	--ch-line-strong: rgba(114, 18, 36, 0.18);
	--ch-line-amber: rgba(200, 138, 62, 0.3);
	--ch-line-dark: rgba(200, 138, 62, 0.18);

	/* Radii */
	--ch-r-xs: 6px;
	--ch-r-sm: 8px;
	--ch-r-md: 12px;
	--ch-r-lg: 16px;
	--ch-r-xl: 24px;
	--ch-r-pill: 999px;

	/* Elevation */
	--ch-shadow-sm: 0 2px 8px -2px rgba(88, 14, 29, 0.08), 0 1px 2px rgba(26, 13, 15, 0.04);
	--ch-shadow-md: 0 12px 32px -4px rgba(88, 14, 29, 0.08), 0 4px 12px -2px rgba(26, 13, 15, 0.04);
	--ch-shadow-lg: 0 24px 60px -18px rgba(88, 14, 29, 0.22), 0 8px 24px -12px rgba(26, 13, 15, 0.12);

	/* Type */
	--ch-font-body: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
	--ch-font-latin: "Epilogue", "Vazirmatn", sans-serif;
	--ch-font-mono: "Space Grotesk", "Vazirmatn", monospace;
	--ch-fs-h1: clamp(1.9rem, 1.35rem + 2.1vw, 2.9rem);

	/* Layout rhythm */
	--ch-header-h: 76px;
	--ch-gutter: clamp(1.25rem, 0.8rem + 1.6vw, 3rem);
	--ch-margin: 0;
	--ch-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

@font-face {
	font-family: "Vazirmatn";
	src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Vazirmatn";
	src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2");
	font-weight: 500 600;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Vazirmatn";
	src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2");
	font-weight: 700 900;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Epilogue";
	src: url("../fonts/Epilogue-Variable.woff2") format("woff2");
	font-weight: 300 800;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Space Grotesk";
	src: url("../fonts/SpaceGrotesk-Variable.woff2") format("woff2");
	font-weight: 300 700;
	font-style: normal;
	font-display: swap;
}

*, *::before, *::after { box-sizing: border-box; }

:focus-visible { outline: 2px solid #c88a3e; outline-offset: 3px; }

::selection { background: #721224; color: #faf6f0; }

body.ch-no-scroll { overflow: hidden; }

.ch-sr-only {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.ch-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ch-placeholder { width: 100%; height: 100%; }

.ch-grain::after {
	content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.3;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
	mix-blend-mode: multiply;
}

.ch-reveal {
	opacity: 0; transform: translateY(22px);
	transition: opacity 0.7s ease, transform 0.7s ease;
}
.ch-reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	.ch-reveal { opacity: 1; transform: none; transition: none; }
}

html { scroll-behavior: smooth; scroll-padding-top: 110px; }

/* ==========================================================================
   Mobile overflow hardening
   --------------------------------------------------------------------------
   Several templates rely on utility grids whose implicit column is sized to
   max-content. A single nowrap child (a filter strip, a search input, a long
   unbroken string) then widens the column past the viewport and the whole page
   scrolls sideways on phones. These rules keep every grid/flex child shrinkable
   and clip any residual overflow without turning <body> into a scroll container
   (which would break the sticky header).
   ========================================================================== */
body {
	overflow-x: clip;
}

@supports not (overflow: clip) {
	body {
		overflow-x: hidden;
	}
}

img,
svg,
video,
iframe {
	max-width: 100%;
}

/* Grid and flex children must be allowed to shrink below their content width. */
.ch-main :is(.grid, .flex) > * {
	min-width: 0;
}

/* Long unbroken strings (URLs, emails, codes) should wrap instead of pushing. */
.ch-main p,
.ch-main li,
.ch-main dd,
.ch-main address {
	overflow-wrap: break-word;
}

/* WordPress core search widget (used in the journal sidebar). */
.wp-block-search__inside-wrapper {
	display: flex;
	flex-wrap: nowrap;
	min-width: 0;
	max-width: 100%;
}

.wp-block-search__input {
	min-width: 0;
	flex: 1 1 auto;
	width: 100%;
	padding: 0.55rem 0.85rem;
	border: 1px solid var(--ch-line, #e6dcd0);
	border-radius: 999px 0 0 999px;
	background: #fff;
	font-size: 0.8125rem;
}

html[dir="rtl"] .wp-block-search__input {
	border-radius: 0 999px 999px 0;
}

.wp-block-search__button {
	flex: 0 0 auto;
	margin: 0;
	padding: 0.55rem 1rem;
	border: 0;
	border-radius: 0 999px 999px 0;
	background: var(--ch-wine, #721224);
	color: var(--ch-cream, #faf6f0);
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.6;
	white-space: nowrap;
}

html[dir="rtl"] .wp-block-search__button {
	border-radius: 999px 0 0 999px;
}

.wp-block-search__label {
	display: block;
	margin-bottom: 0.5rem;
	font-size: 0.8125rem;
	font-weight: 700;
	color: var(--ch-noir, #1a0d0f);
}

/* Horizontal pill strips should never widen their parent. */
[data-ch-cafe-filter],
[data-ch-days],
[data-ch-filter-group] {
	max-width: 100%;
	min-width: 0;
	overscroll-behavior-x: contain;
}
