/**
 * CREA NETWORK — video con poster y modal (portada)
 * ============================================================
 * Componente 16:9 con poster + botón Play y modal <dialog> accesible.
 * Se apoya en los tokens --crea-* y en network-form.css (cargar ANTES). Prefijo .cn-video / .cn-modal.
 * El archivo de video NO se descarga hasta que la persona pulsa Play (ver network-video.js).
 */

/* ── Hero a dos columnas (contenido | video) ───────────────── */
.cn-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 36px; align-items: center; }
@media (min-width: 900px) {
  .cn-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 56px; }
}
.cn-hero-copy { min-width: 0; }

/* ── Tarjeta de video ──────────────────────────────────────── */
.cn-video { margin: 0; position: relative; min-width: 0; }
/* Halo tecnológico tenue detrás del video: no afecta al layout (absoluto, sin eventos). */
.cn-video::before {
  content: "";
  position: absolute;
  inset: -8% -6%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(60% 60% at 55% 45%, rgba(59,130,246,.22), rgba(59,130,246,0) 70%);
}
.cn-video-poster {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;          /* nunca se deforma */
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: var(--crea-bg-deep);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--crea-radius-lg);
  box-shadow: 0 18px 48px rgba(0,0,0,.38), 0 0 0 1px rgba(59,130,246,.10);
  color: var(--crea-text);
  font-family: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--crea-duration-normal) var(--crea-ease-standard),
              box-shadow var(--crea-duration-normal) var(--crea-ease-standard),
              border-color var(--crea-duration-normal) var(--crea-ease-standard);
}
.cn-video-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
@media (hover: hover) {
  .cn-video-poster:hover { transform: translateY(-3px); border-color: rgba(253,212,7,.55); box-shadow: 0 22px 56px rgba(0,0,0,.45), 0 0 0 1px rgba(253,212,7,.25); }
  .cn-video-poster:hover .cn-video-play { transform: translate(-50%, -50%) scale(1.07); }
}

.cn-video-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 76px;
  height: 76px;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--crea-gold);
  color: #0a0c24;
  box-shadow: var(--crea-glow-gold-strong);
  transition: transform var(--crea-duration-fast) var(--crea-ease-standard);
}
.cn-video-play svg { width: 30px; height: 30px; margin-left: 4px; }
.cn-video-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: var(--crea-radius-full);
  background: rgba(5,6,15,.78);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .5px;
}
.cn-video-caption {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  color: var(--crea-text);
}
.cn-video-caption::before { content: "▶"; margin-right: 8px; font-size: 11px; color: var(--crea-gold); vertical-align: 1px; }

/* ── Modal ─────────────────────────────────────────────────── */
html.cn-scroll-lock { overflow: hidden; }
.cn-modal {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--crea-text);
  max-width: none;
  max-height: none;
  overflow: visible;
}
.cn-modal::backdrop { background: rgba(5,6,15,.86); backdrop-filter: blur(4px); }
.cn-modal-inner { position: relative; }
/* Ancho ~90vw con tope; el alto nunca supera la pantalla (móvil en horizontal). Relación 16:9 fija. */
.cn-modal-frame {
  width: min(90vw, 1180px, calc((100vh - 120px) * 16 / 9));
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--crea-radius-lg);
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  overflow: hidden;
}
.cn-modal-frame video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.cn-modal-close {
  position: absolute;
  top: -54px;
  right: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50%;
  background: rgba(14,15,43,.9);
  color: var(--crea-text);
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.cn-modal-close:hover { border-color: var(--crea-gold); color: var(--crea-gold); }
.cn-modal-close svg { width: 18px; height: 18px; }
.cn-modal-msg {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  background: var(--crea-bg-surface);
}
.cn-modal-msg.show { display: flex; }

@media (prefers-reduced-motion: reduce) {
  .cn-video-poster, .cn-video-play { transition: none; }
  .cn-video-poster:hover, .cn-video-poster:hover .cn-video-play { transform: none; }
  .cn-video-poster:hover .cn-video-play { transform: translate(-50%, -50%); }
}
