/* ============================================================
   ConCiencia TV — main.css
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font-body);
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background .4s var(--ease), color .4s var(--ease);
}
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
input { font-family: inherit; }

/* Tipografía propia del logo */
@font-face {
  font-family: "ConCiencia";
  src: url("../fonts/CONCIENCIA.ttf") format("truetype");
  font-display: swap;
}

.logo-word { font-family: var(--font-display); font-weight: 700; letter-spacing: .01em; text-transform: lowercase; }

/* Todo SVG que use el sprite del play hereda el color del contexto */
.logo-play, .card-play, .watermark, .macro-nav svg { fill: currentColor; }

/* ===================== NAVBAR ===================== */
.navbar {
  position: fixed; inset: 0 0 auto 0; height: var(--navbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--pad-x); z-index: 100;
  background: var(--navbar-bg);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: background .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.navbar.solid { background: var(--navbar-solid); box-shadow: var(--shadow-nav); border-bottom-color: var(--border); }
.nav-left { display: flex; align-items: center; gap: 16px; }

.nav-burger { background: none; border: 0; padding: 6px; display: flex; flex-direction: column; gap: 5px; width: 40px; }
.nav-burger span { height: 2px; width: 26px; background: var(--text); border-radius: 2px; transition: transform .3s var(--ease), opacity .3s var(--ease); }
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-theme { background: none; border: 0; color: var(--text); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; transition: background .2s; }
.nav-theme:hover { background: var(--surface); }
.nav-theme .ico-sun { display: none; }
[data-theme="dark"] .nav-theme .ico-moon { display: none; }
[data-theme="dark"] .nav-theme .ico-sun  { display: block; }

.nav-search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 9px 16px; min-width: 300px; transition: border-color .25s, box-shadow .25s; }
.nav-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.nav-search .ico-search { color: var(--text-soft); flex: none; }
.nav-search input { border: 0; background: none; outline: none; flex: 1; font-size: .95rem; color: var(--text); }
.nav-search input::placeholder { color: var(--text-soft); }
.nav-mic { background: none; border: 0; color: var(--text-soft); display: grid; place-items: center; }
.nav-mic:hover { color: var(--accent); }

