/* Screenshot viewer: one moving scene, with smaller neighbours on desktop. */
#bi-lightbox {
    position: fixed; inset: 0; z-index: 100100; display: none; padding: 0;
    width: 100%; height: 100vh; height: 100dvh; overflow: hidden;
    background: rgb(10 12 17 / 97%); color: #f3f5f8;
    overscroll-behavior: contain; -webkit-tap-highlight-color: transparent;
}
#bi-lightbox.is-open { display: block; }
#bi-lightbox * { box-sizing: border-box; }
.bi-viewer-viewport {
    position: absolute; inset: max(56px, env(safe-area-inset-top)) 0 116px;
    overflow: hidden; touch-action: pan-y pinch-zoom; user-select: none;
}
.bi-viewer-slide {
    position: absolute; left: 50%; top: 50%; display: block;
    width: var(--viewer-width); height: var(--viewer-height);
    border: 0; padding: 0; margin: 0; border-radius: 12px;
    background: transparent; cursor: pointer; transform-origin: center;
    will-change: transform; -webkit-tap-highlight-color: transparent;
}
.bi-viewer-slide picture, .bi-viewer-slide img {
    display: block; width: 100%; height: 100%; object-fit: contain;
    border-radius: inherit; user-select: none; -webkit-user-drag: none;
}
/* Navigation controls carry keyboard focus; the photograph stays unframed. */
#bi-lightbox:focus, #bi-lightbox .bi-viewer-slide:focus { outline: none; box-shadow: none; }
.bi-viewer-close, .bi-viewer-arrow {
    position: absolute; z-index: 5; display: grid; place-items: center;
    width: 44px; height: 44px; padding: 0; border: 1px solid #454851;
    border-radius: 10px; background: #202329; color: #fff; cursor: pointer;
}
.bi-viewer-close { top: max(12px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); }
.bi-viewer-arrow { display: none; top: calc(50% - 22px); }
.bi-viewer-arrow[data-step="-1"] { left: 24px; }
.bi-viewer-arrow[data-step="1"] { right: 24px; }
#bi-lightbox button:not(.bi-viewer-slide):focus-visible { outline: 2px solid #bc98ff; outline-offset: 4px; }
.bi-viewer-thumbs {
    position: absolute; bottom: max(46px, calc(env(safe-area-inset-bottom) + 36px));
    left: 50%; transform: translateX(-50%); display: flex; gap: 8px;
    max-width: calc(100% - 32px); padding: 5px; overflow-x: auto;
    scrollbar-width: none; overscroll-behavior: contain;
}
.bi-viewer-thumbs::-webkit-scrollbar { display: none; }
.bi-viewer-thumb {
    flex: 0 0 28px; height: 58px; border: 0; border-radius: 4px;
    padding: 0; background: transparent; opacity: .5; cursor: pointer;
}
.bi-viewer-thumb picture, .bi-viewer-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.bi-viewer-thumb[aria-current="true"] { opacity: 1; outline: 2px solid #bc98ff; outline-offset: 2px; }
#bi-lightbox-counter {
    position: absolute; bottom: max(14px, env(safe-area-inset-bottom));
    left: 16px; right: 16px; margin: 0; text-align: center;
    color: #bac1ce; font: 400 12px/1.4 var(--bi-font, sans-serif); pointer-events: none;
}
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
    .bi-viewer-viewport { inset: 56px 0 64px; }
    .bi-viewer-arrow { display: grid; }
    .bi-viewer-thumbs { display: none; }
    .bi-viewer-close:hover, .bi-viewer-arrow:hover { border-color: #bc98ff; background: #30343e; }
}
@media (max-height: 520px) {
    .bi-viewer-viewport { top: 48px; bottom: 94px; }
    .bi-viewer-thumb { flex-basis: 20px; height: 40px; }
}

@media (max-width: 767px), (pointer: coarse) {
    #bi-lightbox .bi-viewer-close { display: none; }
    #bi-lightbox .bi-viewer-viewport { top: max(16px, env(safe-area-inset-top)); }
}
