.barami-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 700ms cubic-bezier(0.19, 1, 0.22, 1),
        visibility 0s linear 700ms;
}

.barami-lightbox.is-visible {
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.barami-lightbox.is-open {
    opacity: 1;
}

.barami-lightbox__backdrop {
    position: absolute;
    inset: 0;
    display: block;
    border: 0;
    background: rgba(8, 8, 8, 0);
    cursor: zoom-out;
    transition:
        background 700ms cubic-bezier(0.19, 1, 0.22, 1),
        backdrop-filter 900ms cubic-bezier(0.19, 1, 0.22, 1),
        -webkit-backdrop-filter 900ms cubic-bezier(0.19, 1, 0.22, 1);
}

.barami-lightbox.is-open .barami-lightbox__backdrop {
    background: rgba(8, 8, 8, 0.88);
}

@supports (backdrop-filter: blur(20px)) {
    .barami-lightbox__backdrop {
        background: rgba(8, 8, 8, 0);
        /* -webkit-backdrop-filter: blur(0); */
        /* backdrop-filter: blur(0); */
    }

    .barami-lightbox.is-open .barami-lightbox__backdrop {
        background: rgba(8, 8, 8, 0.9);
        /* -webkit-backdrop-filter: blur(24px); */
        /* backdrop-filter: blur(24px); */
    }
}

.barami-lightbox__stage {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(24px) scale(0.96);
    opacity: 0;
    transition:
        transform 900ms cubic-bezier(0.19, 1, 0.22, 1),
        opacity 700ms cubic-bezier(0.19, 1, 0.22, 1);
}

.barami-lightbox.is-open .barami-lightbox__stage {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.barami-lightbox__figure {
    max-width: min(1500px, 86vw);
    max-height: 86vh;
    background: #f5f1e8;
}

.barami-lightbox__image {
    display: block;
    width: auto;
    max-width: min(1500px, 86vw);
    max-height: 82vh;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.985);
    transition:
        opacity 520ms cubic-bezier(0.19, 1, 0.22, 1),
        transform 700ms cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.36);
}

.barami-lightbox.is-loaded .barami-lightbox__image {
    opacity: 1;
    transform: scale(1);
}

.barami-lightbox.is-svg .barami-lightbox__image {
    width: min(1000px, 82vw);
    height: min(720px, 76vh);
    /* padding: 28px; */
    background: #f5f1e8;
}

.barami-lightbox__caption {
    min-height: 20px;
    margin-top: 18px;
    color: rgba(245, 241, 232, 0.72);
    font-size: 11px;
    line-height: 1.4;
    letter-spacing: 1.958px;
    text-transform: uppercase;
    text-align: center;
}

.barami-lightbox__caption:empty {
    display: none;
}

.barami-lightbox__close,
.barami-lightbox__nav {
    position: absolute;
    z-index: 2;
    border: 0;
    color: #f5f1e8;
    background: transparent;
    cursor: pointer;
}

.barami-lightbox__close {
    top: 20px;
    right: 24px;
    padding: 12px 0;
    font-size: 11px;
    line-height: 1;
    letter-spacing: 1.958px;
    text-transform: uppercase;
}

.barami-lightbox__close::after {
    content: '';
    display: block;
    width: 100%;
    height: 1px;
    margin-top: 8px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 500ms cubic-bezier(0.19, 1, 0.22, 1);
}

.barami-lightbox__close:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.barami-lightbox__nav {
    top: 50%;
    width: 58px;
    height: 58px;
    transform: translateY(-50%);
    opacity: 0.72;
    transition:
        opacity 400ms ease,
        transform 500ms cubic-bezier(0.19, 1, 0.22, 1);
}

.barami-lightbox__nav:hover {
    opacity: 1;
}

.barami-lightbox__nav--prev {
    left: 28px;
}

.barami-lightbox__nav--next {
    right: 28px;
}

.barami-lightbox__nav--prev:hover {
    transform: translate(-6px, -50%);
}

.barami-lightbox__nav--next:hover {
    transform: translate(6px, -50%);
}

.barami-lightbox__nav span {
    position: absolute;
    inset: 0;
}

.barami-lightbox__nav span::before,
.barami-lightbox__nav span::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 1px;
    background: currentColor;
    transform-origin: center;
}

.barami-lightbox__nav--prev span::before {
    transform: translate(-50%, -50%) rotate(-45deg);
    margin-top: -7px;
}

.barami-lightbox__nav--prev span::after {
    transform: translate(-50%, -50%) rotate(45deg);
    margin-top: 7px;
}

.barami-lightbox__nav--next span::before {
    transform: translate(-50%, -50%) rotate(45deg);
    margin-top: -7px;
}

.barami-lightbox__nav--next span::after {
    transform: translate(-50%, -50%) rotate(-45deg);
    margin-top: 7px;
}

.barami-lightbox__nav.is-hidden {
    display: none;
}

.barami-lightbox-trigger {
    border: 0;
    padding: 0;
    background: transparent;
    cursor: zoom-in;
    text-align: inherit;
}

body.barami-lightbox-lock {
    overflow: hidden;
}

@media (max-width: 767px) {
    .barami-lightbox {
        padding: 18px;
    }

    .barami-lightbox__figure,
    .barami-lightbox__image {
        max-width: 92vw;
    }

    .barami-lightbox__image {
        max-height: 78vh;
    }

    .barami-lightbox__close {
        top: 12px;
        right: 18px;
    }

    .barami-lightbox__nav {
        top: auto;
        bottom: 22px;
        width: 46px;
        height: 46px;
        transform: none;
    }

    .barami-lightbox__nav--prev {
        left: 18px;
    }

    .barami-lightbox__nav--next {
        right: 18px;
    }

    .barami-lightbox__nav--prev:hover,
    .barami-lightbox__nav--next:hover {
        transform: none;
    }
}
