/**
 * The screen of `loading()`, for pages that have none of their own. The
 * styles of the slider are in style.css.
 *
 * --gs-loaded runs from 0 to 1 while the media load.
 */

.gs-loading {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: grid;
	place-content: center;
	justify-items: center;
	gap: 12px;
	background: var(--gs-loading-back, #111);
	color: var(--gs-loading-color, #fff);
	font: 500 14px/1 system-ui, sans-serif;
	font-variant-numeric: tabular-nums;
	transition: opacity 0.5s, visibility 0.5s;
}

/* The line under the number. */
.gs-loading::after {
	content: "";
	width: 160px;
	max-width: 40vw;
	height: 2px;
	background:
		linear-gradient(currentcolor, currentcolor) no-repeat 0 0 /
			calc(var(--gs-loaded, 0) * 100%) 100%,
		color-mix(in srgb, currentcolor 20%, transparent);
	transition: background-size 0.3s;
}

.gs-loading.gs-loaded {
	opacity: 0;
	visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.gs-loading,
	.gs-loading::after {
		transition: none;
	}
}
