.r3n-lightbox {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
}

.r3n-lightbox::backdrop {
    background: rgb(0 0 0 / 92%);
    backdrop-filter: blur(4px);
}

.r3n-lightbox-open {
    overflow: hidden;
}

.r3n-lightbox__frame {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    height: 100%;
    background: rgb(0 0 0 / 92%);
}

.r3n-lightbox__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 3.5rem;
    padding: 0.5rem 0.75rem 0.25rem 1rem;
}

.r3n-lightbox__counter {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.r3n-lightbox__close,
.r3n-lightbox__previous,
.r3n-lightbox__next {
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9999px;
    background: rgb(255 255 255 / 12%);
    color: #fff;
    cursor: pointer;
    transition: background-color 160ms ease, transform 160ms ease;
}

.r3n-lightbox__close:hover,
.r3n-lightbox__previous:hover,
.r3n-lightbox__next:hover {
    background: rgb(255 255 255 / 22%);
}

.r3n-lightbox__close:focus-visible,
.r3n-lightbox__previous:focus-visible,
.r3n-lightbox__next:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.r3n-lightbox__close {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 2rem;
    line-height: 1;
}

.r3n-lightbox__stage {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 0;
    align-items: center;
    gap: 0.5rem;
    padding: 0 0.75rem 1rem;
}

.r3n-lightbox__previous,
.r3n-lightbox__next {
    z-index: 1;
    width: 2.75rem;
    height: 2.75rem;
    font-size: 2.25rem;
}

.r3n-lightbox__figure {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    min-width: 0;
    height: 100%;
    margin: 0;
}

.r3n-lightbox__image {
    align-self: center;
    justify-self: center;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - 8rem);
    object-fit: contain;
}

.r3n-lightbox__caption {
    max-width: 50rem;
    margin: 0.75rem auto 0;
    padding: 0 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: center;
    color: rgb(255 255 255 / 78%);
}

@media (max-width: 639px) {
    .r3n-lightbox__stage {
        position: relative;
        display: block;
        padding-inline: 0.5rem;
    }

    .r3n-lightbox__figure {
        height: calc(100vh - 4.5rem);
    }

    .r3n-lightbox__previous,
    .r3n-lightbox__next {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }

    .r3n-lightbox__previous {
        left: 0.75rem;
    }

    .r3n-lightbox__next {
        right: 0.75rem;
    }

    .r3n-lightbox__image {
        max-height: calc(100vh - 9rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .r3n-lightbox__close,
    .r3n-lightbox__previous,
    .r3n-lightbox__next {
        transition: none;
    }
}
