/* CS 506 · Week 3 Starter · Lightbox styling
 * Backdrop, centered image, fade-in transition.
 * Students may restyle or replace to match their own page.
 */

/* ── Gallery thumbnails ────────────────────────────────────────────── */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  padding: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.gallery__thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid #ddd;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gallery__thumb:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ── Lightbox overlay ──────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.lightbox.open {
  display: flex;
  opacity: 1;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox__caption {
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  margin-top: 1rem;
  text-align: center;
  max-width: 80vw;
}

/* ── JavaScript-driven lightbox (different from hash-based) ──── */
#js-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 2rem;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#js-lightbox.open {
  display: flex;
  opacity: 1;
}

#js-lightbox .lightbox__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
