/* ============================================================
   Story Split section (layout "story_split")
   Design ref: About Us.png y1440-2250. Teal band: eyebrow/heading/
   text/light button left; a photo (top-left) + an offset illustration
   (lower-right, overlapping) right. Mobile: content then images.
   ============================================================ */

.story-split {
	background: var(--color-teal);
	color: var(--color-text-on-dark);
	padding-block: var(--section-padding);
}

.story-split__inner {
	display: flex;
	flex-direction: column;
	gap: var(--space-lg);
}

.story-split__heading {
	margin-bottom: var(--space-md);
	color: var(--color-text-on-dark);
}

.story-split__text {
	line-height: 1.6;
}

.story-split__text p {
	margin: 0 0 1em;
}

.story-split__text p:last-child {
	margin-bottom: 0;
}

.story-split__button {
	align-self: flex-start;
	margin-top: var(--space-md);
}

/* ---- Media: photo + offset illustration ---- */

.story-split__media {
	position: relative;
}

.story-split__photo img,
.story-split__illustration img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--radius-sm);
}

.story-split__photo img {
	aspect-ratio: 15 / 16;
	object-fit: cover;
}

.story-split__photo {
	width: 62%;
}

/* Offset down + right, overlapping the photo's lower-right */
.story-split__illustration {
	width: 62%;
	margin-left: auto;
	margin-top: -18%;
	position: relative;
}

/* ---- Photo-only: one framed photo with a lighter-teal rectangle offset
       behind it (up-left), per the Programme "therapeutic community" ---- */
.story-split--photo-only .story-split__photo {
	position: relative;
	width: 100%;
}

/* Mobile: the photo leads (design stacks image-first here) */
.story-split--photo-only .story-split__media {
	order: -1;
}

.story-split--photo-only .story-split__photo img {
	position: relative;
	z-index: 1;
	/* design shows a square photo (not the 15/16 used with an illustration) */
	aspect-ratio: 1;
}

.story-split--photo-only .story-split__photo::before {
	content: "";
	position: absolute;
	inset: -1.5rem 1.5rem 1.5rem -1.5rem;
	background: var(--color-teal-frame);
	border-radius: var(--radius-sm);
	z-index: 0;
}

/* ---- Desktop ---- */

@media (min-width: 1024px) {
	.story-split {
		padding-block: 6.5rem;
	}

	.story-split__inner {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 480px);
		column-gap: 4.5rem;
		align-items: center;
	}

	.story-split__content {
		grid-column: 1;
	}

	.story-split__media {
		grid-column: 2;
	}

	/* Photo-only: a larger square photo, balanced columns (per the design) */
	.story-split--photo-only .story-split__inner {
		grid-template-columns: minmax(0, 1fr) minmax(0, 534px);
	}

	/* Reset the mobile "photo leads" order here. Left at -1 it makes grid
	   auto-placement lay the media down first (row 1, col 2), which then
	   bumps the content (pinned to col 1) into row 2 - the photo strands
	   top-right with the content below-left instead of sitting alongside it. */
	.story-split--photo-only .story-split__media {
		order: 0;
	}

	.story-split__text {
		font-size: 1.0625rem;
		line-height: 1.6;
	}
}
