﻿/* =========================================================
   HOME PAGE POPUPS — popup.css (used by js/popup.js)
   ========================================================= */
body.pp-lock {
    overflow: hidden;
}

.pp-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: rgba(6,30,10,.58);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    opacity: 0;
    transition: opacity .4s cubic-bezier(.2,.9,.3,1);
}

    .pp-overlay[hidden] {
        display: none;
    }

    .pp-overlay.open {
        opacity: 1;
    }

/* wrapper shrinks to the image inside it */
.pp-wrapper {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: 100%;
    line-height: 0;
    border-radius: 24px;
    overflow: hidden;
    background: #0f1a12;
    box-shadow: 0 40px 80px -20px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.15) inset;
    transform: scale(.92) translateY(24px);
    opacity: 0;
    transition: transform .55s cubic-bezier(.2,.9,.3,1) .05s, opacity .45s cubic-bezier(.2,.9,.3,1) .05s;
}

.pp-overlay.open .pp-wrapper {
    transform: none;
    opacity: 1;
}

/* soft top/bottom shade so the close button and caption stay readable */
.pp-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0,0,0,.25) 0%, transparent 22%, transparent 72%, rgba(0,0,0,.35) 100%);
}

.pp-slide {
    display: none;
    margin: 0;
}

    .pp-slide.active {
        display: block;
        animation: ppFade .45s ease;
    }

    .pp-slide a {
        display: block;
    }

@keyframes ppFade {
    from {
        opacity: 0;
    }
}

.pp-image {
    display: block;
    width: auto;
    height: auto;
    max-width: min(92vw, 900px);
    max-height: 86vh;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.pp-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1.1rem;
    z-index: 2;
    padding: 0 4rem;
    text-align: center;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    text-shadow: 0 2px 12px rgba(0,0,0,.6);
    pointer-events: none;
}

.pp-multi .pp-caption {
    bottom: 2.4rem;
}

.pp-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.6);
    box-shadow: 0 10px 24px -8px rgba(0,0,0,.4);
    color: #2d2a24;
    cursor: pointer;
    transition: transform .3s cubic-bezier(.2,.9,.4,1), background .3s ease, color .3s ease;
}

    .pp-close:hover {
        background: #fff;
        color: var(--orange-dark);
        transform: scale(1.1) rotate(90deg);
    }

    .pp-close svg {
        width: 20px;
        height: 20px;
    }

.pp-arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 42px;
    height: 42px;
    margin-top: -21px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.85);
    color: #1f2937;
    box-shadow: 0 8px 20px -8px rgba(0,0,0,.45);
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

    .pp-arrow:hover {
        background: var(--green-dark);
        color: #fff;
    }

    .pp-arrow svg {
        width: 20px;
        height: 20px;
    }

.pp-prev {
    left: .9rem;
}

.pp-next {
    right: .9rem;
}

.pp-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: .9rem;
    z-index: 3;
    display: flex;
    justify-content: center;
    gap: 8px;
}

    .pp-dots button {
        width: 8px;
        height: 8px;
        padding: 0;
        border-radius: 50%;
        background: rgba(255,255,255,.55);
        transition: width .25s ease, background .25s ease;
    }

        .pp-dots button.active {
            width: 24px;
            border-radius: 5px;
            background: #fff;
        }

.pp-overlay button:focus-visible {
    outline: 3px solid var(--orange);
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .pp-overlay {
        padding: 1rem;
    }

    .pp-wrapper {
        border-radius: 18px;
    }

    .pp-image {
        max-width: calc(100vw - 2rem);
        max-height: 80vh;
    }

    .pp-close {
        top: .75rem;
        right: .75rem;
        width: 40px;
        height: 40px;
    }

    .pp-arrow {
        width: 36px;
        height: 36px;
        margin-top: -18px;
    }

    .pp-caption {
        font-size: .9rem;
        padding: 0 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pp-overlay, .pp-wrapper, .pp-close {
        transition-duration: .01ms !important;
    }

    .pp-slide.active {
        animation: none;
    }
}


/* =========================================================
   HOME PAGE POPUPS — one after another
   ========================================================= */
/* leaving / arriving animation when one popup closes and the next opens */
.pp-overlay.open .pp-wrapper.pp-swapping {
    opacity: 0;
    transform: scale(.94) translateY(14px);
    transition: transform .3s ease, opacity .3s ease;
}

/* "१ / ३" counter + "close all" at the top-left of the image */
.pp-top-left {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.2;
}

.pp-counter {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.92);
    color: var(--green-dark);
    font-size: .85rem;
    font-weight: 700;
    box-shadow: 0 8px 20px -8px rgba(0,0,0,.4);
}

.pp-skip {
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0,0,0,.45);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s ease;
}

    .pp-skip:hover {
        background: var(--orange-dark);
    }

@media (max-width: 600px) {
    .pp-top-left {
        top: .75rem;
        left: .75rem;
        gap: 6px;
    }

    .pp-counter, .pp-skip {
        padding: 5px 10px;
        font-size: .75rem;
    }
}
