/* ==========================================================================
   GALLERY PAGE STYLES - PINTEREST-STYLE MASONRY LAYOUT & LIGHTBOX
   ========================================================================== */

.gallery-hero-banner {
  background-color: var(--bg-emerald-deep);
  color: var(--text-primary-light);
  padding: 8rem 0 4rem;
  text-align: center;
  position: relative;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

/* Filter Tab Navigation */
.gallery-filters {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 3rem 0;
}

.filter-btn {
  padding: 0.65rem 1.5rem;
  border-radius: var(--radius-full);
  background: var(--bg-cream-alt);
  color: var(--text-primary-dark);
  font-weight: 600;
  font-size: 0.9375rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.filter-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  color: var(--bg-emerald-deep);
  border-color: var(--gold-primary);
}

.filter-btn.active {
  background: var(--bg-emerald-main);
  color: var(--gold-primary);
  border-color: var(--gold-primary);
  box-shadow: var(--shadow-sm);
}

/* Pinterest-Style Masonry Container */
.masonry-grid {
  column-count: 3;
  column-gap: 1.5rem;
  width: 100%;
  margin-bottom: 4rem;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background-color: #fff;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), opacity 400ms ease;
  cursor: pointer;
}

.masonry-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.masonry-item.hide {
  display: none;
}

.masonry-img-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Hover Overlay & Caption */
.masonry-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(6, 31, 26, 0.92) 0%, rgba(6, 31, 26, 0.2) 60%, rgba(0, 0, 0, 0) 100%);
  opacity: 0;
  transition: opacity 350ms ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  color: #fff;
}

.masonry-item:hover .masonry-overlay {
  opacity: 1;
}

.masonry-tag {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold-primary);
  background: rgba(6, 31, 26, 0.8);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.5rem;
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.masonry-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text-primary-light);
  margin-bottom: 0.25rem;
}

.masonry-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary-light);
}

.masonry-zoom-icon {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.2);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-primary);
  border: 1px solid var(--gold-primary);
}

/* Interactive Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 26, 21, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 350ms ease, visibility 350ms ease;
}

.lightbox-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-image-holder {
  position: relative;
  max-height: 70vh;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.lightbox-image-holder img {
  max-height: 70vh;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: block;
}

.lightbox-caption {
  margin-top: 1.25rem;
  text-align: center;
  color: #fff;
}

.lightbox-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--gold-primary);
}

.lightbox-sub {
  font-size: 0.9375rem;
  color: var(--text-secondary-light);
  margin-top: 0.25rem;
}

.lightbox-cta {
  margin-top: 1rem;
}

/* Lightbox Controls */
.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(6, 31, 26, 0.6);
  transition: all var(--transition-fast);
}

.lightbox-close:hover {
  background: var(--gold-primary);
  color: var(--bg-emerald-deep);
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: var(--gold-primary);
  background: rgba(6, 31, 26, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lightbox-arrow:hover {
  background: var(--gold-primary);
  color: var(--bg-emerald-deep);
}

.lightbox-prev {
  left: 2rem;
}

.lightbox-next {
  right: 2rem;
}

/* Responsive Grid Columns */
@media (max-width: 900px) {
  .masonry-grid {
    column-count: 2;
  }
  
  .lightbox-arrow {
    width: 40px;
    height: 40px;
  }

  .lightbox-prev { left: 0.5rem; }
  .lightbox-next { right: 0.5rem; }
}

@media (max-width: 580px) {
  .masonry-grid {
    column-count: 1;
  }
}
