/* ============================================================
   Gallery lightbox — full-screen single-artwork viewer
   Centered, balanced on desktop; stacked + scrollable on mobile.
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox.open { opacity: 1; visibility: visible; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 13, 10, 0.94);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.lightbox-overlay.visible { opacity: 1; visibility: visible; }

/* Two columns, both vertically centered so the info card never
   stretches to match a tall portrait image. */
.lightbox-content {
  position: relative;
  z-index: 2001;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  max-width: 1120px;
  width: 100%;
  max-height: 90vh;
}

.lightbox-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 90vh;
  min-width: 0;
}
.lightbox-img-wrap img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 30px 80px -28px rgba(0, 0, 0, 0.75);
}

.lightbox-info {
  align-self: center;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.6);
}
.lightbox-info .badge { align-self: flex-start; }
.lightbox-info h3 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  line-height: 1.15;
  color: var(--text-primary);
  margin: 0;
}
.lightbox-info p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
}
.lightbox-info .btn { margin-top: 0.5rem; }

/* Controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  z-index: 2002;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: white;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
  font-size: 1.25rem;
  line-height: 1;
}
.lightbox-close { top: 1.25rem; right: 1.25rem; width: 44px; height: 44px; }
.lightbox-prev { left: 1.25rem; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; font-size: 1.6rem; }
.lightbox-next { right: 1.25rem; top: 50%; transform: translateY(-50%); width: 50px; height: 50px; font-size: 1.6rem; }
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1410;
}
.lightbox-prev:active { transform: translateY(-50%) scale(0.92); }
.lightbox-next:active { transform: translateY(-50%) scale(0.92); }

/* "2 / 6" position indicator */
.lightbox-counter {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2002;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  padding: 6px 15px;
  border-radius: 999px;
}

/* ---------------- Mobile: stacked, scrollable, info visible --------------- */
@media (max-width: 768px) {
  .lightbox { padding: 0; align-items: stretch; }
  .lightbox-content {
    grid-template-columns: 1fr;
    align-content: start;
    align-items: stretch;
    gap: 0;
    max-width: 100%;
    max-height: 100vh;
    max-height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .lightbox-img-wrap {
    max-height: none;
    padding: 4.5rem 1rem 1rem;   /* clear the fixed close button / counter */
  }
  .lightbox-img-wrap img {
    max-height: 58vh;
    width: 100%;
  }
  /* Show the info + order button on mobile as a bottom sheet */
  .lightbox-info {
    display: flex;
    border-radius: 20px 20px 0 0;
    margin-top: -18px;
    padding: 1.75rem 1.5rem calc(1.75rem + env(safe-area-inset-bottom));
  }
  .lightbox-info .btn { width: 100%; text-align: center; justify-content: center; }
  .lightbox-close { top: 0.9rem; right: 0.9rem; width: 40px; height: 40px; }
  .lightbox-counter { top: 1rem; }
  .lightbox-prev,
  .lightbox-next {
    width: 42px; height: 42px;
    top: 33%;              /* over the image, not the info sheet */
    background: rgba(15, 13, 10, 0.5);
  }
  .lightbox-prev { left: 0.6rem; }
  .lightbox-next { right: 0.6rem; }
}
