/* ============================================
   GALLERY PAGE — css/gallery.css
   ============================================ */

/* --- FILTER BAR --- */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 48px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.filter-btn {
  background: transparent;
  border: 1.5px solid rgba(0,0,0,0.18);
  border-radius: 100px;
  padding: 8px 22px;
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--gray);
  transition: all 0.18s;
}

.filter-btn:hover {
  border-color: var(--black);
  color: var(--black);
}

.filter-btn.active {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

/* --- GALLERY SECTION --- */
.gallery-section {
  padding: 60px 0 100px;
}

/* --- MASONRY GRID --- */
.masonry {
  columns: 3;
  column-gap: 16px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  background: var(--light);
  /* entrance animation */
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease,
    box-shadow 0.2s ease;
}

.masonry-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.masonry-item.hidden {
  display: none;
}

.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.masonry-item:hover img {
  transform: scale(1.04);
}

.masonry-item:hover {
  box-shadow: 0 16px 48px rgba(0,0,0,0.18);
}

/* --- OVERLAY --- */
.item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, transparent 55%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 18px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.masonry-item:hover .item-overlay {
  opacity: 1;
}

.item-title {
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 4px;
}

.item-tag {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-head);
  font-weight: 700;
}

/* --- LIGHTBOX --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8,8,8,0.96);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lb-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 88vw;
  max-height: 88vh;
  animation: lbIn 0.3s ease both;
}

@keyframes lbIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

.lb-img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.lb-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
  text-align: center;
  gap: 4px;
}

.lb-title {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.lb-caption-text {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.5);
  font-weight: 300;
}

/* Close / Nav buttons */
.lb-close,
.lb-prev,
.lb-next {
  position: absolute;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.lb-close:hover,
.lb-prev:hover,
.lb-next:hover {
  background: rgba(255,255,255,0.22);
}

.lb-close { top: 24px; right: 24px; font-size: 1rem; }
.lb-prev  { left: 24px; top: 50%; transform: translateY(-50%); font-size: 1.8rem; }
.lb-next  { right: 24px; top: 50%; transform: translateY(-50%); font-size: 1.8rem; }

.lb-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  font-family: var(--font-head);
}

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
  .masonry { columns: 2; }
}

@media (max-width: 560px) {
  .masonry { columns: 1; }
  .lb-prev { left: 10px; }
  .lb-next { right: 10px; }
}