/* image popup */
.hp-popup,
.hp-popup *,
.hp-popup *::before,
.hp-popup *::after {
    box-sizing: border-box;
}

.hp-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10050; /* above the theme lightbox (9999) and fixed buttons */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}

.hp-popup[hidden] {
    display: none;
}

.hp-popup.is-visible {
    opacity: 1;
    visibility: visible;
}

.hp-popup__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .75);
    cursor: pointer;
}

.hp-popup__dialog {
    position: relative;
    max-width: 560px;
    width: 100%;
    max-height: calc(100vh - 40px);
    transform: translateY(20px);
    transition: transform .3s ease;
}

.hp-popup.is-visible .hp-popup__dialog {
    transform: translateY(0);
}

.hp-popup__link {
    display: block;
    line-height: 0;
}

.hp-popup__image {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 40px);
    object-fit: contain;
    margin: 0 auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}

.hp-popup__close {
    position: absolute;
    top: -16px;
    right: -16px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #82bc00;
    color: #fff;
    font-size: 26px;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
    transition: opacity .2s ease;
}

.hp-popup__close:hover,
.hp-popup__close:focus {
    opacity: .85;
    color: #fff;
    outline: none;
}

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

@media only screen and (max-width: 575px) {
    .hp-popup {
        padding: 16px;
    }

    .hp-popup__dialog {
        max-width: 100%;
    }

    .hp-popup__close {
        top: -14px;
        right: -8px;
        width: 34px;
        height: 34px;
        font-size: 22px;
        line-height: 34px;
    }
}
