/**
 * Home "Our patient purpose" split section.
 * Markup: template-parts/v2/sections/home-purpose.php
 */
@layer sections {
	/* Locked at 1440px and centered: wider screens get side gaps, the image never scales up. */
	.lb-v2-purpose {
		position: relative;
		width: 100%;
		max-width: var(--lb-v2-banner-max);
		margin-inline: auto;
		background: var(--lb-v2-color-white);
	}

	/*
	 * The image is centered and keeps its proportions (object-fit, never stretched).
	 * Mobile image 390 × 343; desktop image 1440 × 748 (shown at its own ratio on tablets).
	 */
	.lb-v2-purpose__media picture {
		display: block;
	}

	.lb-v2-purpose__media img {
		display: block;
		width: 100%;
		aspect-ratio: 390 / 343;
		object-fit: cover;
		object-position: center;
	}

	@media (min-width: 48rem) {
		.lb-v2-purpose__media img {
			aspect-ratio: 1440 / 748;
		}
	}

	.lb-v2-purpose__inner {
		padding-block: var(--lb-v2-section-space);
	}

	.lb-v2-purpose__content {
		display: grid;
		justify-items: start;
		gap: var(--lb-v2-stack-gap);
	}

	.lb-v2-purpose__content > .lb-v2-link {
		margin-top: calc(var(--lb-v2-cta-gap) - var(--lb-v2-stack-gap));
	}

	@media (min-width: 80rem) {
		.lb-v2-purpose {
			min-height: 46.75rem; /* 748px */
		}

		.lb-v2-purpose__media {
			position: absolute;
			inset: 0;
		}

		.lb-v2-purpose__media picture,
		.lb-v2-purpose__media img {
			height: 100%;
		}

		.lb-v2-purpose__media img {
			aspect-ratio: auto;
		}

		.lb-v2-purpose__inner {
			position: relative;
			display: grid;
			grid-template-columns: 1fr minmax(0, 30.0625rem); /* 481px text column */
			align-content: center; /* the text sits in the middle of the image */
			min-height: 46.75rem; /* 748px: the desktop image height, so a 1440 × 748 image is never scaled */
			padding-block: var(--lb-v2-space-6);
			padding-right: var(--lb-v2-space-6); /* text ends 32px inside the container */
		}

		.lb-v2-purpose__content {
			grid-column: 2;
		}
	}
}
