.pap-popup-open {
    overflow: hidden;
}

.pap-popup-overlay {
    align-items: center;
    background: rgba(0, 0, 0, 0.68);
    bottom: 0;
    display: none;
    justify-content: center;
    left: 0;
    padding: 24px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 999999;
}

.pap-popup-overlay.pap-popup-visible {
    display: flex;
}

.pap-popup {
    background: #ffffff;
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
    max-height: calc(100vh - 48px);
    max-width: 680px;
    overflow: auto;
    position: relative;
    width: min(100%, 680px);
    animation: papPopupIn 180ms ease-out;
}

@keyframes papPopupIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.pap-popup-close {
    align-items: center;
    background: rgba(0, 0, 0, 0.72);
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    font-size: 28px;
    height: 38px;
    justify-content: center;
    line-height: 1;
    position: absolute;
    right: 12px;
    top: 12px;
    width: 38px;
    z-index: 4;
}

.pap-popup-close:hover,
.pap-popup-close:focus {
    background: #000000;
    outline: 2px solid #ffffff;
}

.pap-popup-image-link {
    display: block;
}

.pap-popup-media-list {
    display: grid;
    gap: 0;
}

.pap-popup-media-item {
    background: #ffffff;
}

.pap-popup-media-title {
    color: #111827;
    font-size: clamp(18px, 3vw, 24px);
    line-height: 1.25;
    margin: 0;
    padding: 24px 64px 16px 24px;
    text-align: center;
}

.pap-popup-image,
.pap-popup-video {
    aspect-ratio: 16 / 9;
    background: #000000;
    display: block;
    height: auto;
    object-fit: cover;
    width: 100%;
}

.pap-popup-audio {
    display: block;
    margin: 24px auto 24px;
    max-width: calc(100% - 48px);
    width: 560px;
}

.pap-popup-embed {
    aspect-ratio: 16 / 9;
    background: #000000;
    position: relative;
    width: 100%;
}

.pap-popup-embed iframe {
    border: 0;
    display: block;
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
}

.pap-protected-media {
    -webkit-user-drag: none;
    user-select: none;
}

.pap-popup-content {
    padding: 28px;
    text-align: center;
}

.pap-popup-title {
    color: #111827;
    font-size: clamp(22px, 4vw, 32px);
    line-height: 1.2;
    margin: 0 0 22px;
}

.pap-popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.pap-popup-button {
    border-radius: 999px;
    display: inline-flex;
    font-size: 14px;
    font-weight: 700;
    justify-content: center;
    letter-spacing: 0.04em;
    line-height: 1;
    min-width: 120px;
    padding: 14px 22px;
    text-decoration: none;
    text-transform: uppercase;
    transition: transform 150ms ease, opacity 150ms ease;
}

.pap-popup-button:hover,
.pap-popup-button:focus {
    opacity: 0.9;
    transform: translateY(-1px);
    text-decoration: none;
}

.pap-popup-button-primary {
    background: #111827;
    color: #ffffff;
}

.pap-popup-button-secondary {
    background: #f3f4f6;
    color: #111827;
}

@media (max-width: 520px) {
    .pap-popup-overlay {
        padding: 14px;
    }

    .pap-popup {
        max-height: calc(100vh - 28px);
    }

    .pap-popup-content {
        padding: 22px 18px;
    }

    .pap-popup-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .pap-popup-button {
        width: 100%;
    }

    .pap-popup-media-title {
        padding: 22px 58px 14px 18px;
    }

    .pap-popup-audio {
        margin-top: 20px;
        max-width: calc(100% - 28px);
    }
}