.nav-logo { background: none; border: 0; display: flex; align-items: center; gap: 10px; font-size: clamp(1.5rem, 2.4vw, 2rem); color: var(--text); padding: 4px 6px; transition: transform .2s var(--ease); }
.nav-logo:hover { transform: scale(1.03); }
.logo-play { width: 1.1em; height: 1.1em; color: inherit; }
[data-theme="dark"] .nav-logo .logo-word { color: #fff; }
[data-theme="dark"] .nav-logo .logo-play { color: #fff; }

/* ===================== SNAP / SCREENS ===================== */
.snap { height: 100vh; overflow-y: scroll; scroll-snap-type: y mandatory; scroll-behavior: smooth; }
.screen { height: 100vh; scroll-snap-align: start; scroll-snap-stop: always; padding-top: var(--navbar-h); display: flex; flex-direction: column; overflow: hidden; }

/* ===================== HERO ===================== */
.hero { background: var(--bg); }
.hero-grid {
  flex: 1; display: grid; grid-template-columns: 1fr clamp(300px, 24vw, 420px);
  gap: var(--gap); max-width: var(--maxw); width: 100%; margin: 0 auto;
  padding: var(--pad-y) var(--pad-x) calc(var(--pad-y) + 6px);
}
.live { display: flex; flex-direction: column; min-height: 0; }
.live-bar { font-family: var(--font-display); text-transform: lowercase; font-size: clamp(1.2rem, 1.8vw, 1.6rem); color: var(--text-soft); display: flex; align-items: center; gap: 12px; padding: 2px 4px 14px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #e0392b; box-shadow: 0 0 0 0 rgba(224,57,43,.6); animation: pulse 1.8s infinite; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(224,57,43,.55);} 70%{box-shadow:0 0 0 9px rgba(224,57,43,0);} 100%{box-shadow:0 0 0 0 rgba(224,57,43,0);} }
.live-frame { position: relative; flex: 1; background: var(--live-bg); border-radius: var(--radius); overflow: hidden; min-height: 0; }
.live-placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.32); font-size: 1rem; letter-spacing: .14em; text-transform: uppercase; background: repeating-linear-gradient(45deg, #0a1925 0 18px, #0c1d2c 18px 36px); }

.programs { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: var(--bg-elev); border: 1px solid var(--border); }
.programs-head { font-family: var(--font-display); text-transform: lowercase; font-size: clamp(1.2rem, 1.7vw, 1.5rem); text-align: center; padding: 16px; color: var(--text-soft); background: var(--surface); border-bottom: 1px solid var(--border); }
.programs-list { flex: 1; display: flex; flex-direction: column; }
.programs-list li { flex: 1; display: flex; min-height: 46px; }
.prog-link { flex: 1; display: flex; align-items: center; padding: 0 22px; font-weight: 700; font-size: clamp(.82rem, 1vw, .95rem); letter-spacing: .02em; text-transform: uppercase; color: #fff; background: var(--c); transition: filter .2s var(--ease), padding-left .2s var(--ease); line-height: 1.15; }
.prog-link:hover { filter: brightness(1.1); padding-left: 30px; }

/* ===================== SECCIÓN PROGRAMA ===================== */
.program { position: relative; overflow: hidden; }
.program::before { content: ""; position: absolute; inset: 0; background: var(--c); opacity: .07; z-index: 0; }
[data-theme="dark"] .program::before { opacity: .14; }

.program-grid {
  position: relative; z-index: 1; flex: 1; min-height: 0;
  display: grid; grid-template-columns: clamp(300px, 26vw, 440px) 1fr;
  gap: var(--gap); max-width: var(--maxw); width: 100%; margin: 0 auto;
  padding: var(--pad-y) var(--pad-x);
  overflow: hidden;
}

/* --- Card de presentación (columna izquierda fija) --- */
.prog-card { display: flex; flex-direction: column; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); }
.prog-card-top { background: var(--c); padding: clamp(28px, 4vh, 52px) 28px; color: #fff; position: relative; overflow: hidden; }
.prog-card-top .watermark { position: absolute; right: -10%; bottom: -30%; width: 70%; opacity: .14; color: #fff; }
.prog-card-eje { font-size: .72rem; text-transform: uppercase; letter-spacing: .18em; font-weight: 700; opacity: .9; }
.prog-card-title { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.8rem); font-weight: 800; text-transform: uppercase; line-height: .98; margin: 10px 0 0; }
.prog-card-body { padding: 24px 28px; display: flex; flex-direction: column; gap: 18px; flex: 1; }
.prog-card-desc { color: var(--text-soft); line-height: 1.55; font-size: .95rem; }
.prog-meta { display: flex; flex-direction: column; gap: 8px; margin-top: auto; }
.prog-meta-row { display: flex; align-items: center; gap: 10px; font-size: .86rem; }
.prog-meta-row b { color: var(--c); text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; min-width: 78px; }

/* --- Macro: pares de temporadas (columna derecha) --- */
.macro { position: relative; min-width: 0; display: flex; flex-direction: column; }
.macro-swiper { flex: 1; min-height: 0; width: 100%; height: 100%; }
.macro-slide { height: 100%; display: flex; }

/* Altura de fila compartida por ambos formatos (16:9 y 9:16) */
.season {
  --row-h: clamp(120px, 19vh, 230px);
  display: flex; flex-direction: column; width: 100%; height: 100%;
  justify-content: center;
  gap: clamp(14px, 2vh, 26px);
  padding: 0;
}
.season-head { display: flex; align-items: center; gap: 12px; flex: none; }
.season-name { font-family: var(--font-display); text-transform: lowercase; font-size: clamp(1.4rem, 2vw, 2rem); color: var(--text); letter-spacing: .02em; }
.season-count { font-size: .8rem; color: var(--text-soft); }

.season-rows { display: flex; flex-direction: column; gap: clamp(16px, 2.4vh, 32px); }

.rail { width: 100%; overflow: hidden; }
.rail .swiper-wrapper { align-items: flex-start; }
.rail .swiper-slide { width: auto !important; }
/* Ancho fijo por formato derivado de --row-h: Swiper no puede estirarlas
   aunque la temporada tenga pocos shorts. 16:9 → h*16/9 ; 9:16 → h*9/16 */
.rail-wide .card     { width: calc(var(--row-h) * 16 / 9); }
.rail-vertical .card { width: calc(var(--row-h) * 9 / 16); }

/* Cards: altura fija = --row-h, ancho según aspect-ratio */
.card { height: auto; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform .22s var(--ease), box-shadow .22s var(--ease); display: flex; flex-direction: column; }
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-card); }
.card-thumb { width: 100%; height: var(--row-h); background: var(--surface); display: grid; place-items: center; color: var(--text-soft); font-size: .78rem; position: relative; }
.card-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Shorts: el thumbnail de YouTube viene 16:9 con barras; lo escalamos
   para que el contenido llene el 9:16 y las barras queden fuera del recorte.
   Con thumbnails reales de shorts verticales esto se ve aún más limpio. */
.card.vertical .card-img { width: 178%; height: 100%; left: 50%; transform: translateX(-50%); object-fit: cover; }
.card-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.42)); z-index: 1; }
.card-play { position: absolute; z-index: 2; width: 38px; height: 38px; color: #fff; opacity: .92; filter: drop-shadow(0 2px 5px rgba(0,0,0,.5)); }
.card-body { padding: 12px 14px; flex: none; }
.card-title { font-size: .84rem; font-weight: 600; line-height: 1.3; color: var(--text); }
.card-meta { font-size: .72rem; color: var(--text-soft); margin-top: 4px; }

/* --- Flechas del macro: usan el logo-play del canal --- */
.macro-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 5; width: clamp(44px, 3.4vw, 60px); height: clamp(44px, 3.4vw, 60px); border: 0; border-radius: 50%; display: grid; place-items: center; transition: transform .2s var(--ease), filter .2s; }
.macro-nav svg { width: 52%; height: 52%; }
.macro-nav.prev { left: calc(var(--pad-x) * -1 + 6px); background: color-mix(in srgb, var(--c) 18%, var(--bg-elev)); color: var(--c); }
.macro-nav.prev svg { transform: scaleX(-1); }
.macro-nav.next { right: calc(var(--pad-x) * -1 + 6px); background: var(--c); color: #fff; box-shadow: var(--shadow-card); }
.macro-nav:hover { transform: translateY(-50%) scale(1.08); filter: brightness(1.05); }
.macro-nav.swiper-button-disabled { opacity: .3; pointer-events: none; }

/* ===================== DRAWER ===================== */
.drawer { position: fixed; inset: 0 auto 0 0; width: min(380px, 86vw); background: var(--bg-elev); z-index: 200; transform: translateX(-100%); transition: transform .38s var(--ease); display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 26px; border-bottom: 1px solid var(--border); }
.drawer-title { font-family: var(--font-display); text-transform: lowercase; font-size: 1.6rem; color: var(--text-soft); }
.drawer-close { background: none; border: 0; font-size: 2rem; color: var(--text); line-height: 1; }
.drawer-body { padding: 22px 26px; overflow-y: auto; }
.drawer-search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 10px 16px; margin-bottom: 26px; color: var(--text-soft); }
.drawer-search input { border: 0; background: none; outline: none; flex: 1; color: var(--text); }
.drawer-group { margin-bottom: 28px; }
.drawer-group h3 { font-size: .76rem; text-transform: uppercase; letter-spacing: .16em; color: var(--text-soft); margin: 0 0 12px; }
.drawer-group li a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius); font-weight: 500; transition: background .2s; }
.drawer-group li a:hover { background: var(--surface); }
.drawer-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }

