.sbh-lightbox-trigger {
    position: relative;
    display: block;
    width: fit-content;
    max-width: 100%;
    border-radius: var(--sbh-radius, .375rem);
    cursor: zoom-in;
}

.sbh-lightbox-trigger:focus-visible {
    outline: 3px solid var(--sbh-brand, #e31e24);
    outline-offset: 4px;
}

.sbh-lightbox-trigger__icon {
    position: absolute;
    right: .75rem;
    bottom: .75rem;
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgb(255 255 255 / .3);
    border-radius: 50%;
    background: var(--sbh-ink, #191a20);
    color: #fff;
    box-shadow: 0 2px 10px rgb(0 0 0 / .12);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 160ms ease, transform 160ms ease;
    pointer-events: none;
}

.sbh-lightbox-trigger__icon svg { width: 1.4rem; height: 1.4rem; }

.sbh-lightbox-trigger:is(:hover, :focus-visible) .sbh-lightbox-trigger__icon {
    opacity: 1;
    transform: none;
}

@media (hover: none) {
    .sbh-lightbox-trigger__icon { opacity: 1; transform: none; }
}

html.sbh-image-lightbox-open { overflow: hidden; }

.sbh-image-lightbox {
    box-sizing: border-box;
    width: max-content;
    max-width: calc(100vw - 2rem);
    max-height: calc(100dvh - 2rem);
    padding: 0;
    margin: auto;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / .2);
    border-radius: .75rem;
    background: #fff;
    color: var(--sbh-ink, #191a20);
    box-shadow: 0 24px 80px rgb(0 0 0 / .3);
}

.sbh-image-lightbox[open] { display: flex; flex-direction: column; }
.sbh-image-lightbox::backdrop { background: rgb(10 12 16 / .8); backdrop-filter: blur(3px); }

.sbh-image-lightbox__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex: 0 0 auto;
    padding: .5rem .5rem .5rem 1.25rem;
    border-bottom: 1px solid var(--sbh-border, #e5e7eb);
}

.sbh-image-lightbox__title {
    min-width: 0;
    margin: 0;
    font-size: .875rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.sbh-image-lightbox__close {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border: 0;
    border-radius: .375rem;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 1.75rem;
    cursor: pointer;
}

.sbh-image-lightbox__close:hover { background: #f2f3f5; }
.sbh-image-lightbox__close:focus-visible { outline: 2px solid var(--sbh-brand, #e31e24); outline-offset: -2px; }

.sbh-image-lightbox__viewport {
    min-width: 0;
    min-height: 0;
    max-height: calc(100dvh - 6rem);
    overflow: auto;
    overscroll-behavior: contain;
    background: #f7f7f7;
}

.sbh-image-lightbox__viewport img {
    display: block;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    margin: auto;
}

.sbh-image-lightbox__error { padding: 1.5rem; margin: 0; }

@media (prefers-reduced-motion: reduce) {
    .sbh-lightbox-trigger__icon { transition: none; }
}
