/* ============================================
   KASARACHI FOUNDATION - Gallery Page Styles
   ============================================ */

/* Page Hero */
.page-hero {
  min-height: 35vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  background: linear-gradient(135deg, #0a1628 0%, #1a2a4a 50%, #0d1b33 100%);
  color: var(--white);
  padding: 120px 0 70px;
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,193,7,0.08) 0%, transparent 60%);
  z-index: 0;
}

.page-hero-content {
  position: relative;
  z-index: 1;
  max-width: 650px;
}

.page-hero .badge {
  margin-bottom: 16px;
}

.page-hero h1 {
  margin-bottom: 14px;
}

.page-hero .hero-sub {
  font-size: 1.1rem;
  opacity: 0.9;
}

.section-padding-sm {
  padding: 40px 0;
}

/* Filter Bar */
.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.gallery-filter-btn {
  padding: 10px 20px;
  border: 2px solid var(--border);
  border-radius: 50px;
  background: var(--white);
  cursor: pointer;
  font-family: var(--font);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
  color: var(--dark-light);
}

.gallery-filter-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.gallery-filter-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* Gallery Masonry */
.gallery-masonry {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 220px;
  gap: 16px;
  grid-auto-flow: dense;
}

.gallery-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s ease;
  position: relative;
}

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

.gallery-item.wide {
  grid-column: span 2;
}

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

.gallery-item.hidden {
  display: none;
}

.gallery-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.5s ease;
}

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

.gallery-icon {
  font-size: 3.5rem;
  position: absolute;
  z-index: 1;
  opacity: 0.9;
  transition: all 0.4s ease;
}

.gallery-item:hover .gallery-icon {
  transform: scale(1.1);
  opacity: 1;
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: var(--white);
  padding: 40px 20px 16px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
  transform: translateY(0);
}

.gallery-title {
  display: block;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
}

.gallery-subtitle {
  display: block;
  font-size: 0.8rem;
  opacity: 0.85;
}

/* Load More */
.load-more-wrapper {
  text-align: center;
  margin-top: 40px;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
}

.lightbox-close:hover {
  color: var(--accent);
  transform: scale(1.1);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
  padding: 16px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  z-index: 10;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255,255,255,0.25);
}

.lightbox-content {
  max-width: 80vw;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.lightbox-caption {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--white);
  text-align: center;
  font-size: 1rem;
  font-weight: 500;
}

/* Video Section */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.video-card {
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
}

.video-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.video-thumbnail {
  height: 200px;
  overflow: hidden;
}

.video-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1E293B, #334155);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s ease;
}

.video-card:hover .video-placeholder {
  transform: scale(1.05);
}

.play-icon {
  font-size: 3rem;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
  transition: transform 0.3s ease;
}

.video-card:hover .play-icon {
  transform: scale(1.2);
}

.video-info {
  padding: 18px;
}

.video-info h4 {
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.video-info p {
  color: var(--gray);
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.video-duration {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 500;
}

/* Instagram */
.instagram-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.insta-item {
  aspect-ratio: 1/1;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}

.insta-item:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
}

.insta-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #E1306C, #F77737);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--white);
}

.insta-cta {
  text-align: center;
  margin-top: 28px;
}

/* CTA */
.cta-section .cta-box {
  padding: 48px 32px;
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Active Nav */
.nav-link.active {
  color: var(--primary);
  font-weight: 600;
}

.nav-link.active::after {
  width: 100%;
}

/* Responsive */
@media (max-width: 992px) {
  .gallery-masonry {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

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

  .instagram-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .page-hero {
    min-height: 28vh;
    padding: 100px 0 50px;
  }

  .gallery-masonry {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    grid-auto-rows: 180px;
    gap: 10px;
  }

  .gallery-item.tall {
    grid-row: span 1;
  }

  .filter-buttons {
    gap: 6px;
  }

  .gallery-filter-btn {
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  .lightbox-prev,
  .lightbox-next {
    font-size: 1.5rem;
    padding: 10px 8px;
  }

  .instagram-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}