/* NikolicWP Zavesa – the curtain shown while a page loads.
 * Colours and size come from the settings as CSS variables (printed in <head>). */

.nwp-zavesa {
	--nwp-zavesa-speed: .45s;
	--nwp-zv-s: min(var(--nwp-zavesa-size, 100px), 70vw, 60vh);
	align-items: center;
	justify-content: center;
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity var(--nwp-zavesa-speed) ease, visibility var(--nwp-zavesa-speed) ease, transform var(--nwp-zavesa-speed) ease;
	/* The curtain takes no clicks of its own. While the page loads, the page under it is hidden
	   (html.nwp-zavesa-lock), so nothing can be clicked anyway; and a theme that asks which element
	   is at the top of the screen (to measure a sticky header) gets the page, not the curtain.
	   When it covers the page again for a link (is-leaving), it holds the clicks. */
	pointer-events: none;
	overflow: hidden;
}
.nwp-zavesa.is-leaving { pointer-events: auto; }
.nwp-zavesa__inner {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
	padding: 24px;
	text-align: center;
	transition: opacity .25s ease;
}
.nwp-zavesa__media { width: var(--nwp-zv-s); height: var(--nwp-zv-s); border: 0; display: block; }
.nwp-zavesa__img { object-fit: contain; }
.nwp-zavesa__text { margin: 0; color: var(--nwp-zavesa-color); font: inherit; font-size: 15px; font-weight: 600; letter-spacing: .02em; opacity: .85; }

