/* Site styling for gallery blocks. */

/* No visible captions: the caption text stays as the image's alt text for screen readers */
.block--gallery figcaption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.block--gallery .gallery__item { position: relative; margin: 0; }
.block--gallery .grid { gap: 1.5rem; }

/* Class "infographics": whole artwork, never cropped, on a raised mat */
.block--gallery.infographics .gallery__link { background: var(--maw-surface); border: 1px solid var(--maw-border); }
.block--gallery.infographics .gallery__item img { object-fit: contain; }

/* ── Lightbox (user/site/js/site.js): gallery images open in a modal ───────── */
.block--gallery .gallery__link { cursor: zoom-in; }
html.lightbox-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgb(18 36 43 / 0.94); color: var(--pec-ivory); overflow: hidden; }
.lightbox:not([open]) { display: none; }
.lightbox::backdrop { background: rgb(18 36 43 / 0.6); }
.lightbox__figure { position: absolute; inset: 0; margin: 0; padding: 4rem 5rem; display: grid; place-items: center; }
.lightbox__img { max-width: calc(100vw - 10rem); max-height: calc(100vh - 8rem); max-height: calc(100dvh - 8rem); width: auto; height: auto; object-fit: contain; box-shadow: 0 2rem 4rem -2rem rgb(0 0 0 / 0.7); transition: opacity 200ms var(--maw-ease); }
.lightbox.is-loading .lightbox__img { opacity: 0.25; }
.lightbox__btn { position: absolute; z-index: 1; display: grid; place-items: center; width: 3rem; height: 3rem; padding: 0; border: 1px solid rgb(246 244 238 / 0.35); border-radius: 2px; background: rgb(36 70 83 / 0.7); color: var(--pec-ivory); cursor: pointer; transition: background 150ms, border-color 150ms; }
.lightbox__btn:hover { background: var(--pec-sea-glass); border-color: var(--pec-sea-glass); }
.lightbox__btn:focus-visible { outline: 3px solid var(--pec-eucalyptus); outline-offset: 2px; }
.lightbox__btn[hidden] { display: none; }
.lightbox__close { top: 1rem; right: 1rem; }
.lightbox__prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox__count { position: absolute; left: 0; right: 0; bottom: 1.25rem; margin: 0; text-align: center; font-size: var(--maw-text-xs); font-weight: 600; letter-spacing: 0.1em; color: rgb(246 244 238 / 0.8); }
@media (max-width: 640px) {
  .lightbox__figure { padding: 4.5rem 0.75rem 4.5rem; }
  .lightbox__img { max-width: calc(100vw - 1.5rem); max-height: calc(100vh - 9rem); max-height: calc(100dvh - 9rem); }
  .lightbox__prev, .lightbox__next { top: auto; bottom: 0.75rem; transform: none; }
  .lightbox__count { bottom: 1.6rem; }
}

/* Video in the lightbox */
.lightbox__video { width: min(100vw - 10rem, (100vh - 8rem) * 16 / 9); aspect-ratio: 16 / 9; border: 0; background: #000; box-shadow: 0 2rem 4rem -2rem rgb(0 0 0 / 0.7); }
.lightbox__video[hidden], .lightbox__img[hidden] { display: none; }
@media (max-width: 640px) { .lightbox__video { width: calc(100vw - 1.5rem); } }
