[data-gallery-image] { cursor: zoom-in; }
html.image-viewer-open { overflow: hidden; }
.image-viewer { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 64px 24px 24px; border: 0; box-sizing: border-box; color: #fff; background: rgba(12, 14, 20, .94); }
.image-viewer[open] { display: flex; align-items: center; justify-content: center; }
.image-viewer::backdrop { background: rgba(12, 14, 20, .7); }
.image-viewer-content { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 100%; max-height: 100%; margin: 0; }
.image-viewer-content img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 150px); object-fit: contain; }
.image-viewer-content figcaption { max-width: 80ch; max-height: 3em; overflow-y: auto; margin: 0; color: #e9e9ef; font-size: .85rem; line-height: 1.5; text-align: center; }
.image-viewer-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(16px, env(safe-area-inset-right)); display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #777a85; border-radius: 50%; padding: 0; background: #242630; color: #fff; font: 32px/1 Arial, sans-serif; cursor: pointer; }
.image-viewer-close:hover { background: #3b3e4b; }
.image-viewer-close:focus-visible { outline: 3px solid #a7b8ff; outline-offset: 3px; }
@media (max-width: 600px) {
  .image-viewer { padding: 68px 12px 20px; }
  .image-viewer-content img { max-height: calc(100dvh - 170px); }
}
@media print { .image-viewer { display: none !important; } }
