/* =============================================================================
   Videos dentro de las landings (VDL, pedido de Lucero del 24 oct 2026; aprobado: D-20261024-MKT-733 a 742)
   La tarjeta (.vid) es un enlace al .mp4: el póster con ▶ y su duración, el título y «Ver el video». videos.js la abre
   en su ventana (.vidbox): a pantalla completa en el celular y al centro en la computadora, con sonido.
   Toma los colores de cada página (--marca-boton, --titulo, --borde…), así sirve igual en HJ PRE y en primaria.
   Solo la piden las páginas que tienen un video aprobado (videos.py → hoja()).
   ============================================================================= */

/* ---------------------------------------------------------------- la tarjeta */
.vid-lugar { margin-top: 24px; }
.vid {
  display: grid; grid-template-columns: minmax(112px, 36%) 1fr; gap: 14px; align-items: center;
  max-width: 520px; padding: 10px 14px 10px 10px; border-radius: var(--radio); border: 1px solid var(--borde);
  background: var(--blanco); color: var(--tinta); text-decoration: none; box-shadow: var(--sombra-chica);
  transition: transform .15s ease, box-shadow .15s ease;
}
@media (pointer: fine) {
  .vid:hover { transform: translateY(-2px); box-shadow: var(--sombra); }
  .vid:hover .vid__play { transform: scale(1.08); }
}
.vid__poster {
  position: relative; display: block; overflow: hidden; aspect-ratio: 9 / 16;
  border-radius: calc(var(--radio) - 6px); background: #0E1A33;
}
.vid__poster img { width: 100%; height: 100%; object-fit: cover; }
.vid__play {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  display: grid; place-content: center; background: rgba(255, 255, 255, .95);
  box-shadow: 0 8px 22px -6px rgba(0, 0, 0, .65); transition: transform .15s ease;
}
.vid__play svg { width: 26px; height: 26px; margin-left: 3px; fill: var(--marca-boton); }
.vid__dur {
  position: absolute; right: 8px; bottom: 8px; padding: 1px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .74); color: #FFFFFF; font: 700 12.5px/1.6 var(--fuente); font-variant-numeric: tabular-nums;
}
.vid__txt { display: grid; gap: 6px; align-content: center; min-width: 0; }
.vid__et {
  display: inline-flex; align-items: center; gap: 6px; color: var(--marca-boton);
  font: 700 12px/1.3 var(--fuente); letter-spacing: .06em; text-transform: uppercase;
}
.vid__et svg { width: 16px; height: 16px; flex: none; fill: currentColor; }
.vid__tit { color: var(--titulo); font: 800 18px/1.25 var(--fuente); text-wrap: balance; }
.vid__linea { color: var(--suave); font-size: 14.5px; line-height: 1.45; text-wrap: pretty; }
.vid__ver {
  justify-self: start; display: inline-flex; align-items: center; min-height: 44px; margin-top: 4px; padding: 0 18px;
  border-radius: 999px; background: var(--marca-boton); color: #FFFFFF; font: 700 15px/1.1 var(--fuente);
}
/* horizontal (el nuevo local): el póster arriba, a todo el ancho */
.vid--h { grid-template-columns: 1fr; gap: 12px; max-width: 560px; padding: 10px 10px 16px; }
.vid--h .vid__poster { aspect-ratio: 16 / 9; }
.vid--h .vid__txt { padding: 0 6px; }
/* al centro donde lo de arriba va a todo el ancho: la banda (VDL-2), la pregunta de San Marcos (VDL-6) y las dudas de primaria (VDL-10) */
.banda .vid, .reto-sec .vid, .dudas .vid { margin-inline: auto; }
/* en la ruta (VDL-4), después de los botones: en el celular, .ruta__lado es «contents» y ordena a sus hijos del 1 al 5 */
.ruta__lado > .vid-lugar { order: 6; margin-top: 8px; }
/* aire debajo cuando sigue más contenido: la semana (VDL-5), «¿Por qué ahora?» del curso (VDL-7) y «Ejemplos de cómo
   se vería una clase» en la IA de primaria (VDL-10) */
.como .vid-lugar, .ia-sec .vid-lugar { margin-bottom: 30px; }
.ia-pri .vid-lugar { margin-bottom: 26px; }
/* sobre las bandas oscuras, la tarjeta sigue blanca y sin borde */
.banda-osc .vid { border-color: transparent; box-shadow: 0 16px 34px -20px rgba(0, 0, 0, .7); }

/* ---------------------------------------------------------------- la ventana del video */
html.con-video, html.con-video body { overflow: hidden; }
.vidbox {
  border: 0; padding: 0; margin: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%;
  background: #05080F; color: #FFFFFF; overflow: hidden;
}
.vidbox::backdrop { background: rgba(5, 8, 15, .86); }
.vidbox__caja { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; }
.vidbox__cabeza {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) max(10px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px));
}
.vidbox__tit { margin: 0; font: 700 15px/1.3 var(--fuente); color: #FFFFFF; text-wrap: balance; }
.vidbox__cerrar {
  flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; display: grid; place-content: center;
  background: rgba(255, 255, 255, .16); color: #FFFFFF; cursor: pointer;
}
.vidbox__cerrar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.vidbox__cerrar:hover { background: rgba(255, 255, 255, .26); }
.vidbox :focus-visible { outline: 3px solid #F0D844; outline-offset: 2px; }
.vidbox__marco { position: relative; min-height: 0; padding-bottom: env(safe-area-inset-bottom, 0px); background: #000000; }
.vidbox video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000000; }
/* al terminar: WhatsApp, «Ver de nuevo» y el siguiente video */
.vidbox__fin {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 24px;
  background: rgba(5, 8, 15, .92); text-align: center;
}
.vidbox__fin-tit { max-width: 320px; font: 800 20px/1.3 var(--fuente); color: #FFFFFF; text-wrap: balance; }
.vidbox__fin .btn-wa { max-width: 340px; }
.vidbox__otros { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.vidbox__otro {
  min-height: 44px; padding: 0 16px; border-radius: 999px; border: 2px solid rgba(255, 255, 255, .7);
  background: transparent; color: #FFFFFF; font: 700 14.5px/1.1 var(--fuente); cursor: pointer;
}
.vidbox__otro:hover { background: rgba(255, 255, 255, .12); }
/* computadora: una ventana al centro, del tamaño del video (vertical, el 80 % del alto de la pantalla) */
@media (min-width: 900px) {
  .vidbox { width: fit-content; height: fit-content; margin: auto; border-radius: 18px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); }
  .vidbox__caja { height: auto; }
  .vidbox--v .vidbox__caja { width: calc(min(80vh, 800px) * 9 / 16); }
  .vidbox--h .vidbox__caja { width: min(86vw, 1040px); }
  .vidbox--v .vidbox__marco { aspect-ratio: 9 / 16; }
  .vidbox--h .vidbox__marco { aspect-ratio: 16 / 9; }
  .vidbox__cabeza { padding: 10px 10px 10px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .vid, .vid__play { transition: none; }
}
