.gallery-grid a[data-lightbox] {
  display: block;
  min-width: 0;
  border-radius: 10px;
  cursor: default;
}
.gallery-grid a[data-lightbox]:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}
body.lightbox-open { overflow: hidden; }
.photo-lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 16px 24px;
  padding-top: max(16px, env(safe-area-inset-top));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  border: 0;
  background: transparent;
  color: #fff;
  font: 400 14px/1.5 var(--utility);
  overscroll-behavior: contain;
}
.photo-lightbox[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
}
.photo-lightbox::backdrop { background: rgb(12 12 12 / 94%); }
.lightbox-toolbar, .lightbox-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  pointer-events: none;
}
.lightbox-toolbar { justify-content: space-between; }
.lightbox-nav { justify-content: center; }
.photo-lightbox button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 50%;
  background: #242424;
  color: #fff;
  font: 400 32px/1 Arial, sans-serif;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}
.photo-lightbox button:hover { background: #414141; }
.photo-lightbox button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.lightbox-figure {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  justify-items: center;
  align-items: center;
  gap: 12px;
  margin: 0;
  pointer-events: none;
}
.lightbox-image {
  display: block;
  min-width: 0;
  min-height: 0;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  pointer-events: auto;
}
@media (max-width: 600px) {
  .photo-lightbox { padding-left: 12px; padding-right: 12px; }
}
@keyframes lightbox-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .lightbox-image.is-entering { animation: lightbox-fade 180ms ease-out; }
}
