.lb-trigger {
    cursor: zoom-in;
}

.lb {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lb[hidden] {
    display: none;
}

.lb__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
}

.lb__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 1600px);
    height: min(100%, 1000px);
}

.lb__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
}

.lb__image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 120px);
    width: auto;
    height: auto;
    object-fit: contain;
    background: #111;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.lb__caption {
    max-width: 900px;
    margin-top: 12px;
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

.lb__close,
.lb__previous,
.lb__next {
    position: absolute;
    z-index: 2;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    font: inherit;
}

.lb__close:hover,
.lb__previous:hover,
.lb__next:hover,
.lb__close:focus-visible,
.lb__previous:focus-visible,
.lb__next:focus-visible {
    background: rgba(255, 255, 255, 0.26);
}

.lb__close {
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    font-size: 28px;
    line-height: 1;
}

.lb__previous,
.lb__next {
    top: 50%;
    width: 48px;
    height: 48px;
    transform: translateY(-50%);
    font-size: 30px;
    line-height: 1;
}

.lb__previous {
    left: 16px;
}

.lb__next {
    right: 16px;
}

.lb__previous[hidden],
.lb__next[hidden] {
    display: none;
}

body.lb-open {
    overflow: hidden;
}

@media (max-width: 700px) {
    .lb {
        padding: 12px;
    }

    .lb__image {
        max-height: calc(100vh - 90px);
    }

    .lb__previous,
    .lb__next {
        top: auto;
        bottom: 16px;
        transform: none;
    }

    .lb__previous {
        left: calc(50% - 60px);
    }

    .lb__next {
        right: calc(50% - 60px);
    }
}