.overlay { position: fixed; inset: 0; background: rgba(4,12,20,.5); z-index: 150; opacity: 0; visibility: hidden; transition: opacity .35s, visibility .35s; backdrop-filter: blur(2px); }
.overlay.show { opacity: 1; visibility: visible; }

/* ===================== MODAL ===================== */
.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(4,12,20,.62); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; padding: 20px; }
.modal.show { opacity: 1; visibility: visible; }
.modal-box { position: relative; background: var(--bg-elev); border-radius: var(--radius); max-width: 540px; width: 100%; box-shadow: 0 30px 80px rgba(0,0,0,.4); transform: translateY(16px) scale(.98); transition: transform .35s var(--ease); overflow: hidden; }
.modal-box--wide { max-width: 760px; max-height: 84vh; display: flex; flex-direction: column; }
.modal-box--wide .modal-content { overflow-y: auto; }
.modal-body-text { color: var(--text-soft); line-height: 1.65; }
.modal-body-text p { margin: 0 0 14px; }
.modal-body-text ul.lineas { display: grid; gap: 10px; padding: 0; }
.modal-body-text ul.lineas li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; background: var(--surface); border-radius: var(--radius); }
.modal-body-text .ln-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; margin-top: 4px; background: var(--c); }
.modal.show .modal-box { transform: translateY(0) scale(1); }
.modal-close { position: absolute; top: 12px; right: 16px; background: none; border: 0; font-size: 2rem; color: var(--text-soft); line-height: 1; z-index: 1; }
.modal-content { padding: 44px 40px; }
.modal-content h2 { font-family: var(--font-display); margin: 0 0 14px; font-size: 1.8rem; color: var(--text); }
.modal-content p { margin: 0; color: var(--text-soft); line-height: 1.6; }

