/* ── MYT Image Popup ────────────────────────────────────────── */

/* Overlay — sits above Divi (z-index 999999) */
.myt-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;               /* toggled by JS */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.myt-popup-overlay.myt-popup-visible {
    opacity: 1;
}

/* Dark backdrop */
.myt-popup-overlay-bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    cursor: pointer;             /* hint it's clickable to close */
}

/* Popup wrapper */
.myt-popup-container {
    position: relative;
    max-width: 680px;
    width: 90vw;
    max-height: 90vh;
    z-index: 1;                  /* above the bg inside the overlay */
    transform: scale(0.95);
    transition: transform 0.3s ease;
    line-height: 0;              /* kill whitespace around img */
}
.myt-popup-visible .myt-popup-container {
    transform: scale(1);
}

/* Close button — big, obvious, idiot-proof */
.myt-popup-close {
    position: absolute;
    top: -18px;
    right: -18px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: #000;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, background 0.15s ease;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
}
.myt-popup-close:hover,
.myt-popup-close:focus {
    background: #d63638;
    transform: scale(1.1);
    outline: none;
}

/* Image link — no underlines or borders */
.myt-popup-image-link {
    display: block;
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Images */
.myt-popup-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Desktop / mobile image switching */
.myt-popup-img-mobile {
    display: none;
}

@media (max-width: 767px) {
    .myt-popup-container {
        max-width: 92vw;
    }
    .myt-popup-img-desktop {
        display: none;
    }
    .myt-popup-img-mobile {
        display: block;
    }

    /* Re-position close button so it doesn't get cut off on small screens */
    .myt-popup-close {
        top: -14px;
        right: -6px;
    }
}
