/* =========================================================
   THE GROOT OOTY — Gallery & Lightbox
   ========================================================= */

.gallery-page {
  padding-top: var(--nav-height);
  background-color: #FFFFFF;
  min-height: 100vh;
}

.gallery-main-section {
  padding-top: clamp(1.5rem, 3vw, 2.5rem);
  padding-bottom: clamp(2rem, 3.5vw, 3rem);
}

.gallery-page .cta-section {
  padding-top: 1rem;
  padding-bottom: clamp(2.5rem, 4vw, 4rem);
}

/* Category Filter Tabs */
.gallery-filters {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.gallery-filter-btn {
  padding: 8px 20px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  background: rgba(159, 207, 73, 0.14);
  color: #111111;
  border: 1px solid rgba(159, 207, 73, 0.30);
  transition: all var(--dur-fast) ease;
  cursor: pointer;
}

.gallery-filter-btn:hover {
  background: rgba(159, 207, 73, 0.25);
  transform: translateY(-2px);
}

.gallery-filter-btn.active {
  background: var(--color-mantis);
  color: #FFFFFF;
  border-color: var(--color-mantis);
  box-shadow: var(--shadow-sm);
}

/* Gallery Uniform Grid */
.gallery-masonry {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  aspect-ratio: 4/3;
  transition: transform var(--dur-base) var(--ease-snappy),
              box-shadow var(--dur-base) var(--ease-snappy);
}

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

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s var(--ease-snappy);
}

.gallery-item img.loaded,
.gallery-item img[src] {
  opacity: 1;
}

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

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(17, 27, 18, 0.88) 0%,
    rgba(17, 27, 18, 0.35) 50%,
    transparent 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity var(--dur-fast) ease;
  color: #FFFFFF;
  padding: 1.25rem 1.5rem;
  text-align: left;
}

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

.gallery-item-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1.35;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* ---------------------------------------------------------
   LIGHTBOX MODAL
   --------------------------------------------------------- */

.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 11, 0.95);
  backdrop-filter: blur(16px);
}

.lightbox-content {
  position: relative;
  z-index: 2001;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 85vw;
  max-height: 85vh;
}

.lightbox-img-wrap img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.lightbox-caption {
  margin-top: 1rem;
  background: rgba(17, 27, 18, 0.85);
  backdrop-filter: blur(10px);
  color: var(--color-cream);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  max-width: 80%;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.20);
  color: #FFFFFF;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2002;
  font-size: 1.25rem;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

.lightbox-close {
  top: -60px;
  right: 0;
}

.lightbox-nav.prev {
  left: -65px;
}

.lightbox-nav.next {
  right: -65px;
}

/* Responsive */
@media (max-width: 1024px) {
  .gallery-masonry {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  .lightbox-close {
    top: -50px;
    right: 0;
  }
  .lightbox-nav.prev {
    left: 10px;
  }
  .lightbox-nav.next {
    right: 10px;
  }
}

@media (max-width: 640px) {
  .gallery-masonry {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .gallery-item {
    aspect-ratio: 16/10;
  }
  .lightbox-close {
    top: 10px;
    right: 10px;
  }
  .lightbox-nav.prev {
    left: 5px;
  }
  .lightbox-nav.next {
    right: 5px;
  }
}
