:root {
	--section-padding-block: var(--space-xl);
}

@media (min-width: 719px) {
	:root {
		--section-padding-block: var(--space-xxxl);
	}
}

:is(
	.info-section,
	.info-features-section,
	.info-text-columns-section,
	.box-section,
	.secondary-mission-section,
	.two-column-flexible,
	.text-cta-intro,
	.short-info-section,
	.testimonial,
	.concertina,
	.wistia-video-section
) {
	padding-block: var(--section-padding-block);
}

/* What We Do keeps its smaller mobile spacing. */
.home-what-section {
	padding-block: var(--space-md);
}

@media (min-width: 719px) {
	.home-what-section {
		padding-block: var(--section-padding-block);
	}
}

/* Page headers keep their header offset instead of standard section spacing. */
.page-hero-framed-section {
	padding-block-start: var(--header-space);
}

/* Matching backgrounds remove the second section's top padding and the first content inset. */
.is-background-light-grey:has(+ .is-background-light-grey) .content-wrapper,
.is-background-red:has(+ .is-background-red) .content-wrapper,
.is-background-black:has(+ .is-background-black) .content-wrapper,
.is-background-white:has(+ .is-background-white) .content-wrapper {
	padding-block-end: 0;
}

.is-background-light-grey + .is-background-light-grey,
.is-background-red + .is-background-red,
.is-background-black + .is-background-black,
.is-background-white + .is-background-white {
	padding-block-start: 0;
}

/* Info followed by matching picture boxes has no additional bottom section padding. */
.info-section.is-background-light-grey:has(+ .box-section.is-background-light-grey),
.info-section.is-background-black:has(+ .box-section.is-background-black) {
	padding-block-end: 0;
}

.info-section.is-background-white:has(+ .info-section.is-background-light-grey),
.info-section.is-background-light-grey:has(+ .info-section.is-background-light-grey) {
	border-bottom: 1px solid var(--color-black);
}

.info-section.is-background-black:has(+ .info-section.is-background-black),
.info-section.is-background-red:has(+ .info-section.is-background-red) {
	border-bottom: 1px solid var(--color-white);
}

/* Framed images retain their inset even after a matching-background section. */
.layered-image-section.is-layout-framed {
	padding-block: var(--space-md, 1.25rem);
}

/* Section content fades and rises in on entering the viewport; section backgrounds stay
   put and heroes run their own reveals. */
@media screen and (prefers-reduced-motion: no-preference) {
	html.has-section-reveal
		.prevail-section:not(.home-hero-section, .page-hero-section, .page-hero-framed-section)
		> .content-wrapper {
		opacity: 0;
		transform: translateY(1.5rem);
		transition:
			opacity 700ms cubic-bezier(0.2, 0.8, 0.2, 1),
			transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
	}

	html.has-section-reveal .prevail-section.is-section-revealed > .content-wrapper {
		opacity: 1;
		transform: none;
	}
}
