/* ═══════════════════════════════════════
   GALLERY — university-images auto-scan
   ═══════════════════════════════════════ */

.gallery-section { padding: 90px 0; background: var(--bg); }
.gallery-section.alt { background: var(--bg3); }
[data-theme="dark"] .gallery-section.alt { background: var(--bg2); }

/* Grid: 5 per row */
.ugallery-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-top: 48px;
}

.ugallery-item {
  position: relative; overflow: hidden;
  border-radius: 12px; cursor: pointer;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--card-border);
  background: var(--bg3);
}
.ugallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1), filter 0.4s;
  display: block;
}
.ugallery-item:hover img { transform: scale(1.1); filter: brightness(0.75); }

.ugallery-item .gal-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(11,28,68,0.85) 0%, transparent 60%);
  opacity: 0; transition: opacity 0.35s;
  display: flex; align-items: flex-end; padding: 14px;
}
.ugallery-item:hover .gal-overlay { opacity: 1; }
.gal-overlay span {
  color: #fff; font-size: 0.78rem; font-weight: 700;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.gal-zoom-icon {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(0.5);
  opacity: 0; transition: all 0.35s;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(201,168,76,0.9);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: #fff;
}
.ugallery-item:hover .gal-zoom-icon {
  opacity: 1; transform: translate(-50%,-50%) scale(1);
}

/* ── LIGHTBOX ── */
#galLightbox {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.96);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}
#galLightbox.open { opacity: 1; visibility: visible; }

.lb-inner {
  position: relative;
  max-width: 90vw; max-height: 90vh;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.lb-img {
  max-width: 88vw; max-height: 78vh;
  object-fit: contain; border-radius: 12px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.8);
  transform: scale(0.85); transition: transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}
#galLightbox.open .lb-img { transform: scale(1); }

.lb-caption {
  color: rgba(255,255,255,0.8); font-size: 0.9rem; text-align: center;
}
.lb-close {
  position: absolute; top: -44px; right: 0;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.1); color: #fff;
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; cursor: pointer; border: none;
}
.lb-close:hover { background: var(--gold); }
.lb-nav {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.1); color: #fff;
  font-size: 1.2rem; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; cursor: pointer; border: none;
}
.lb-nav:hover { background: var(--gold); }
.lb-prev { left: 10px; }
.lb-next { right: 10px; }
/* Hide arrows when lightbox closed to prevent overflow */
#galLightbox:not(.open) .lb-nav,
#galLightbox:not(.open) .lb-close { display: none; }
.lb-counter {
  position: absolute; bottom: -36px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.5); font-size: 0.78rem;
}

/* ── RESPONSIVE ── */