/**
 * ELEGANT IMAGE POPUPS – FRONTEND STYLES
 * =======================================
 * Edit this file freely over FTP:
 * wp-content/plugins/elegant-image-popups/assets/css/popup.css
 * The plugin versions its URL with a hash of the CSS file contents.
 */

/* Block site scrolling while the modal is visible. */
body.eip-popup-open {
    overflow: hidden !important;
}

/* The entire backdrop is invisible and non-interactive until the image loads. */
.eip-popup-overlay[hidden] {
    display: none !important;
}

.eip-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 36px 16px;
    box-sizing: border-box;
    overflow: auto;
    background: rgba(13, 20, 30, 0.57);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: eip-backdrop-in 220ms ease-out both;
}

.eip-popup-overlay *,
.eip-popup-overlay *::before,
.eip-popup-overlay *::after {
    box-sizing: border-box;
}

.eip-popup-dialog {
    position: relative;
    width: fit-content;
    max-width: 100%;
    margin: auto;
    outline: none;
    isolation: isolate;
    animation: eip-dialog-in 260ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.eip-popup-link {
    display: block;
    width: fit-content;
    max-width: 100%;
    line-height: 0;
    text-decoration: none !important;
    border: 0 !important;
    outline: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 22px 75px rgba(2, 8, 20, 0.3), 0 3px 15px rgba(0, 0, 0, 0.11);
    background: #fff;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.eip-popup-media {
    display: block;
    line-height: 0;
}

.eip-popup-image {
    display: block;
    width: auto;
    height: auto;
    max-width: min(var(--eip-max-width, 720px), 92vw);
    max-height: calc(100vh - 96px);
    max-height: calc(100dvh - 96px);
    object-fit: contain;
    border: 0;
    border-radius: inherit;
}

.eip-popup-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 27px 80px rgba(2, 8, 20, 0.36), 0 5px 16px rgba(0, 0, 0, 0.14);
}

.eip-popup-link:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 5px;
}

.eip-popup-close {
    position: absolute;
    z-index: 2;
    top: -17px;
    right: -17px;
    left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 39px;
    height: 39px;
    padding: 0;
    border: 1px solid rgba(10, 20, 30, 0.08);
    border-radius: 50%;
    background: #fff;
    color: #26313b;
    box-shadow: 0 5px 20px rgba(4, 12, 24, 0.18);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    -webkit-appearance: none;
    appearance: none;
    transition: transform 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.eip-popup-close:hover {
    background: #f4f6f8;
    transform: scale(1.07);
    box-shadow: 0 7px 23px rgba(4, 12, 24, 0.23);
}

.eip-popup-close:focus-visible {
    outline: 3px solid #5b9bff;
    outline-offset: 3px;
}

.eip-popup-close svg {
    display: block;
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

@keyframes eip-backdrop-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes eip-dialog-in {
    from { opacity: 0; transform: translateY(11px) scale(0.975); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 600px) {
    .eip-popup-overlay { padding: 35px 12px; }
    .eip-popup-link { border-radius: 12px; }
    .eip-popup-image {
        max-width: min(var(--eip-max-width, 720px), 92vw);
        max-height: calc(100vh - 92px);
        max-height: calc(100dvh - 92px);
    }
    .eip-popup-close { top: -16px; right: -8px; width: 36px; height: 36px; }
}

@media (prefers-reduced-motion: reduce) {
    .eip-popup-overlay, .eip-popup-dialog { animation: none !important; }
    .eip-popup-link, .eip-popup-close { transition: none !important; }
}
