.gallery-lightbox.hidden {
    display: none !important;
}

.gallery-lightbox:not(.hidden) {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.gallery-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, #000 82%, transparent);
    cursor: pointer;
}

.gallery-lightbox__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    max-width: 100%;
    max-height: 100%;
    min-height: 0;
}

.gallery-lightbox__image {
    display: block;
    width: auto;
    height: auto;
    max-width: min(960px, 100%);
    max-height: calc(100dvh - 5.5rem);
    object-fit: contain;
    border-radius: 0.5rem;
    box-shadow: 0 16px 48px color-mix(in srgb, #000 35%, transparent);
}

.gallery-lightbox__close {
    position: static;
    align-self: flex-end;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: #fff !important;
    color: #000 !important;
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    box-shadow: 0 2px 8px color-mix(in srgb, #000 20%, transparent);
}

.gallery-lightbox__close:hover {
    background: #f0f0f0 !important;
    color: #000 !important;
}

.gallery-lightbox__close:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

.gallery-lightbox__trigger {
    cursor: zoom-in;
    background: none;
    border: 0;
    padding: 0;
    text-align: inherit;
    width: 100%;
}

.gallery-lightbox__trigger:focus-visible {
    outline: 2px solid var(--tpl-btn-primary, #0d6efd);
    outline-offset: 3px;
}
