/* ============================================================
   BREW & CO. — Lightbox Modal Component
   Fullscreen Gallery Preview, Counter, Navigation & Responsive
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.94);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox--open {
  opacity: 1;
  visibility: visible;
}

.lightbox__container {
  position: relative;
  max-width: 86vw;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox__image {
  max-width: 100%;
  max-height: 74vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.94);
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lightbox--open .lightbox__image {
  transform: scale(1);
}

.lightbox__caption {
  margin-top: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  color: white;
  font-family: var(--font-heading);
}

.lightbox__counter {
  font-size: var(--text-xs);
  color: var(--color-accent);
  letter-spacing: var(--tracking-wide);
}

.lightbox__title {
  font-size: var(--text-base);
  font-weight: 600;
}

.lightbox__btn {
  position: absolute;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  color: white;
  font-size: var(--text-xl);
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
  border: none;
  z-index: 2;
}

.lightbox__btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

.lightbox__close {
  top: var(--space-6);
  right: var(--space-6);
}

.lightbox__prev {
  left: var(--space-6);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__prev:hover {
  transform: translateY(-50%) scale(1.08);
}

.lightbox__next {
  right: var(--space-6);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__next:hover {
  transform: translateY(-50%) scale(1.08);
}

/* ── RESPONSIVE LIGHTBOX ── */
@media (max-width: 768px) {
  .lightbox__container {
    max-width: 92vw;
    max-height: 85vh;
    max-height: 85dvh;
  }

  .lightbox__image {
    max-height: 62vh;
    max-height: 62dvh;
  }

  .lightbox__btn {
    width: 44px;
    height: 44px;
    background: rgba(44, 24, 16, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }

  .lightbox__prev {
    left: var(--space-2);
  }

  .lightbox__next {
    right: var(--space-2);
  }

  .lightbox__close {
    top: calc(var(--space-3) + var(--safe-top));
    right: calc(var(--space-3) + var(--safe-right));
  }

  .lightbox__caption {
    flex-direction: column;
    gap: var(--space-1);
    text-align: center;
    padding-inline: var(--space-4);
    font-size: var(--text-sm);
  }
}
