.photo-gallery {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.photo-card {
  display: block;
  text-decoration: none;
  overflow: hidden;
  padding: 8px 8px 0;
  border: 1px solid var(--rule);
  border-radius: 2px;
  background: #fffdf9;
  color: inherit;
  box-shadow: 0 2px 5px #33291808;
  transition:
    border-color 0.18s,
    transform 0.18s,
    box-shadow 0.18s;
}
.photo-card:hover,
.photo-card:has(.photo-link:focus-visible) {
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(-2px);
  box-shadow: 0 5px 12px #33291812;
}
.photo-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.photo-link:focus-visible {
  outline: none;
}
.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: #e8e2d7;
}
.photo-card figcaption {
  padding: 9px 6px 10px;
}
.photo-subject {
  display: block;
  font: 14px/1.4 var(--serif);
}
.photo-location {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font: 11px/1.5 var(--sans);
}
.photo-note {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 5px;
  color: var(--ink);
  font: italic 12px/1.5 var(--serif);
}
.photo-credit {
  margin: -6px 6px 0;
  padding-bottom: 10px;
  color: var(--muted);
  font: 10px/1.5 var(--sans);
}
.photo-credit a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 2px;
}
.photo-credit a:hover,
.photo-credit a:focus-visible {
  color: var(--accent);
  text-decoration-color: currentColor;
}
.photo-map-arrow {
  width: 10px;
  height: 10px;
  margin-left: 5px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.photo-link:focus-visible .photo-map-arrow {
  opacity: 1;
}
@media (hover: hover) and (pointer: fine) {
  .photo-link:hover .photo-map-arrow {
    opacity: 1;
  }
}
.gallery-empty {
  grid-column: 1/-1;
  padding: 32px;
  border: 1px solid var(--rule);
  color: var(--muted);
  text-align: center;
  font:
    14px/1.6 system-ui,
    sans-serif;
}
@media (max-width: 760px) {
  .photo-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
}
@media (max-width: 500px) {
  .photo-gallery {
    grid-template-columns: 1fr;
  }
  .photo-card img {
    aspect-ratio: 5/3;
  }
}
