/* Photo gallery --------------------------------------------------------
   A gallery is the tile grid above with quieter captions: the photographs
   are the content, the words under them are a footnote. The block is named
   photo-gallery rather than gallery because .gallery is already the product
   page's picture column further down this stylesheet, and a section carrying
   both classes would get that flex column instead of the grid. */

.photo-gallery__item .tile__caption {
  padding: var(--space-2) var(--space-3);
}

/* The item is a <button> (sections.go galleryItem), not an anchor: an anchor
   to the large image was a download link under the right button. A button
   brings its own padding, centred text and font, so it is put back to what
   the tile is — and it takes the anchor tile's hover, which tiles.css gives
   to a.tile only. */
.photo-gallery__item {
  width: 100%;
  padding: 0;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
}

.photo-gallery__item:hover {
  border-color: var(--primary);
  box-shadow: var(--glow-pink);
}

.photo-gallery__item:hover img {
  transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
  .photo-gallery__item:hover img {
    transform: none;
  }
}

/* Lightbox -------------------------------------------------------------
   What a gallery photo opens in: one native <dialog> per section, wearing
   the shared .dialog shell (components.css). What is left here is room for
   the picture, a veil darker than a dialog's — the photo is all there is to
   look at — and where the three controls float. */

.lightbox {
  position: relative;
  width: min(1200px, 96vw);
  border: 0;
  overflow: hidden;
}

.lightbox[open]::backdrop {
  background: var(--backdrop-deep);
}

.lightbox__img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: 86vh;
}

.lightbox__caption {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--ink-muted);
  text-align: center;
}

.lightbox__close {
  top: var(--space-3);
  right: var(--space-3);
}

.lightbox__prev {
  top: 50%;
  left: var(--space-3);
  transform: translateY(-50%);
}

.lightbox__next {
  top: 50%;
  right: var(--space-3);
  transform: translateY(-50%);
}
