/*
 * Section rhythm + surface system.
 *
 * Every body section gets:
 *   <section class="ibv-section ibv-section--surface-{X}">
 *
 * `.ibv-section` provides standard vertical rhythm via padding-block.
 * `.ibv-section--rhythm-sm` overrides to a tighter rhythm tier.
 * Six `--surface-{X}` modifiers provide the bg colour. The
 * `--surface-forest-green` modifier also sets a bright text colour
 * default to prevent dark-on-dark; consumers still override
 * specific child colours (sage, muted, etc.) explicitly.
 *
 * Same-surface adjacent sections collapse the second section's top
 * padding to 0 — visually tightens continuous bands of one colour.
 *
 * Hero, footer, and other chrome-level surfaces are deliberately
 * exempt from this system and own their own padding models.
 */

/* Base rhythm */
.ibv-section {
	padding-block: var(--ibv-section-pad-y);
}

/* Rhythm tiers */
.ibv-section--rhythm-sm {
	padding-block: var(--ibv-section-pad-y-sm);
}

/* Surface modifiers */
.ibv-section--surface-bg {
	background: var(--ibv-color-bg);
}

.ibv-section--surface-white {
	background: var(--ibv-color-white);
}

.ibv-section--surface-tint-teal {
	background: var(--ibv-color-tint-teal);
}

.ibv-section--surface-tint-gold {
	background: var(--ibv-color-tint-gold);
}

.ibv-section--surface-tint-blue {
	background: var(--ibv-color-tint-blue);
}

.ibv-section--surface-forest-green {
	background: var(--ibv-color-forest-green-deep);
	/* Bare default — bright off-white prevents dark-on-dark.
	 * Consumers (e.g. why-iv2000) declare their own child colours
	 * (sage body, etc.) explicitly. This rule is the legibility
	 * floor, not the design system for dark sections. */
	color: var(--ibv-color-text-on-dark);
}

.ibv-section--surface-blue {
	background: var(--ibv-color-blue-400);
	color: var(--ibv-color-text-on-dark);
}

/* Same-surface adjacency collapse — drops the second section's
 * top padding so two same-surface sections feel continuous. */
.ibv-section--surface-bg + .ibv-section--surface-bg,
.ibv-section--surface-white + .ibv-section--surface-white,
.ibv-section--surface-tint-teal + .ibv-section--surface-tint-teal,
.ibv-section--surface-tint-gold + .ibv-section--surface-tint-gold,
.ibv-section--surface-tint-blue + .ibv-section--surface-tint-blue,
.ibv-section--surface-forest-green + .ibv-section--surface-forest-green,
.ibv-section--surface-blue + .ibv-section--surface-blue {
	padding-block-start: 0;
}

/* Legals composition exception — band + tabs + content read as one header
 * unit. All three are surface-bg; per the Legals design (node 301:9442) the
 * band keeps its own 48px internal padding, the tabs sit flush beneath it, and
 * the content column starts ~24px under the tabs (rather than a full rhythm gap
 * at each junction). Scoped to the legal template's body class so the rhythm
 * system stays untouched elsewhere; normal rhythm resumes below the content
 * column, before the footer. Placed after the adjacency collapse so it wins on
 * source order for the content column's top padding. */
.page-template-page-legal-php .ibv-title-band {
	padding-block: var(--ibv-section-pad-y-sm); /* 48px top + bottom */
}

.page-template-page-legal-php .ibv-legal-tabs {
	padding-block: 0;
}

.page-template-page-legal-php .ibv-legal-content {
	padding-block-start: var(--ibv-space-lg); /* ~24px offset beneath the tabs */
}
