/**
 * Type C — Product Row.
 *
 * Header block in its own column on the left, four white cards across. Unlike the feature grid,
 * these cards carry no coloured ground — the design puts them straight on the page.
 *
 * The track narrows to two columns and then stays there. It used to become a scroll-snap carousel
 * on phones, with each card at 58% and the row bleeding past its padding so the next one peeked —
 * which is exactly what made the second card look cut off. All four products in a 2x2 grid, no
 * horizontal scrolling and nothing clipped, is what the row does now.
 */

.csl-row__inner {
	display: grid;
	grid-template-columns: minmax( 190px, 240px ) minmax( 0, 1fr );
	gap: var( --csl-space-10 );
	align-items: center;
	/* Width is the Divi row's to set — see the feature grid. */
	padding: 0 var( --csl-space-5 );
}

.csl-row__track {
	display: grid;
	grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
	gap: var( --csl-space-6 );
}

.csl-header {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var( --csl-space-2 );
}

.csl-header .csl-section-title {
	margin: 0;
	font-size: var( --csl-text-2xl );
	font-weight: var( --csl-weight-bold );
	line-height: 1.12;
	letter-spacing: var( --csl-tracking-tight );
}

.csl-header .csl-section-description {
	margin: 0;
	max-width: 24ch;
	font-size: var( --csl-text-sm );
	line-height: 1.45;
	color: var( --csl-ink-soft );
}

/* The one button in the design set in capitals, so it keeps the caps tracking the base has dropped. */
.csl-header__cta {
	margin-top: var( --csl-space-3 );
	padding: 0.85em 1.7em;
	font-size: var( --csl-text-base );
	letter-spacing: var( --csl-tracking-wide );
}

/* A section with no header gives its whole width to the products. */
.csl-row__inner:not(:has(.csl-header)) {
	grid-template-columns: minmax( 0, 1fr );
}

@media ( max-width: 1024px ) {
	.csl-row__inner {
		grid-template-columns: minmax( 0, 1fr );
		gap: var( --csl-space-5 );
		align-items: start;
	}
}

/* Two by two, all four products on screen together, from tablet down. */
@media ( max-width: 780px ) {
	.csl-row__track {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
		gap: var( --csl-space-5 ) var( --csl-space-4 );
	}

	/*
	 * Show the whole product name. The card's two-line clamp is there to keep four cards level
	 * across a desktop row; below this breakpoint there is no row of four to match, and the clamp
	 * was cutting most catalogue names mid-word. It lives here rather than in the card stylesheet
	 * because this is the rule that decides there are only two columns — a card on its own has no
	 * way of knowing it has stopped being one of four.
	 *
	 * `display: block` is what lifts it: `-webkit-line-clamp` only applies inside a `-webkit-box`.
	 */
	.csl-row__track .csl-card__title {
		display: block;
		overflow: visible;
	}
}
