/* Toolbox: visor de capturas en grande. Colores y foco, de assets/tokens.css. */
.visor {
  width: 100vw;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--texto);
  overflow: hidden;
}
.visor[open] {
  display: grid;
  place-items: center;
  animation: visor-entrada var(--dur-media) var(--curva-suave);
}
.visor::backdrop { background: var(--velo); }

.visor-figura {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--e-3);
  max-width: calc(100vw - 2 * 4.5rem);
}
.visor-imagen {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 7rem);
  object-fit: contain;
  background: var(--carbon-3);
  border: var(--borde);
  box-shadow: var(--sombra);
}
.visor-pie {
  font-size: var(--t-sm);
  color: var(--texto-suave);
  text-align: center;
  max-width: var(--ancho-texto);
}
.visor-contador { font-family: var(--fuente-mono); color: var(--cyan); font-weight: 700; }

.visor-boton {
  position: absolute;
  width: 3rem;
  height: 3rem;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: var(--borde);
  background: var(--carbon-2);
  color: var(--texto);
  font: 700 1.75rem/1 var(--fuente-texto);
  cursor: pointer;
}
.visor-boton:hover { border-color: var(--magenta); box-shadow: var(--sombra); }
.visor-boton:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; }
.visor-boton[hidden] { display: none; }
.visor-anterior { left: var(--e-4); top: 50%; transform: translateY(-50%); }
.visor-siguiente { right: var(--e-4); top: 50%; transform: translateY(-50%); }
.visor-cerrar { right: var(--e-4); top: var(--e-4); background: var(--magenta); color: var(--sobre-acento); border-color: var(--magenta); }
.visor-cerrar:hover { background: var(--magenta-hover); }

@media (max-width: 40rem) {
  .visor-figura { max-width: calc(100vw - 1rem); }
  .visor-imagen { max-height: calc(100dvh - 10rem); }
  .visor-anterior, .visor-siguiente { top: auto; bottom: var(--e-4); transform: none; }
  .visor-anterior { left: var(--e-4); }
  .visor-siguiente { right: var(--e-4); }
}

body:has(.visor[open]) { overflow: hidden; }

@keyframes visor-entrada { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .visor[open] { animation: none; }
}
