.gallery-page .site-nav a[aria-current="page"] {
  background: rgba(245, 241, 232, 0.14);
  color: var(--paper);
}

.gallery-page-hero,
.extended-gallery-section {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto 4.5rem;
}

.gallery-page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr);
  gap: clamp(1.2rem, 4vw, 2.4rem);
  align-items: end;
  padding-top: clamp(2rem, 5vw, 4rem);
}

.gallery-page-hero h1 {
  max-width: 12ch;
}

.gallery-page-hero p:not(.eyebrow) {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.1rem;
}

.gallery-page-hero figure {
  min-height: 24rem;
  margin: 0;
  border: 1px solid rgba(229, 227, 221, 0.78);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.gallery-page-hero img {
  width: 100%;
  height: 100%;
  min-height: 24rem;
  object-fit: cover;
}

.gallery-jump-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.3rem;
}

.gallery-jump-links a {
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(160, 48, 61, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--burgundy);
  font-weight: 900;
  text-decoration: none;
}

.gallery-jump-links a:hover,
.gallery-jump-links a:focus-visible {
  background: var(--paper);
}

.extended-gallery-section {
  padding: clamp(1.2rem, 4vw, 2.4rem);
  border: 1px solid rgba(229, 227, 221, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.8)),
    url("assets/Textures/6.png") left top / 72rem auto no-repeat;
  box-shadow: 0 18px 44px rgba(50, 51, 53, 0.05);
}

.extended-gallery-section:nth-of-type(2n) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.82)),
    url("assets/Textures/8.png") right top / cover no-repeat;
}

.extended-gallery-heading {
  max-width: 760px;
  margin-bottom: 1.4rem;
}

.extended-gallery-heading h2 {
  margin-bottom: 0;
}

.extended-photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 0.85rem;
}

.extended-photo-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.extended-photo-card {
  margin: 0;
  border: 1px solid rgba(229, 227, 221, 0.86);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.86)),
    url("assets/Textures/9.png") center / cover no-repeat;
  box-shadow: 0 12px 30px rgba(50, 51, 53, 0.06);
  overflow: hidden;
}

.extended-photo-card.large {
  grid-column: span 2;
  grid-row: span 2;
}

.extended-photo-card.wide {
  grid-column: span 2;
}

.extended-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.extended-photo-card.large img {
  aspect-ratio: 1 / 1;
}

.extended-photo-card.wide img {
  aspect-ratio: 2 / 1;
}

.extended-photo-card figcaption {
  padding: 0.72rem 0.85rem;
  color: var(--sage-deep);
  font-weight: 850;
}

@media (max-width: 920px) {
  .gallery-page-hero {
    grid-template-columns: 1fr;
  }

  .extended-photo-grid,
  .extended-photo-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .gallery-page-hero,
  .extended-gallery-section,
  .gallery-jump-links,
  .gallery-jump-links a {
    width: 100%;
  }

  .extended-photo-grid,
  .extended-photo-grid.compact {
    grid-template-columns: 1fr;
  }

  .extended-photo-card.large,
  .extended-photo-card.wide {
    grid-column: span 1;
    grid-row: span 1;
  }

  .extended-photo-card.large img,
  .extended-photo-card.wide img,
  .extended-photo-card img {
    aspect-ratio: 4 / 3;
  }
}
