/* ==========================================================================
   3 · LAYOUT — a few pieces reused by every section.
   Use the same pieces everywhere; avoid section-specific classes.
   ========================================================================== */

/* Page width + side padding */
.container {
	width: 100%;
	max-width: calc(var(--content-max) + 2 * var(--space-gutter));
	margin-inline: auto;
	padding-inline: var(--space-gutter);
}

/* A full-width band. Background is set with data-bg (from the section's Background field). */
.section {
	padding-block: var(--space-section);
	background: var(--bg);
	color: var(--fg);
}

/* Background contexts: change the context colors, and every component inside follows. */
[data-bg="cream"] { --bg: var(--cream); --surface: var(--white); }
[data-bg="white"] { --bg: var(--white); --surface: var(--white); }
[data-bg="sand"]  { --bg: var(--sand); --surface: var(--white); --border: var(--sand-line); }
[data-bg="navy"] {
	--bg: var(--navy);
	--fg: var(--on-dark);
	--fg-muted: var(--on-dark-muted);
	--fg-subtle: var(--on-dark-muted);
	--heading: var(--white);
	--accent: var(--on-dark-accent);
	--link: var(--on-dark-accent);
	--border: rgba(255, 255, 255, 0.16);
	--surface: rgba(255, 255, 255, 0.06);
}
[data-bg="teal"] {
	--bg: var(--teal);
	--fg: var(--on-teal);
	--fg-muted: var(--on-teal);
	--heading: var(--white);
	--accent: var(--white);
	--link: var(--white);
	--border: rgba(255, 255, 255, 0.2);
}

/* Two neighboring sections with the same background get a 1px line between them. */
[data-bg="cream"] + [data-bg="cream"],
[data-bg="white"] + [data-bg="white"],
[data-bg="sand"] + [data-bg="sand"] {
	border-top: 1px solid var(--border);
}

/* Vertical rhythm: children spaced with gap. Change spacing with --stack-gap. */
.stack {
	display: flex;
	flex-direction: column;
	gap: var(--stack-gap, var(--space-4));
}
.stack--lg { --stack-gap: var(--space-6); }
.stack--sm { --stack-gap: var(--space-2); }

/* Row of items that wraps (buttons, chips, icons + text) */
.cluster {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--cluster-gap, var(--space-3));
}

/* Cards that wrap: 1 column on phones, more as space allows.
   Set the smallest card width with --grid-min (default 240px). */
.grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--grid-min, 240px)), 1fr));
	gap: var(--space-grid);
}
/* Fixed column counts that stay "full" (no lonely card): 1 → 2 → N */
.grid--2,
.grid--3,
.grid--4 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
	.grid--2,
	.grid--3,
	.grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
	.grid--3 { grid-template-columns: repeat(3, 1fr); }
	.grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* Image + text side by side from tablet up. Add .split--reverse to swap sides. */
.split {
	display: grid;
	gap: var(--space-columns);
	align-items: center;
}
@media (min-width: 768px) {
	.split { grid-template-columns: 1fr 1fr; }
	.split--reverse > :first-child { order: 2; }
}

/* Section heading block: eyebrow + headline + intro, then 48px before content */
.section-head {
	margin-bottom: var(--space-head);
}
/* Left-aligned heads use the full content width; centered heads stay a readable block. */
.section-head--center {
	max-width: 50rem;
	margin-inline: auto;
	text-align: center;
}

/* Heading block (label + headline + intro): fixed spacing, not inherited from the section */
.head-block { --stack-gap: 1.1rem; }
