.gallery-page {
  background: var(--bg-dark);
}

.gallery-hero {
  min-height: min(76vh, 760px);
  position: relative;
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fff;
}

.gallery-hero__image,
.gallery-hero__veil {
  position: absolute;
  inset: 0;
}

.gallery-hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 48%;
  transform: scale(1.015);
}

.gallery-hero__veil {
  background:
    linear-gradient(90deg, rgba(35, 29, 25, .8) 0%, rgba(35, 29, 25, .48) 48%, rgba(35, 29, 25, .1) 100%),
    linear-gradient(0deg, rgba(35, 29, 25, .55), transparent 55%);
}

.gallery-hero__content {
  position: relative;
  z-index: 1;
  padding-block: clamp(72px, 10vw, 128px);
}

.gallery-hero .kicker {
  color: #f1bf78;
  margin: 0 0 12px;
}

.gallery-hero h1 {
  color: #fff;
  font-size: clamp(3.5rem, 9vw, 7.2rem);
  font-weight: 700;
  margin: 0 0 24px;
  letter-spacing: -.045em;
}

.gallery-hero p:not(.kicker) {
  max-width: 650px;
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.7;
  color: rgba(255, 255, 255, .9);
}

.gallery-hero__cue {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: #fff;
  margin-top: 38px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, .55);
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
}

.gallery-hero__cue:hover {
  color: #f1bf78;
  border-color: #f1bf78;
}

.gallery-section {
  padding: clamp(72px, 9vw, 120px) 0;
}

.gallery-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  align-items: end;
  gap: clamp(30px, 7vw, 90px);
  margin-bottom: clamp(48px, 7vw, 84px);
}

.gallery-intro h2 {
  max-width: 720px;
  font-size: clamp(2.1rem, 5vw, 3.8rem);
  line-height: 1.12;
  color: var(--ink);
}

.gallery-intro > p {
  margin: 0 0 6px;
  padding-left: 24px;
  border-left: 3px solid var(--primary-accent);
  color: var(--muted);
  font-size: 1.05rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: 42px;
  grid-auto-flow: dense;
  gap: 18px;
}

.gallery-item {
  grid-column: span 4;
  grid-row: span 8;
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: #ded8cf;
  cursor: zoom-in;
  box-shadow: var(--shadow);
}

.gallery-item.portrait {
  grid-row: span 12;
}

.gallery-item.wide {
  grid-column: span 8;
}

.gallery-item.feature {
  grid-column: span 5;
  grid-row: span 13;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .65s cubic-bezier(.2, .7, .2, 1), filter .4s ease;
}

.gallery-item__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  background: linear-gradient(0deg, rgba(31, 25, 22, .82), transparent 60%);
  color: #fff;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  text-align: left;
  opacity: 0;
  transition: opacity .35s ease;
}

.gallery-item__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .75);
  font-size: 1.3rem;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.045);
  filter: saturate(1.04);
}

.gallery-item:hover .gallery-item__overlay,
.gallery-item:focus-visible .gallery-item__overlay {
  opacity: 1;
}

.gallery-item:focus-visible {
  outline: 3px solid var(--highlight-gold);
  outline-offset: 4px;
}

.gallery-visit {
  padding: clamp(64px, 8vw, 100px) 0;
  background: var(--earth-dark);
  color: #fff;
  border-top: 4px solid var(--primary-accent);
}

.gallery-visit__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
}

.gallery-visit h2 {
  max-width: 780px;
  color: #fff;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.gallery-visit .kicker {
  color: #f1bf78;
}

.gallery-visit .button {
  flex: 0 0 auto;
}

.gallery-page + .gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: minmax(52px, 1fr) minmax(0, 1100px) minmax(52px, 1fr);
  align-items: center;
  background: rgba(27, 23, 21, .96);
  color: #fff;
  padding: 40px clamp(12px, 3vw, 44px);
}

.gallery-lightbox figure {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 14px;
}

.gallery-lightbox figure img {
  max-width: 100%;
  max-height: calc(100vh - 150px);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .32);
}

.gallery-lightbox figcaption {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  text-align: center;
}

.gallery-lightbox button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, .35);
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}

.gallery-lightbox button:hover,
.gallery-lightbox button:focus-visible {
  background: var(--primary-accent);
  border-color: var(--primary-accent);
  outline: none;
}

.gallery-lightbox__nav {
  width: 48px;
  height: 48px;
  justify-self: center;
  font-size: 1.35rem;
}

.gallery-lightbox__close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 46px;
  height: 46px;
  font-size: 1.75rem;
}

.gallery-lightbox__count {
  position: absolute;
  left: 24px;
  bottom: 17px;
  margin: 0;
  color: rgba(255, 255, 255, .62);
  font-size: .85rem;
  letter-spacing: .08em;
}

body.gallery-lightbox-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .gallery-intro {
    grid-template-columns: 1fr;
  }

  .gallery-intro > p {
    max-width: 650px;
  }

  .gallery-item,
  .gallery-item.feature {
    grid-column: span 6;
  }

  .gallery-item.wide {
    grid-column: span 12;
  }

  .gallery-visit__inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .gallery-hero {
    min-height: 650px;
  }

  .gallery-hero__veil {
    background: linear-gradient(0deg, rgba(35, 29, 25, .85), rgba(35, 29, 25, .16) 78%);
  }

  .gallery-hero__content {
    padding-bottom: 72px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 12px;
  }

  .gallery-item,
  .gallery-item.portrait,
  .gallery-item.wide,
  .gallery-item.feature {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 4 / 3;
  }

  .gallery-item.portrait,
  .gallery-item.feature {
    aspect-ratio: 3 / 4;
  }

  .gallery-item__overlay {
    opacity: 1;
    padding: 18px;
    background: linear-gradient(0deg, rgba(31, 25, 22, .68), transparent 48%);
  }

  .gallery-lightbox {
    grid-template-columns: 52px 1fr 52px;
    padding-inline: 6px;
  }

  .gallery-lightbox__nav {
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-item img,
  .gallery-item__overlay {
    transition: none;
  }

  .gallery-item:hover img,
  .gallery-item:focus-visible img {
    transform: none;
  }
}
