/* ==========================================================================
   LAYOUT — containers, sections, grids, stacks, responsive utilities
   Breakpoints: base 360–767 · tablet ≥768 · desktop ≥1024 · large ≥1440
   Nav switches to the hamburger below 1200px (see site.css).
   ========================================================================== */

/* ---- Containers ---------------------------------------------------------- */
.wrap {
	width: min(100% - 2 * var(--gutter), var(--container));
	margin-inline: auto;
}

/* Modifiers are self-sufficient (they centre themselves) so they also work without the base .wrap class. */
.wrap--wide {
	width: min(100% - 2 * var(--gutter), 1560px);
	margin-inline: auto;
}

.wrap--narrow {
	width: min(100% - 2 * var(--gutter), var(--container-narrow));
	margin-inline: auto;
}

.wrap--text {
	width: min(100% - 2 * var(--gutter), var(--container-text));
	margin-inline: auto;
}

.wrap--full {
	width: 100%;
	margin-inline: 0;
}

/* ---- Sections ------------------------------------------------------------ */
.tone-dark,
.tone-charcoal,
.tone-ivory {
	background-color: var(--bg);
	color: var(--fg);
}

.tone-saffron {
	background: linear-gradient(135deg, var(--saffron) 0%, var(--saffron-mid) 100%);
	color: var(--fg);
}

.section {
	position: relative;
	padding-block: var(--section-y);
	background-color: var(--bg);
	color: var(--fg);
	isolation: isolate;
}

.section--sm {
	padding-block: calc(var(--section-y) * 0.6);
}

.section--lg {
	padding-block: calc(var(--section-y) * 1.25);
}

.section--flush {
	padding-block: 0;
}

.section--flush-top {
	padding-top: 0;
}

.section--flush-bottom {
	padding-bottom: 0;
}

.section--clip {
	overflow: clip;
}

/* Decorative layers that sit behind section content */
.section__bg {
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	overflow: hidden;
}

/* Subtle saffron light from a corner/edge (Sacred Monumental Modernism: saffron behaves like light) */
.glow {
	position: absolute;
	z-index: -1;
	pointer-events: none;
	width: min(70vw, 900px);
	aspect-ratio: 1;
	border-radius: 50%;
	background: radial-gradient(closest-side, rgba(244, 122, 31, 0.28), rgba(244, 122, 31, 0.08) 55%, transparent 75%);
	filter: blur(10px);
}

.glow--tr {
	top: -20%;
	right: -15%;
}

.glow--tl {
	top: -20%;
	left: -15%;
}

.glow--br {
	bottom: -25%;
	right: -15%;
}

.glow--bl {
	bottom: -25%;
	left: -15%;
}

.glow--center {
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
}

.glow--gold {
	background: radial-gradient(closest-side, rgba(217, 164, 65, 0.22), rgba(217, 164, 65, 0.06) 55%, transparent 75%);
}

/* Very light stone/grain overlay (2–5%); use on dark hero/CTA surfaces only */
.grain {
	position: relative;
}

.grain::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background-image: url('../img/noise.svg');
	background-size: 220px 220px;
	opacity: 0.06;
	mix-blend-mode: overlay;
}

/* Faint sacred-geometry lattice */
.pattern-jali::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-image: url('../img/pattern-jali.svg');
	background-size: 160px 160px;
	opacity: 0.5;
	-webkit-mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
	mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
}

/* ---- Grids --------------------------------------------------------------- */
.grid {
	display: grid;
	gap: var(--gap);
}

.grid--2,
.grid--3,
.grid--4,
.grid--5 {
	grid-template-columns: 1fr;
}

.grid--gap-sm {
	gap: calc(var(--gap) * 0.5);
}

.grid--gap-lg {
	gap: calc(var(--gap) * 1.6);
}

.grid--align-center {
	align-items: center;
}

.grid--align-start {
	align-items: start;
}

.grid--align-stretch {
	align-items: stretch;
}

@media (min-width: 560px) {
	.grid--4,
	.grid--5 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 768px) {
	.grid--2 {
		grid-template-columns: repeat(2, 1fr);
	}
	.grid--3 {
		grid-template-columns: repeat(2, 1fr);
	}
	.grid--4 {
		grid-template-columns: repeat(2, 1fr);
	}
	.grid--5 {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (min-width: 1024px) {
	.grid--3 {
		grid-template-columns: repeat(3, 1fr);
	}
	.grid--4 {
		grid-template-columns: repeat(4, 1fr);
	}
	.grid--5 {
		grid-template-columns: repeat(5, 1fr);
	}
}

/* Auto-fit cards: --min controls the minimum card width */
.grid--auto {
	grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 260px)), 1fr));
}

