#popup {
    popup: auto;
    display: none;
    position: fixed;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    border: none;
    outline: none;
    transition: 0.5s allow-discrete;
    z-index: 100010;
    /*
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    */
    max-width: 600px;
    font-size: 14px;
}

#popup:popover-open {
    opacity: 1;
    display: block;
    @starting-style {
        opacity: 0;
    }
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ccc;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    line-height: 30px;
    padding: 0;
}

.popup-content {
    max-width: 90vw;
    max-height: 90vh;
}

.popup-content img {
    display: block;
    max-width: none;
}

@media screen and (orientation: landscape) {
    .popup-content img {
        height: 600px;
        width: 600px;
        object-fit: contain;
    }
}

@media screen and (orientation: portrait) {
    .popup-content img {
        width: 600px;
        height: 600px;
        object-fit: contain;
    }
}

.backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    transition: 0.5s allow-discrete;
    z-index: 100000;
}

#popup:popover-open ~ .backdrop {
    opacity: 1;
    display: block;
    @starting-style {
        opacity: 0;
    }
}