/* ============================================
   Aurexa Academy — Gallery Page
   ============================================ */

.gallery-page { padding-top: calc(var(--navbar-height) + var(--space-3xl)); }

.gallery-hero {
  text-align: center;
  padding: var(--space-3xl) 0;
  background: var(--bg-secondary);
  margin-bottom: var(--space-3xl);
}

.gallery-hero h1 { margin-bottom: var(--space-md); }
.gallery-hero p { max-width: 600px; margin: 0 auto; font-size: var(--fs-md); }

.gallery-tabs {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
  flex-wrap: wrap;
}

.gallery-tab {
  padding: 8px 24px;
  border-radius: var(--radius-full);
  font-weight: var(--fw-medium);
  font-size: var(--fs-sm);
  border: 2px solid var(--border-light);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  transition: all var(--transition-base);
  cursor: pointer;
}

.gallery-tab:hover { border-color: var(--brand); color: var(--brand); }
.gallery-tab.active { background: var(--brand); color: white; border-color: var(--brand); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-md);
  grid-auto-rows: 250px;
}

.gallery-item {
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.gallery-item:nth-child(3n+1) { grid-row: span 2; }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.gallery-item .gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(var(--primary-rgb),0.7) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: var(--space-lg);
  opacity: 0;
  transition: opacity var(--transition-base);
}

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

.gallery-overlay span {
  color: white;
  font-weight: var(--fw-semibold);
  font-size: var(--fs-base);
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: var(--radius-md);
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-2xl);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lightbox-close:hover { background: rgba(255,255,255,0.2); }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.1);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }

@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; }
  .gallery-item:nth-child(3n+1) { grid-row: span 1; }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: 220px; }
}
