/**
 * SunCatcher Power Private Limited - Gallery Styles
 * Filterable gallery with lightbox integration
 */

/* ===== GALLERY SECTION ===== */
.gallery-section {
  padding: 100px 0;
  background: var(--warm-white);
  display: block;
  visibility: visible;
}

.gallery-header {
  text-align: center;
  margin-bottom: 56px;
}

.gallery-header .section-title {
  margin-bottom: 16px;
}

.gallery-header .section-body {
  margin: 0 auto;
}

/* ===== GALLERY FILTERS ===== */
.gallery-filters {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 12px 28px;
  border: 2px solid var(--border);
  background: var(--white);
  color: var(--slate-mid);
  font-size: 14px;
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--slate);
  transform: translateY(-2px);
}

/* ===== GALLERY GRID ===== */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  visibility: visible;
}

.gallery-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s ease;
  height: 300px;
  background: var(--slate);
  visibility: visible;
  display: block;
}

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

.gallery-item img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}

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

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(30,41,59,0.9) 0%, rgba(30,41,59,0.3) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
}

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

.gallery-category {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 8px;
  transform: translateY(20px);
  transition: transform 0.4s ease 0.1s;
}

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

.gallery-title {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
  transform: translateY(20px);
  transition: transform 0.4s ease 0.2s;
}

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

.gallery-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 60px;
  height: 60px;
  background: var(--amber);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--slate);
  font-size: 24px;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

/* ===== MASONRY LAYOUT ===== */
.gallery-masonry {
  column-count: 3;
  column-gap: 24px;
}

.gallery-masonry .gallery-item {
  break-inside: avoid;
  margin-bottom: 24px;
  aspect-ratio: auto;
}

/* ===== GALLERY ITEM SIZES ===== */
.gallery-item.wide {
  grid-column: span 2;
}

.gallery-item.tall {
  grid-row: span 2;
  aspect-ratio: 3/4;
}

.gallery-item.large {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: 1;
}

/* ===== LIGHTBOX CUSTOMIZATION ===== */
.lb-dataContainer {
  padding: 20px;
}

.lb-caption {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--slate);
}

.lb-number {
  font-size: 13px;
  color: var(--slate-light);
}

.lb-closeContainer {
  top: 20px;
  right: 20px;
}

.lb-close {
  background: var(--slate);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.lb-close:hover {
  background: var(--amber);
}

.lb-nav {
  display: flex;
  align-items: center;
}

.lb-prev,
.lb-next {
  background: var(--slate);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.lb-prev:hover,
.lb-next:hover {
  background: var(--amber);
  opacity: 1;
}

.lb-prev::before,
.lb-next::before {
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 20px;
  color: var(--white);
}

.lb-prev::before {
  content: '\f053';
}

.lb-next::before {
  content: '\f054';
}

/* ===== GALLERY LOADING STATE ===== */
.gallery-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.gallery-loading .spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top-color: var(--amber);
  border-radius: 50%;
}

/* ===== EMPTY STATE ===== */
.gallery-empty {
  text-align: center;
  padding: 80px 20px;
  background: var(--white);
  border-radius: 20px;
  border: 2px dashed var(--border);
}

.gallery-empty i {
  font-size: 64px;
  color: var(--border);
  margin-bottom: 24px;
}

.gallery-empty h4 {
  font-size: 24px;
  color: var(--slate);
  margin-bottom: 12px;
}

.gallery-empty p {
  color: var(--slate-light);
}

/* ===== GALLERY PLACEHOLDER ===== */
.gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  visibility: visible;
}

.gallery-placeholder-icon {
  font-size: 64px;
  opacity: 0.3;
}

/* ===== GALLERY BADGES ===== */
.gallery-kwp-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--amber);
  color: var(--slate);
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 10px;
  line-height: 1;
  z-index: 10;
}

.gallery-kwp-badge span {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  display: block;
  margin-top: 2px;
}

/* ===== GALLERY ITEM ANIMATIONS ===== */
.gallery-item.fade-in {
  animation: galleryFadeIn 0.6s ease forwards;
}

@keyframes galleryFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ===== RESPONSIVE GALLERY ===== */
@media (max-width: 991px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .gallery-masonry {
    column-count: 2;
  }
  
  .gallery-item.wide,
  .gallery-item.large {
    grid-column: span 1;
  }
  
  .gallery-item.tall {
    grid-row: span 1;
    aspect-ratio: 4/3;
  }
}

@media (max-width: 576px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-masonry {
    column-count: 1;
  }
  
  .gallery-filters {
    gap: 8px;
  }
  
  .filter-btn {
    padding: 10px 20px;
    font-size: 13px;
  }
  
  .gallery-title {
    font-size: 16px;
  }
}

/* ===== GALLERY ZOOM ON CLICK ===== */
.gallery-item.zoom-effect {
  transition: transform 0.3s ease;
}

.gallery-item.zoom-effect:active {
  transform: scale(0.95);
}

/* ===== GALLERY BADGES ===== */
.gallery-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--amber);
  color: var(--slate);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
}

.gallery-badge.featured {
  background: var(--amber-dark);
}

/* ===== GALLERY VIDEO INDICATOR ===== */
.gallery-video-indicator {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 40px;
  height: 40px;
  background: rgba(0,0,0,0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 16px;
  z-index: 10;
}

/* ===== GALLERY LAZY LOADING ===== */
.gallery-item img {
  opacity: 1;
  transition: opacity 0.5s ease;
}

.gallery-item img.loaded {
  opacity: 1;
}

.gallery-item img.loading {
  background: var(--border);
  min-height: 200px;
}

/* ===== GALLERY HOVER EFFECTS ===== */
.gallery-item.effect-zoom:hover img {
  transform: scale(1.15);
}

.gallery-item.effect-grayscale:hover img {
  filter: grayscale(0%);
}

.gallery-item.effect-grayscale img {
  filter: grayscale(100%);
  transition: filter 0.5s ease;
}

.gallery-item.effect-blur:hover img {
  filter: blur(0);
}

.gallery-item.effect-blur img {
  filter: blur(4px);
  transition: filter 0.5s ease;
}

/* ===== GALLERY SLIDER ===== */
.gallery-slider {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
}

.gallery-slider .swiper-slide {
  aspect-ratio: 16/9;
}

.gallery-slider img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-slider .swiper-button-prev,
.gallery-slider .swiper-button-next {
  background: var(--slate);
  color: var(--white);
  width: 50px;
  height: 50px;
  border-radius: 50%;
}

.gallery-slider .swiper-button-prev:hover,
.gallery-slider .swiper-button-next:hover {
  background: var(--amber);
}

.gallery-slider .swiper-pagination-bullet {
  background: var(--white);
  opacity: 0.5;
}

.gallery-slider .swiper-pagination-bullet-active {
  background: var(--amber);
  opacity: 1;
}

/* ===== GALLERY THUMBNAILS ===== */
.gallery-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.gallery-thumbnail {
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.3s ease;
}

.gallery-thumbnail:hover,
.gallery-thumbnail.active {
  border-color: var(--amber);
  transform: scale(1.05);
}

.gallery-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== GALLERY STATS ===== */
.gallery-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 56px;
  padding: 40px;
  background: var(--white);
  border-radius: 20px;
  border: 1px solid var(--border);
}

.gallery-stat {
  text-align: center;
}

.gallery-stat-number {
  font-family: 'Fraunces', serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--amber);
  line-height: 1;
  margin-bottom: 8px;
}

.gallery-stat-label {
  font-size: 13px;
  color: var(--slate-light);
  font-weight: 500;
}
