/* ─────────────────────────────────────────────────
   Deep Wall Gallery17 — Stylesheet v1.1.0
───────────────────────────────────────────────── */

/* === CONTAINER === */
.dwg17-container {
  position: relative;
  width: 100%;
  height: 80vh;
  min-height: 260px;
  overflow: hidden;
  background: #0a0a1a;
  border-radius: 4px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  cursor: grab;
}
.dwg17-container:active { cursor: grabbing; }

.dwg17-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* === PLACEHOLDER === */
.dwg17-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: #0a0a1a;
  color: #888;
  font-family: sans-serif;
  font-size: 14px;
  border: 2px dashed #333;
  border-radius: 4px;
  padding: 24px;
  text-align: center;
}

/* === LOADING === */
.dwg17-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0a0a1a;
  z-index: 10;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.dwg17-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: rgba(255,255,255,0.6);
  font-family: 'Helvetica Neue', sans-serif;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.dwg17-spinner {
  width: 36px; height: 36px;
  border: 2px solid rgba(255,255,255,.1);
  border-top-color: rgba(255,255,255,.7);
  border-radius: 50%;
  animation: dwg17-spin .9s linear infinite;
}
@keyframes dwg17-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════
   LIGHTBOX
═══════════════════════════════════════════════ */
.dwg17-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.dwg17-lightbox.dwg17-lb-active {
  opacity: 1;
  pointer-events: all;
}

/* Backdrop */
.dwg17-lb-backdrop {
  position: absolute;
  inset: 0;
  background: var(--dwg17-overlay, rgba(0,0,0,.92));
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Inner layout */
.dwg17-lb-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 56px 80px 8px;
  box-sizing: border-box;
  overflow: hidden;
}

/* Stage: fills space, click-outside-close target */
.dwg17-lb-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  cursor: default;
  /* clicking stage background → close (if lbClickOutside enabled via JS) */
}

/* Image */
.dwg17-lb-img {
  max-width: 90vw;
  max-height: 68vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 30px 80px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.06);
  animation: dwg17-lb-in .3s ease;
  cursor: default;
  display: block;
}
@keyframes dwg17-lb-in {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1);   }
}

/* Caption */
.dwg17-lb-caption {
  margin-top: 10px;
  color: rgba(255,255,255,.5);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 13px;
  letter-spacing: .04em;
  text-align: center;
  min-height: 18px;
}

/* Counter */
.dwg17-lb-counter {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.35);
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 12px;
  letter-spacing: .12em;
  pointer-events: none;
  white-space: nowrap;
}

/* Close button */
.dwg17-lb-close {
  position: absolute;
  top: 14px; right: 18px;
  width: 40px; height: 40px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff;
  transition: background .2s, transform .2s;
  padding: 0; z-index: 10;
}
.dwg17-lb-close:hover { background: rgba(255,255,255,.18); transform: rotate(90deg); }
.dwg17-lb-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; }

/* ── NAVIGATION ARROWS ── */
.dwg17-lb-prev,
.dwg17-lb-next {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #fff;
  transition: background .2s, transform .2s, opacity .3s;
  padding: 0; z-index: 10;
}
.dwg17-lb-prev { left: 16px; }
.dwg17-lb-next { right: 16px; }
.dwg17-lb-prev:hover { background: rgba(255,255,255,.2); transform: translateY(-50%) scale(1.08); }
.dwg17-lb-next:hover { background: rgba(255,255,255,.2); transform: translateY(-50%) scale(1.08); }
.dwg17-lb-prev svg,
.dwg17-lb-next svg {
  width: 20px; height: 20px;
  stroke: currentColor; stroke-width: 1.8;
  fill: none; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Arrow visibility modes ── */

/* always: arrows always visible (default, no extra CSS needed) */

/* hover: arrows hidden, show when lightbox hovered */
.dwg17-arrows-hover .dwg17-lb-prev,
.dwg17-arrows-hover .dwg17-lb-next {
  opacity: 0;
  pointer-events: none;
}
.dwg17-lightbox.dwg17-arrows-hover:hover .dwg17-lb-prev,
.dwg17-lightbox.dwg17-arrows-hover:hover .dwg17-lb-next {
  opacity: 1;
  pointer-events: all;
}

/* autohide: hidden by default, shown via JS class for 2 s */
.dwg17-arrows-autohide .dwg17-lb-prev,
.dwg17-arrows-autohide .dwg17-lb-next {
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.dwg17-lightbox.dwg17-arrows-autohide.dwg17-arrows-visible .dwg17-lb-prev,
.dwg17-lightbox.dwg17-arrows-autohide.dwg17-arrows-visible .dwg17-lb-next {
  opacity: 1;
  pointer-events: all;
}

/* ── THUMBNAIL STRIP ── */
.dwg17-lb-thumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 90vw;
  overflow-x: auto;
  padding: 10px 0 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
  flex-shrink: 0;
}
.dwg17-lb-thumbs::-webkit-scrollbar { height: 4px; }
.dwg17-lb-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }

.dwg17-lb-thumb {
  flex-shrink: 0;
  width: 52px; height: 36px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255,255,255,.05);
  transition: border-color .2s, opacity .2s, transform .15s;
  opacity: .55;
}
.dwg17-lb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dwg17-lb-thumb:hover { opacity: .85; transform: scale(1.06); }
.dwg17-lb-thumb.active {
  border-color: rgba(255,255,255,.8);
  opacity: 1;
  transform: scale(1.08);
}

/* ── AUTOPLAY BAR ── */
.dwg17-lb-autoplay-bar {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, rgba(255,255,255,.3), rgba(255,255,255,.8));
  border-radius: 0 3px 3px 0;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
  /* Tablet: handled by Elementor responsive canvas_height control */
}

@media (max-width: 768px) {
  .dwg17-lb-inner { padding: 52px 12px 6px; }
  .dwg17-lb-img   { max-width: 96vw; max-height: 62vh; }
  .dwg17-lb-prev  { left: 6px;  width: 40px; height: 40px; }
  .dwg17-lb-next  { right: 6px; width: 40px; height: 40px; }
  .dwg17-lb-prev svg, .dwg17-lb-next svg { width: 16px; height: 16px; }
  .dwg17-lb-close { top: 10px; right: 10px; }
  .dwg17-lb-thumb { width: 42px; height: 30px; }
  /* On mobile, autohide arrows are shown by default until first touch */
  .dwg17-arrows-hover .dwg17-lb-prev,
  .dwg17-arrows-hover .dwg17-lb-next {
    opacity: 1;
    pointer-events: all;
  }
}

@media (max-width: 480px) {
  .dwg17-lb-img { max-height: 55vh; }
}

/* Elementor editor hint */
.elementor-edit-mode .dwg17-container { min-height: 300px; }
