/* ==========================================================================
   VISOR DE FOTOS (/trabajos) · 26-oct-2026
   --------------------------------------------------------------------------
   En la rejilla cada pedido enseña solo la foto y su título; la descripción
   sigue en el HTML (la leen Google y el .md) y sale como pie en el visor.
   Cada tarjeta es un enlace a la foto grande: sin JS la abre tal cual; con
   JS (visor.js) se abre en un <dialog> con anterior/siguiente, Esc, flechas
   del teclado y deslizar con el dedo.
   ========================================================================== */

/* --- La tarjeta: solo el título, y un aviso de que se amplía ------------- */
.card--visor { cursor: zoom-in; }
.card--visor .card__cuerpo { padding-top: 56px; }
.card--visor .card__cuerpo h3 { margin-bottom: 0; }
.card--visor .card__cuerpo p { display: none; }
.card--visor:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
/* Icono de ampliar arriba a la derecha (::after ya es el velo de .card--foto) */
.card--visor::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 253, 248, 0.86) no-repeat center / 18px 18px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310314a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E");
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(16, 49, 74, 0.14);
  transition: transform 0.3s var(--ease);
  pointer-events: none;
}
.card--visor:hover::before { transform: scale(1.08); }

/* --- El visor ------------------------------------------------------------ */
html.visor-abierto { overflow: hidden; }
.visor {
  width: 100%;
  max-width: 100%;
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  overflow: hidden;
}
.visor::backdrop {
  background: rgba(8, 22, 34, 0.96);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}
.visor[open] { display: grid; }
.visor__marco {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  gap: 16px;
  width: 100%;
  height: 100%;
  padding: 72px clamp(16px, 7vw, 96px) 24px;
  box-sizing: border-box;
}
.visor__foto {
  align-self: center;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  background: rgba(255, 255, 255, 0.04);
  transition: opacity 0.25s var(--ease);
}
.visor__foto.is-cargando { opacity: 0.35; }
.visor__pie {
  width: 100%;
  max-width: 760px;
  text-align: center;
}
.visor__titulo {
  display: block;
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 700;
  line-height: 1.3;
}
.visor__texto {
  margin: 6px auto 0;
  max-width: 62ch;
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.8);
}
.visor__cuenta {
  position: absolute;
  top: 26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.72);
}
.visor__btn {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(12px);
          backdrop-filter: blur(12px);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.2s var(--ease);
}
.visor__btn:hover { background: rgba(255, 255, 255, 0.24); }
.visor__btn:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.visor__btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.visor__cerrar { top: 14px; right: 14px; }
.visor__ant { left: 14px; top: 50%; margin-top: -24px; }
.visor__sig { right: 14px; top: 50%; margin-top: -24px; }

@media (max-width: 760px) {
  .visor__marco { padding: 68px 12px 20px; }
  .visor__foto { border-radius: 12px; }
  /* en el móvil las flechas van abajo, a los lados del pie, para no tapar la foto */
  .visor__ant,
  .visor__sig { top: auto; bottom: 18px; margin-top: 0; }
  .visor__pie { padding: 0 56px; box-sizing: border-box; }
  .visor__texto { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .visor__foto,
  .card--visor::before { transition: none; }
}
