/* ============================================================
   Smart Coaching Centre — Gallery Page Styles
   ============================================================ */

/* ── FILTER TABS ───────────────────────────────────────────── */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 44px;
}
.gf-btn {
  padding: 9px 22px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem; font-weight: 600;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  background: var(--bg-white);
  transition: var(--ease);
  cursor: pointer;
}
.gf-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.gf-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(26,75,140,0.3);
}

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

/* Gallery Item */
.gallery-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}
/* Make some items span 2 columns for variety */
.gallery-item:nth-child(4n+1) { grid-column: span 1; }
.gallery-item:nth-child(7n+3) { grid-column: span 2; }

.gi-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-light);
  aspect-ratio: 4/3;
  box-shadow: var(--shadow-xs);
  transition: var(--ease);
}
.gallery-item:nth-child(7n+3) .gi-wrap { aspect-ratio: 16/7; }

.gi-img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.gallery-item:hover .gi-img { transform: scale(1.06); }

/* Overlay */
.gi-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(13,29,58,0.7) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 16px;
}
.gallery-item:hover .gi-overlay { opacity: 1; }

.gi-zoom {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.7);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255,255,255,0.4);
  color: #fff; font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.25s ease, background 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.gallery-item:hover .gi-zoom { transform: translate(-50%, -50%) scale(1); }
.gi-zoom:hover { background: rgba(255,255,255,0.35); }

.gi-cat {
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--gold);
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  transition: var(--ease-fast);
  position: absolute; bottom: 12px; left: 12px;
}
.gi-cat:hover { background: rgba(0,0,0,0.6); }

.gi-caption {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
  padding: 0 4px;
  line-height: 1.4;
}

/* Empty State */
.gallery-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}
.gallery-empty i  { font-size: 4rem; margin-bottom: 20px; opacity: 0.25; }
.gallery-empty h3 { color: var(--text-dark); margin-bottom: 8px; }

/* ── LIGHTBOX ──────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(8, 15, 30, 0.95);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.open {
  opacity: 1;
  pointer-events: all;
}
.lb-img-wrap {
  position: relative;
  max-width: 90vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.lightbox #lbImg {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: var(--radius);
  object-fit: contain;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  transition: opacity 0.2s ease;
}
.lb-close, .lb-prev, .lb-next {
  position: fixed;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.15);
  color: #fff; font-size: 1.1rem;
  border-radius: 50%;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--ease);
  backdrop-filter: blur(8px);
}
.lb-close { top: 20px; right: 20px; font-size: 1.3rem; }
.lb-prev  { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next  { right: 20px; top: 50%; transform: translateY(-50%); }
.lb-close:hover, .lb-prev:hover, .lb-next:hover {
  background: rgba(255,255,255,0.22);
  transform: scale(1.1);
}
.lb-prev:hover { transform: translateY(-50%) scale(1.1); }
.lb-next:hover { transform: translateY(-50%) scale(1.1); }
.lb-counter {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
  letter-spacing: 1px;
}
.lb-caption {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.8);
  text-align: center;
  max-width: 600px;
  line-height: 1.5;
  min-height: 22px;
}

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-item:nth-child(7n+3) { grid-column: span 1; }
  .gallery-item:nth-child(7n+3) .gi-wrap { aspect-ratio: 4/3; }
}
@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: 1fr; gap: 14px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
  .lb-close { top: 12px; right: 12px; }
}
