/* ============================================================
   IFAD page preloader — logo + REAL (determinate) progress + fade.
   - White ground (matches the site overlay).
   - Gold progress fill that grows 0 -> 100% driven by preloader.js.
   - Optional gold "shine" sweep over the logo: only activates if the
     .ifad-vp__glint element is present in markup; harmless if absent.
   IFAD tweak: progress line is thinner (2px) and sits closer to the logo
   (inner gap 10px) per client request.
   ============================================================ */

#ifad-preloader {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #ffffff;
	will-change: opacity;
}
#ifad-preloader.is-done {
	opacity: 0;
	visibility: hidden;
	transition: opacity .55s ease, visibility .55s ease;
}

.ifad-vp__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 9px;                     /* line sits close under the logo */
	animation: ifadVpIn .55s cubic-bezier(.22, 1, .36, 1) both;
}

/* Logo (scaled 10% down from the 132px reference). */
.ifad-vp__logo { width: 119px; height: auto; display: block; }

/* Wrapper is only needed for the optional gold shine. */
.ifad-vp__logo-wrap {
	position: relative;
	display: block;
	line-height: 0;
}
.ifad-vp__glint {
	position: absolute;
	inset: 0;
	pointer-events: none;
	/* Mask by the logo alpha so the shine only shows on the logo shape. */
	-webkit-mask: url(../img/logo.svg) center / contain no-repeat;
	        mask: url(../img/logo.svg) center / contain no-repeat;
	background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.85) 50%, transparent 60%);
	background-size: 250% 100%;
	mix-blend-mode: screen;
	animation: ifadVpGlint 2.4s ease-in-out infinite;
}

/* Progress track + gold fill (determinate; width is set by JS). */
.ifad-vp__bar {
	position: relative;
	width: 119px;                 /* scaled 10% down, matches the logo width */
	height: 2px;                  /* thinner line */
	border-radius: 99px;
	background: #e5e5ea;          /* light track */
	overflow: hidden;
}
.ifad-vp__bar > span {
	display: block;
	height: 100%;
	width: 0;                     /* JS drives this from 0% to 100% */
	border-radius: 99px;
	background: linear-gradient(90deg, #e6c877, #caa24a, #b5872f); /* gold */
	transition: width .18s ease-out;
}

@keyframes ifadVpIn {
	from { opacity: 0; transform: translateY(10px) scale(.98); }
	to   { opacity: 1; transform: none; }
}
@keyframes ifadVpGlint {
	0%       { background-position: 180% 0; }
	55%,100% { background-position: -80% 0; }
}

@media ( prefers-reduced-motion: reduce ) {
	.ifad-vp__inner  { animation: none; }
	.ifad-vp__glint  { animation: none; }
	.ifad-vp__bar > span { transition: none; }
}
