/**
 * Wasla interstitial (js/wasla-interstitial.js).
 * Phone / app: full screen, creative cropped to fill (keep content in the central safe zone).
 * Desktop: the creative centred over a dark backdrop, sized to fit the window.
 */

html.wist-open,
html.wist-open body {
    overflow: hidden !important;
}

.wist {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 10, 20, .82);
    font-family: inherit;
    animation: wist-in .25s ease both;
}

.wist.is-closing {
    animation: wist-out .25s ease both;
}

@keyframes wist-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes wist-out { from { opacity: 1; } to { opacity: 0; } }

.wist__box {
    position: relative;
    overflow: hidden;
    background: #000;
}

.wist__link {
    display: block;
    width: 100%;
    height: 100%;
}

.wist__media {
    display: block;
}

/* ── Phone / app: full screen ── */
.wist--full {
    background: #000;
}

.wist--full .wist__box {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
}

.wist--full .wist__media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wist--contain .wist__media {
    object-fit: contain;
}

/* ── Desktop: centred ── */
.wist--desktop .wist__box {
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}

.wist--desktop .wist__media {
    width: auto;
    height: auto;
    max-width: min(90vw, 1600px);
    max-height: 86vh;
}

/* ── Top bar: badge + skip ── */
.wist__top {
    position: absolute;
    inset: 0 0 auto 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    padding-top: max(14px, env(safe-area-inset-top));
    background: linear-gradient(rgba(0, 0, 0, .45), rgba(0, 0, 0, 0));
    pointer-events: none;
}

.wist__top > * {
    pointer-events: auto;
}

.wist__badge {
    padding: 3px 10px;
    border-radius: 6px;
    background: #ffd400;
    color: #111;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
}

/* Close "X": appears once the skip delay is over */
.wist .wist__skip {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 50%;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transform: scale(.8);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s, background .15s ease, color .15s ease;
}

.wist .wist__skip.is-visible {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    transition: opacity .2s ease, transform .2s ease, visibility 0s, background .15s ease, color .15s ease;
}

/* Hello Elementor colours every button pink (#c36) on hover / focus: keep ours neutral. */
.wist .wist__skip:focus,
.wist .wist__skip:active {
    border-color: rgba(255, 255, 255, .55);
    background: rgba(0, 0, 0, .6);
    color: #fff;
}

.wist .wist__skip:hover,
.wist .wist__skip:focus-visible {
    border-color: #fff;
    background: #fff;
    color: #111;
}

.wist .wist__skip:focus-visible {
    outline: 2px solid #ffd400;
    outline-offset: 2px;
}

/* ── Bottom: CTA + sound ── */
.wist__cta {
    position: absolute;
    left: 50%;
    bottom: max(28px, calc(env(safe-area-inset-bottom) + 20px));
    transform: translateX(-50%);
    padding: 12px 28px;
    border-radius: 999px;
    background: #ffd400;
    color: #111 !important;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none !important;
    white-space: nowrap;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}

.wist__cta:hover {
    background: #ffe24d;
}

.wist .wist__sound {
    position: absolute;
    right: 16px;
    bottom: max(28px, calc(env(safe-area-inset-bottom) + 20px));
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 999px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.wist .wist__sound:hover,
.wist .wist__sound:focus,
.wist .wist__sound:active {
    border-color: #fff;
    background: rgba(0, 0, 0, .75);
    color: #fff;
}

.wist .wist__cta ~ .wist__sound {
    bottom: max(88px, calc(env(safe-area-inset-bottom) + 80px));
}

.wist--desktop .wist__cta,
.wist.wist--desktop .wist__sound {
    bottom: 24px;
}

/* ── Auto-close progress ── */
.wist__progress {
    position: absolute;
    inset: auto 0 0 0;
    height: 4px;
    background: rgba(255, 255, 255, .2);
}

.wist__progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: #ffd400;
    transform-origin: right center;
    animation: wist-progress linear both;
}

@keyframes wist-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
    .wist,
    .wist.is-closing {
        animation: none;
    }
}
