/* =========================================================
   GALLERY LIGHTBOX — Society Clubroom
   ========================================================= */

/* ── Trigger buttons ─────────────────────────────────── */

.lightbox-trigger {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: none;
  background: transparent;
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
  border-radius: inherit;
}

.lightbox-trigger img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.35s ease;
}

.lightbox-trigger:hover img,
.lightbox-trigger:focus-visible img {
  transform: scale(1.05);
  filter: brightness(0.82);
}

.lightbox-trigger:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
  border-radius: 4px;
}

.lightbox-trigger__hint {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem 0.75rem;
  background: linear-gradient(to top, rgba(5, 5, 5, 0.82), transparent);
  color: rgba(243, 239, 232, 0.85);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.lightbox-trigger:hover .lightbox-trigger__hint,
.lightbox-trigger:focus-visible .lightbox-trigger__hint {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .lightbox-trigger img,
  .lightbox-trigger__hint {
    transition: none;
  }
}


/* ── Overlay shell ───────────────────────────────────── */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9800;
  background: rgba(5, 5, 5, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.lightbox-overlay--visible {
  opacity: 1;
  pointer-events: all;
}

@media (prefers-reduced-motion: reduce) {
  .lightbox-overlay { transition: none; }
}


/* ── Top bar ─────────────────────────────────────────── */

.lb-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem 0.6rem 1rem;
  flex-shrink: 0;
  gap: 1rem;
}

.lb-counter {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(207, 199, 186, 0.6);
  min-width: 3rem;
}

.lb-zoom-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--color-gold);
  background: rgba(215, 174, 88, 0.1);
  border: 1px solid rgba(215, 174, 88, 0.25);
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}

.lb-zoom-badge--visible {
  opacity: 1;
}


/* ── Middle row (nav + stage) ────────────────────────── */

.lb-middle {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.5rem;
}

.lb-stage {
  flex: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 6px;
}

.lb-imgwrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.lb-img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 64px rgba(0, 0, 0, 0.7);
  transform-origin: center center;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  will-change: transform;
}


/* ── Bottom bar ──────────────────────────────────────── */

.lb-bottombar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem 0.75rem 1rem;
  flex-shrink: 0;
  gap: 1rem;
  min-height: 3.5rem;
}

.lb-caption {
  font-size: 0.8125rem;
  color: rgba(207, 199, 186, 0.55);
  line-height: 1.45;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

.lb-zoom-toolbar {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}


/* ── Buttons (shared) ────────────────────────────────── */

.lb-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 17, 20, 0.9);
  border: 1px solid rgba(197, 52, 52, 0.3);
  border-radius: 50%;
  color: var(--color-text-soft);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.lb-btn svg {
  width: 1.125rem;
  height: 1.125rem;
  pointer-events: none;
}

.lb-btn:hover {
  background: rgba(197, 52, 52, 0.25);
  border-color: rgba(197, 52, 52, 0.65);
}

.lb-btn:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 2px;
}

/* Close button */
.lb-btn--close {
  width: 2.5rem;
  height: 2.5rem;
}

.lb-btn--close:hover {
  transform: rotate(90deg);
}

/* Nav prev / next */
.lb-btn--nav {
  width: 2.75rem;
  height: 2.75rem;
}

.lb-btn--nav:hover {
  transform: scale(1.1);
}

/* Zoom toolbar buttons */
.lb-btn--zoom {
  width: 2.25rem;
  height: 2.25rem;
}

.lb-btn--zoom svg {
  width: 1rem;
  height: 1rem;
}

/* Hidden state */
.lb-btn--hidden {
  opacity: 0;
  pointer-events: none;
}


/* ── Gallery grid item cursor ────────────────────────── */

.gallery-grid__item {
  cursor: zoom-in;
}


/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 480px) {
  .lb-btn--nav {
    width: 2.25rem;
    height: 2.25rem;
  }

  .lb-caption {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lb-btn,
  .lb-zoom-badge {
    transition: none;
  }
}
