/**
 * Component: stat.
 *
 * A value and label under a thin gradient hairline (orange fading out).
 * Markup: cartrack_stat() in inc/components.php. Count-up: js/countup.js.
 *
 * @package cartrack
 */

.stat {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: var(--stat-label-gap);
	padding-top: var(--stat-line-offset);
}

.stat::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: var(--stat-line-width);
	max-width: 100%;
	height: var(--stat-line-thickness);
	background: var(--stat-line-gradient);
}

.stat__value {
	color: var(--color-text);
	font-family: var(--t-stat-family);
	font-size: var(--t-stat-size);
	font-weight: var(--t-stat-weight);
	line-height: var(--t-stat-line-height);
	letter-spacing: var(--t-stat-tracking);
	/* Digits keep the same width while counting. */
	font-variant-numeric: tabular-nums;
}

/* JS reserves the final width here (min-width) so the stat doesn't jiggle. */
.stat__number {
	display: inline-block;
}

.stat__label {
	color: var(--color-text);
	font-family: var(--t-body-family);
	font-size: var(--t-body-size);
	font-weight: var(--t-body-weight);
	line-height: var(--t-body-line-height);
	letter-spacing: var(--t-body-tracking);
}
