/**
 * EW Popup — frontend styles
 * Version: 1.0.0
 */

.ew-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20, 28, 36, 0.62);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: ew-popup-fade-in 0.22s ease-out;
}

.ew-popup-modal {
    position: relative;
    max-width: min(700px, 94vw);
    max-height: 85vh;
    animation: ew-popup-pop-in 0.26s cubic-bezier(0.34, 1.3, 0.64, 1);
}

.ew-popup-link {
    display: block;
    line-height: 0;
}

.ew-popup-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.ew-popup-close {
    position: absolute;
    top: -14px;
    right: -14px;
    z-index: 1;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    color: #333333;
    font-size: 22px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    transition: transform 0.12s ease, background 0.12s ease;
}

.ew-popup-close:hover,
.ew-popup-close:focus {
    background: #e8f4fc; /* --ew-primary-blue-light */
    transform: scale(1.08);
}

.ew-popup-close:focus-visible {
    outline: 2px solid #449ae3; /* --ew-primary-blue */
    outline-offset: 2px;
}

.ew-popup--closing {
    animation: ew-popup-fade-out 0.2s ease-in forwards;
}

@keyframes ew-popup-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes ew-popup-fade-out {
    from { opacity: 1; }
    to   { opacity: 0; }
}

@keyframes ew-popup-pop-in {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

@media (max-width: 782px) {
    .ew-popup-overlay {
        padding: 14px;
    }
    /* Keep the close target on-screen on small viewports. */
    .ew-popup-close {
        top: -10px;
        right: -6px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ew-popup-overlay,
    .ew-popup-modal,
    .ew-popup--closing {
        animation: none;
    }
}
