/* ── VARIABLES ── */
:root {
  --black:      #0a0a0a;
  --dark:       #111111;
  --card:       #191919;
  --border:     #2a2a2a;
  --gray:       #888888;
  --light-gray: #cccccc;
  --red:        #e8230a;
  --orange:     #ff6b00;
  --yellow:     #ffd600;
  --white:      #ffffff;
}


*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--black);
  color: var(--white);
  font-family: 'Barlow', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
}

a { text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ── TOP BAR ── */
.top-bar {
  background: #0d0d0d; border-bottom: 1px solid var(--border);
  padding: 0 32px; min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  position: -webkit-sticky; position: sticky; top: 0; z-index: 300; flex-wrap: wrap; 
}
.top-bar-left, .top-bar-right { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; }
.topbar-clock, .topbar-weather { display: flex; align-items: center; gap: 6px; font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; color: var(--gray); }
#clockDisplay { font-family: 'Bebas Neue', cursive; font-size: 15px; color: var(--white); letter-spacing: 0.08em; animation: clockPulse 1s ease-in-out infinite; }
@keyframes clockPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
#dateDisplay { color: var(--gray); font-size: 11px; text-transform: capitalize; }
.clock-sep { color: #333; margin: 0 4px; }
#weatherIcon { font-size: 15px; }
#weatherTemp { font-family: 'Bebas Neue', cursive; font-size: 16px; color: var(--yellow); letter-spacing: 0.05em; }
#weatherDesc { font-size: 11px; color: #666; }
.topbar-social { width: 26px; height: 26px; border-radius: 4px; display: flex; align-items: center; justify-content: center; color: #555; border: 1px solid #222; transition: all 0.2s; }
.topbar-social svg { width: 13px; height: 13px; }
.topbar-social:hover { transform: translateY(-2px); }
.topbar-social.instagram:hover { color: #e1306c; border-color: #e1306c; background: #1a0810; }
.topbar-social.facebook:hover  { color: #1877f2; border-color: #1877f2; background: #080f1a; }
.topbar-social.tiktok:hover    { color: #69c9d0; border-color: #69c9d0; background: #081414; }
.topbar-social.youtube:hover   { color: #ff0000; border-color: #ff0000; background: #1a0000; }

/* ── HEADER ── */
header { background: transparent; position: absolute; left: 0; right: 0; top: 38px; z-index: 200; pointer-events: none; border: none; width: 100%; -webkit-transform: translateZ(0); transform: translateZ(0); }
.header-inner { padding: 20px 32px 0; display: flex; flex-direction: column; align-items: center; gap: 0; pointer-events: none; width: 100%; }
#mainNav { display: flex; gap: 2px; align-items: center; justify-content: center; flex-wrap: wrap; pointer-events: all; background: rgba(0,0,0,0.55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.06); border-radius: 8px; padding: 6px 10px; margin-bottom: 16px; max-width: 90%; position: relative; z-index: 201; }
.header-logo-center { display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: all; max-width: 100%; flex-shrink: 0; }
.header-logo-img { height: clamp(70px, 18vw, 140px); width: auto; max-width: 100%; filter: drop-shadow(0 0 24px rgba(232,35,10,0.5)) drop-shadow(0 0 48px rgba(255,214,0,0.2)); transition: transform 0.3s; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.header-logo-img:hover { transform: scale(1.04); }
.header-brand-text { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.hb-fm { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 13px; letter-spacing: 0.4em; color: rgba(255,255,255,0.6); text-transform: uppercase; }
.hb-name { font-family: 'Bebas Neue', cursive; font-size: clamp(32px, 10vw, 64px); letter-spacing: 0.06em; color: var(--white); text-shadow: 0 2px 20px rgba(0,0,0,0.8); line-height: 1; text-align: center; -webkit-text-size-adjust: 100%; }
.hb-freq { font-family: 'Bebas Neue', cursive; font-size: clamp(20px, 6vw, 40px); color: var(--yellow); letter-spacing: 0.06em; line-height: 1; text-shadow: 0 2px 16px rgba(255,214,0,0.4); -webkit-text-size-adjust: 100%; }

nav > a { color: var(--gray); font-family: 'Barlow Condensed', sans-serif; font-weight: 600; font-size: clamp(11px, 2vw, 13px); letter-spacing: 0.1em; text-transform: uppercase; padding: 8px 14px; border-radius: 4px; transition: all 0.2s; white-space: nowrap; min-height: 44px; display: flex; align-items: center; justify-content: center; }
nav > a:hover  { color: var(--white); background: #1e1e1e; }
nav > a.active { color: var(--yellow); }

.live-btn {
  display: flex !important;
  align-items: center;
  gap: 8px;
  background: var(--red) !important;
  color: #fff !important;
  padding: 9px 20px !important;
  border-radius: 4px !important;
  min-width: fit-content;
  min-height: 44px;
}
.live-btn:hover { background: #c41a06 !important; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #fff;
  display: inline-block; flex-shrink: 0;
  animation: blink 1.2s ease-in-out infinite;
}

.menu-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--white); font-size: 20px; padding: 6px 12px; border-radius: 4px; cursor: pointer; min-height: 44px; min-width: 44px; }

/* ── HERO ── */
.hero { position: relative; overflow: hidden; min-height: 520px; display: flex; align-items: flex-end; padding: 0; width: 100%; }
.hero-console { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.console-img { width: 100%; height: 100%; object-fit: cover; object-position: center; filter: blur(2px) brightness(0.28) saturate(0.7); transform: scale(1.04); -webkit-transform: translateZ(0) scale(1.04); transform: translateZ(0) scale(1.04); will-change: transform; }
.console-glow { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0.4) 70%, rgba(0,0,0,0.85) 100%), radial-gradient(ellipse at 50% 100%, rgba(0,0,0,0.6) 0%, transparent 60%); z-index: 1; -webkit-transform: translateZ(0); transform: translateZ(0); }
.hero-main { position: relative; z-index: 2; width: 100%; padding: 280px 64px 60px; box-sizing: border-box; -webkit-transform: translateZ(0); transform: translateZ(0); }
.hero-title { font-family: 'Bebas Neue', cursive; font-size: clamp(38px, 6vw, 82px); line-height: 0.93; color: var(--white); margin-bottom: 16px; text-shadow: 0 2px 20px rgba(0,0,0,0.5), 0 4px 40px rgba(0,0,0,0.3); -webkit-text-size-adjust: 100%; }
.hero-title span { color: var(--yellow); }
.hero-desc { font-size: clamp(14px, 2vw, 15px); line-height: 1.7; color: rgba(255,255,255,0.75); max-width: 520px; margin-bottom: 22px; text-shadow: 0 1px 10px rgba(0,0,0,0.6); }
.hero-meta { display: flex; gap: 20px; flex-wrap: wrap; font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 600; text-transform: uppercase; color: rgba(255,255,255,0.45); }

/* ── SPONSORS CARROUSEL ── */
.sponsors-section {
  width: 100%;
  background: #0a0a0a;
  padding: 50px 32px;
  border-top: 1px solid var(--border);
  box-sizing: border-box;
}
.sponsors-carousel {
  max-width: 1320px;
  margin: 0 auto;
  overflow: hidden;
}
.sponsors-track {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  transition: transform 0.6s ease-in-out;
  will-change: transform;
}
.sponsor-item {
  flex: 0 0 200px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 30px;
}
.sponsor-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.sponsor-item img:hover {
  transform: scale(1.08);
}

/* ── ESCUDOS ── */
.escudos-section {
  width: 100%; background: #0a0a0a; padding: 40px 32px;
  border-bottom: 1px solid var(--border); box-sizing: border-box;
  display: flex; justify-content: center;
}
.escudos-container {
  display: flex; justify-content: center; align-items: center;
  max-width: 1320px; width: 100%; margin: 0 auto;
}
.escudos-container img {
  height: clamp(80px, 12vw, 130px); width: auto; object-fit: contain; opacity: 0.88;
}

/* ── LAYOUT ── */
.container { max-width: 1320px; margin: 0 auto; padding: 0 32px; box-sizing: border-box; width: 100%; }
.section { padding: 56px 0; border-bottom: 1px solid var(--border); width: 100%; }
.section-header { display: flex; align-items: baseline; gap: 16px; margin-bottom: 32px; }
.section-title { font-family: 'Bebas Neue', cursive; font-size: 34px; color: var(--white); white-space: nowrap; }
.section-line { flex: 1; height: 1px; background: var(--border); }

/* ── NOTICIAS ── */
/* ── NOTICIAS 5 COLUMNAS ── */
.news-slider-wrapper { 
  overflow: hidden; 
  width: 100%; 
  position: relative;
}

.news-track {
  display: flex; 
  flex-wrap: nowrap; 
  transition: transform 0.5s ease-in-out; 
  width: 100%;
}

.news-page {
  width: 100%;
  flex: 0 0 100%; 
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  margin: -8px; 
  box-sizing: border-box;
  justify-content: flex-start;
}

/* FIX: Centrar páginas incompletas */
.news-page:has(.card:nth-child(5):last-child),
.news-page:has(.card:nth-child(4):last-child),
.news-page:has(.card:nth-child(3):last-child),
.news-page:has(.card:nth-child(2):last-child),
.news-page:has(.card:nth-child(1):last-child) {
  justify-content: center;
}

.news-page.incomplete {
  justify-content: center;
}

/* FIX: Cards con max-width para que no se vean enormes cuando son pocas */
.card {
  width: calc(20% - 16px);
  margin: 8px;
  background: var(--card); 
  border: 1px solid var(--border);
  border-radius: 6px; 
  overflow: hidden; 
  transition: all 0.2s;
  display: flex; 
  flex-direction: column;
  cursor: pointer;
  max-width: 220px;           /* ← FIX: límite máximo de ancho */
}

.card:hover { 
  border-color: #444; 
  transform: translateY(-3px); 
}

/* ── Card Thumb ── */
.card-thumb { 
  width: 100%; 
  aspect-ratio: 16 / 10; 
  background: #222; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  position: relative; 
  overflow: hidden; 
}

.card-thumb-gradient { 
  position: absolute; 
  inset: 0; 
  z-index: 1;
}

/* FIX: Imagen visible correctamente */
.card-thumb-img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  z-index: 2;
}

/* Solo ocultar imagen si src está VACÍO explícitamente */
.card-thumb-img[src=""] {
  display: none;
}

/* Mostrar gradiente cuando NO hay imagen válida */
.card-thumb:not(:has(.card-thumb-img[src])) .card-thumb-gradient,
.card-thumb:has(.card-thumb-img[src=""]) .card-thumb-gradient {
  display: block;
}

/* Icono de fallback */
.card-thumb-icon { 
  font-size: 28px; 
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3; 
}

/* Ocultar icono cuando hay imagen válida */
.card-thumb:has(.card-thumb-img[src]:not([src=""])) .card-thumb-icon {
  display: none;
}

.card-body { 
  padding: 14px; 
  flex: 1; 
  display: flex; 
  flex-direction: column; 
}

.card-cat { 
  font-family: 'Barlow Condensed', sans-serif; 
  font-weight: 700; 
  font-size: 9px; 
  letter-spacing: 0.2em; 
  text-transform: uppercase; 
  color: var(--orange); 
  margin-bottom: 6px; 
}

.card-cat.politics { color: var(--red); } 
.card-cat.sport { color: #00c4ff; } 
.card-cat.culture { color: #b069ff; }

/* FIX: Título con word-break para que no se corte */
.card-title { 
  font-family: 'Barlow', sans-serif; 
  font-weight: 700; 
  font-size: 13px; 
  line-height: 1.35; 
  color: var(--white); 
  margin-bottom: 8px;
  word-break: break-word;
  overflow-wrap: break-word;
}

.card-time { 
  font-family: 'Barlow Condensed', sans-serif; 
  font-size: 10px; 
  color: #555; 
  margin-top: auto; 
}

.pagination { 
  display: flex; 
  justify-content: center; 
  gap: 8px; 
  margin-top: 32px; 
  flex-wrap: wrap;
}

.page-btn { 
  background: #1a1a1a; 
  border: 1px solid #333; 
  color: #888; 
  font-family: 'Barlow Condensed', sans-serif; 
  font-weight: 700; 
  font-size: 14px; 
  padding: 6px 14px; 
  border-radius: 4px; 
  cursor: pointer; 
  transition: all 0.2s; 
}

.page-btn:hover { 
  background: #2a2a2a; 
  color: #fff; 
}

.page-btn.active { 
  background: var(--red); 
  color: #fff; 
  border-color: var(--red); 
}

.share-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.share-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray);
  margin-right: 6px;
}

.share-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card);
  border: 1px solid var(--border);
  color: #888;
  cursor: pointer;
  transition: all 0.2s;
}

.share-btn svg {
  width: 16px;
  height: 16px;
}

.share-btn:hover {
  transform: translateY(-2px);
}

.share-btn.facebook:hover {
  color: #1877f2;
  border-color: #1877f2;
  background: rgba(24,119,242,0.1);
}

.share-btn.whatsapp:hover {
  color: #25d366;
  border-color: #25d366;
  background: rgba(37,211,102,0.1);
}

.share-btn.copy:hover {
  color: var(--yellow);
  border-color: var(--yellow);
  background: rgba(255,214,0,0.1);
}

/* ── FOOTER ── */
footer { background: #0d0d0d; border-top: 1px solid var(--border); padding: 48px 32px 24px; width: 100%; box-sizing: border-box; }
.footer-new-grid { max-width: 1000px; margin: 0 auto; display: flex; flex-wrap: wrap; justify-content: space-around; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.footer-brand-centered, .footer-about { flex: 1 1 300px; min-width: 250px; }
.footer-brand-centered { display: flex; flex-direction: column; align-items: center; text-align: center; }
.footer-logo { height: 56px; margin-bottom: 12px; filter: drop-shadow(0 0 10px rgba(232,35,10,0.5)); }
.footer-brand-centered .hb-name-footer { font-family: 'Barlow', sans-serif; font-size: 22px; font-weight: 700; color: var(--white); margin-bottom: 14px; }
.footer-brand-centered .tagline { font-size: 15px; color: var(--gray); line-height: 1.6; max-width: 320px; margin-bottom: 22px; }
.footer-about { display: flex; flex-direction: column; justify-content: center; }
.footer-about h4 { font-family: 'Barlow', sans-serif; font-size: 18px; color: var(--white); margin-bottom: 16px; }
.footer-about p, .footer-about li { font-size: 14px; color: var(--gray); line-height: 1.7; margin-bottom: 8px; }
.footer-about ul { list-style: none; padding-left: 0; }

.footer-sponsors-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  gap: 20px;
}
.sponsor-col {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}
.footer-sponsor-img {
  height: 65px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  opacity: 0.9;
}

.footer-bottom { max-width: 1000px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #555; flex-wrap: wrap; gap: 12px; }

.socials { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.social-btn { width: 42px; height: 42px; background: #151515; border: 1px solid var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #888; transition: all 0.2s; }
.social-btn svg { width: 18px; height: 18px; }
.social-btn:hover { transform: translateY(-3px); }
.social-btn.instagram:hover { color: #e1306c; border-color: #e1306c; background: rgba(225,48,108,0.1); }
.social-btn.facebook:hover  { color: #1877f2; border-color: #1877f2; background: rgba(24,119,242,0.1); }
.social-btn.tiktok:hover    { color: #69c9d0; border-color: #69c9d0; background: rgba(105,201,208,0.1); }
.social-btn.youtube:hover   { color: #ff0000; border-color: #ff0000; background: rgba(255,0,0,0.1); }
.social-btn.whatsapp:hover  { color: #25d366; border-color: #25d366; background: rgba(37,211,102,0.1); }
.social-btn.gmail:hover     { color: #ea4335; border-color: #ea4335; background: rgba(234,67,53,0.1); }

/* ── MEDIA QUERIES ── */
@media (max-width: 1200px) {
  .card { width: calc(25% - 16px); }
  .sponsor-item { flex: 0 0 170px; height: 70px; margin-right: 24px; }
}
@media (max-width: 900px) {
  .card { width: calc(33.333% - 16px); }
  .sponsor-item { flex: 0 0 150px; height: 65px; margin-right: 20px; }
}
@media (max-width: 680px) {
  .card { width: calc(50% - 16px); }
}
@media (max-width: 560px) {
  .top-bar { 
    flex-direction: column; 
    padding: 12px 16px; 
    gap: 12px; 
    justify-content: center; 
    min-height: auto; 
  }
  .top-bar-left, .top-bar-right { 
    width: 100%; 
    justify-content: center; 
    gap: 8px; 
  }
  #dateDisplay, #weatherDesc { 
    display: none; 
  }

  /* FIX: Header pasa a relative en mobile */
  header {
    position: relative;
    top: 0;
  }

  .hero { 
    min-height: auto; 
  }
  .hero-main { 
    padding: 40px 16px 30px; 
    text-align: center; 
  }
  .hero-meta { 
    justify-content: center; 
  }
  .header-logo-img { 
    height: 70px; 
  }
  #mainNav { 
    width: calc(100% - 20px); 
    max-width: 100%; 
    margin: 0 auto 18px auto; 
    padding: 6px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    flex-wrap: nowrap; 
    gap: 2px; 
    overflow: hidden; 
  }
  .live-btn { 
    padding: 7px 10px !important; 
    gap: 5px; 
    font-size: 10px; 
    flex-shrink: 0; 
  }
  .live-dot { 
    width: 6px; 
    height: 6px; 
  }

  .container { 
    padding: 0 16px; 
  }

  /* ═══════════════════════════════════════
     FIX: 5 cards por fila en mobile (2 filas = 10 noticias)
     ═══════════════════════════════════════ */
  .news-page { 
    margin: -4px; 
    justify-content: center;
  }

  .card { 
    width: calc(20% - 8px);    /* ← 5 por fila */
    margin: 4px;
    max-width: none;            /* ← Sin límite en mobile */
  }

  .card-thumb { 
    aspect-ratio: 1 / 1;        /* ← Cuadrado, más compacto */
    padding-bottom: 0;
  }

  .card-thumb-icon { 
    font-size: 20px; 
  }

  .card-body { 
    padding: 6px; 
  }

  .card-cat { 
    font-size: 6px; 
    letter-spacing: 0.1em; 
    margin-bottom: 2px; 
  }

  .card-title { 
    font-size: 10px;            /* ← Legible pero compacto */
    line-height: 1.25; 
    margin-bottom: 3px; 
    word-break: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
  }

  .card-time { 
    font-size: 7px; 
  }

  .sponsors-section { 
    padding: 36px 16px; 
  }
  .sponsor-item { 
    flex: 0 0 130px; 
    height: 55px; 
    margin-right: 16px; 
  }
  .escudos-container img { 
    height: 70px; 
  }

  footer { 
    padding: 32px 16px 20px; 
  }
}
@media (max-width: 480px) {
  .card { 
    width: calc(20% - 8px);    /* ← Mantener 5 por fila */
    margin: 4px;
  }
  
  .card-title {
    font-size: 9px;            /* ← Un poco más chico en pantallas muy pequeñas */
  }
}



/* ── FIXES ESPECÍFICOS PARA iOS SAFARI ── */

@media screen and (max-width: 896px) and (orientation: landscape) {
  .header-logo-img { height: 60px; }
  .hb-name { font-size: 32px; }
  .hero-main { padding-top: 20px; padding-bottom: 30px; }
}

@media screen and (max-width: 375px) {
  .header-inner { padding: 12px 16px 0; }
  .hero-title { font-size: 28px; }
  .hero-desc { font-size: 12px; }
  .hb-name { font-size: 28px; }
  .hb-freq { font-size: 18px; }
}



/* ── FIX iOS SAFARI: Header y live-btn posicionamiento ── */

/* ── PANEL ADMIN EN TOP BAR ── */
.topbar-admin {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  background: rgba(232, 35, 10, 0.15);
  border: 1px solid rgba(232, 35, 10, 0.4);
  padding: 6px 14px;
  border-radius: 4px;
  margin-left: 8px;
  transition: all 0.2s;
  text-decoration: none;
}

.topbar-admin:hover {
  background: var(--red);
  border-color: var(--red);
  transform: translateY(-1px);
}

.admin-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
  animation: blink 1.2s ease-in-out infinite;
}

a.card {
  text-decoration: none;
  color: inherit;
}

