/**
 * IEMA Media + Text sections (single project page).
 *
 * Two reusable, ACF-driven sections used by the single-project template
 * (inc/projects.php → iema_project_single_sections):
 *
 *  - .iema-project-narrative  the white "Summary / The Objective" text
 *                             section (navy H2 + grey body groups).
 *  - .iema-media-text         the grey alternating image + text rows
 *                             ("Our Response" / "The Impact"), image side
 *                             flipping every row. Matches Figma frame
 *                             6272-4527 (desktop 1440×1098, rows gap 64,
 *                             100px column gap, 16px image radius) and the
 *                             mobile stack (6603-5881).
 *
 * Built on the shared IEMA tokens (navy #002147, Helvetica, 16px radius,
 * 1440/80 section shell) so it reads as part of the same system as the
 * Projects / Form Callout / Contact Us blocks beneath it. Scoped to its
 * own classes, so inert anywhere the sections are not present.
 */

/* Shared section shell --------------------------------------------- */
.iema-project-narrative,
.iema-media-text {
	color: #002147;
	font-family: Helvetica, "Helvetica Neue", Arial, sans-serif;
}

.iema-project-narrative {
	background-color: #ffffff;
}

.iema-media-text {
	background-color: #f6f6f6;
}

.iema-project-narrative__inner,
.iema-media-text__inner {
	box-sizing: border-box;
	max-width: 1440px;
	margin: 0 auto;
	padding: 64px 80px;
}

/* Shared navy section heading -------------------------------------- */
.iema-project-narrative__heading,
.iema-media-text__heading {
	margin: 0;
	color: #002147;
	font-weight: 700;
	font-size: 40px;
	line-height: 44px;
	letter-spacing: 0;
}

/* ==================================================================
   Narrative (Summary / The Objective)
   ================================================================== */
.iema-project-narrative__groups {
	display: flex;
	flex-direction: column;
	gap: 40px;
}

.iema-project-narrative__group {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.iema-project-narrative__body {
	color: #767676;
	font-weight: 400;
	font-size: 16px;
	line-height: 22.4px;
}

.iema-project-narrative__group:first-child > .iema-project-narrative__body {
	font-size: 18px !important;
	line-height: normal !important;
}

.iema-project-narrative__body > :first-child {
	margin-top: 0;
}

.iema-project-narrative__body > :last-child {
	margin-bottom: 0;
}

.iema-project-narrative__body p {
	margin: 0 0 16px;
}

/* ==================================================================
   Media + Text alternating rows
   ================================================================== */
.iema-media-text__rows {
	display: flex;
	flex-direction: column;
	gap: 64px;
}

.iema-media-text__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	column-gap: 100px;
	align-items: center;
}

.iema-media-text__row.iema-media-text__column {
	grid-template-columns: 1fr !important;
	row-gap: 50px;
}

.iema-media-text__row.iema-media-text__column .iema-media-text__media,
.iema-media-text__row.iema-media-text__column--flip .iema-media-text__media {
	aspect-ratio: auto !important;
	order: 1 !important;
}

.iema-media-text__row.iema-media-text__column .iema-media-text__media img,
.iema-media-text__row.iema-media-text__column--flip .iema-media-text__media img {
	max-width: 824px;
}

.iema-media-text__row.iema-media-text__column--flip {
	display: flex !important;
	flex-direction: column-reverse !important;
	row-gap: 50px;
}

/* Odd rows flip the image to the right. */
.iema-media-text__row--flip .iema-media-text__media {
	order: 2;
}

.iema-media-text__media {
	border-radius: 16px;
	overflow: hidden;
	line-height: 0;
	aspect-ratio: 580/466;
}

.iema-media-text__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.iema-media-text__content {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.iema-media-text__body {
	color: #707070;
	font-weight: 400;
	font-size: 16px;
	line-height: 22.4px;
}

.iema-media-text__body > :first-child {
	margin-top: 0;
}

.iema-media-text__body > :last-child {
	margin-bottom: 0;
}

.iema-media-text__body p {
	margin: 0 0 16px;
}

.iema-media-text__body ul {
	margin: 0 0 16px;
	padding-left: 20px;
	list-style: disc;
}

.iema-media-text__body li {
	margin: 0;
}

/* ==================================================================
   Mobile (≤ 1024px) — stack sections; image sits above the text.
   ================================================================== */
@media (max-width: 1024px) {
	.iema-project-narrative__inner,
	.iema-media-text__inner {
		padding: 40px 24px;
	}

	.iema-project-narrative__heading,
	.iema-media-text__heading {
		font-size: 32px;
		line-height: 35.2px;
	}

	.iema-media-text__rows {
		gap: 40px;
	}

	.iema-media-text__row {
		grid-template-columns: 1fr;
		row-gap: 24px;
	}

	/* Image always on top on mobile, regardless of desktop side. */
	.iema-media-text__row--flip .iema-media-text__media {
		order: 0;
		aspect-ratio: 382/300;
	}
}
