/* vup_2018_child — components/gallery-ui.css
 * Clean build: centered stage, exact N thumbnails, contain-by-default, cover opt-in.
 * Honors center-column gutters (no overflow).
 */

/* ========== TOKENS / KNOBS (scoped to each gallery) ========== */
.vu-gallery {
  /* Stage sizing (defaults can be overridden per gallery) */
  --stage-w: min(1100px, 90vw);
  --stage-ar: 16/9;

  /* Spacing + visuals */
  --stage-pad: 0px;
  --stage-rad: var(--gallery-stage-rad, var(--vu-radius-lg, 12px));
  --thumb-underlap: 0px;
  --ui-gap: 10px;
  --ui-bg: transparent;
  --ui-ink: #ffffff;
  --accent: var(--loc-accent, var(--vu-gold));

  /* Dots */
  --dot: 25px;
  --dot-height: 7px;

  /* Thumbnails */
  --thumbs-per: 7;
  --thumb-gap: 6px;
  --thumb-gap-top: 30px;
  --thumb-ar: 2/1;
  --thumb-strip-scale: .75;
  --thumb-frame: rgba(255, 255, 255, .25);
  --thumb-frame-active: var(--accent);
  display: block;
  margin: 0;
  color: var(--ui-ink);
}

/* ========== STAGE (bounded by column, centered) ========== */
.vu-gallery .gal-stage {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--stage-w);
  margin-inline: auto;

  position: relative;
  padding: 0;
  touch-action: pan-y;
}

.vu-gallery .gal-stage::before {
  content: none;
}

/* Stage canvas uses aspect-ratio (no vh clamps) */
.vu-gallery .gal-canvas {
  aspect-ratio: var(--stage-ar);
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: hidden;
  border-radius: var(--stage-rad);
  border: 3px solid var(--vu-glass-border, rgba(255, 255, 255, 0.35));
  box-shadow: var(--vu-glass-shadow, 0 10px 30px rgba(0, 0, 0, 0.18));
  display: block;
  position: relative;
  cursor: pointer;
}

/* Hover helper: softly light the half the pointer sits on */
.vu-gallery .gal-canvas::before,
.vu-gallery .gal-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
  z-index: 2;
  background: linear-gradient(
    to right,
    rgba(255, 217, 0, 0.28),
    rgba(255, 217, 0, 0.12) 55%,
    transparent 70%
  );
}

.vu-gallery .gal-canvas::after {
  transform: scaleX(-1);
}

.vu-gallery.is-hover-left .gal-canvas::before { opacity: 1; }
.vu-gallery.is-hover-right .gal-canvas::after { opacity: 1; }

/* ========== SLIDES (default CONTAIN) ========== */
.vu-gallery .gal-slide {
  aspect-ratio: var(--stage-ar);
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transform: none;
  transition: opacity .28s ease;
  display: block;
}

.vu-gallery .gal-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
  display: block;
}

.vu-gallery .gal-slide .gal-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  -webkit-user-select: none;
  user-select: none;
  background: var(--ui-bg);
}

/* ========== BLUR-UP (uses --lqip inline style) ========== */
.vu-gallery .gal-slide.is-loading .gal-img {
  background-image: var(--lqip);
  background-size: cover;
  background-position: center;
  filter: saturate(120%) contrast(105%) blur(12px);
}

.vu-gallery .gal-slide:not(.is-loading) .gal-img {
  filter: none;
  background-image: none;
  transition: filter .25s ease, opacity .2s ease, background-image .2s;
}

/* ========== CAPTION (hover reveal) ========== */
.vu-gallery .gal-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: .4rem .8rem;
  font-size: .9rem;
  line-height: 1.25;
  background: rgba(255, 255, 255, .8);
  color: #111;
  opacity: 0;
  transition: opacity .25s;
}

.vu-gallery .gal-slide:is(:hover, :focus-within) .gal-cap {
  opacity: 1;
}

/* ========== DOTS ========== */
.vu-gallery .gal-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  z-index: 3;
  pointer-events: auto;
}

