[data-gallery-image][aria-haspopup="dialog"] { cursor: zoom-in; }
[data-gallery-image].is-enlarged img { visibility: hidden; }

/* The native dialog keeps focus inside the enlarged screenshot. */
.image-lightbox { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; overflow: hidden; background: transparent; color: var(--gallery-cream, #faf8f4); }
.image-lightbox[open] { display: grid; place-items: center; }
.image-lightbox::backdrop { background: transparent; }
.image-lightbox-scrim { position: absolute; inset: 0; background: rgb(10 12 22 / 94%); }
.image-lightbox-figure { position: relative; display: grid; justify-items: center; gap: 16px; pointer-events: none; }
.image-lightbox-image { width: auto; height: auto; max-width: min(1440px, calc(100vw - 48px)); max-height: calc(100vh - 160px); max-height: calc(100dvh - 160px); transform-origin: top left; pointer-events: auto; box-shadow: 0 16px 64px rgb(0 0 0 / 25%); }
.image-lightbox-caption { max-width: calc(100vw - 48px); color: var(--gallery-muted, #bbbccc); text-align: center; font-size: 0.875rem; }
.image-lightbox-close { position: absolute; top: max(16px, env(safe-area-inset-top)); right: max(24px, env(safe-area-inset-right)); z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 44px; min-height: 44px; padding-inline: 14px; border: 1px solid var(--gallery-line, #3c3f55); border-radius: 3px; background: var(--gallery-night, #151726); font-size: 0.875rem; }
.image-lightbox-close:hover { border-color: var(--gallery-orange, #ffad7f); color: var(--gallery-orange, #ffad7f); }
.image-lightbox-close > span { font-size: 1.375rem; line-height: 1; }

.image-lightbox-close:focus-visible { outline: 2px solid var(--gallery-orange, #ffad7f); outline-offset: 5px; }
