/*
 * base.css - Componentes compartidos del theme TV4 La Vall (modo claro).
 * Los colores viven en tokens.css; aquí solo estructura y componentes.
 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }   /* el atributo hidden gana siempre a los display de las clases */
html { scroll-behavior: smooth; }
html, body { font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* Visible solo para lectores de pantalla y buscadores (no ocupa espacio en pantalla) */
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── Nav (siempre oscura) ─────────────────────────────────────────── */
nav.site-nav { position: sticky; top: 0; z-index: 100; background: var(--nav-bg); border-bottom: 1px solid var(--nav-line); }
.nav-inner { max-width: 1160px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; gap: 26px; }
.nav-logo { display: flex; align-items: center; margin-right: auto; }
.nav-logo .logo-mark { display: block; height: 40px; width: auto; background: #fff; border-radius: 8px; padding: 3px 9px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a { position: relative; padding: 8px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: rgba(255,255,255,.72); transition: color .15s, background .15s; }
.nav-links a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-links a.active { color: #fff; }
.nav-links a.active::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--brand); }
.nav-live { display: none; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(242,169,0,.6); background: rgba(242,169,0,.2); color: #ffd666; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.nav-live.on { display: inline-flex; }
.nav-live .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(242,169,0,.5); } 50% { box-shadow: 0 0 0 6px rgba(242,169,0,0); } }
.nav-cta { flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; border-radius: 999px; background: var(--brand); color: var(--accent); font-size: 13px; font-weight: 800; white-space: nowrap; transition: background .15s, transform .1s; }
.nav-cta:hover { background: #ffb700; }
.nav-cta:active { transform: scale(.97); }
.nav-cta svg { width: 13px; height: 13px; flex-shrink: 0; }

.nav-toggle { display: none; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px; border: 0; border-radius: 8px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; }
.nav-toggle:hover { background: rgba(255,255,255,.16); }
.nav-toggle svg { width: 19px; height: 19px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle.open .icon-burger { display: none; }
.nav-toggle.open .icon-close { display: block; }

@media (max-width: 720px) {
  .nav-inner { position: relative; padding: 0 14px; gap: 10px; height: 54px; }
  .nav-toggle { display: flex; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 2px; background: var(--nav-bg); border-bottom: 1px solid var(--nav-line); padding: 8px 14px 16px; box-shadow: 0 16px 30px rgba(0,0,0,.22); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 14px; font-size: 15px; border-radius: 10px; }
  .nav-links a.active { background: rgba(255,255,255,.1); }
  .nav-links a.active::after { display: none; }
  .nav-live span:last-child { display: none; }
  .nav-cta { padding: 8px 13px; font-size: 12.5px; }
  .nav-logo .logo-mark { height: 34px; }
  .cookie-banner { top: 68px; }
}

/* ── Secciones ────────────────────────────────────────────────────── */
main.site-main { flex: 1; padding: 34px 0 56px; }
.sec { margin-bottom: 44px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.sec-title { font-size: clamp(1.15rem, 3vw, 1.45rem); font-weight: 800; letter-spacing: -.4px; }
.sec-more { font-size: 13.5px; font-weight: 700; color: var(--text-inverse); white-space: nowrap; }
.sec-more:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Tarjetas de vídeo ────────────────────────────────────────────── */
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
@media (max-width: 560px) { .vgrid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
.vcard { display: block; border-radius: var(--radius); transition: transform .18s ease; }
.vcard:hover { transform: translateY(-3px); }
.vthumb { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: #dfe1e5; box-shadow: 0 1px 8px rgba(0,0,0,.09); }
.vthumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard:hover .vthumb { box-shadow: 0 8px 22px rgba(0,0,0,.16); }
.vplay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .18s; background: rgba(0,0,0,.28); }
.vcard:hover .vplay { opacity: 1; }
.vplay svg { width: 44px; height: 44px; fill: #fff; filter: drop-shadow(0 2px 8px rgba(0,0,0,.4)); }
.vdur { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 5px; background: rgba(0,0,0,.82); color: #fff; font-size: 11.5px; font-weight: 700; }
.vtag { position: absolute; left: 8px; top: 8px; padding: 3px 9px; border-radius: 5px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.vmeta { padding: 10px 2px 0; }
.vtitle { font-size: 14px; font-weight: 700; line-height: 1.35; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vdate { font-size: 12px; color: var(--faint); margin-top: 4px; }

/* Skeletons */
.vskel { background: linear-gradient(100deg, #ececee 40%, #f6f6f8 50%, #ececee 60%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.vskel-title { height: 13px; border-radius: 4px; margin: 10px 2px 0; width: 80%; }
@media (prefers-reduced-motion: reduce) { .vskel { animation: none; } .nav-live .dot { animation: none; } }

/* ── Botones ──────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border: 0; border-radius: 10px; font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .15s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; transition: background .15s, color .15s, transform .1s; }
.btn-primary:hover { background: var(--brand); color: var(--accent); }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: #eaebee; }

/* ── Footer (azul de marca, igual que el nav) ────────────────────── */
footer.site-footer { border-top: none; background: var(--nav-bg); }
.footer-inner { max-width: 1160px; margin: 0 auto; padding: 26px 24px 30px; }
.foot-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 18px; margin-bottom: 16px; border-bottom: 1px solid var(--nav-line); }
.foot-logo { display: flex; align-items: center; }
.foot-logo .logo-mark { display: block; height: 32px; width: auto; background: #fff; border-radius: 7px; padding: 3px 8px; }
.foot-social { display: flex; gap: 8px; }
.foot-social a { width: 36px; height: 36px; border-radius: 9px; border: 1px solid rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.75); background: rgba(255,255,255,.06); transition: color .15s, border-color .15s, background .15s; }
.foot-social a:hover { color: #fff; border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.12); }
.foot-social svg { width: 17px; height: 17px; }
.foot-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.foot-meta { font-size: 12.5px; color: rgba(255,255,255,.6); }
.foot-credit { font-size: 12.5px; color: rgba(255,255,255,.6); }
.foot-credit a { color: rgba(255,255,255,.9); font-weight: 700; }
.foot-credit a:hover { color: var(--brand); }
@media (max-width: 560px) { .foot-bottom { flex-direction: column; align-items: flex-start; gap: 8px; } }

/* ── Banner de cookies (gate de los embeds de YouTube) ────────────── */
.cookie-banner { position: fixed; left: 16px; right: 16px; top: 76px; z-index: 300; max-width: 560px; margin: 0 auto; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.22); }
.cookie-banner p { font-size: 13px; line-height: 1.55; color: var(--muted); }
.cookie-actions { display: flex; gap: 10px; }
.cookie-actions .btn { padding: 9px 16px; font-size: 13px; }

/* ── Añadir a pantalla de inicio (móvil) ──────────────────────────── */
.a2hs-banner { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 250; display: flex; align-items: center; gap: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 14px 40px 14px 14px; box-shadow: 0 10px 40px rgba(0,0,0,.22); }
.a2hs-icon img { display: block; width: 44px; height: 44px; border-radius: 10px; }
.a2hs-body { flex: 1; min-width: 0; }
.a2hs-title { font-size: 13.5px; font-weight: 800; line-height: 1.3; margin-bottom: 2px; }
.a2hs-text { font-size: 12px; color: var(--muted); line-height: 1.45; }
.a2hs-action { flex-shrink: 0; padding: 9px 15px; font-size: 12.5px; white-space: nowrap; }
.a2hs-close { position: absolute; top: 8px; right: 10px; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: transparent; color: var(--faint); font-size: 18px; line-height: 1; cursor: pointer; }
.a2hs-close:hover { background: var(--surface); color: var(--text); }
@media (min-width: 721px) { .a2hs-banner { display: none !important; } }

/* ── Revelado sutil al hacer scroll ───────────────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
