/**
 * Gadimat — page-transition wipe (sgtm.ma style).
 * A solid brand panel with a rounded/curved (wave) leading edge wipes up to
 * cover the screen, then wipes off the top to reveal the next page.
 * - Between pages: shows the circular loader.
 * - First / direct load: same navy cover, but no loader icon.
 * Default state is "parked off-screen" so the site is never blocked if JS fails.
 */
#gadimat-wipe {
    position: fixed;
    inset: 0;
    z-index: 2147483600;
    overflow: hidden;
    pointer-events: none;
    visibility: hidden;
}
#gadimat-wipe.is-active { visibility: visible; }

#gadimat-wipe .gadimat-wipe__panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #2a5291 0%, #14274a 100%);
    /* parked just below the viewport (+ room for the curved edge) */
    transform: translateY(calc(100% + 17vh));
    transition: transform 1.15s cubic-bezier(0.76, 0, 0.24, 1);
    will-change: transform;
}

/* Curved (wave) leading edges — a smooth dome on top and bottom of the panel */
#gadimat-wipe .gadimat-wipe__panel::before,
#gadimat-wipe .gadimat-wipe__panel::after {
    content: "";
    position: absolute;
    left: -3vw;
    right: -3vw;
    height: 16vh;
}
#gadimat-wipe .gadimat-wipe__panel::before {
    bottom: 100%;
    background: #2a5291;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
#gadimat-wipe .gadimat-wipe__panel::after {
    top: 100%;
    background: #14274a;
    border-radius: 0 0 50% 50% / 0 0 100% 100%;
}

#gadimat-wipe.is-cover .gadimat-wipe__panel { transform: translateY(0); }
#gadimat-wipe.is-reveal .gadimat-wipe__panel { transform: translateY(calc(-100% - 17vh)); }
#gadimat-wipe.gadimat-wipe--noanim .gadimat-wipe__panel { transition: none !important; }

/* No loader icon — keep only the navy background wipe. */
#gadimat-wipe .gadimat-wipe__loader { display: none !important; }
#gadimat-wipe .gadimat-wipe__arc {
    stroke-dasharray: 44 132;
    transform-origin: 50% 50%;
    animation: gadimat-wipe-spin 0.9s linear infinite;
}
@keyframes gadimat-wipe-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    #gadimat-wipe .gadimat-wipe__panel { transition-duration: 0.001ms; }
    #gadimat-wipe .gadimat-wipe__arc { animation: none; }
}
