/* Product screenshot galleries and the full-screen viewer (see gallery.js) */

.gal { display: flex; flex-direction: column; gap: 10px; }

.gal-stage {
  --gal-ratio: 4 / 5;
  position: relative;
  aspect-ratio: var(--gal-ratio);
  overflow: hidden;
  background: #07070c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: zoom-in;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.gal-stage:hover,
.gal-stage:focus-visible {
  border-color: var(--teal, #00d4aa);
  box-shadow: 0 0 28px rgba(0, 212, 170, 0.18);
}

.gal-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.gal-slide.is-front { opacity: 1; }

.gal-bg {
  position: absolute;
  inset: -24px;
  width: calc(100% + 48px);
  height: calc(100% + 48px);
  object-fit: cover;
  filter: blur(26px) brightness(0.35) saturate(1.3);
}

.gal-fg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 50%;
}

/* Shapes close to the frame fill it from the top; hovering pans down the page */
.gal-slide[data-fit="cover"] .gal-fg {
  object-fit: cover;
  object-position: 50% 0%;
  transition: object-position 0.8s ease;
}

.gal-slide[data-fit="cover"] .gal-bg { display: none; }

.gal-stage:hover .gal-slide[data-fit="cover"] .gal-fg {
  object-position: 50% 100%;
  transition: object-position 6s ease-in-out;
}

.gal-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 38px;
  height: 52px;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.gal-prev { left: 8px; }
.gal-next { right: 8px; }
.gal-stage:hover .gal-nav,
.gal-stage:focus-within .gal-nav { opacity: 1; }
.gal-nav:hover { background: rgba(0, 212, 170, 0.85); color: #000; }

.gal-count,
.gal-expand {
  position: absolute;
  z-index: 2;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.gal-count { left: 8px; bottom: 8px; }
.gal-expand { right: 8px; top: 8px; font-size: 14px; opacity: 0; transition: opacity 0.2s ease; }
.gal-stage:hover .gal-expand { opacity: 1; }

.gal-caption {
  min-height: 1.4em;
  margin: 0;
  color: var(--text-muted, rgba(255, 255, 255, 0.5));
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  line-height: 1.4;
}

.gal-dots { display: flex; flex-wrap: wrap; gap: 6px; }

.gal-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.gal-dots span.active { background: var(--teal, #00d4aa); transform: scale(1.25); }

.gal-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--teal, #00d4aa) transparent;
}

.gal-thumb {
  flex: 0 0 auto;
  width: 104px;
  height: 66px;
  padding: 0;
  background: #07070c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.gal-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%; display: block; }
.gal-thumb:hover { opacity: 0.9; }
.gal-thumb.active { opacity: 1; border-color: var(--teal, #00d4aa); }

/* ═══ Full-screen viewer ═══ */
html.lb-open { overflow: hidden; }

.lb {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  background: rgba(2, 2, 6, 0.94);
  backdrop-filter: blur(6px);
}

.lb[hidden] { display: none; }

.lb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: min(1400px, 100%);
  max-height: 100%;
  margin: 0;
}

.lb-scroll {
  max-height: calc(100vh - 110px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  scrollbar-width: thin;
  scrollbar-color: #00d4aa transparent;
}

.lb-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 110px);
  cursor: zoom-in;
}

.lb-scroll.is-zoomed .lb-img { max-height: none; cursor: zoom-out; }

.lb-cap {
  display: flex;
  gap: 14px;
  align-items: baseline;
  color: rgba(255, 255, 255, 0.75);
  font-family: 'Outfit', sans-serif;
  font-size: 15px;
  text-align: center;
}

.lb-count { color: #00d4aa; font-family: 'JetBrains Mono', monospace; font-size: 12px; white-space: nowrap; }

.lb-close,
.lb-nav {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.lb-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  font-size: 26px;
  line-height: 1;
}

.lb-nav { width: 48px; height: 72px; font-size: 32px; }
.lb-close:hover, .lb-nav:hover { background: #00d4aa; color: #000; }
.lb-nav[hidden] { display: none; }

@media (max-width: 700px) {
  .lb { padding: 64px 8px 16px; }
  .lb-nav { position: absolute; bottom: 14px; width: 56px; height: 44px; }
  .lb-prev { left: 14px; }
  .lb-next { right: 14px; }
  .lb-scroll, .lb-img { max-height: calc(100vh - 170px); }
}

@media (prefers-reduced-motion: reduce) {
  .gal-slide, .gal-fg { transition: none !important; }
}
