/* galeria.css · copia literal de media.module.css (MediaGallery, ARKIERO 07/11/2026) con las clases renombradas a .g-* para la demostración estática. Identidad Soulbaric por variables --media-* en .sb-media. */
/* =====================================================================
   Sistema visual corporativo · galerías (Dirección 07/11/2026)
   Identidad por variables: cada empresa (skin/brand) puede redefinirlas en su contenedor.
     --media-stage    fondo del escenario (la foto nunca se recorta: se ajusta dentro)
     --media-radius   radio del escenario
     --media-accent   miniatura activa y foco
     --media-ink      iconos sobre el escenario
     --media-viewer   fondo del visor a pantalla completa
     --media-ph-display  none = sin marcador difuminado detrás de la foto (fotografía íntegra, sin efectos)
     --media-thumb-fit   contain = miniaturas con la foto completa, sin recorte
   ===================================================================== */

.g-gallery {
  --_stage: var(--media-stage, #f3f2ef);
  --_radius: var(--media-radius, 18px);
  --_accent: var(--media-accent, currentColor);
  --_ink: var(--media-ink, #1d1d1f);
  min-width: 0;
}

.g-stageWrap { position: relative; }
.g-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  aspect-ratio: var(--media-ratio, 4 / 3);
  border-radius: var(--_radius);
  background: var(--_stage);
  outline: none;
}
.g-track::-webkit-scrollbar { display: none; }
.g-track:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--_accent) 55%, transparent); }

.g-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: zoom-in;
  overflow: hidden;
  background: var(--_stage);
}
/* marcador de carga: la miniatura ampliada y suavizada (solo si hay miniatura) hasta que llega la versión web; también
   rellena con suavidad el margen de las fotos verticales u horizontales sin recortarlas */
.g-slide::before { content: ""; position: absolute; inset: -24px; background: var(--media-ph, none) center / cover no-repeat; filter: blur(22px) saturate(1.05); opacity: 0.38; display: var(--media-ph-display, block); }
.g-pending { position: relative; z-index: 1; width: 100%; height: 100%; background: var(--media-ph, none) center / contain no-repeat; }
.g-slide img { position: relative; z-index: 1; display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }

.g-arrow {
  position: absolute; top: 50%; z-index: 2;
  display: grid; place-items: center;
  width: 44px; height: 44px; margin-top: -22px;
  border: 0; border-radius: 999px;
  background: color-mix(in srgb, #fff 88%, transparent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  color: var(--_ink, #1d1d1f);
  cursor: pointer;
  transition: opacity 160ms ease;
}
.g-arrow svg, .g-expand svg, .g-viewerTools svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.g-arrow:disabled { opacity: 0; pointer-events: none; }
.g-prev { left: 12px; }
.g-next { right: 12px; }
.g-counter, .g-expand {
  position: absolute; z-index: 2;
  background: rgba(20, 20, 22, 0.62); color: #fff;
  backdrop-filter: blur(6px);
}
.g-counter { left: 12px; bottom: 12px; padding: 5px 11px; border-radius: 999px; font: 500 12.5px/1.2 system-ui, sans-serif; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.g-expand { right: 12px; bottom: 12px; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 999px; cursor: pointer; }
@media (hover: none) { .g-arrow { width: 38px; height: 38px; margin-top: -19px; } .g-prev { left: 8px; } .g-next { right: 8px; } }

.g-thumbs {
  display: flex; gap: 8px;
  margin-top: 10px; padding: 2px;
  overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.g-thumbs::-webkit-scrollbar { display: none; }
.g-thumb, .g-thumb.on {
  flex: 0 0 auto; width: 72px; height: 54px; padding: 0;
  border: 0; border-radius: calc(var(--_radius, 18px) / 2.5);
  overflow: hidden; cursor: pointer; scroll-snap-align: center;
  background: var(--_stage, #eee);
  opacity: 0.62; transition: opacity 160ms ease, box-shadow 160ms ease;
}
.g-thumb img, .g-thumb.on img { display: block; width: 100%; height: 100%; object-fit: var(--media-thumb-fit, cover); }
.g-thumb:hover { opacity: 0.9; }
.g-thumb.on { opacity: 1; box-shadow: 0 0 0 2px var(--_accent, #1d1d1f); }
.g-thumb:focus-visible, .g-thumb.on:focus-visible { outline: 2px solid var(--_accent, #1d1d1f); outline-offset: 2px; }
@media (max-width: 640px) { .g-thumb, .g-thumb.on { width: 58px; height: 44px; } }

/* ── Visor a pantalla completa ─────────────────────────────────────── */
.g-viewer {
  position: fixed; inset: 0; z-index: 1000;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  background: var(--media-viewer, #0c0c0e);
  color: #fff;
  outline: none;
  --_accent: #fff; --_stage: #1b1b1e; --_radius: 10px;
}
.g-viewerBar { display: flex; align-items: center; justify-content: space-between; padding: max(10px, env(safe-area-inset-top)) 14px 10px; }
.g-viewerCounter { font: 500 14px/1 system-ui, sans-serif; letter-spacing: 0.05em; font-variant-numeric: tabular-nums; opacity: 0.85; }
.g-viewerTools { display: flex; gap: 6px; }
.g-viewerTools button {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.1); color: #fff; cursor: pointer;
}
.g-viewerTools button:disabled { opacity: 0.35; cursor: default; }
.g-viewerTools button:focus-visible, .g-viewerArrow:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.g-viewerTrack {
  display: flex; min-height: 0; min-width: 0; width: 100%;
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior: contain;
  scrollbar-width: none;
}
.g-viewerTrack::-webkit-scrollbar { display: none; }
.g-locked { overflow-x: hidden; }
.g-viewerStage {
  flex: 0 0 100%; scroll-snap-align: center; scroll-snap-stop: always;
  position: relative; display: grid; place-items: center;
  overflow: hidden; touch-action: pan-x; user-select: none; cursor: zoom-in;
  background: var(--media-ph, none) center / contain no-repeat;
}
.g-viewerStage img {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain;
  transform-origin: center center; will-change: transform; transition: transform 120ms ease-out;
  -webkit-user-drag: none;
}
.g-zooming { touch-action: none; cursor: grab; }
.g-zooming:active { cursor: grabbing; }
.g-zooming img { transition: none; }
.g-viewerArrow { top: 50%; background: rgba(255, 255, 255, 0.12); color: #fff; box-shadow: none; }
@media (hover: none) { .g-viewerArrow { display: none; } }
.g-viewerThumbs { min-width: 0; padding: 6px 14px max(12px, env(safe-area-inset-bottom)); }
.g-viewerThumbs .g-thumbs { justify-content: safe center; margin-top: 0; }
@media (prefers-reduced-motion: reduce) { .g-viewerStage img, .g-arrow, .g-thumb, .g-thumb.on { transition: none; } }
