/* ==========================================================================
   LAYOUT (CVI §4)
   --------------------------------------------------------------------------
   The global layout primitives. Only what the CVI actually defines lives here;
   section-specific layout belongs to its component.
   ========================================================================== */

/* --------------------------------------------------------------------------
   CONTAINER

   The horizontal padding resolves through --page-gutter, which steps
   24px → 40px → 64px across the CVI §18 breakpoints. The gutter is inside the
   max-width, matching the CVI's header/footer spec (§7.2, §9): 1440px wide with
   64px padding, giving a 1312px content area on desktop.
   -------------------------------------------------------------------------- */

.container {
	width: 100%;
	max-width: var(--max-width);
	margin-inline: auto;
	padding-inline: var(--page-gutter);
}

/* --------------------------------------------------------------------------
   CONTAINER MODES

   One primitive with three maxima. A section picks the mode that suits what is
   in it — see docs/layout-system.md — and a full-bleed surface is a separate
   idea again: the surface is the element that spans the viewport, and one of
   these sits inside it.

   All three are identical at and below 1440. Only --page-gutter-wide grows
   after that, so the wide mode is something that happens above the design's
   own artboard width rather than a change to it.
   -------------------------------------------------------------------------- */

.container--wide {
	max-width: calc(var(--container-wide) + var(--page-gutter-wide) * 2);
	padding-inline: var(--page-gutter-wide);
}

/*
 * The first screen — header bar and homepage hero — on very large displays.
 * Up to 1920 it is the wide container. Above that the side margin stops being
 * a fixed 96px and becomes a share of the screen (4.5%, about the Figma
 * frame's 64px at 1440), so on a 24–27" monitor the hero is no longer a 1728px
 * strip in the middle of a 2560px screen (usertest 31.10, finding 1). Header
 * and hero share it so the logo stays aligned with the hero heading.
 *
 * The rail stops at 2352px (from a ~2614px screen up): the hero's contents
 * grow with the rail only up to 1.6x the frame (front-page.css), and a wider
 * rail would again only widen the gap between the copy and the card — on a
 * 3440 ultra-wide or a 4K screen at 100% the two ended up 2200–2570px apart.
 */
@media (min-width: 1921px) {
	/* Homepage only: the header follows the hero there. On every other page
	   the header stays on the content's own rail, so the logo lines up with
	   the page below it (audit 01.11, A2a-09: at 2240 the logo sat 155px
	   left of the catalogue it heads). */
	.home .container--first-screen {
		max-width: none;
		padding-inline: max(var(--page-gutter-wide), 4.5vw, (100vw - 2352px) / 2);
	}
}

.container--narrow {
	max-width: calc(var(--container-narrow) + var(--page-gutter) * 2);
}

/* --------------------------------------------------------------------------
   12-COLUMN GRID

   Transcribed from CVI §4. Column spans are a component concern — a component
   places its children with grid-column and decides how they reflow, so no
   speculative .col-* helpers are defined here.
   -------------------------------------------------------------------------- */

.grid-12 {
	display: grid;
	grid-template-columns: repeat(var(--grid-columns), minmax(0, 1fr));
	column-gap: var(--grid-gap);
}
