/**
 * Intro Split block (blocks/content/intro-split.php)
 *
 * Light two-column section: square image on one side; on the other a display
 * heading (with a trailing italic emphasis) + pill CTA at the top and a body
 * paragraph pinned to the bottom so it aligns with the image's lower edge.
 */

.dm-intro-split {
	padding-block: clamp(3rem, 7vw, 6rem);
}

.dm-intro-split__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: stretch;
	gap: clamp(1.75rem, 4vw, 4.5rem);
	padding-inline: 16px;
}

/* Image side ordering (default left). */
.dm-intro-split--image-right .dm-intro-split__media {
	order: 2;
}

/* ---- Image ---------------------------------------------------------- */
.dm-intro-split__media {
	position: relative;
}

.dm-intro-split__img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	height: auto;
	object-fit: cover;
	object-position: center;
}

/* ---- Content -------------------------------------------------------- */
.dm-intro-split__content {
	display: flex;
	flex-direction: column;
	/* Group centred against the image (client request — the design pinned the
	 * paragraph to the image's bottom edge, which left a large gap). */
	justify-content: center;
	/* Inset the heading/paragraph from the image's top & bottom edges (per mockup). */
	padding-block: clamp(1.5rem, 4vw, 3.5rem);
}

.dm-intro-split__heading {
	margin: 0;
	max-width: 31rem;                   /* wrap the title tighter, per mockup */
	color: var(--dm-bg-default-tertiary);                     /* Semantics/fg/default/primary */
	font-family: var(--font-display, "IM Fell Double Pica", serif);
	font-weight: 400;
	font-style: normal;
	font-size: clamp(2rem, 3.6vw, 3.25rem); /* caps at Figma 52px */
	line-height: 1.1;                   /* 110% */
	letter-spacing: -0.02em;            /* -1.04px at 52px */
}

.dm-intro-split__heading-em {
	font-style: italic;
}

/* Forest pill CTA â€” white label (Figma: "Discover Our Mezcales"). */
.dm-intro-split__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	margin-top: clamp(1.25rem, 2vw, 1.75rem);
	padding: 0 1.5rem;
	border-radius: 999px;
	background: var(--dm-bg-default-tertiary);                 /* Semantics/fg/default/primary */
	color: var(--dm-bg-default-white);                         /* Semantics/fg/default/white */
	font-family: var(--font-sans, "Roboto Condensed", sans-serif);
	font-size: 16px;                     /* body/md/regular */
	font-weight: 400;
	line-height: 1.4;                    /* 140% */
	text-decoration: none;
	white-space: nowrap;
}

/* Body paragraph sits a fixed 40px under the CTA (client request, replaces
 * the design's bottom-pinned paragraph). */
.dm-intro-split__body {
	margin: 40px 0 0;
	max-width: 600px;
	color: var(--dm-fg-default-primary);                     /* Semantics/fg/default/primary */
	font-family: var(--font-sans, "Roboto Condensed", sans-serif);
	font-size: 18px;                    /* body/lg/regular */
	font-weight: 400;
	line-height: 1.4;                   /* 140% â†’ 25.2px */
}

/* ---- Background: sand ------------------------------------------------ */
.dm-intro-split--bg-sand {
	background-color: var(--dm-bg-default-secondary);
}

/* ---- Layout: stacked ------------------------------------------------- *
 * Heading, copy, then button, the whole group centred against the image
 * (Our Story "Fair pay. Responsible agave."). Copy is in the display face. */
.dm-intro-split--stacked .dm-intro-split__content {
	justify-content: center;
}

.dm-intro-split--stacked .dm-intro-split__heading {
	max-width: 36rem;
}

.dm-intro-split--stacked .dm-intro-split__body {
	margin: clamp(1.25rem, 2vw, 1.75rem) 0 0;
	max-width: 38rem;
	font-family: var(--font-display, "IM Fell Double Pica", serif);
	font-size: 20px;
	line-height: 1.25;
}

/* Figma heading-mobile/h6-M: 18px / 120%. */
@media (max-width: 767px) {
	.dm-intro-split--stacked .dm-intro-split__body {
		color: var(--dm-fg-default-primary);
		font-size: 18px;
		font-weight: 400;
		line-height: 1.2;
	}
}

