/* ========== ENHANCED GALLERY SECTION ========== */
.gallery-section {
  padding: 80px 6%;
  background: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.05), transparent 70%);
}

.destination-group {
  margin-bottom: 90px;
  scroll-margin-top: 150px;
}

.dest-title {
  font-size: clamp(1.8rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--text);
  margin-bottom: 35px;
  padding-left: 18px;
  border-left: 4px solid var(--brand);
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.02em;
}

/* STICKY GLASSMORPHISM FILTER BAR */
.gallery-filter-bar {
  background: rgba(10, 26, 34, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50px;
  position: sticky;
  top: 90px;
  z-index: 99;
  margin-bottom: 50px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scrollbar-width: none; /* Hide scrollbar for clean UI */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.gallery-filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-link {
  padding: 10px 24px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border: 1px solid var(--border);
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-link:hover,
.filter-link.active {
  background: var(--brand);
  color: #001;
  border-color: var(--brand);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

/* DYNAMIC BENTO MASONRY GRID */
.masonry-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 240px;
  grid-auto-flow: dense;
  gap: 24px;
}

/* GALLERY CARDS & EFFECTS */
.gallery-item {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  isolation: isolate;
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.85) 100%);
  opacity: 0.6;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.gallery-item:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 25px rgba(56, 189, 248, 0.25);
}

.gallery-item:hover::after {
  opacity: 0.85;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* BENTO VARIATIONS */
.gallery-item.tall {
  grid-row: span 2;
}

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

/* FLOATING GLASS BADGE */
.badge {
  position: absolute;
  bottom: 16px;
  left: 16px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  transform: translateY(0);
  transition: transform 0.3s ease, background 0.3s ease;
}

.gallery-item:hover .badge {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--brand);
  transform: translateY(-3px);
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 900px) {
  .masonry-gallery {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 220px;
  }
  .gallery-item.wide {
    grid-column: span 1;
  }
}

@media (max-width: 600px) {
  .gallery-section {
    padding: 50px 4%;
  }
  .masonry-gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: 260px;
  }
  .gallery-item.tall {
    grid-row: span 1;
  }
}