/* 12-column editorial grid: 4 cols mobile / 8 tablet / 12 desktop.
   Children stack by default; .col-N spans N of 12 from 1024px, .tcol-N spans N of 8 from 768px. */
.grid-12 {
	display: grid;
	gap: var(--gap);
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-12 > * {
	grid-column: 1 / -1;
	min-width: 0;
}

@media (min-width: 768px) {
	.grid-12 {
		grid-template-columns: repeat(8, minmax(0, 1fr));
	}
	.tcol-2 { grid-column: span 2; }
	.tcol-3 { grid-column: span 3; }
	.tcol-4 { grid-column: span 4; }
	.tcol-5 { grid-column: span 5; }
	.tcol-6 { grid-column: span 6; }
	.tcol-8 { grid-column: 1 / -1; }
}

@media (min-width: 1024px) {
	.grid-12 {
		grid-template-columns: repeat(12, minmax(0, 1fr));
	}
	/* `.col-N` spans N columns (auto-placed). `.col-start-N` pins the start and re-uses the span from --col-span,
	   so `class="col-7 col-start-2"` composes (start 2, span 7). */
	.col-1 { grid-column: span 1; --col-span: 1; }
	.col-2 { grid-column: span 2; --col-span: 2; }
	.col-3 { grid-column: span 3; --col-span: 3; }
	.col-4 { grid-column: span 4; --col-span: 4; }
	.col-5 { grid-column: span 5; --col-span: 5; }
	.col-6 { grid-column: span 6; --col-span: 6; }
	.col-7 { grid-column: span 7; --col-span: 7; }
	.col-8 { grid-column: span 8; --col-span: 8; }
	.col-9 { grid-column: span 9; --col-span: 9; }
	.col-10 { grid-column: span 10; --col-span: 10; }
	.col-11 { grid-column: span 11; --col-span: 11; }
	.col-12 { grid-column: 1 / -1; --col-span: 12; }
	.col-start-2 { grid-column: 2 / span var(--col-span, 1); }
	.col-start-3 { grid-column: 3 / span var(--col-span, 1); }
	.col-start-6 { grid-column: 6 / span var(--col-span, 1); }
	.col-start-7 { grid-column: 7 / span var(--col-span, 1); }
	.col-start-8 { grid-column: 8 / span var(--col-span, 1); }
	.col-start-9 { grid-column: 9 / span var(--col-span, 1); }
	.row-span-2 { grid-row: span 2; }
	.self-center { align-self: center; }
	.self-start { align-self: start; }
	.self-end { align-self: end; }
	/* Make one column's media a little taller than its neighbour's text */
	.col-bleed-right { margin-right: calc((100vw - min(100vw - 2 * var(--gutter), var(--container))) / -2); }
	.col-bleed-left { margin-left: calc((100vw - min(100vw - 2 * var(--gutter), var(--container))) / -2); }
}

/* Mobile order helpers: image first, then copy */
@media (max-width: 1023px) {
	.order-first-mobile { order: -1; }
	.order-last-mobile { order: 99; }
}

/* ---- Stacks / clusters ----------------------------------------------------- */
.stack {
	display: flex;
	flex-direction: column;
	gap: var(--stack-gap, 1rem);
}

.stack--xs { --stack-gap: 0.4rem; }
.stack--sm { --stack-gap: 0.75rem; }
.stack--lg { --stack-gap: 1.75rem; }
.stack--xl { --stack-gap: 2.75rem; }

.stack > * {
	margin-block: 0;
}

.cluster {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--cluster-gap, 1rem);
}

.cluster--sm { --cluster-gap: 0.5rem; }
.cluster--lg { --cluster-gap: 1.5rem; }
.cluster--center { justify-content: center; }
.cluster--between { justify-content: space-between; }
.cluster--end { justify-content: flex-end; }

.center-x {
	margin-inline: auto;
}

.measure {
	max-width: var(--container-text);
}

.measure--wide {
	max-width: 62rem;
}

