/* ============================================================
   GALERIA MODAL — Amber · 31/10/2026
   Al hacer clic en la ficha de un personaje se abre su galeria
   de varias imagenes con flechas. La ficha muestra la foto real.
   Uso: <div class="jg-retrato jg-foto" data-galeria="axton">
   El JS (galeria.js) levanta las imagenes img/personajes/galeria/<clave>_N.jpg
   ============================================================ */

/* retrato con foto real */
.jg-retrato.jg-foto{
  padding:0; overflow:hidden;
  position:relative;
  background:linear-gradient(135deg,rgba(255,255,255,.04),rgba(0,0,0,.25));
  cursor:zoom-in;
}
.jg-retrato.jg-foto img{
  width:100%; height:100%; object-fit:cover; display:block;
  transition:transform .45s cubic-bezier(.2,.7,.2,1), filter .3s ease;
  filter:saturate(1.05) contrast(1.02);
}
.jg-card:hover .jg-retrato.jg-foto img{ transform:scale(1.08); filter:saturate(1.15) contrast(1.05); }

/* aviso de que la foto abre la galeria (la galeria NO se abre sola) */
.jg-retrato.jg-foto::after{
  content:"\1F50D  Ver galer\00EDa";
  position:absolute; left:0; right:0; bottom:0;
  padding:8px 10px;
  font-family:'Chakra Petch',sans-serif; font-size:.62rem; letter-spacing:.12em;
  text-transform:uppercase; color:#ffb020; text-align:center;
  background:linear-gradient(180deg,transparent,rgba(6,4,12,.88));
  opacity:0; transform:translateY(8px);
  transition:opacity .25s ease, transform .25s ease;
  pointer-events:none;
}
.jg-retrato.jg-foto:hover::after,
.jg-retrato.jg-foto:focus-within::after{ opacity:1; transform:none; }

/* ---------- MODAL ---------- */
.jg-modal{
  position:fixed; inset:0; z-index:9999;
  display:none; align-items:center; justify-content:center;
  background:rgba(6,4,12,.92);
  backdrop-filter:blur(10px) saturate(1.2);
  padding:24px;
}
.jg-modal.abierto{ display:flex; animation:gm-fade .28s ease both; }
@keyframes gm-fade{ from{opacity:0} to{opacity:1} }

.jg-modal-caja{
  position:relative; width:min(920px,94vw); max-height:90vh;
  display:flex; flex-direction:column; gap:14px;
  background:linear-gradient(160deg,rgba(20,16,34,.96),rgba(10,8,18,.98));
  border:1px solid rgba(255,176,32,.28);
  border-radius:18px; padding:18px 18px 14px;
  box-shadow:0 30px 90px rgba(0,0,0,.6), 0 0 60px rgba(255,176,32,.08) inset;
  animation:gm-pop .32s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes gm-pop{ from{transform:translateY(18px) scale(.97); opacity:.4} to{transform:none; opacity:1} }

.jg-modal-cab{ display:flex; align-items:baseline; justify-content:space-between; gap:12px; }
.jg-modal-titulo{
  font-family:'Orbitron','Arial Black',sans-serif; font-weight:800;
  font-size:1.05rem; letter-spacing:.06em; text-transform:uppercase; color:#fff; margin:0;
}
.jg-modal-cierre{
  flex:0 0 auto; width:40px; height:40px; border-radius:50%;
  border:1px solid rgba(255,255,255,.22); background:rgba(255,255,255,.06);
  color:#fff; font-size:1.3rem; line-height:1; cursor:pointer;
  transition:background .18s ease, transform .18s ease, border-color .18s ease;
}
.jg-modal-cierre:hover{ background:rgba(255,176,32,.2); border-color:#ffb020; transform:rotate(90deg); }

.jg-modal-img-wrap{ position:relative; flex:1 1 auto; min-height:0; display:flex; align-items:center; justify-content:center; }
.jg-modal-img{
  max-width:100%; max-height:62vh; width:auto; height:auto;
  border-radius:12px; display:block;
  box-shadow:0 12px 40px rgba(0,0,0,.5);
  animation:gm-img .3s ease both;
}
@keyframes gm-img{ from{opacity:.3; transform:scale(.985)} to{opacity:1; transform:none} }

.jg-flecha{
  position:absolute; top:50%; transform:translateY(-50%);
  width:48px; height:48px; border-radius:50%;
  border:1px solid rgba(255,176,32,.4); background:rgba(10,8,18,.7);
  color:#ffb020; font-size:1.5rem; line-height:1; cursor:pointer; z-index:3;
  display:flex; align-items:center; justify-content:center;
  transition:background .18s ease, color .18s ease, transform .18s ease;
}
.jg-flecha:hover{ background:#ffb020; color:#1a1206; transform:translateY(-50%) scale(1.08); }
.jg-flecha.izq{ left:8px; } .jg-flecha.der{ right:8px; }

.jg-modal-pie{ display:flex; align-items:center; justify-content:space-between; gap:12px; }
.jg-modal-contador{ font-family:'Chakra Petch',sans-serif; font-size:.78rem; letter-spacing:.12em; color:#ffb020; }
.jg-miniaturas{ display:flex; gap:8px; flex-wrap:wrap; justify-content:center; }
.jg-mini{
  width:54px; height:54px; border-radius:8px; overflow:hidden; cursor:pointer;
  border:2px solid transparent; opacity:.5; padding:0; background:none;
  transition:opacity .18s ease, border-color .18s ease, transform .18s ease;
}
.jg-mini img{ width:100%; height:100%; object-fit:cover; display:block; }
.jg-mini:hover{ opacity:.85; transform:translateY(-2px); }
.jg-mini.activa{ opacity:1; border-color:#ffb020; }

/* ---------- CELULAR ---------- */
@media (max-width:640px){
  .jg-modal{ padding:10px; }
  .jg-modal-caja{ padding:12px 12px 10px; border-radius:14px; }
  .jg-modal-img{ max-height:52vh; }
  .jg-flecha{ width:40px; height:40px; font-size:1.2rem; }
  .jg-mini{ width:42px; height:42px; }
  .jg-modal-titulo{ font-size:.92rem; }
}