.vu-gallery .gal-dot {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: transform .2s ease, background-color .2s ease, opacity .2s ease;
}

.vu-gallery .gal-dot.is-active {
  background: var(--accent);
  transform: scale(1.1);
}

/* ========== THUMB STRIP (centered, exact N per view) ========== */
.vu-gallery .gal-thumbs {
  display: none !important;
}

.vu-gallery .gal-thumbs::-webkit-scrollbar {
  display: none;
}

.vu-gallery .gal-thumb {
  display: none;
}

.vu-gallery .gal-thumb.is-active {
  display: none;
}

.vu-gallery .gal-thumb:hover {
  display: none;
}

.vu-gallery .gal-thumb:active {
  display: none;
}

.vu-gallery .gal-thumb:focus-visible {
  display: none;
}

.vu-gallery .gal-thumb img {
  display: none;
}

.vu-gallery .gal-thumbs::before {
  left: 0;
  background: var(--grad-gallery-fade-dark, linear-gradient(to right, rgba(0, 0, 0, .45), transparent));
}

.vu-gallery .gal-thumbs::after {
  right: 0;
  background: var(--grad-gallery-fade-dark-rev, linear-gradient(to left, rgba(0, 0, 0, .45), transparent));
}

@supports (-webkit-user-drag: none) {

  .vu-gallery .gal-slide .gal-img,
  .vu-gallery .gal-thumb img {
    -webkit-user-drag: none;
  }
}

@supports (scrollbar-width: none) {
  .vu-gallery .gal-thumbs {
    scrollbar-width: none;
  }
}

/* ========== RESPONSIVE KNOBS ONLY (no selector duplication) ========== */
@media (max-width:1024px) {
  .vu-gallery {
    --thumbs-per: 5;
    --thumb-strip-scale: .88;
  }
}

@media (max-width:640px) {
  .vu-gallery {
    --thumbs-per: 3;
    --thumb-strip-scale: 1;
    --thumb-scale: .9;
    --thumb-scale-active: 1.05;
  }
}

/* ========== COVER MODE (wins last) ========== */
.vu-gallery.vu-cover {
  --stage-pad: 0;
}

.vu-gallery.vu-cover .gal-stage {
  padding: var(--stage-pad);
}

.vu-gallery.vu-cover .gal-canvas {
  aspect-ratio: var(--stage-ar);
}

.vu-gallery.vu-cover .gal-slide {
  margin: 0;
}

.vu-gallery.vu-cover .gal-slide .gal-img {
  object-fit: cover;
  /* fill + crop */
}

/* OPTIONAL: keep portraits readable in cover mode (commented out) */
/*
.vu-gallery.vu-cover .gal-slide .gal-img[data-orient="portrait"]{
  object-fit:contain;
}
*/

/* ========== ARROW NAVIGATION (mobile) ========== */
.vu-gallery .gal-arrow {
  display: none; /* Hidden by default (desktop uses dots + hover zones) */
  position: absolute;
  bottom: 10px;
  z-index: 4;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background-color 0.2s ease, transform 0.15s ease;
  /* Center the SVG icon */
  align-items: center;
  justify-content: center;
}

.vu-gallery .gal-arrow--prev {
  left: 10px;
}

.vu-gallery .gal-arrow--next {
  right: 10px;
}

.vu-gallery .gal-arrow:hover,
.vu-gallery .gal-arrow:focus-visible {
  background: var(--vu-gold, #ffd900);
  color: #000;
}

.vu-gallery .gal-arrow:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.vu-gallery .gal-arrow:active {
  transform: scale(0.95);
}

.vu-gallery .gal-arrow svg {
  width: 24px;
  height: 24px;
  display: block;
}

/* Mobile: show arrows, hide dots */
@media (max-width: 768px) {
  .vu-gallery .gal-dots {
    display: none;
  }

  .vu-gallery .gal-arrow {
    display: flex;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .vu-gallery * {
    transition: none;
    animation: none;
    scroll-behavior: auto;
  }
}
