.filter-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.filter-btn {
  padding: 10px 22px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover {
  border-color: var(--gold);
  color: var(--ink);
}

.filter-btn.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

.masonry {
  columns: 3 260px;
  column-gap: 20px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.masonry-item img {
  width: 100%;
  display: block;
  transition: transform 0.7s ease;
}

.masonry-item:hover img {
  transform: scale(1.05);
}

.masonry-item__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 22px 20px;
  background: linear-gradient(to top, rgba(20, 18, 15, 0.82), transparent);
  color: var(--cream);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
}

.masonry-item:hover .masonry-item__caption {
  opacity: 1;
  transform: translateY(0);
}

.masonry-item__caption span {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-light);
}

.masonry-item__caption h3 {
  color: var(--cream);
  margin-top: 6px;
  font-size: 1.2rem;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(15, 13, 11, 0.94);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 64px clamp(16px, 5vw, 48px) clamp(24px, 4vh, 40px);
}

.lightbox img {
  max-width: 100%;
  max-height: 72vh;
  max-height: 72dvh;
  object-fit: contain;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  color: var(--cream);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox__caption {
  flex: none;
  max-width: 100%;
  text-align: center;
  color: var(--cream);
}

.lightbox__caption span {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-light);
  margin-bottom: 6px;
}

@media (max-width: 700px) {
  .masonry {
    columns: 1 100%;
  }
}

/* Touch devices never fire :hover, so reveal the captions permanently. */
@media (hover: none) {
  .masonry-item__caption {
    opacity: 1;
    transform: none;
  }
}

@media (max-height: 520px) {
  .lightbox {
    gap: 12px;
    padding: 52px 16px 16px;
  }

  .lightbox img {
    max-height: 62vh;
    max-height: 62dvh;
  }
}