/* ===================== MODAL DE VIDEO ===================== */
.video-modal { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; background: rgba(0,0,0,.92); opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; padding: 3vmin; }
.video-modal.show { opacity: 1; visibility: visible; }
.video-close { position: fixed; top: 18px; right: 24px; z-index: 5; background: none; border: 0; color: #fff; font-size: 2.6rem; line-height: 1; opacity: .85; }
.video-close:hover { opacity: 1; }

.video-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: 100%; max-height: 100%; }
.video-frame { background: #000; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.video-frame iframe { display: block; width: 100%; height: 100%; }

/* Apaisado (16:9): grande, limitado por ancho */
.video-stage[data-vertical="0"] .video-frame { width: min(90vw, calc((100vh - 140px) * 16 / 9)); aspect-ratio: 16/9; }
/* Vertical (9:16): alto, limitado por altura → pillarbox natural por el fondo negro */
.video-stage[data-vertical="1"] .video-frame { height: min(82vh, calc(90vw * 16 / 9)); aspect-ratio: 9/16; }

.video-info { color: #fff; text-align: center; max-width: 680px; }
.video-info h3 { font-family: var(--font-display); font-size: 1.4rem; margin: 0 0 4px; }
.video-info p { margin: 0; color: rgba(255,255,255,.6); font-size: .85rem; }

/* Rotación automática del teléfono: en horizontal el apaisado ocupa todo,
   el vertical se limita por altura (pillarbox). En vertical, al revés. */
@media (max-width: 900px) and (orientation: portrait) {
  .video-stage[data-vertical="0"] .video-frame { width: 96vw; aspect-ratio: 16/9; } /* apaisado pequeño, letterbox por el fondo */
  .video-stage[data-vertical="1"] .video-frame { height: 80vh; aspect-ratio: 9/16; } /* vertical casi fullscreen */
  .video-info { display: none; }
}
@media (max-width: 900px) and (orientation: landscape) {
  .video-stage[data-vertical="0"] .video-frame { height: 92vh; aspect-ratio: 16/9; } /* apaisado fullscreen */
  .video-stage[data-vertical="1"] .video-frame { height: 92vh; aspect-ratio: 9/16; } /* vertical alto, pillarbox a los lados */
  .video-info { display: none; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .program-grid { grid-template-columns: 1fr; }
  .prog-card { display: none; }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; grid-template-rows: minmax(0,1fr) auto; }
  .live-frame { aspect-ratio: 16/9; flex: none; }
  .programs { max-height: 40vh; }
  .programs-list { overflow-y: auto; }
}
@media (max-width: 560px) {
  .nav-search { display: none; }   /* buscador vive en el drawer en móvil */
  :root { --navbar-h: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html, .snap { scroll-behavior: auto; }
}