/* «15 años de historia» (17-nov): bloque de destacados, página /historia y visor a pantalla completa.
   Lo carga historia-widget.js solo cuando hay videos que mostrar (o la página lo trae con <link>).
   Usa las variables y letras de styles.css; los valores después de la coma son por si una página no lo trae. */
.hx-zona { --hx-rojo: var(--rojo, #c8141f); --hx-rojo-osc: var(--rojo-osc, #8e0c14); --hx-sol: var(--sol, #ffc01e); --hx-crema: var(--crema-t, #f3e6d4); --hx-papel: var(--papel, #f7f0e4); --hx-vino: var(--vino, #3a0a0d); --hx-tinta: var(--tinta, #1b1210); }
.hx, .hx-pagina, .hx-visor { --hx-rojo: var(--rojo, #c8141f); --hx-rojo-osc: var(--rojo-osc, #8e0c14); --hx-sol: var(--sol, #ffc01e); --hx-crema: var(--crema-t, #f3e6d4); --hx-papel: var(--papel, #f7f0e4); --hx-vino: var(--vino, #3a0a0d); --hx-tinta: var(--tinta, #1b1210);
  --hx-script: var(--f-script, 'Shrikhand', 'Cooper Black', Georgia, serif); --hx-txt: var(--f-txt, 'Bricolage Grotesque', system-ui, sans-serif); }
.hx .sr, .hx-pagina .sr, .hx-visor .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Bloque: el rollo de película ---------- */
.hx { position: relative; isolation: isolate; overflow: hidden; color: var(--hx-crema); font-family: var(--hx-txt); padding: 64px 0 58px;
  background: radial-gradient(70% 60% at 85% 0%, rgba(200, 20, 31, .55), transparent 70%), radial-gradient(60% 50% at 0% 100%, rgba(255, 192, 30, .14), transparent 70%), var(--hx-vino); }
.hx::before, .hx::after { content: ''; position: absolute; left: 0; right: 0; height: 26px; z-index: -1; background:
  repeating-linear-gradient(90deg, transparent 0 9px, rgba(243, 230, 212, .2) 9px 25px, transparent 25px 34px) 0 7px / 100% 12px no-repeat, #140606; }
.hx::before { top: 0; }
.hx::after { bottom: 0; }
.hx__in { width: 100%; max-width: var(--ancho, 1240px); margin: 0 auto; padding: 0 16px; }

/* Cabecera: el tambor con el 15 y el título */
.hx-cab { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 14px 18px; }
.hx-emblema { position: relative; width: 132px; aspect-ratio: 1; flex: none; display: grid; place-items: center; }
.hx-emblema img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .35)); }
.hx-emblema--sin-img::before { content: ''; position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(60% 55% at 35% 30%, #ff4d55, var(--hx-rojo) 55%, var(--hx-rojo-osc)); box-shadow: 0 0 0 7px #111, 0 0 0 10px var(--hx-sol), 0 12px 24px rgba(0, 0, 0, .4); }
.hx-emblema--entra { animation: hx-entra .9s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes hx-entra { from { opacity: 0; transform: scale(.7) rotate(-18deg); } }
.hx-emblema__num { position: relative; font-family: var(--hx-script); font-size: 3.4rem; line-height: 1; color: #fff; transform: translateY(-8%) rotate(-6deg); text-shadow: 0 3px 0 var(--hx-rojo-osc), 0 6px 14px rgba(0, 0, 0, .35); font-variant-numeric: tabular-nums; }
.hx-cab__sobre { margin: 0; font-size: 1rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--hx-sol); }
.hx-cab__tit { margin: 6px 0 0; font-weight: 800; font-stretch: 75%; text-transform: uppercase; font-size: clamp(2.3rem, 10.5vw, 4.6rem); line-height: .9; letter-spacing: -.01em; color: var(--hx-papel); }
.hx-cab__tit em { font-family: var(--hx-script); font-weight: 400; font-style: normal; text-transform: none; color: var(--hx-sol); letter-spacing: 0; font-size: .9em; display: inline-block; transform: rotate(-3deg); }
.hx-cab__bajada { grid-column: 1 / -1; margin: 6px 0 0; font-size: 1.06rem; color: var(--hx-crema); max-width: 36rem; }

/* La tira de destacados: se desliza en el celular, grilla en la compu */
.hx-tira { list-style: none; margin: 30px -16px 0; padding: 10px 16px 18px; display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; overscroll-behavior-x: contain; scrollbar-width: none; }
.hx-tira::-webkit-scrollbar { display: none; }
.hx-tira > li { flex: 0 0 58%; max-width: 250px; scroll-snap-align: start; }
.hx__pie { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 18px; }
.hx-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; padding: .7em 1.3em; border-radius: 999px; border: 2px solid transparent; font: inherit; font-weight: 800; font-size: 1rem; text-decoration: none; cursor: pointer; line-height: 1.15; transition: transform .18s ease, background-color .18s ease; }
.hx-btn:hover { transform: translateY(-2px); }
.hx-btn--sol { background: var(--hx-sol); color: var(--hx-tinta); box-shadow: 0 4px 0 #b88400; }
.hx-btn--rojo { background: var(--hx-rojo); color: #fff; box-shadow: 0 4px 0 var(--hx-rojo-osc); }
.hx-btn--linea { border-color: var(--hx-crema); color: var(--hx-crema); background: transparent; }
.hx-btn .hx-ic { width: 1.2em; height: 1.2em; }
.hx__cuenta { font-size: 1rem; color: var(--hx-crema); opacity: .9; }

/* ---------- Tarjeta (cuadro de película) ---------- */
.hx-c { --r: 0deg; position: relative; }
.hx-c:nth-child(3n + 1) { --r: -1.4deg; }
.hx-c:nth-child(3n + 2) { --r: 1.1deg; }
.hx-c:nth-child(3n) { --r: -.6deg; }
.hx-c__b { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transform: rotate(var(--r)); transition: transform .35s cubic-bezier(.2, .8, .2, 1); -webkit-tap-highlight-color: transparent; }
.hx-c__marco { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: #241010; border: 3px solid var(--hx-papel); box-shadow: 0 14px 28px rgba(0, 0, 0, .35), 7px 7px 0 var(--hx-rojo); }
.hx-c__marco img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.hx-c__marco::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20, 6, 6, .55), transparent 45%); pointer-events: none; }
.hx-c__play { position: absolute; left: 10px; bottom: 10px; z-index: 1; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--hx-rojo); color: #fff; box-shadow: 0 4px 0 var(--hx-rojo-osc); transition: transform .25s ease; }
.hx-c__play .hx-ic { width: 20px; height: 20px; margin-left: 3px; }
.hx-c__dur { position: absolute; right: 8px; bottom: 10px; z-index: 1; padding: 2px 9px; border-radius: 999px; background: rgba(20, 6, 6, .78); color: #fff; font-size: 1rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.5; }
.hx-c__anio { position: absolute; left: 8px; top: 8px; z-index: 1; padding: 1px 10px; border-radius: 999px; background: var(--hx-sol); color: var(--hx-tinta); font-size: 1rem; font-weight: 800; line-height: 1.5; }
.hx-c__estrella { position: absolute; right: 8px; top: 8px; z-index: 1; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--hx-sol); color: var(--hx-tinta); }
.hx-c__estrella .hx-ic { width: 17px; height: 17px; }
.hx-c__tit { display: block; margin-top: 12px; font-weight: 700; font-size: 1rem; line-height: 1.3; color: var(--hx-papel); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (hover: hover) {
  .hx-c__b:hover { transform: rotate(0deg) translateY(-6px); }
  .hx-c__b:hover .hx-c__marco img { transform: scale(1.06); }
  .hx-c__b:hover .hx-c__play { transform: scale(1.1); }
}
.hx-c__b:focus-visible { outline: 3px solid var(--hx-sol); outline-offset: 5px; border-radius: 16px; }

/* Aparición (la activa historia-widget.js al entrar en pantalla; sin JS o con «menos movimiento», quietas) */
.hx-anima .hx-c { opacity: 0; transform: translateY(26px); transition: opacity .55s ease, transform .7s cubic-bezier(.2, .8, .2, 1); transition-delay: calc(var(--k, 0) * 70ms); }
.hx-anima .hx-c.hx-c--ver { opacity: 1; transform: none; }

/* ---------- Página /historia ---------- */
.hx-pagina { background: var(--hx-vino); color: var(--hx-crema); min-height: 60vh; }
.hx-pagina .hx { padding-top: calc(var(--cab-alto, 66px) + 46px); }
.hx-pagina .hx-cab { gap: 18px 22px; }
/* Mientras llegan los datos, la grilla guarda su lugar: si no, el cierre y el pie suben y bajan (CLS medido: 0,63). */
.hx-pagina [data-historia="todos"]:empty { min-height: 100vh; }
.hx-filtros { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.hx-filtros button { min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 2px solid rgba(243, 230, 212, .5); background: transparent; color: var(--hx-crema); font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; }
.hx-filtros button[aria-pressed='true'] { background: var(--hx-sol); border-color: var(--hx-sol); color: var(--hx-tinta); }
.hx-grilla { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 14px; }
.hx-vacio { margin-top: 26px; font-size: 1.06rem; }
.hx-cierre { text-align: center; padding: 56px 16px 70px; background: var(--hx-papel); color: var(--hx-tinta); }
.hx-cierre h2 { margin: 0; font-weight: 800; font-stretch: 75%; text-transform: uppercase; font-size: clamp(2.2rem, 9vw, 3.8rem); line-height: .92; }
.hx-cierre h2 em { font-family: var(--hx-script); font-weight: 400; font-style: normal; text-transform: none; color: var(--hx-rojo); display: inline-block; transform: rotate(-3deg); }
.hx-cierre p { margin: 16px auto 24px; max-width: 30rem; font-size: 1.06rem; }

@media (min-width: 720px) {
  .hx { padding: 84px 0 76px; }
  .hx-emblema { width: 176px; }
  .hx-emblema__num { font-size: 4.6rem; }
  .hx-cab { grid-template-columns: auto 1fr; gap: 10px 28px; }
  .hx-emblema { grid-row: 1 / span 2; }
  .hx-cab > div { align-self: end; }
  .hx-cab__bajada { grid-column: 2; align-self: start; margin-top: 0; }
  .hx-tira { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; margin: 38px 0 0; padding: 10px 0 8px; gap: 34px 26px; }
  .hx-tira > li { max-width: none; }
  .hx-grilla { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 38px 26px; }
}
@media (min-width: 1100px) {
  .hx-emblema { width: 210px; }
  .hx-emblema__num { font-size: 5.6rem; }
  /* Con 6 llenan el ancho; con menos no se agrandan de más (cada cuadro, 230 px como mucho). */
  .hx-tira { grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); gap: 26px 22px; max-width: calc(var(--n, 6) * 252px); }
  .hx-grilla { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1360px) { .hx-grilla { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ---------- Visor (pantalla completa, tipo reels) ---------- */
html.hx-abierto, html.hx-abierto body { overflow: hidden; }
.hx-visor { position: fixed; inset: 0; z-index: 1000; background: #0b0303; color: #fff; font-family: var(--hx-txt); }
.hx-visor__pista { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; }
.hx-visor__pista::-webkit-scrollbar { display: none; }
.hx-v { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always; display: grid; place-items: center; overflow: hidden; }
.hx-v__fondo { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(28px) saturate(1.2) brightness(.45); transform: scale(1.1); }
/* Posición absoluta y no grilla: en una fila de grilla automática el alto 100 % no se resuelve y un video
   vertical se estiraba al doble de la pantalla (medido a 1440: 1180 × 2102). */
.hx-v__marco { position: relative; width: 100%; height: 100%; }
.hx-v__marco > img, .hx-capa video { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; }
.hx-capa { position: absolute; inset: 0; }
.hx-capa video { background: transparent; }
.hx-capa__barra { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .22); }
.hx-capa__barra i { display: block; height: 100%; width: 0; background: var(--hx-rojo); }
.hx-capa__play { position: absolute; left: 50%; top: 50%; margin: -42px 0 0 -42px; width: 84px; height: 84px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(200, 20, 31, .92); color: #fff; box-shadow: 0 6px 0 var(--hx-rojo-osc); cursor: pointer; opacity: 0; transform: scale(.8); transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.hx-capa__play .hx-ic { width: 34px; height: 34px; margin-left: 5px; }
.hx-visor[data-pausa] .hx-capa__play { opacity: 1; transform: none; pointer-events: auto; }
.hx-capa__cargando { position: absolute; left: 50%; top: 50%; margin: -23px 0 0 -23px; width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: hx-girar .8s linear infinite; opacity: 0; transition: opacity .2s ease; pointer-events: none; }
.hx-visor[data-cargando] .hx-capa__cargando { opacity: 1; }
@keyframes hx-girar { to { transform: rotate(360deg); } }
.hx-v__info { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 84px calc(22px + env(safe-area-inset-bottom)) 18px; background: linear-gradient(to top, rgba(0, 0, 0, .78), transparent); pointer-events: none; }
.hx-v__info b { display: block; font-size: 1.15rem; line-height: 1.25; }
.hx-v__info span { display: block; margin-top: 4px; font-size: 1rem; opacity: .9; }
.hx-visor__barra { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 10px 10px 16px; background: linear-gradient(to bottom, rgba(0, 0, 0, .6), transparent); pointer-events: none; }
.hx-visor__barra > * { pointer-events: auto; }
.hx-visor__cuenta { margin: 0 auto 0 0; font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums; }
.hx-visor__cuenta em { font-family: var(--hx-script); font-style: normal; font-weight: 400; color: var(--hx-sol); margin-right: 8px; }
.hx-vb { width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.hx-vb:hover { background: rgba(255, 255, 255, .26); }
.hx-vb:focus-visible { outline: 3px solid var(--hx-sol); outline-offset: 2px; }
.hx-vb .hx-ic { width: 22px; height: 22px; }
.hx-vb[aria-pressed='true'] { background: var(--hx-sol); color: var(--hx-tinta); }
.hx-visor__nav { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); display: none; flex-direction: column; gap: 12px; }
.hx-visor__nav .hx-vb { width: 56px; height: 56px; }
.hx-visor__nav .hx-vb[disabled] { opacity: .3; cursor: default; }
.hx-visor__aviso { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); margin: 0; padding: 8px 16px; border-radius: 999px; background: rgba(0, 0, 0, .75); font-size: 1rem; font-weight: 700; }
.hx-visor__desliza { position: absolute; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 999px; background: rgba(0, 0, 0, .6); font-size: 1rem; font-weight: 700; pointer-events: none; animation: hx-sube 1.6s ease-in-out 3; }
.hx-visor__desliza .hx-ic { width: 20px; height: 20px; }
@keyframes hx-sube { 50% { transform: translate(-50%, -10px); } }
.hx-ic { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hx-ic .r { fill: currentColor; stroke: none; }

/* Última «diapositiva»: a dónde seguir */
.hx-final { position: relative; text-align: center; padding: 24px; max-width: 30rem; }
.hx-final__num { font-family: var(--hx-script); font-size: 6rem; line-height: 1; color: var(--hx-sol); transform: rotate(-6deg); text-shadow: 0 5px 0 var(--hx-rojo); margin: 0; }
.hx-final h3 { margin: 18px 0 10px; font-weight: 800; font-stretch: 75%; text-transform: uppercase; font-size: 2.2rem; line-height: .95; }
.hx-final p { margin: 0 0 22px; font-size: 1.06rem; opacity: .92; }
.hx-final .hx-btn + .hx-btn { margin-top: 12px; }
.hx-final__acciones { display: grid; gap: 12px; justify-items: center; }

@media (min-width: 900px) {
  .hx-visor__nav { display: flex; }
  .hx-visor__desliza { display: none; }
  .hx-v__marco { width: min(92vw, 1180px); height: 88vh; height: 88dvh; }
  .hx-v__info { padding-left: max(18px, calc(50vw - 590px)); }
}
@media (prefers-reduced-motion: reduce) {
  .hx-anima .hx-c { opacity: 1; transform: none; transition: none; }
  .hx-c__b, .hx-c__marco img, .hx-btn { transition: none; }
  .hx-visor__desliza { animation: none; }
}
