/**
 * Page-level layout.
 *
 * Two earlier versions of this file got the same thing wrong in different ways,
 * so the rule is worth stating plainly: a block decides its own width, and this
 * file only supplies a reading column to whatever does not.
 *
 * The first version capped the article wrapper at 1100px, which flattened three
 * of the four section widths into one box - the section reported max-width:none
 * and simply had nowhere to grow.
 *
 * The second decided who to cap by looking for "sigma-" in the class name. Only
 * four of the fifteen blocks in this theme use that prefix; the other eleven -
 * accordion, cta-band, grid, hero, quote and the rest - are named without it. So
 * the test misclassified most of the theme, and the hero came out capped at
 * 1100px inside a band meant to reach both edges.
 *
 * A block now says what it is. `data-full-bleed` on the outer element means the
 * block handles its own width and this file leaves it alone. Everything else
 * gets the column. Guessing from a name was the mistake both times.
 */

/*
 * The two content columns the comps actually draw, measured at 1440
 * (docs/qa/comp-spec/SPEC-home.md): rules and card rows run x=111..1325,
 * a 1214px column; the stat and resources bands run x=90..1350, 1260px.
 * These are the same numbers design/tokens.json's choices.width carries
 * for sigma/section's inline style ("wide" = 1260, "content" = 1214) --
 * kept in step by hand because that file only feeds ACF choices, not
 * :root, and a width is not one of the property groups
 * scripts/build-tokens.php emits. Anything in assets/css that needs a
 * column reads these, never a literal.
 *
 * They are content widths: a box that also carries the page gutter
 * (padding-inline --space-xl at >= 768) adds the gutter on top, so the
 * words land at the comp's x and not 48px inside it.
 */
:root {
	--width-wide: 1260px;
	--width-content: 1214px;
	--width-narrow: 760px;
}

.entry-header {
	max-width: calc(var(--width-content) + 2 * var(--space-xl));
	margin-inline: auto;
	padding-inline: var(--space-lg);
}

.entry-content > *:not([data-full-bleed]) {
	max-width: calc(var(--width-content) + 2 * var(--space-xl));
	margin-inline: auto;
	padding-inline: var(--space-lg);
}

@media (min-width: 768px) {
	.entry-header,
	.entry-content > *:not([data-full-bleed]) {
		padding-inline: var(--space-xl);
	}
}

/**
 * Vertical rhythm between stacked blocks.
 *
 * Blocks carry no outer margin of their own, so three grids in a row read as one
 * continuous table instead of three groups. Full-bleed bands are exempt: they
 * have their own padding-block, and two adjacent bands should meet edge to edge
 * rather than show a stripe of page between them.
 */
.entry-content > * + *:not([data-full-bleed]) {
	margin-block-start: var(--space-2xl);
}

.entry-content > [data-full-bleed] + *:not([data-full-bleed]) {
	margin-block-start: 0;
}

.entry-content > *:last-child {
	margin-block-end: var(--space-2xl);
}
