/* ============================================================
   GALLERY PAGE STYLES
   ============================================================ */

/* --- Filter Tabs --- */
.gallery-section {
  padding: var(--space-2xl) 0 var(--space-5xl);
  background: rgba(255, 255, 255, 0.8);
}

.gallery-filters {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-3xl);
  flex-wrap: wrap;
}

.gallery-filter-btn {
  padding: var(--space-sm) var(--space-xl);
  font-family: var(--font-accent);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--clr-gray-500);
  background: var(--clr-gray-100);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-base);
  border: 2px solid transparent;
}

.gallery-filter-btn:hover {
  color: var(--clr-primary);
  background: var(--clr-primary-bg);
}

.gallery-filter-btn.active {
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-saffron));
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

/* --- Gallery Grid --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
  transition: all var(--transition-base);
}

.gallery-item.wide {
  grid-column: span 2;
  aspect-ratio: 2/1;
}

.gallery-item.tall {
  grid-row: span 2;
  aspect-ratio: auto;
}

/* Video items container */
.gallery-item.video-item {
  background: transparent;
}

.gallery-item img,
.gallery-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery-item.video-item video.gallery-video {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 1;
}

.gallery-video-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(20px) brightness(0.6);
  transform: scale(1.15);
  /* Scales up slightly to hide the sharp, unblurred edges */
  z-index: 0;
}

.gallery-item:hover img,
.gallery-item:hover video {
  transform: scale(1.1);
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 40%, rgba(27, 40, 56, 0.85));
  opacity: 0;
  transition: opacity var(--transition-base);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-lg);
  z-index: 2;
}

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

.gallery-item-title {
  font-family: var(--font-accent);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: white;
  margin-bottom: var(--space-xs);
  transform: translateY(10px);
  transition: transform var(--transition-base);
}

.gallery-item:hover .gallery-item-title {
  transform: translateY(0);
}

.gallery-item-category {
  font-size: var(--fs-xs);
  color: var(--clr-primary-light);
  transform: translateY(10px);
  transition: transform var(--transition-base) 0.05s;
}

.gallery-item:hover .gallery-item-category {
  transform: translateY(0);
}

.gallery-item-zoom {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.5);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--fs-lg);
  opacity: 0;
  transition: all var(--transition-base);
  z-index: 2;
}

.gallery-item:hover .gallery-item-zoom {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* Hidden gallery items for filtering */
.gallery-item.hidden {
  display: none;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  backdrop-filter: blur(10px);
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 85vw;
  max-height: 85vh;
  animation: scaleIn 0.3s ease-out;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
}

.lightbox-close:hover {
  background: var(--clr-primary);
  transform: rotate(90deg);
}

.lightbox-caption {
  text-align: center;
  margin-top: var(--space-lg);
  color: var(--clr-gray-300);
  font-family: var(--font-accent);
  font-size: var(--fs-sm);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  border: none;
}

.lightbox-nav:hover {
  background: var(--clr-primary);
}

.lightbox-prev {
  left: -70px;
}

.lightbox-next {
  right: -70px;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-item.wide {
    grid-column: span 1;
    aspect-ratio: 1;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
}