/**
 * Type B — Feature Grid.
 *
 * Three columns, two rows, taken from the approved design:
 *
 *   ┌──────────┬──────────┬─────────────┐
 *   │  HEADER  │  tile 1  │             │
 *   ├──────────┼──────────┤   FEATURE   │   feature spans both rows
 *   │  tile 2  │  tile 3  │             │
 *   └──────────┴──────────┴─────────────┘
 *
 * The header is a CELL of the grid, not a column beside it — that is what stops this section
 * reading like the product row with different tiles in it.
 */

.csl-grid__tiles {
	display: grid;
	grid-template-columns: repeat( 2, minmax( 0, 1fr ) ) minmax( 0, 1.35fr );
	grid-template-rows: repeat( 2, minmax( 0, 1fr ) );

	/* Tile gutter — shared with the recommendation row, see `--csl-tile-gap`. */
	gap: var( --csl-tile-gap );

	/*
	 * No max-width and no auto margins. This section sits inside a Divi row that already
	 * sets the site's content width, so capping again here constrained it a second time and
	 * left visible gutters inside the row. Same reasoning the hero slider documents.
	 *
	 * The side padding stays: it is the section's own gutter, not a width cap, and keeps the
	 * tiles off the edge on a Divi row that supplies none.
	 */
	padding: 0 var( --csl-space-5 );
}

/* Feature tile: far column, both rows. */
.csl-grid--feature-top .csl-grid__tiles > .csl-card--lg {
	grid-column: 3;
	grid-row: 1 / span 2;
}

/* Mirrored: the feature moves to the first column and the header shifts across. */
.csl-grid--feature-bottom .csl-grid__tiles {
	grid-template-columns: minmax( 0, 1.35fr ) repeat( 2, minmax( 0, 1fr ) );
}

.csl-grid--feature-bottom .csl-grid__tiles > .csl-card--lg {
	grid-column: 1;
	grid-row: 1 / span 2;
}

/* ------------------------------------------------------------ header cell */

.csl-header--cell {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: var( --csl-space-2 );
	padding: var( --csl-space-6 );
	background-color: var( --csl-ground, #ffffff );
}

.csl-header--cell .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--cell .csl-section-description {
	margin: 0;
	max-width: 26ch;
	font-size: var( --csl-text-sm );
	line-height: 1.45;
	color: var( --csl-ink-soft );
}

.csl-header--cell .csl-header__cta {
	margin-top: var( --csl-space-3 );
	padding: 0.85em 1.7em;
	font-size: var( --csl-text-base );
}

/* An override image fills its tile rather than sitting in the packshot's padded well. */
.csl-card__image--override {
	object-fit: cover;
	padding: 0;
}

/* -------------------------------------------------------------- responsive */

@media ( max-width: 1024px ) {
	.csl-grid__tiles,
	.csl-grid--feature-bottom .csl-grid__tiles {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
		grid-template-rows: auto;
	}

	/* Header spans the full width, feature leads the tiles. */
	.csl-grid__tiles > .csl-header--cell {
		grid-column: 1 / -1;
	}

	.csl-grid--feature-top .csl-grid__tiles > .csl-card--lg,
	.csl-grid--feature-bottom .csl-grid__tiles > .csl-card--lg {
		grid-column: 1 / -1;
		grid-row: auto;
	}
}

@media ( max-width: 560px ) {
	.csl-grid__tiles,
	.csl-grid--feature-bottom .csl-grid__tiles {
		grid-template-columns: minmax( 0, 1fr );
		padding: 0 var( --csl-space-3 );
	}

	.csl-header--cell { padding: var( --csl-space-5 ) var( --csl-space-4 ); }
}

/* ------------------------------------------------------------ tile fill */

/*
 * The three small tiles are washed; the feature tile is not, as the comp draws it — at roughly
 * four times the area the same 135deg ramp reads as an uneven fill behind the packshot rather
 * than as a wash.
 *
 * Both are decided in `render()` by the `washed` argument, not here: the wash comes paired with
 * the secondary ink it needs to stay AA, and `.csl-card--washed` in the card stylesheet is what
 * keeps the two together. This note is all that is left of the rule that used to live here.
 */
