/* ===================================================================
   DR. BHAGAT'S CLINIC — GALLERY & LIGHTBOX SYSTEM
   Balanced Mid-Tone Theme: Soft Slate Blue Backdrop with Crisp White Cards
   =================================================================== */

#gallery,
.gallery-section,
#gallery.section-purple,
.section-purple#gallery {
  background: #e4edf6 !important;
  color: #0f172a !important;
  padding: 85px 0 !important;
  position: relative;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
}

#gallery .section-header {
  text-align: center;
  margin-bottom: 35px;
}

/* ── Section Header Accent ── */
#gallery .section-header .section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full, 9999px);
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

#gallery .section-header .section-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: clamp(1.85rem, 2.6vw, 2.4rem);
  font-weight: 800;
  color: #1a385c !important;
  line-height: 1.2;
  margin: 0;
}

#gallery .gradient-text {
  background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#gallery .section-header .section-desc {
  color: #475569;
  max-width: 550px;
}

/* ── 1. FILTER TABS BAR ── */
.gallery-filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 2.2rem;
}

.gallery-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: var(--radius-full, 9999px);
  color: #475569;
  font-family: var(--font-body, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(11, 29, 54, 0.03);
}

.gallery-filter-btn i {
  font-size: 0.9rem;
  color: #0284c7;
  transition: transform 0.3s ease;
}

.gallery-filter-btn:hover {
  background: #f0f7ff;
  border-color: #0284c7;
  color: #0284c7;
  transform: translateY(-2px);
}

.gallery-filter-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: #0284c7;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.3);
  transform: translateY(-2px);
}

.gallery-filter-btn.active i {
  color: #ffffff;
}

/* ── 2. GALLERY GRID ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

/* ── 3. GALLERY CARD ── */
.gallery-card {
  position: relative;
  height: 290px;
  border-radius: 20px;
  overflow: hidden;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(11, 29, 54, 0.05);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.gallery-card.hidden {
  display: none !important;
}

.gallery-card-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gallery-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), filter 0.6s ease;
}

.gallery-card-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.05) 0%,
    transparent 40%,
    rgba(11, 29, 54, 0.65) 75%,
    rgba(11, 29, 54, 0.9) 100%
  );
  pointer-events: none;
  transition: background 0.35s ease;
}

/* Hover States */
.gallery-card:hover {
  transform: translateY(-5px);
  border-color: #0284c7;
  box-shadow: 0 16px 36px rgba(2, 132, 199, 0.15);
}

.gallery-card:hover .gallery-card-media img {
  transform: scale(1.08);
}

/* ── 4. CARD TOP FLOATING BADGE & ZOOM ── */
.gallery-card-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 3;
  pointer-events: none;
}

.gallery-pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-full, 9999px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #e2e8f0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #0369a1;
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.gallery-pill-badge i {
  color: #0284c7;
  font-size: 0.8rem;
}

.gallery-zoom-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #e2e8f0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #0369a1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.gallery-card:hover .gallery-zoom-btn {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  transform: scale(1.08);
}

/* ── 5. CARD BOTTOM TITLE ── */
.gallery-card-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 18px 18px 16px 18px;
  z-index: 3;
  pointer-events: none;
}

.gallery-card-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.12rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.gallery-card:hover .gallery-card-title {
  color: #e0f2fe;
}

/* ── 6. CLEAN LIGHTBOX MODAL ── */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.lightbox-modal.is-active {
  opacity: 1;
  visibility: visible;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 29, 54, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
}

.lightbox-dialog {
  position: relative;
  z-index: 2;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(11, 29, 54, 0.25);
  transform: scale(0.96);
  transition: transform 0.3s ease;
}

.lightbox-modal.is-active .lightbox-dialog {
  transform: scale(1);
}

.lightbox-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.lightbox-tag-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lightbox-badge {
  padding: 4px 12px;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-full, 9999px);
  color: #0369a1;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.lightbox-counter {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 700;
}

.lightbox-close-btn {
  background: #e2e8f0;
  border: none;
  color: #475569;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lightbox-close-btn:hover {
  background: #ef4444;
  color: #ffffff;
}

.lightbox-media-frame {
  position: relative;
  width: 100%;
  height: 500px;
  max-height: 60vh;
  background: #1a385c;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lightbox-img-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  transition: opacity 0.25s ease;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1.5px solid #e2e8f0;
  color: #1a385c;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lightbox-nav-btn:hover {
  background: #0284c7;
  border-color: #0284c7;
  color: #ffffff;
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav-btn.prev { left: 16px; }
.lightbox-nav-btn.next { right: 16px; }

.lightbox-details {
  padding: 16px 20px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.lightbox-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.15rem;
  font-weight: 800;
  color: #1a385c;
  margin: 0;
}

/* ── 7. RESPONSIVE BREAKPOINTS ── */
@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
  .gallery-card {
    height: 260px;
  }
  .lightbox-media-frame {
    height: 380px;
  }
}

@media (max-width: 640px) {
  #gallery,
  .gallery-section,
  #gallery.section-purple,
  .section-purple#gallery {
    padding: 42px 0 38px !important;
  }

  #gallery .section-header {
    margin-bottom: 16px;
    text-align: center;
  }

  #gallery .section-header .section-title {
    font-size: 1.5rem;
    margin: 4px 0 0;
  }

  .gallery-filter-bar {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 14px;
    padding: 2px 4px 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

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

  .gallery-filter-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 14px;
    font-size: 0.78rem;
  }

  /* Horizontal Swipe Gallery Track */
  .gallery-grid {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    gap: 14px;
    margin: 0 -16px;
    padding: 6px 24px 14px 16px !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  .gallery-card {
    flex: 0 0 78% !important;
    min-width: 250px !important;
    max-width: 290px !important;
    height: 185px !important;
    scroll-snap-align: center;
    border-radius: 16px;
  }

  .lightbox-modal {
    padding: 12px;
  }
  .lightbox-media-frame {
    height: 280px;
  }
  .lightbox-nav-btn.prev { left: 8px; }
  .lightbox-nav-btn.next { right: 8px; }
}

@media (max-width: 480px) {
  #gallery,
  .gallery-section,
  #gallery.section-purple,
  .section-purple#gallery {
    padding: 38px 0 34px !important;
  }

  #gallery .section-header .section-title {
    font-size: 1.45rem;
  }

  .gallery-filter-btn {
    padding: 5px 11px;
    font-size: 0.74rem;
  }

  .gallery-card {
    flex: 0 0 78% !important;
    min-width: 240px !important;
    height: 175px !important;
    border-radius: 14px;
  }

  .gallery-card-bottom {
    padding: 10px 12px;
  }

  .gallery-card-title {
    font-size: 0.88rem;
  }

  .gallery-pill-badge {
    font-size: 0.65rem;
    padding: 3px 8px;
  }

  .lightbox-modal {
    padding: 8px;
  }
  .lightbox-dialog {
    border-radius: 16px;
  }
  .lightbox-top-bar {
    padding: 10px 12px;
  }
  .lightbox-badge {
    font-size: 0.68rem;
    padding: 3px 8px;
  }
  .lightbox-counter {
    font-size: 0.74rem;
  }
  .lightbox-close-btn {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }
  .lightbox-media-frame {
    height: 220px;
  }
  .lightbox-nav-btn {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }
  .lightbox-nav-btn.prev { left: 6px; }
  .lightbox-nav-btn.next { right: 6px; }
  .lightbox-details {
    padding: 12px 14px;
  }
  .lightbox-title {
    font-size: 0.95rem;
  }
}
