/* =========================================================
   GALLERY LIGHTBOX
   ========================================================= */

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

.lightbox-trigger {
  display: block;
  width: 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.38s ease, filter 0.38s 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, #c9a45c);
  outline-offset: 2px;
}

.lightbox-trigger__hint {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6rem 1rem;
  background: linear-gradient(to top, rgba(9, 8, 6, 0.88), transparent);
  color: rgba(240, 235, 228, 0.9);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  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 ─────────────────────────────────────────── */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9800;
  background: rgba(9, 8, 6, 0.97);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  padding: 1rem;
}

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

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

/* ── Stage (image area) ──────────────────────────────── */

.lightbox-overlay__stage {
  position: relative;
  max-width: min(90vw, 1200px);
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-overlay__img {
  display: block;
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 0;
  box-shadow: 0 8px 64px rgba(0, 0, 0, 0.85);
  animation: lightbox-img-in 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes lightbox-img-in {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

/* ── Controls ────────────────────────────────────────── */

.lightbox-overlay__controls {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.lightbox-overlay__btn {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: rgba(20, 17, 9, 0.88);
  border: 1px solid rgba(201, 164, 92, 0.3);
  border-radius: 0;
  color: #f0ebe4;
  cursor: pointer;
  pointer-events: all;
  transition:
    background var(--transition, 0.22s ease),
    border-color var(--transition, 0.22s ease),
    transform var(--transition, 0.22s ease);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.lightbox-overlay__btn:hover {
  background: rgba(201, 164, 92, 0.18);
  border-color: rgba(201, 164, 92, 0.7);
}

.lightbox-overlay__btn:focus-visible {
  outline: 2px solid var(--color-gold, #c9a45c);
  outline-offset: 3px;
}

.lightbox-overlay__btn--close {
  top: -0.75rem;
  right: -0.75rem;
}

.lightbox-overlay__btn--prev {
  top: 50%;
  left: -1.25rem;
  transform: translateY(-50%);
}

.lightbox-overlay__btn--next {
  top: 50%;
  right: -1.25rem;
  transform: translateY(-50%);
}

.lightbox-overlay__btn--prev:hover,
.lightbox-overlay__btn--next:hover { transform: translateY(-50%) scale(1.06); }

.lightbox-overlay__btn--close:hover { transform: rotate(90deg); }

.lightbox-overlay__btn--hidden {
  opacity: 0.2;
  pointer-events: none;
}

.lightbox-overlay__btn svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── Caption ─────────────────────────────────────────── */

.lightbox-overlay__caption {
  position: absolute;
  bottom: -2rem;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(168, 156, 140, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Counter ─────────────────────────────────────────── */

.lightbox-overlay__counter {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(168, 156, 140, 0.7);
  background: rgba(20, 17, 9, 0.85);
  padding: 0.375rem 1rem;
  border-radius: 0;
  border: 1px solid rgba(201, 164, 92, 0.15);
}

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

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

@media (prefers-reduced-motion: reduce) {
  .lightbox-overlay__btn,
  .lightbox-overlay__btn--prev:hover,
  .lightbox-overlay__btn--next:hover,
  .lightbox-overlay__btn--close:hover {
    transition: none;
    transform: none;
  }
  .lightbox-overlay__btn--prev,
  .lightbox-overlay__btn--next { transform: translateY(-50%); }
}
