.le-feature-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 3rem 1.125rem;
	margin: 0;
	padding: 0 var(--le-gutter);
	list-style: none;
	color: var(--le-black);
	background: var(--le-feature-background, var(--le-white));
}

/* Each panel shares the grid's row tracks, so images and text blocks line up across a row. */
.le-feature-grid__item {
	display: grid;
	grid-template-rows: subgrid;
	grid-row: span 2;
	row-gap: 1.8125rem;
}

.le-feature-grid__media {
	aspect-ratio: 687 / 420;
}

.le-feature-grid__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.le-feature-grid__text {
	max-width: 25.25rem;
}

.le-feature-grid__text > * {
	/*
	 * Space is measured from the capitals' tops and the baseline, as text-box trimming would, but by
	 * pulling the margins in by half the line's extra height instead: trimmed boxes got clipped on
	 * tablets and phones. The box keeps its full line height, so nothing is cut off.
	 */
	--le-trim: calc((1cap - 1lh) / 2);

	margin-block: var(--le-trim);
}

/* Wide: the text runs to 90px short of its panel's edge. */
.le-feature-grid--wide .le-feature-grid__text {
	max-width: calc(100% - 5.625rem);
}

.le-feature-grid--space-below {
	padding-bottom: 7.5rem;
}

.le-feature-grid__number {
	margin-bottom: calc(1.5rem + var(--le-trim));
	color: var(--le-500);
}

.le-feature-grid__title {
	margin: var(--le-trim) 0 calc(1rem + var(--le-trim));
	font-family: var(--le-font-sans);
	font-size: 1.375rem;
	font-weight: 600;
	line-height: 1.625rem;
	letter-spacing: -0.0138rem;
	color: inherit;
}

.le-feature-grid__text .le-p {
	color: var(--le-600);
}

/*
 * Three across: the text first, then a square image, with the text blocks sharing one row
 * track so the images line up even when one panel's text runs longer.
 */
.le-feature-grid--three {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	row-gap: 3.75rem;
}

.le-feature-grid--three .le-feature-grid__item {
	row-gap: 1.5rem;
}

.le-feature-grid--three .le-feature-grid__text {
	grid-row: 1;
	max-width: none;
}

.le-feature-grid--three .le-feature-grid__media {
	grid-row: 2;
	aspect-ratio: 1;
}

.le-feature-grid--three .le-feature-grid__title {
	font-size: 1.1875rem;
	line-height: 1.1;
	letter-spacing: -0.0119rem;
}

.le-feature-grid--three .le-p {
	font-size: 0.9375rem;
	line-height: 1.3;
	letter-spacing: -0.0094rem;
}

/*
 * Rows: one panel per row on the page grid, the image across the left six columns
 * and the text starting on the eighth, with the rows almost touching.
 */
@media (min-width: 881px) {
	.le-feature-grid--rows {
		grid-template-columns: var(--le-grid-columns);
		gap: 0.625rem var(--le-grid-gap);
		padding-block: 3.75rem 5rem;
	}

	.le-feature-grid--rows .le-feature-grid__item {
		grid-template-rows: none;
		grid-template-columns: subgrid;
		grid-row: auto;
		grid-column: 1 / -1;
		align-items: start;
	}

	.le-feature-grid--rows .le-feature-grid__media {
		grid-column: 1 / span 6;
		aspect-ratio: 687 / 496;
	}

	.le-feature-grid--rows .le-feature-grid__text {
		grid-column: 8 / -1;
		max-width: 23.75rem;
	}
}

@media (max-width: 880px) {
	.le-feature-grid {
		grid-template-columns: minmax(0, 1fr);
		row-gap: 3.75rem;
	}

	.le-feature-grid--wide .le-feature-grid__text {
		max-width: none;
	}

	.le-feature-grid--space-below {
		padding-bottom: 3.75rem;
	}

	/* A fixed height, as in the mockup: tall on a narrow phone, a wide band on a phone held sideways. */
	.le-feature-grid__media {
		aspect-ratio: auto;
		height: 26.25rem;
	}

	.le-feature-grid--three {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Square photos stay square, up to a sensible size. */
	.le-feature-grid--three .le-feature-grid__media {
		aspect-ratio: 1;
		height: auto;
		max-height: 26.25rem;
	}
}

/* The widget's Card text width, where set: it outranks each layout's own width on that screen. */
@media (min-width: 1024px) {
	.le-feature-grid.le-feature-grid--text-max-desktop .le-feature-grid__text {
		max-width: var(--le-card-text-max-desktop);
	}
}

@media (min-width: 881px) and (max-width: 1023px) {
	.le-feature-grid.le-feature-grid--text-max-tablet .le-feature-grid__text {
		max-width: var(--le-card-text-max-tablet);
	}
}

@media (max-width: 880px) {
	.le-feature-grid.le-feature-grid--text-max-mobile .le-feature-grid__text {
		max-width: var(--le-card-text-max-mobile);
	}
}

@media (max-width: 880px) {
	.le-feature-grid--rows {
		padding-block: 1.5rem 3rem;
	}
}
