/* Photo gallery component. Reads the website's theme tokens. */
.gallery-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  gap: clamp(8px, 1.5vw, 16px);
}
.gallery-tile {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  border-radius: var(--module-radius);
  overflow: hidden;
}
.gallery-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.gallery-tile:hover img,
.gallery-tile:focus-visible img {
  transform: scale(1.03);
}
.gallery-caption {
  margin: 6px 0 0;
  font-size: 0.9em;
  color: var(--quiet, #6b7080);
}
.gallery-viewer {
  width: min(96vw, 1100px);
  max-height: 94vh;
  border: 0;
  padding: 0;
  background: #0b0b0c;
  color: #f5f5f5;
  border-radius: 12px;
}
.gallery-viewer::backdrop {
  background: rgb(0 0 0 / 0.85);
}
.gallery-viewer figure {
  margin: 0;
  display: grid;
}
.gallery-viewer img {
  width: 100%;
  max-height: 80vh;
  object-fit: contain;
}
.gallery-viewer figcaption {
  padding: 10px 16px 0;
  font-size: 0.95em;
}
.gallery-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 12px;
}
.gallery-controls button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  border: 1px solid rgb(255 255 255 / 0.3);
  background: transparent;
  color: inherit;
  font-size: 18px;
  cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  .gallery-tile img {
    transition: none;
  }
}
