.image-modal {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 50px;
    background: rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
    opacity: 0;
    transition: opacity .5s ease;
    pointer-events: none;
}

.image-modal.is-open {
    opacity: 1;
    pointer-events: all;
}

.image-modal__dialog {
    display: flex;
    flex-direction: column;
    position: relative;
    max-width: min(100%, 1100px);
    max-height: 100%;
    padding: 50px 20px 20px;
    border-radius: 20px;
    background: rgba(10, 10, 10, 0.8);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.6);
    box-sizing: border-box;
}

.image-modal__image {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.image-modal__caption {
    color: white;
    text-align: center;
}

.image-modal__caption:empty {
    display: none;
}

.image-modal__close {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 34px;
    height: 34px;
    border: 1px solid orange;
    border-radius: 50%;
    background: black;
    color: orange;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.image-modal__close:hover {
    background: orange;
    color: black;
}

@media (max-width: 700px) {
    .image-modal {
        padding: 16px;
    }

    .image-modal__dialog {
        padding: 12px;
    }

    .image-modal__image {
        max-width: calc(100vw - 56px);
        max-height: calc(100vh - 130px);
    }
}