.dm-intro-split--stacked .dm-intro-split__cta {
	margin-top: clamp(1.4rem, 2.2vw, 2rem);
}

/* ---- Mobile: stack (image on top), natural flow --------------------- */
@media (max-width: 767px) {
	.dm-intro-split {
		padding-block: 4rem;            /* a little more top/bottom air on mobile */
	}

	.dm-intro-split__grid {
		grid-template-columns: 1fr;
		gap: 1.75rem;
	}

	/* Image always leads on mobile, regardless of desktop side. */
	.dm-intro-split--image-right .dm-intro-split__media {
		order: 0;
	}

	/* No inset on mobile â€” heading/body align flush to the section gutter. */
	.dm-intro-split__content {
		padding-block: 0;
	}

	/* Figma heading-mobile/h2-M: 36px / 110% / -0.72px, held to a tighter wrap. */
	.dm-intro-split__heading {
		max-width: 19ch;
		font-size: 36px;
		letter-spacing: -0.72px;
	}

	.dm-intro-split__cta {
		margin-top: clamp(1.55rem, 2vw, 1.75rem);
	}

	.dm-intro-split__body {
		margin-top: 3rem;              /* fixed gap; nothing to pin against */
	}
}

/* ---- Small desktop (1280+): match the Figma board -------------------- *
 * Figma "Home Page - Small Desktop" > image-text-container (1987:16213):
 * px-100 py-80, gap 24; image and content each flex-1 (528 at 1280, square,
 * radius 4); content px-32 py-40 with the heading/button group at the top and
 * the body paragraph pinned to the bottom; heading 46/110%/-0.92px.
 *
 * Scoped to :not(--stacked) so the Our Story "Fair pay" variant, which shares
 * this block with a different layout, keeps its own spacing.
 * Must stay at the end of the file: the base rules above would otherwise win
 * on source order, since a media query adds no specificity. */
@media (min-width: 1024px) and (max-width: 1280.98px) {
	.dm-intro-split:not(.dm-intro-split--stacked) {
		padding-block: 80px;
	}

	.dm-intro-split:not(.dm-intro-split--stacked) .dm-intro-split__grid {
		/* The capped 1080 container already provides Figma's 100px gutter. */
		padding-inline: 0;
		gap: 24px;
	}

	.dm-intro-split:not(.dm-intro-split--stacked) .dm-intro-split__img {
		border-radius: 4px;             /* radius/r-xs */
	}

	.dm-intro-split:not(.dm-intro-split--stacked) .dm-intro-split__content {
		padding-block: 40px;
		padding-inline: 32px;
	}

	.dm-intro-split:not(.dm-intro-split--stacked) .dm-intro-split__heading {
		max-width: none;                /* fills the 464 content box */
		font-size: 46px;
	}

	.dm-intro-split:not(.dm-intro-split--stacked) .dm-intro-split__cta {
		margin-top: 32px;
	}

	.dm-intro-split:not(.dm-intro-split--stacked) .dm-intro-split__body {
		max-width: none;
	}
}

/* Small desktop, stacked variant (Our Story "Fair pay"). No board; same
   rules as the split layout above. */
@media (min-width: 1024px) and (max-width: 1280.98px) {
	.dm-intro-split--stacked {
		padding-block: 80px;
	}

	.dm-intro-split--stacked .dm-intro-split__grid {
		padding-inline: 0;
		gap: 24px;
	}

	.dm-intro-split--stacked .dm-intro-split__img {
		border-radius: 4px;
	}

	.dm-intro-split--stacked .dm-intro-split__content {
		padding-block: 40px;
		padding-inline: 32px;
	}

	.dm-intro-split--stacked .dm-intro-split__heading {
		font-size: 46px;
	}

	.dm-intro-split--stacked .dm-intro-split__body {
		margin-top: 24px;
		font-size: 20px;
	}

	.dm-intro-split--stacked .dm-intro-split__cta {
		margin-top: 32px;
	}
}
