/**
 * Meridian Sections — Mosaic List
 *
 * Figma 13:8771. A photo mosaic — one tall image beside a stack of small ones —
 * next to a headed list of short items. Drawn as "Values", with the initials
 * spelling CORE; the section itself knows nothing about values.
 *
 * The band is the same as Featurette Dots: 96/96 on the .md-dots ground, closed
 * with a rule, with the same dot accent overhanging the imagery.
 */

.md-section.md-mlist {
	padding-block: var(--md-section-pt, 6rem) var(--md-section-pb, 6rem);

	/* 5px dots, as measured off this comp's sibling. */
	--md-dot-size: 2.5px;
}

.md-mlist--ruled {
	border-block-end: var(--md-border-width, 1px) solid
		var(--md-color-rule, #ebebeb);
}

.md-mlist__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--md-space-xl, 3rem);
}

/* --- Mosaic -------------------------------------------------------------- */
.md-mlist__media {
	/* The accent is positioned against this, so it tracks the imagery rather
	 * than the section. */
	position: relative;
	min-width: 0;
}

.md-mlist__mosaic {
	display: grid;
	/*
	 * 2fr beside 1fr, and as many rows as there are small images — three in the
	 * comp, but a section with two should not leave an empty row.
	 */
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
	grid-template-rows: repeat(var(--md-mlist-rows, 3), minmax(0, 1fr));
	gap: 0.75rem; /* 12px */
	/* 478.5 × 542 in the comp: stated as a ratio so the mosaic keeps its
	 * proportions at any column width, with the comp's own floor. */
	aspect-ratio: 478.5 / 542;
	min-height: 26.25rem; /* 420px */
}

/* With no tall image there is no 2fr column to fill, so the small ones take the
 * whole width instead of leaving a hole beside them. */
.md-mlist__mosaic--stack {
	grid-template-columns: minmax(0, 1fr);
}

/*
 * The cell itself is .md-media-cell in sections.css, shared with the Gallery.
 * Only its placement is this section's business: the tall one spans every row
 * and the rest auto-place down column 2.
 */
.md-mlist__cell--main {
	grid-column: 1;
	grid-row: 1 / -1;
}

.md-mlist__artwork {
	/* Bottom-right of the mosaic, as drawn: 39px past its right edge and 25px
	 * below its bottom. */
	inset-block-end: -1.5625rem; /* -25px */
	inset-inline-end: -2.4375rem; /* -39px */
}

/* --- List ---------------------------------------------------------------- */
.md-mlist__items {
	/* No 40px token on the 8px scale, so it is stated. */
	margin-block-start: 2.5rem; /* 40px */
}

.md-mlist__item {
	padding-block: var(--md-space-md, 1.5rem) 1.5625rem; /* 24 / 25 */
	border-block-end: var(--md-border-width, 1px) solid
		var(--md-color-rule, #ebebeb);
}

/* The first item sits straight under the heading's own 40px gap. */
.md-mlist__item:first-child {
	padding-block-start: 0;
}

/* The last rule would double up with the band's own closing rule. */
.md-mlist__item:last-child {
	padding-block-end: var(--md-space-md, 1.5rem);
	border-block-end: 0;
}

.md-mlist__item-title {
	margin: 0;
	color: var(--md-color-heading, #0a1628);
	font-family: var(--md-font-heading, "Cabin", sans-serif);
	font-size: 1.0625rem; /* 17px */
	font-weight: var(--md-weight-bold, 700);
	/*
	 * A length, not a ratio: the accented initial is larger, and inheriting a
	 * unitless line-height would give it a taller line box and push the rows
	 * apart. 23.375px is the comp's leading on both.
	 */
	line-height: 1.4609375rem;
}

.md-mlist__initial {
	color: var(--md-blue, #006bb6);
	font-size: 1.25rem; /* 20px */
}

.md-mlist__item-text {
	margin: 0;
	margin-block-start: var(--md-space-2xs, 0.5rem); /* 8px */
	color: var(--md-color-text-muted, #6a7282);
	/*
	 * 16px, not the 13px drawn. Bumped deliberately across every section whose body
	 * copy sat at 13 — Callouts, Card Grid, Leadership Grid, Markets, Mosaic List —
	 * because 13px prose is small to read and 16px is the browser default a reader
	 * expects. The 1.625 leading is unitless, so it follows to 26px.
	 */
	font-size: var(--md-text-small, 1rem); /* 16px */
	line-height: 1.625; /* 26 / 16 */
}

/* --- Two-up ------------------------------------------------------------- */
@media (min-width: 62em) {
	.md-mlist__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 6rem; /* 96px */
		/* Both columns are self-start in the comp; the mosaic is taller than the
		 * list and neither is centred against the other. */
		align-items: start;
	}

	/*
	 * The markup is list-then-mosaic so the heading is read first; the comp draws
	 * the mosaic on the left, so both are placed rather than following DOM order.
	 */
	.md-mlist__media {
		grid-column: 1;
		grid-row: 1;
	}

	.md-mlist__copy {
		grid-column: 2;
		grid-row: 1;
	}

	.md-mlist--media-right .md-mlist__media {
		grid-column: 2;
	}

	.md-mlist--media-right .md-mlist__copy {
		grid-column: 1;
	}

	.md-mlist--media-right .md-mlist__artwork {
		inset-inline: -2.4375rem auto;
	}

	.md-mlist__copy:only-child,
	.md-mlist__media:only-child {
		grid-column: 1 / -1;
	}
}

/* No gutter for the accent to hang in once the columns stack, and it is only
 * decoration. */
@media (max-width: 61.9375em) {
	.md-mlist__artwork {
		display: none;
	}
}
