/* Shared photo viewer for the homepage and gallery pages. */
dialog.gallery-lightbox {
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
  background: #122018ed;
  color: #fff;
  overscroll-behavior: contain;
}
dialog.gallery-lightbox[open] {display: grid; place-items: center;}
dialog.gallery-lightbox::backdrop {background: #122018;}
.gallery-lightbox .gallery-figure {margin: 0; padding: 0; pointer-events: none;}
.gallery-lightbox .gallery-image {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 120px);
  max-height: calc(100vh - 120px);
  max-height: calc(100dvh - 120px);
  margin: 0 auto;
  object-fit: contain;
  pointer-events: auto;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}
.gallery-lightbox .gallery-caption {
  position: absolute;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 24px;
  right: 24px;
  margin: 0;
  padding: 0;
  text-align: center;
  color: #fff;
  font: 14px/1.5 'DM Sans', sans-serif;
  pointer-events: none;
}
.gallery-lightbox button {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.gallery-lightbox button:focus-visible {outline: 2px solid #fff; outline-offset: 2px;}
.gallery-lightbox .gallery-close {
  top: max(8px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  font: 400 38px/1 Arial, sans-serif;
}
.gallery-lightbox .gallery-prev,
.gallery-lightbox .gallery-next {top: 50%; transform: translateY(-50%);}
.gallery-lightbox .gallery-prev {left: max(8px, env(safe-area-inset-left));}
.gallery-lightbox .gallery-next {right: max(8px, env(safe-area-inset-right));}
.gallery-lightbox button svg {display: block; width: 28px; height: 28px; filter: drop-shadow(0 1px 3px #0008);}
.gallery-lightbox button[hidden] {display: none;}
@media (max-width: 600px) {
  .gallery-lightbox .gallery-image {
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 144px);
    max-height: calc(100dvh - 144px);
  }
  .gallery-lightbox .gallery-caption {left: 20px; right: 20px; font-size: 12px;}
  .gallery-lightbox .gallery-prev {left: 4px;}
  .gallery-lightbox .gallery-next {right: 4px;}
}