/* Screen readers: "Loading…" */
.nwp-zavesa__sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Progress */
.nwp-zavesa__progress { display: flex; align-items: center; gap: 10px; width: min(var(--nwp-zv-s) * 1.6, 70vw); min-width: 120px; }
.nwp-zavesa__bar { position: relative; flex: 1; height: 4px; border-radius: 4px; overflow: hidden; background: rgba(127, 127, 127, .2); }
.nwp-zavesa__bar i, .nwp-zavesa__line i { position: absolute; inset: 0; background: var(--nwp-zavesa-color); transform: scaleX(0); transform-origin: left center; transition: transform .25s ease-out; }
.nwp-zavesa__pct { min-width: 3.2em; color: var(--nwp-zavesa-color); font: inherit; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.nwp-zavesa__line { position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 3; }

/* Lifting */
.nwp-zavesa.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.nwp-zavesa--exit-zoom.is-hidden { transform: scale(1.08); }
.nwp-zavesa--exit-slide.is-hidden { transform: translateY(-6%); }
.nwp-zavesa.is-gone { display: none !important; }

/* "Curtain": two halves part to the sides */
.nwp-zavesa--curtain { --nwp-zavesa-speed: .7s; background: transparent; }
.nwp-zavesa__panel { position: absolute; top: 0; bottom: 0; width: 50.5%; background: var(--nwp-zavesa-bg); background: var(--nwp-zavesa-fill, var(--nwp-zavesa-bg)); background-attachment: fixed; z-index: 1; transition: transform var(--nwp-zavesa-speed) cubic-bezier(.77, 0, .18, 1); }
.nwp-zavesa__panel--l { left: 0; box-shadow: inset -18px 0 24px -22px rgba(0, 0, 0, .35); }
.nwp-zavesa__panel--r { right: 0; box-shadow: inset 18px 0 24px -22px rgba(0, 0, 0, .35); }
.nwp-zavesa--curtain.is-hidden { opacity: 1; transition: visibility 0s linear var(--nwp-zavesa-speed); }
.nwp-zavesa--curtain.is-hidden .nwp-zavesa__panel--l { transform: translateX(-102%); }
.nwp-zavesa--curtain.is-hidden .nwp-zavesa__panel--r { transform: translateX(102%); }
.nwp-zavesa.is-hidden .nwp-zavesa__inner { opacity: 0; }

/* Shown again while leaving for another page */
.nwp-zavesa.is-leaving { display: flex !important; transition-duration: .2s; }

/* Spinners */
.nwp-zavesa__spinner { display: block; position: relative; width: var(--nwp-zv-s); height: var(--nwp-zv-s); color: var(--nwp-zavesa-color); }
.nwp-zavesa__spinner--ring { box-sizing: border-box; border-radius: 50%; border: max(3px, calc(var(--nwp-zv-s) / 22)) solid rgba(127, 127, 127, .18); border-top-color: currentColor; animation: nwp-zavesa-spin .8s linear infinite; }
.nwp-zavesa__spinner--dots { display: flex; align-items: center; justify-content: center; gap: calc(var(--nwp-zv-s) / 10); height: auto; }
.nwp-zavesa__spinner--dots i { display: block; width: calc(var(--nwp-zv-s) / 5); height: calc(var(--nwp-zv-s) / 5); border-radius: 50%; background: currentColor; animation: nwp-zavesa-dot 1.2s ease-in-out infinite both; }
.nwp-zavesa__spinner--dots i:nth-child(2) { animation-delay: .15s; }
.nwp-zavesa__spinner--dots i:nth-child(3) { animation-delay: .3s; }
.nwp-zavesa__spinner--bars { display: flex; align-items: center; justify-content: center; gap: calc(var(--nwp-zv-s) / 14); height: calc(var(--nwp-zv-s) * .6); }
.nwp-zavesa__spinner--bars i { display: block; width: calc(var(--nwp-zv-s) / 9); height: 100%; border-radius: 4px; background: currentColor; animation: nwp-zavesa-bar 1s ease-in-out infinite; }
.nwp-zavesa__spinner--bars i:nth-child(2) { animation-delay: .1s; }
.nwp-zavesa__spinner--bars i:nth-child(3) { animation-delay: .2s; }
.nwp-zavesa__spinner--bars i:nth-child(4) { animation-delay: .3s; }
.nwp-zavesa__spinner--pulse i { position: absolute; inset: 0; border-radius: 50%; background: currentColor; opacity: 0; animation: nwp-zavesa-wave 1.6s ease-out infinite; }
.nwp-zavesa__spinner--pulse i:nth-child(2) { animation-delay: .8s; }
.nwp-zavesa__spinner--dual { box-sizing: border-box; border-radius: 50%; border: max(3px, calc(var(--nwp-zv-s) / 22)) solid transparent; border-top-color: currentColor; border-bottom-color: currentColor; animation: nwp-zavesa-spin 1.1s linear infinite; }
.nwp-zavesa__spinner--dual i { position: absolute; inset: 22%; box-sizing: border-box; border-radius: 50%; border: max(2px, calc(var(--nwp-zv-s) / 30)) solid transparent; border-left-color: currentColor; border-right-color: currentColor; animation: nwp-zavesa-spin .8s linear infinite reverse; }
.nwp-zavesa__spinner--dual i + i { display: none; }
@keyframes nwp-zavesa-spin { to { transform: rotate(360deg); } }
@keyframes nwp-zavesa-wave { 0% { transform: scale(.15); opacity: .9; } 100% { transform: scale(1); opacity: 0; } }
@keyframes nwp-zavesa-dot { 0%, 80%, 100% { transform: scale(.4); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
@keyframes nwp-zavesa-bar { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

/* Logo animations (picture type) */
.nwp-zavesa-anim-pulse { animation: nwp-zavesa-pulse 1.6s ease-in-out infinite; }
.nwp-zavesa-anim-rotate { animation: nwp-zavesa-spin 2s linear infinite; }
.nwp-zavesa-anim-fade { animation: nwp-zavesa-fade 1.4s ease-in-out infinite; }
.nwp-zavesa-anim-bounce { animation: nwp-zavesa-bounce 1s ease-in-out infinite; }
@keyframes nwp-zavesa-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.08); opacity: .85; } }
@keyframes nwp-zavesa-fade { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes nwp-zavesa-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* Nik – the NikolicWP mascot (curtain type "Nik" and the admin screens) */
.nwp-zavesa__nik { display: block; width: min(calc(var(--nwp-zavesa-size, 100px) * 1.5), 70vw, 50vh); height: auto; }
.nwp-nik { display: block; overflow: visible; }
.nwp-nik__bob { animation: nwp-nik-bob 1.2s ease-in-out infinite; }
.nwp-nik__shadow { transform-box: fill-box; transform-origin: center; animation: nwp-nik-shadow 1.2s ease-in-out infinite; }
.nwp-nik__eyes { transform-box: fill-box; transform-origin: center; animation: nwp-nik-blink 3.6s infinite; }
.nwp-nik__tip { animation: nwp-nik-tip 1.2s ease-in-out infinite; }
.nwp-nik__d { animation: nwp-nik-dot 1.2s ease-in-out infinite; }
.nwp-nik__d2 { animation-delay: .2s; }
.nwp-nik__d3 { animation-delay: .4s; }
@keyframes nwp-nik-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes nwp-nik-shadow { 0%, 100% { transform: scaleX(1); opacity: 1; } 50% { transform: scaleX(.84); opacity: .7; } }
@keyframes nwp-nik-blink { 0%, 46%, 50%, 100% { transform: scaleY(1); } 48% { transform: scaleY(.08); } }
@keyframes nwp-nik-tip { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes nwp-nik-dot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-8px); } }

/* Visitors who asked their system for less motion */
@media (prefers-reduced-motion: reduce) {
	.nwp-zavesa--rm, .nwp-zavesa--rm * { animation-duration: 2.4s !important; transition-duration: .15s !important; }
	.nwp-zavesa--rm .nwp-zavesa-anim-pulse, .nwp-zavesa--rm .nwp-zavesa-anim-rotate, .nwp-zavesa--rm .nwp-zavesa-anim-bounce { animation: none !important; }
	.nwp-zavesa--rm.is-hidden { transform: none !important; }
	.nwp-zavesa--rm .nwp-nik *, .nwp-nik-still .nwp-nik * { animation: none !important; }
	.nwp-zavesa--rm .nwp-nik__d { opacity: .6; }
}