/* ---- Responsive visibility ------------------------------------------------- */
.hide-mobile { display: none !important; }
.show-mobile { display: initial; }

@media (min-width: 768px) {
	.hide-mobile { display: revert !important; }
	.show-mobile { display: none !important; }
	.hide-tablet-up { display: none !important; }
}

@media (max-width: 1023px) {
	.hide-below-desktop { display: none !important; }
}

@media (min-width: 1024px) {
	.hide-desktop { display: none !important; }
}

/* ---- Misc layout utilities ------------------------------------------------- */
.relative { position: relative; }
.overflow-clip { overflow: clip; }
.overflow-hidden { overflow: hidden; }
.z-1 { position: relative; z-index: 1; }
.z-2 { position: relative; z-index: 2; }

.sticky-top {
	position: sticky;
	top: calc(var(--header-h) + 24px);
}

@media (max-width: 1023px) {
	.sticky-top { position: static; }
}

.full-bleed {
	width: 100vw;
	margin-left: calc(50% - 50vw);
}

.aspect-16x9 { aspect-ratio: 16 / 9; }
.aspect-4x3 { aspect-ratio: 4 / 3; }
.aspect-3x4 { aspect-ratio: 3 / 4; }
.aspect-1x1 { aspect-ratio: 1; }

.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-sm { margin-top: 1rem; }
.mt-md { margin-top: 2rem; }
.mt-lg { margin-top: 3.5rem; }
.mb-sm { margin-bottom: 1rem; }
.mb-md { margin-bottom: 2rem; }
.mb-lg { margin-bottom: 3.5rem; }

/* ---- Rail: swipeable snap cards on mobile → grid from tablet ---------------------
   <div class="rail" style="--rail-cols:2; --rail-cols-lg:4"> children… </div>        */
.rail,
.rail--scroll {
	position: relative; /* containing block for absolute descendants, so they are clipped with the scroller */
}

.rail {
	display: flex;
	gap: var(--gap);
	margin-inline: calc(var(--gutter) * -1);
	padding: 0.25rem var(--gutter) 1rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-padding-inline: var(--gutter);
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.rail::-webkit-scrollbar {
	display: none;
}

.rail > * {
	flex: 0 0 min(82%, 340px);
	min-width: 0;
	scroll-snap-align: start;
}

@media (min-width: 768px) {
	.rail {
		display: grid;
		grid-template-columns: repeat(var(--rail-cols, 2), minmax(0, 1fr));
		margin-inline: 0;
		padding: 0;
		overflow: visible;
	}
	.rail > * {
		flex: initial;
	}
}

@media (min-width: 1024px) {
	.rail {
		grid-template-columns: repeat(var(--rail-cols-lg, 4), minmax(0, 1fr));
	}
}

/* Always-horizontal rail (editorial "From the Field" strip): snap scroll at every width */
.rail--scroll {
	display: flex;
	margin-inline: calc(var(--gutter) * -1);
	padding: 0.25rem var(--gutter) 1rem;
	overflow-x: auto;
}

.rail--scroll > * {
	flex: 0 0 min(86%, 420px);
}

@media (min-width: 768px) {
	.rail--scroll {
		display: flex;
		overflow-x: auto;
		margin-inline: calc(var(--gutter) * -1);
		padding: 0.25rem var(--gutter) 1rem;
	}
	.rail--scroll > * {
		flex: 0 0 min(46%, 440px);
	}
}

/* ---- Display type helpers ---------------------------------------------------------- */
.display {
	margin: 0;
	font-family: var(--font-display);
	font-size: var(--fs-hero);
	line-height: 1.02;
	letter-spacing: var(--tracking-display);
	text-wrap: balance;
}

.display--md {
	font-size: clamp(2.5rem, 1.5rem + 4.2vw, 5rem);
}

.display--sm {
	font-size: var(--fs-h2);
	line-height: 1.05;
	letter-spacing: -0.02em;
}

/* Oversized opening word (Mission manifesto) */
.dropword {
	display: block;
	margin-bottom: 0.2em;
	color: var(--accent);
	font-family: var(--font-display);
	font-size: clamp(3.5rem, 2rem + 8vw, 8rem);
	line-height: 0.95;
	letter-spacing: -0.03em;
}

.body-lg {
	font-size: var(--fs-lg);
	line-height: 1.6;
}
