/* IC Stat Strip (patterns/ic-stats.php). Generalized from 300 NLS stat-strip; layout here, not in the property skin. */

/* One row: every child (figure cell or image) takes an equal column, so 3 or 4 figures, with or without images, all fit. */
.tt5c-ic-stats__grid {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, 1fr);
	align-items: stretch;
	gap: var(--wp--preset--spacing--10);
	max-width: var(--wp--custom--layout--content);
	margin-inline: auto;
}
.tt5c-ic-stats__grid > * { margin: 0; min-width: 0; }

/* Square cells; a cell grows taller if its copy needs it, and the row stretches with it. */
.tt5c-ic-stats__grid > .tt5c-ic-stats__item,
.tt5c-ic-stats__grid > .tt5c-ic-stats__media { aspect-ratio: 1 / 1; }

/* Figure cell. */
.tt5c-ic-stats .tt5c-ic-stats__item {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--20);
	padding: var(--wp--preset--spacing--30);
}
.tt5c-ic-stats__item > * { margin-block: 0; }
.tt5c-ic-stats__figure {
	font-family: var(--ico-type-headline-banner-family);
	font-size: var(--ico-type-headline-banner-size);
	font-weight: var(--ico-type-headline-banner-weight);
	line-height: var(--ico-type-headline-banner-lh);
	letter-spacing: var(--ico-type-headline-banner-ls);
	text-transform: var(--ico-type-headline-banner-case);
	overflow-wrap: anywhere;
}
.tt5c-ic-stats__label {
	font-family: var(--ico-type-label-caps-small-family);
	font-size: var(--ico-type-label-caps-small-size);
	font-weight: var(--ico-type-label-caps-small-weight);
	line-height: var(--ico-type-label-caps-small-lh);
	letter-spacing: var(--ico-type-label-caps-small-ls);
	text-transform: var(--ico-type-label-caps-small-case);
	padding-top: var(--wp--preset--spacing--15);
	border-top: 1px solid currentColor; /* derived — not Figma */
	overflow-wrap: break-word;
}

/* Image cell: fills its cell edge to edge. */
.tt5c-ic-stats .tt5c-ic-stats__media { overflow: hidden; }
.tt5c-ic-stats .tt5c-ic-stats__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

@media (max-width: 900px) {
	/* Two across; an odd last cell takes the full row. */
	.tt5c-ic-stats__grid {
		grid-auto-flow: row;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.tt5c-ic-stats__grid > :last-child:nth-child(odd) {
		grid-column: 1 / -1;
		aspect-ratio: 2 / 1;
	}
}
@media (max-width: 600px) {
	.tt5c-ic-stats .tt5c-ic-stats__item { padding: var(--wp--preset--spacing--20); }
}
