/**
 * Commix's loader — the COMMIX wordmark with a sweep filling the letters and a runner along the
 * track (commix-loader.svg, printed inline by commix_loader_markup() in includes/loader.php; the
 * admin pages render the same file). This file only lays out the wrapper and maps the theme onto
 * the SVG's color hooks.
 *
 * REPLACEABILITY CONTRACT: a future loader design replaces commix-loader.svg and this file
 * without touching any calling code, as long as the wrapper stays .commix-loader (with the
 * optional .commix-loader__label).
 *
 * Colors: the Commix Style where there is one (a .commix-block's tokens, or an admin page's --cx-*
 * colors), else the SVG's own — the letters and track in the text color, the sweep from the
 * primary color into the text color (as the COMMIX wordmark). Design source:
 * H:\COMMIX\concepts\Commix loader\ (commix-loader-preview.html is the design sandbox).
 */

.commix-loader {
	--cx-ink: var(--foreground, var(--cx-text, currentColor));
	--cx-a: var(--primary, var(--cx-accent, #3a55d9));
	--cx-b: var(--foreground, var(--cx-text, #f0804f));
	--cx-mid: color-mix(in srgb, var(--cx-a) 55%, var(--cx-b));

	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
}

.commix-loader .cx-loader {
	display: block;
	width: var(--commix-loader-width, 240px);
	max-width: 100%;
	height: auto;
}

.commix-loader__label {
	font-size: 13px;
	letter-spacing: 0.02em;
	opacity: 0.7;
}

/* Full-screen version — shown by commix-loader-overlay.js while a plain form POST or link is in
   flight (a real page reload, not AJAX). Hidden by default; JS only ever adds/removes
   .is-visible, never touches display directly. */
.commix-loader-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: center;
	justify-content: center;
	background: rgba(247, 248, 252, 0.94);
	color: #1b1f2b;
}
.commix-loader-overlay.is-visible {
	display: flex;
}
@media (prefers-color-scheme: dark) {
	.commix-loader-overlay {
		background: rgba(10, 11, 16, 0.94);
		color: #f2f3f7;
	}
}
