/**
 * SigmaGraft About — Impact Statistics.
 *
 * Defaults only: every value here is overridable by the widget's controls.
 *
 * ── Why the columns have no gap ───────────────────────────────────────────
 *
 * The mockup's hairline rules sit exactly ON the column boundaries, not
 * floating in a gutter between them. So the grid runs at zero column gap, the
 * columns butt together, and each one insets its own content with padding.
 * The rule is then a pseudo-element pinned to the column's start edge, and the
 * first column drops its start padding so its icon lines up with the eyebrow
 * and the container edge above it.
 *
 * Drawing the rule as a pseudo-element rather than a border is what makes its
 * length controllable — the mockup's rule is centred and slightly shorter than
 * the column, which a border could never be.
 *
 * ── Layer order ───────────────────────────────────────────────────────────
 *
 *   .sgxa-stats__bg       the laboratory photograph      z-index 0
 *   .sgxa-stats__overlay  the navy scrim over it         z-index 1
 *   .sgxa-stats__inner    the eyebrow and the figures    z-index 2
 */

.sgxa-stats {
	position: relative;
	overflow-x: clip;
	isolation: isolate;
	padding: 18px 0 20px;
	background-color: #0A2559;
}

/* ═════════ Background photograph ═════════ */

.sgxa-stats__bg {
	--sgxa-s-fade: 45%;

	position: absolute;
	inset-block: 0;
	inset-inline-end: 0;
	z-index: 0;
	width: 36%;
	overflow: hidden;
	pointer-events: none;
}

/*
 * The mask is what stops the photograph ending on a hard vertical edge. At a
 * fade of 0 the two stops coincide and the mask is a no-op, so turning it off
 * costs nothing.
 */
.sgxa-stats-bg-side.sgxa-stats-side-end .sgxa-stats__bg {
	inset-inline-end: 0;
	inset-inline-start: auto;
	-webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--sgxa-s-fade));
	mask-image: linear-gradient(to right, transparent 0, #000 var(--sgxa-s-fade));
}

.sgxa-stats-bg-side.sgxa-stats-side-start .sgxa-stats__bg {
	inset-inline-start: 0;
	inset-inline-end: auto;
	-webkit-mask-image: linear-gradient(to left, transparent 0, #000 var(--sgxa-s-fade));
	mask-image: linear-gradient(to left, transparent 0, #000 var(--sgxa-s-fade));
}

.sgxa-stats-bg-full .sgxa-stats__bg {
	inset: 0;
	width: 100%;
	-webkit-mask-image: none;
	mask-image: none;
}

.sgxa-stats__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
}

.sgxa-stats__overlay {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
}

/* ═════════ Container ═════════ */

.sgxa-stats__inner {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: 24px;
}

.sgxa-stats--container-full .sgxa-stats__inner {
	max-width: none;
}

/* The eyebrow is white here rather than the blue the light sections use. */
.sgxa-stats .sgxa-head {
	margin-bottom: 12px;
}

.sgxa-stats .sgxa-head__eyebrow {
	color: #FFFFFF;
	font-size: 11px;
	letter-spacing: 1.3px;
}

.sgxa-stats .sgxa-head__title {
	color: #FFFFFF;
}

.sgxa-stats .sgxa-head__desc {
	color: rgba(255, 255, 255, .7);
}

/* ═════════ Grid ═════════ */

.sgxa-stats__grid {
	--sgxa-col-gap: 0px;
	--sgxa-row-gap: 0px;
	--sgxa-s-sep-color: rgba(255, 255, 255, .16);
	--sgxa-s-sep-w: 1px;
	--sgxa-s-sep-len: 100%;
}

.sgxa-stats__cell {
	position: relative;
	display: flex;
	padding: 0 16px 0 18px;
}

/* First column lines up with the container edge and the eyebrow above it. */
.sgxa-stats__cell:first-child {
	padding-inline-start: 0;
}

.sgxa-stats__cell:not(:first-child)::before {
	content: "";
	position: absolute;
	display: block;
	inset-block-start: 50%;
	inset-inline-start: 0;
	width: var(--sgxa-s-sep-w);
	height: var(--sgxa-s-sep-len);
	transform: translateY(-50%);
	background-color: var(--sgxa-s-sep-color);
	pointer-events: none;
}

/* ═════════ Figure ═════════ */

.sgxa-stats__item {
	--sgxa-s-t: 260ms;
	--sgxa-s-lift: 0px;
	--sgxa-s-icon-scale: 1;

	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	color: inherit;
	text-align: start;
	text-decoration: none;
	transition:
		background-color var(--sgxa-s-t) ease,
		border-color var(--sgxa-s-t) ease,
		box-shadow var(--sgxa-s-t) ease,
		transform var(--sgxa-s-t) ease;
}

.sgxa-stats__item:hover {
	transform: translateY(var(--sgxa-s-lift));
}

a.sgxa-stats__item:focus-visible {
	outline: 2px solid #FFFFFF;
	outline-offset: 3px;
}

.sgxa-stats__head {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 9px;
	min-width: 0;
	margin-bottom: 4px;
}

.sgxa-stats__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	color: #FFFFFF;
	font-size: 17px;
	line-height: 0;
	transition:
		color var(--sgxa-s-t) ease,
		background-color var(--sgxa-s-t) ease,
		border-color var(--sgxa-s-t) ease,
		transform var(--sgxa-s-t) ease;
}

.sgxa-stats__item:hover .sgxa-stats__icon {
	transform: scale(var(--sgxa-s-icon-scale));
}

.sgxa-stats__value {
	display: inline-flex;
	align-items: baseline;
	gap: 0;
	color: #FFFFFF;
	font-size: 23px;
	font-weight: 700;
	line-height: 1.1;
	transition: color var(--sgxa-s-t) ease;
	/* Keeps the row from reflowing as the count-up runs through its digits. */
	font-variant-numeric: tabular-nums;
}

.sgxa-stats__label {
	margin: 0 0 5px;
	color: #FFFFFF;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.35;
	transition: color var(--sgxa-s-t) ease;
}

.sgxa-stats__text {
	margin: 0;
	color: rgba(255, 255, 255, .62);
	font-size: 10.5px;
	line-height: 1.45;
	text-wrap: pretty;
	transition: color var(--sgxa-s-t) ease;
}

/* ═════════ Responsive fallbacks ═════════ */

/*
 * Columns, gaps, padding, rule style, image width and fade, and every type
 * size have responsive controls, so only behaviour without a control repeats
 * here.
 *
 * Once the six figures wrap onto more than one row the first column of each
 * new row still butts against the container edge, so the flush-left rule has
 * to relax or the second row would sit inset from the first.
 */
@media (max-width: 1024px) {

	.sgxa-stats__cell:first-child {
		padding-inline-start: 18px;
	}

	.sgxa-stats__cell {
		padding-block: 2px;
	}
}

@media (max-width: 767px) {

	.sgxa-stats__cell:first-child {
		padding-inline-start: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {

	.sgxa-stats__item,
	.sgxa-stats__icon,
	.sgxa-stats__value,
	.sgxa-stats__label,
	.sgxa-stats__text {
		transition: none !important;
	}

	.sgxa-stats__item:hover,
	.sgxa-stats__item:hover .sgxa-stats__icon {
		transform: none;
	}
}
