/* Line counts (stats.js) in their card (hover-card.css): the total, then
   each language. */

.loc-card-title {
	margin: 0 0 2px;
	font-size: 12px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.loc-card-total {
	margin: 0 0 var(--s3);
}

.loc-card-aside {
	margin: var(--s3) 0 0;
	font-size: 12px;
	line-height: 16px;
	color: var(--muted);
}

/* Languages as rows: the name and its lines, the share, and a bar of the
   share, every bar in the accent (the names say which is which). */
.loc-languages {
	display: flex;
	flex-direction: column;
	gap: var(--s2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.loc-languages li {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	column-gap: var(--s3);
	row-gap: 4px;
	align-items: baseline;
}

.loc-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.loc-value,
.loc-share {
	color: var(--muted);
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.loc-share {
	min-width: 4ch;
}

.loc-track {
	grid-column: 1 / -1;
	height: 4px;
	border-radius: 2px;
	background: color-mix(in srgb, var(--text) 12%, transparent);
	overflow: hidden;
}

.loc-fill {
	display: block;
	width: calc(var(--share) * 100%);
	min-width: 2px;
	height: 100%;
	border-radius: inherit;
	background: var(--accent);
	transform-origin: left;
	animation: languageGrow var(--spring-grow-duration, 700ms) var(--spring-grow, ease-out) 120ms backwards;
}

/* The bars grow from the start as their figures arrive. */
@keyframes languageGrow {
	from {
		transform: scaleX(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.loc-fill {
		animation: none;
	}
}
