.gallery-page {
  padding: 48px 0 80px;
  background: var(--cream, #fff9f4);
}

.gallery-hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 36px;
}

.gallery-hero h1 {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  font-synthesis: none;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.1;
  margin-bottom: 14px;
  background-image: var(--heading-grad, linear-gradient(to right, #b57b43d1 0%, #6b3704d6 100%));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.gallery-hero p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.filter-btn {
  border: 1.5px solid var(--tan, #c4a07a);
  background: #fff;
  color: var(--brown, #a78464);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 12px 18px;
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-btn:hover {
  border-color: var(--tan, #c4a07a);
  color: var(--brown, #a78464);
}

.filter-btn.is-active {
  background-image: var(--btn-grad);
  background-color: #b79068;
  border-color: transparent;
  color: #fff;
}

.masonry {
  column-count: 4;
  column-gap: 18px;
}

.masonry-item {
  break-inside: avoid;
  margin: 0 0 18px;
  display: block;
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 24px rgba(90, 70, 40, 0.08);
  text-decoration: none;
  color: inherit;
  cursor: zoom-in;
}

.masonry-item[hidden] {
  display: none;
}

.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: top;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.masonry-item:hover img,
.masonry-item:focus-visible img {
  transform: scale(1.04);
}

.masonry-item figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 14px 12px;
  background: linear-gradient(180deg, transparent, rgba(7, 30, 54, 0.88));
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.gallery-cta {
  text-align: center;
  margin-top: 12px;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: rgba(7, 30, 54, 0.88);
  display: grid;
  place-items: center;
  padding: 56px 72px 72px;
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox img {
  max-width: min(1080px, 100%);
  max-height: calc(100vh - 140px);
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.gallery-lightbox .lightbox-caption,
.gallery-lightbox figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18px;
  text-align: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

.lightbox-close {
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 22px;
}

.lightbox-nav {
  top: 50%;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 28px;
  transform: translateY(-50%);
}

.lightbox-nav.prev {
  left: 16px;
}

.lightbox-nav.next {
  right: 16px;
}

.lightbox-close:hover,
.lightbox-nav:hover,
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  background: #3a2c22;
  color: #ffffff;
}

@media (max-width: 1100px) {
  .masonry {
    column-count: 3;
  }
}

@media (max-width: 720px) {
  .masonry {
    column-count: 2;
    column-gap: 12px;
  }

  .masonry-item {
    margin-bottom: 12px;
    border-radius: 12px;
  }

  .gallery-lightbox {
    padding: 64px 16px 80px;
  }

  .lightbox-nav {
    top: auto;
    bottom: 16px;
    transform: none;
  }

  .lightbox-nav.prev {
    left: 24px;
  }

  .lightbox-nav.next {
    right: 24px;
  }
}
