/* styles/gallery-view.css — the shared photo-gallery visuals (album cover cards
   grouped by semester + the lightbox), used by both the public Gallery page and
   the committee pages' "Past Events" section (see js/gallery/gallery-view.js).
   Page-specific bits (e.g. the Gallery banner) stay in styles/pages/gallery.css. */

.gallery-empty {
  color: var(--color-text-muted);
}

.gallery-semester {
  margin-bottom: var(--space-7, 3rem);
}

.gallery-semester-heading {
  font-size: 1.4rem;
  color: var(--color-primary);
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-primary-light, var(--color-border));
}

.gallery-album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-5);
}

.gallery-album-card {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.gallery-album-card:hover:not(:disabled) {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.gallery-album-card:disabled {
  cursor: default;
  opacity: 0.7;
}

.gallery-album-cover {
  position: relative;
  aspect-ratio: 4 / 3;
  background-color: var(--color-primary-light);
  overflow: hidden;
}

/* Photo-count badge on the cover, so it's clear how many images the album holds. */
.gallery-album-count {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.gallery-album-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-album-cover.is-empty {
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
  opacity: 0.6;
}

.gallery-album-name {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-text);
  padding: var(--space-3) var(--space-3) 0;
}

.gallery-album-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  padding: 2px var(--space-3) var(--space-3);
}

/* ---------- Lightbox ---------- */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lb-figure {
  margin: 0;
  max-width: 92vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.gallery-lb-img {
  max-width: 92vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.gallery-lb-caption {
  color: #fff;
  font-size: 0.9rem;
  text-align: center;
  max-width: 60ch;
}

.gallery-lb-close,
.gallery-lb-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-lb-close {
  top: var(--space-4);
  right: var(--space-4);
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
}

.gallery-lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 1.8rem;
  line-height: 1;
}

.gallery-lb-prev {
  left: var(--space-4);
}

.gallery-lb-next {
  right: var(--space-4);
}

.gallery-lb-close:hover,
.gallery-lb-nav:hover {
  background: rgba(255, 255, 255, 0.28);
}

.gallery-lb-counter {
  position: absolute;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.85rem;
}
