/* ==========================================================================
   WudGres preloader
   The W monogram fills bottom-up, then the flag squares from the logo cycle.
   Replaces the theme's generic .loading-overlay spinner.
   ========================================================================== */

.wg-loader {
	position: fixed;
	inset: 0;
	z-index: 1000000;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 26px;
	background: #0b0b0b;
	opacity: 1;
	visibility: visible;
	transition: opacity 0.55s ease, visibility 0s linear 0.55s;
}

.wg-loader.is-done {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

/* --- Monogram ----------------------------------------------------------- */

.wg-loader__mark {
	position: relative;
	width: 76px;
	height: 76px;
}

.wg-loader__mark svg {
	display: block;
	width: 76px;
	height: 76px;
}

/* Dim ghost sits underneath so the shape reads even before the fill starts */
.wg-loader__ghost {
	color: rgba(255, 255, 255, 0.16);
}

/* Bottom-anchored window whose height animates, revealing the bright copy */
.wg-loader__fill {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 76px;
	height: 0;
	overflow: hidden;
	animation: wgFill 1.9s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.wg-loader__fill svg {
	position: absolute;
	left: 0;
	bottom: 0;
	color: #fff;
}

@keyframes wgFill {
	0% {
		height: 0;
	}
	55% {
		height: 100%;
	}
	80% {
		height: 100%;
	}
	100% {
		height: 0;
	}
}

/* --- Flag squares ------------------------------------------------------- */

.wg-loader__flag {
	display: flex;
	gap: 7px;
}

.wg-loader__flag span {
	width: 9px;
	height: 9px;
	opacity: 0.28;
	animation: wgFlag 1.9s ease-in-out infinite;
}

.wg-loader__flag span:nth-child(1) {
	background: #ff9933;
	animation-delay: 0s;
}

.wg-loader__flag span:nth-child(2) {
	background: #fff;
	animation-delay: 0.18s;
}

.wg-loader__flag span:nth-child(3) {
	background: #138808;
	animation-delay: 0.36s;
}

@keyframes wgFlag {
	0%,
	70%,
	100% {
		opacity: 0.28;
		transform: translateY(0);
	}
	28% {
		opacity: 1;
		transform: translateY(-5px);
	}
}

/* --- Suppress the theme's default loader -------------------------------- */

.loading-overlay,
.loading-overlay .loader {
	display: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.wg-loader__fill {
		height: 100%;
		animation: none;
	}

	.wg-loader__flag span {
		opacity: 1;
		animation: none;
	}
}
