/**
 * "The Numbers Behind The Work" — the bits theme.json can't express: the
 * two-tone figures (slate base + orange unit/plus), the hairline grid of cells,
 * and the responsive column count. Loaded only on pages with this section.
 *
 * The figure colour and hairlines are a neutral slate scale taken straight from
 * the comp (not the site's blue-tinted greys), so they live here as scoped
 * component tokens rather than in the global palette.
 */
.ab-impact-stats {
	--ab-fig: #52525b;       /* figure + label colour */
	--ab-fig-line: #d4d4d8;  /* hairline rules */
}

/* Row: a hairline above and below the whole band of figures. */
.ab-impact-stats__row {
	border-top: 1px solid var(--ab-fig-line);
	border-bottom: 1px solid var(--ab-fig-line);
}

/* Cells: equal columns with a hairline between each and generous height. */
.ab-impact-stats__cell {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.75rem;
	padding: clamp(2.5rem, 5vw, 5rem) 1.25rem;
	text-align: center;
}

.ab-impact-stats__cell + .ab-impact-stats__cell {
	border-left: 1px solid var(--ab-fig-line);
}

/* Figure: serif, slate, with an orange unit ("M") and a superscript plus. */
.ab-impact-stats__num {
	margin: 0;
	font-family: var(--wp--preset--font-family--serif);
	font-weight: 700;
	line-height: 1;
	color: var(--ab-fig);
	font-size: clamp(2.75rem, 5.2vw, 4.625rem);
	white-space: nowrap;
}

.ab-impact-stats__unit {
	color: var(--wp--preset--color--ab-orange);
}

.ab-impact-stats__plus {
	color: var(--wp--preset--color--ab-orange);
	font-size: 0.5em;
	vertical-align: 0.6em;
	margin-left: 0.03em;
}

/* Label: same slate, calm and readable under the figure. */
.ab-impact-stats__label {
	margin: 0;
	color: var(--ab-fig);
	font-size: 1.0625rem;
	line-height: 1.35;
}

/* 5 figures don't fit narrow screens — drop to 2 columns and re-flow the
   hairlines (vertical between the pair, horizontal between rows). */
@media (max-width: 900px) {
	.ab-impact-stats__row {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
	.ab-impact-stats__cell {
		border-left: none;
		padding: 2.25rem 0.75rem;
	}
	.ab-impact-stats__cell:nth-child(even) {
		border-left: 1px solid var(--ab-fig-line);
	}
	.ab-impact-stats__cell:nth-child(n + 3) {
		border-top: 1px solid var(--ab-fig-line);
	}
}

@media (max-width: 480px) {
	.ab-impact-stats__num {
		font-size: clamp(2.5rem, 13vw, 3.25rem);
	}
}
