html.gallery-lightbox-open { overflow: hidden; }
.gallery-lightbox {
    position: fixed;
    inset: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-width: none;
    max-height: none;
    padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    border: 0;
    color: #faf7f0;
    background: rgba(18, 13, 11, .96);
    overflow: hidden;
}
.gallery-lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; }
.gallery-lightbox::backdrop { background: rgba(18, 13, 11, .8); }
.gallery-lightbox__toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.gallery-lightbox button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid #a69a8d;
    border-radius: 50%;
    background: #302722;
    color: #faf7f0;
    font: 28px/1 system-ui, sans-serif;
    cursor: pointer;
}
.gallery-lightbox button:hover { background: #554238; }
.gallery-lightbox button:disabled { opacity: .35; cursor: default; }
.gallery-lightbox :focus-visible { outline: 3px solid #d6b86f; outline-offset: 4px; }
.gallery-lightbox__stage { position: relative; display: grid; place-items: center; min-height: 0; touch-action: pan-y pinch-zoom; }
.gallery-lightbox__stage img { max-width: 100%; max-height: 100%; width: auto; height: auto; min-height: 0; object-fit: contain; }
.gallery-lightbox__stage img[hidden] { display: none; }
.gallery-lightbox__stage [role="status"] { position: absolute; max-width: 32rem; padding: 16px; text-align: center; }
.gallery-lightbox__footer { display: flex; align-items: center; justify-content: center; gap: 20px; }
.gallery-lightbox__description { width: min(70ch, 100%); min-width: 0; max-height: 24vh; overflow: auto; text-align: center; overflow-wrap: anywhere; }
.gallery-lightbox__description p { margin: 0 0 8px; white-space: pre-line; }
.gallery-lightbox__description a { display: inline-block; color: #e5c989; text-decoration: underline; padding: 8px; font-size: .875rem; }
@media (max-width: 600px) {
    .gallery-lightbox__footer { gap: 10px; }
    .gallery-lightbox__description { font-size: .875rem; }
}
