/* ═══════════════════════════════════════════════════════════════════
   Voxel Arch Gallery – Frontend Styles
   ═══════════════════════════════════════════════════════════════════ */

/* ── Gallery Container ──────────────────────────────────────────── */
.voxel-arch-gallery-wrap {
  position: relative;
  width: 100%;
  min-height: 300px;
  background: #f5f5f5;
  overflow: hidden;
  border-radius: 4px;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

.voxel-arch-gallery-wrap:active {
  cursor: grabbing;
}

.voxel-arch-gallery-wrap canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}

/* ── Hint overlay (fade out on first interaction) ────────────────── */
.voxel-arch-gallery-wrap::after {
  content: "↕ Scroll · Drag to rotate · Tap an image";
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(60, 60, 60, 0.55);
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 1.2s ease;
}

.voxel-arch-gallery-wrap[data-booted="1"]:hover::after,
.voxel-arch-gallery-wrap[data-booted="1"]:focus::after {
  opacity: 0;
}

/* ── Lightbox ────────────────────────────────────────────────────── */
.vag-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 5, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  pointer-events: none;
  transition:
    background 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    backdrop-filter 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.vag-lightbox--open {
  background: rgba(5, 5, 5, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  pointer-events: all;
}

/* ── Lightbox Inner ─────────────────────────────────────────────── */
.vag-lightbox-inner {
  position: relative;
  max-width: min(90vw, 1100px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  opacity: 0;
  transform: scale(0.90) translateY(24px);
  transition:
    opacity 0.38s cubic-bezier(0.4, 0, 0.2, 1) 0.06s,
    transform 0.38s cubic-bezier(0.4, 0, 0.2, 1) 0.06s;
}

.vag-lightbox--open .vag-lightbox-inner {
  opacity: 1;
  transform: scale(1) translateY(0);
}

/* ── Lightbox Image ─────────────────────────────────────────────── */
.vag-lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 3px;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.55),
    0  4px 20px rgba(0, 0, 0, 0.30);
}

/* ── Lightbox Caption ───────────────────────────────────────────── */
.vag-lightbox-caption {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  line-height: 1.5;
}

/* ── Close Button ───────────────────────────────────────────────── */
.vag-lightbox-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform  0.2s ease,
    border-color 0.2s ease;
}

.vag-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.55);
  transform: scale(1.12) rotate(90deg);
}

.vag-lightbox-close:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 3px;
}

/* ── Mobile ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .vag-lightbox-inner {
    max-width: 95vw;
  }

  .vag-lightbox-img {
    max-height: 75vh;
    border-radius: 2px;
  }

  .vag-lightbox-close {
    top: -44px;
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .voxel-arch-gallery-wrap::after {
    font-size: 10px;
    bottom: 10px;
  }
}

/* ── Reduced Motion ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .vag-lightbox,
  .vag-lightbox-inner,
  .vag-lightbox-close {
    transition: none !important;
  }
}
