/**
 * Story Collage block (blocks/content/story-collage.php)
 *
 * "Single village mezcal": two columns on flat cream. Left stacks a tall
 * portrait photo over a pull quote; right stacks heading + body copy over a
 * second photo.
 *
 * The interleaved look is emergent, not positioned — the right column's copy
 * is shorter than the left column's photo, so its photo starts while the tall
 * one is still running. That means no absolute positioning to unpick at
 * mobile, where the grid simply becomes one column.
 *
 * Type follows the page's other sections: display face for heading and quote
 * (villages-hero, achievements), Roboto Condensed for body copy.
 */

.dm-story-collage {
	background-color: var(--color-cream);
	padding-block: clamp(3rem, 7vw, 6.5rem);
	overflow: hidden;
}

.dm-story-collage__inner {
	display: grid;
	/* Left column is wider — it carries the tall photo and the quote. */
	grid-template-columns: minmax(0, 1fr) minmax(0, 0.95fr);
	column-gap: clamp(2rem, 5vw, 5.5rem);
	align-items: start;
	padding-inline: 16px;
}

.dm-story-collage__col {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

/* Right column starts a touch lower than the left, so the heading sits just
   under the top edge of the tall photo rather than flush with it. */
.dm-story-collage__col--right {
	padding-top: clamp(1rem, 3vw, 2.75rem);
}

/* ---- Figures --------------------------------------------------------- */
.dm-story-collage__figure {
	margin: 0;
	overflow: hidden;
	border-radius: 4px;
}

.dm-story-collage__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* 4:5 rather than the comp's ~0.78 exactly: the supplied photo is square, so
   every portrait crop cuts its sides, and 4:5 keeps 80% of the width where 3:4
   would keep 75%. Paired with the object-position below, that keeps the
   jimador — who sits right of centre — fully in frame. */
.dm-story-collage__figure--tall {
	aspect-ratio: 4 / 5;
}

.dm-story-collage__figure--tall .dm-story-collage__img {
	object-position: 65% center;
}

/* Square, matching both the comp and the supplied photo. Pushed down and in
   from the column's outer edge, which is what reads as the offset/overlap
   against the tall photo beside it. */
.dm-story-collage__figure--inset {
	aspect-ratio: 1 / 1;
	margin-top: clamp(2rem, 5vw, 4.5rem);
	margin-left: clamp(1rem, 4vw, 4rem);
}

/* ---- Copy ------------------------------------------------------------ */
.dm-story-collage__heading {
	margin: 0;
	color: var(--dm-fg-default-primary);
	font-family: var(--font-display, "IM Fell Double Pica", serif);
	font-weight: 400;
	/* Figma heading/h2 — 40px, down to h2-M (28px). Section head, not page title. */
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.dm-story-collage__body {
	margin-top: clamp(1rem, 2vw, 1.5rem);
	max-width: 30rem;
	color: var(--dm-fg-default-primary);
	font-family: var(--font-sans, "Roboto Condensed", sans-serif);
	font-size: clamp(0.95rem, 1.15vw, 1.0625rem);
	font-weight: 400;
	line-height: 1.65;
}

.dm-story-collage__body > :first-child {
	margin-top: 0;
}

.dm-story-collage__body > :last-child {
	margin-bottom: 0;
}

.dm-story-collage__body p + p {
	margin-top: 1.1em;
}

/* ---- Pull quote ------------------------------------------------------ */
.dm-story-collage__quote {
	margin: clamp(2rem, 4vw, 3.25rem) 0 0;
	max-width: 26rem;
}

.dm-story-collage__quote-text {
	margin: 0;
	padding: 0;
	border: 0;
	color: var(--dm-fg-default-primary);
	font-family: var(--font-display, "IM Fell Double Pica", serif);
	font-size: clamp(1.375rem, 2.2vw, 1.875rem);
	font-weight: 400;
	line-height: 1.25;
}

/* Typographic quote marks, so the copy in the field stays clean text. */
.dm-story-collage__quote-text::before {
	content: open-quote;
}

.dm-story-collage__quote-text::after {
	content: close-quote;
}

.dm-story-collage__quote-source {
	margin-top: clamp(0.75rem, 1.5vw, 1.1rem);
	color: var(--dm-fg-default-primary);
	opacity: 0.75;
	font-family: var(--font-sans, "Roboto Condensed", sans-serif);
	font-size: clamp(0.8125rem, 1vw, 0.9375rem);
	line-height: 1.4;
}

/* ---- Mobile ---------------------------------------------------------- */
@media (max-width: 767px) {
	.dm-story-collage__inner {
		grid-template-columns: minmax(0, 1fr);
		row-gap: clamp(1.75rem, 6vw, 2.5rem);
	}

	/* Reading order on one column: photo, heading + copy, second photo, quote.
	   The quote is the section's closing beat, so it moves below the copy it
	   belongs to rather than staying stuck to the first photo. */
	.dm-story-collage__col--left {
		display: contents;
	}

	.dm-story-collage__figure--tall {
		order: 1;
		/* Square on one column — the source is square, so this is the only
		   crop that loses nothing, and there is no neighbouring column left
		   for a portrait shape to line up against. */
		aspect-ratio: 1 / 1;
	}

	.dm-story-collage__col--right {
		order: 2;
		padding-top: 0;
		gap: clamp(1.75rem, 6vw, 2.5rem);
	}

	.dm-story-collage__quote {
		order: 3;
		max-width: none;
		margin-top: 0;
	}

	/* Offsets are a desktop device; on one column they just misalign the edge. */
	.dm-story-collage__figure--inset {
		margin-left: 0;
		margin-top: 0;
	}

	.dm-story-collage__body {
		max-width: none;
	}
}

/* ---- Small desktop (1024-1280) ---------------------------------------
 * No Figma board for Our Story; same rules as the other 1280 pages:
 * 80px section padding, the capped 1080 container, 24px gaps, 4px radius. */
@media (min-width: 1024px) and (max-width: 1280.98px) {
	.dm-story-collage {
		padding-block: 80px;
	}

	.dm-story-collage__inner {
		/* The capped 1080 container already provides the 100px gutter. */
		padding-inline: 0;
		column-gap: 48px;
	}

	.dm-story-collage__col--right {
		padding-top: 40px;
	}

	.dm-story-collage__figure--inset {
		margin-top: 48px;
		margin-left: 48px;
	}

	.dm-story-collage__heading {
		font-size: 40px;                /* heading/h3 */
	}

	.dm-story-collage__body {
		margin-top: 24px;
		font-size: 16px;
		line-height: 1.6;
	}

	.dm-story-collage__quote {
		margin-top: 40px;
	}

	.dm-story-collage__quote-text {
		font-size: 28px;
	}

	.dm-story-collage__quote-source {
		margin-top: 16px;
		font-size: 14px;
	}
}
