.photo-gallery {
  padding: clamp(2rem, 5vw, 5rem) 6%;
  color: #202d77;
  font-family: Novarese, Georgia, serif;
}
.photo-gallery h1 { text-align: center; margin: 0 0 1em; }
.gallery-grid figure { margin: 0; }
.gallery-grid figcaption { padding: .75rem 0; font-weight: bold; }
.gallery-grid :target figcaption { text-decoration: underline #b8862e; text-underline-offset: .3em; }

.event-album {
  margin-bottom: clamp(2rem, 5vw, 4rem);
  scroll-margin-top: 7rem;
}
.event-album h2 { margin: 0 0 1rem; }
.gallery-grid, .event-photos {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.gallery-grid img, .event-photos img {
  height: auto;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: .85rem;
}

.event-photos a {
  display: block;
  border-radius: .85rem;
}
.event-photos a:focus-visible {
  outline: 2px solid #202d77;
  outline-offset: 3px;
}

@media (max-width: 48rem) {
  .gallery-grid, .event-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.gallery-more {
  display: flex;
  align-items: center;
  width: fit-content;
  min-height: 2.85rem;
  box-sizing: border-box;
  margin: 2rem auto 0;
  padding: .75rem 1.2rem;
  border: 1px solid #d6c298;
  border-radius: 2rem;
  background: #fff8e9;
  color: #192d46;
  font: 700 1rem/1.25 Novarese, Georgia, serif;
  text-decoration: none;
}
.gallery-more:hover { background: #f3d49a; }
.gallery-more:focus-visible { outline: 2px solid #202d77; outline-offset: 4px; }

.photo-gallery { background: #fffcf8; padding-top: 0; }
.photo-gallery h1 {
  display: flex;
  align-items: flex-end;
  box-sizing: border-box;
  min-height: clamp(13rem, 30vw, 26rem);
  margin: 0 -6.82% clamp(2rem, 4vw, 3.5rem);
  padding: 1.5rem 6.82%;
  border-bottom: 3px solid #c59b57;
  color: white;
  font-size: clamp(3.25rem, 7.5vw, 7rem);
  line-height: 1;
  letter-spacing: -.045em;
  background: linear-gradient(20deg, #0c1c34e8, #13233b18 75%), url('../assets/images/heroBanner.jpg') center 52% / cover;
}
.event-album h2, .estate-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1rem;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
}
.event-album h2::after, .estate-heading::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, #c49b58, transparent);
}
.event-photos a, .gallery-grid a {
  display: block;
  overflow: hidden;
  border-radius: .85rem;
  box-shadow: 0 .35rem 1rem #18233e1a;
  cursor: zoom-in;
}
@media (prefers-reduced-motion: no-preference) {
  .event-photos img, .gallery-grid img { transition: transform .35s ease; }
  .photo-gallery a:is(:hover, :focus-visible) img { transform: scale(1.04); }
}
.photo-viewer {
  box-sizing: border-box;
  inset: 0;
  margin: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  border: 0;
  padding: clamp(1rem, 3vw, 2.5rem);
  color: #fff8e9;
  background: #111a29;
}
.photo-viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 1rem; }
.viewer-image { width: 100%; height: 100%; object-fit: contain; }
.viewer-close { justify-self: end; }
.viewer-controls { display: flex; align-items: center; justify-content: space-between; gap: .75rem; text-align: center; }
.photo-viewer button { cursor: pointer; padding: .65rem 1rem; border: 1px solid #c7ac7c; border-radius: 2rem; color: inherit; background: transparent; font: inherit; }
.photo-viewer button:is(:hover,:focus-visible) { background: #fff8e9; color: #192d46; }
body:has(.photo-viewer[open]) { overflow: hidden; }
