/* Keep each original photograph's proportions at every viewport width. */
.gallery-grid .gallery-tile {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  cursor: zoom-in;
  overflow: hidden;
}
.gallery-grid .gallery-tile img.tile {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  margin: 0;
}
.gallery-grid .gallery-tile:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
.gallery-viewer.lightbox {
  z-index: 1000;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  height: 100vh;
  height: 100dvh;
  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));
  background: #081922fa;
  color: #fff;
  cursor: default;
  overscroll-behavior: contain;
}
.gallery-viewer__toolbar, .gallery-viewer__footer {
  width: min(1200px, 100%);
  justify-self: center;
}
.gallery-viewer__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gallery-viewer__count, .gallery-viewer button, .gallery-viewer__help {
  font-family: Archivo, system-ui, sans-serif;
}
.gallery-viewer button {
  min-width: 48px;
  min-height: 48px;
  border: 1px solid #ffffff70;
  border-radius: 999px;
  background: #183a4a;
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.gallery-viewer button:hover { background: #26566c; }
.gallery-viewer button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.gallery-viewer .gallery-viewer__close { font-size: 32px; padding: 0; }
.gallery-viewer__stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pinch-zoom;
  user-select: none;
}
.gallery-viewer.lightbox .gallery-viewer__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
  border-radius: 6px;
  pointer-events: none;
}
.gallery-viewer__navigation { display: flex; justify-content: center; gap: 16px; }
.gallery-viewer__navigation button { padding: 0 24px; }
.gallery-viewer__caption { color: #fff; text-align: center; font-size: 16px; line-height: 1.4; margin: 12px 0 4px; }
.gallery-viewer__help { color: #c0d2db; text-align: center; font-size: 12px; line-height: 1.4; margin: 0; }
@media (max-width: 480px) {
  .gallery-viewer.lightbox { gap: 10px; }
  .gallery-viewer__caption { font-size: 14px; }
  .gallery-viewer__help { font-size: 11px; }
}
@media (max-height: 480px) {
  .gallery-viewer.lightbox { gap: 4px; padding-top: 6px; padding-bottom: 6px; }
  .gallery-viewer__caption, .gallery-viewer__help { display: none; }
}
