/* ── Reset & variables ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --rojo:   #c8102e;
  --rojo-d: #a00d24;

  /* Categorías */
  --cat-default:   #c8102e;
  --cat-nacional:  #1565c0;
  --cat-politica:  #6a1b9a;
  --cat-economia:  #2e7d32;
  --cat-seguridad: #e65100;
  --cat-mundo:     #00695c;

  /* Colores modo claro */
  --bg:       #ffffff;
  --bg-alt:   #f5f5f5;
  --texto:    #111111;
  --texto-2:  #333333;
  --texto-3:  #666666;
  --borde:    #e0e0e0;
  --card-bg:  #ffffff;
  --sombra:   rgba(0,0,0,.08);

  /* Header/Footer siempre oscuros */
  --header-bg:  #111111;
  --footer-bg:  #0d0d0d;

  /* Tipografía */
  --fuente: 'Georgia', serif;
  --sans:   'Helvetica Neue', Arial, sans-serif;
  --trans:  .18s ease;
}

[data-theme="dark"] {
  --bg:      #0d0d0d;
  --bg-alt:  #181818;
  --texto:   #eeeeee;
  --texto-2: #cccccc;
  --texto-3: #888888;
  --borde:   #2c2c2c;
  --card-bg: #181818;
  --sombra:  rgba(0,0,0,.5);
}

/* ── Base ───────────────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--fuente);
  background: var(--bg);
  color: var(--texto);
  font-size: 16px;
  line-height: 1.65;
  transition: background var(--trans), color var(--trans);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.truncar-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.truncar-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 10px rgba(0,0,0,.4);
}

.header-top {
  background: var(--rojo);
  padding: 5px 20px;
  font-family: var(--sans);
  font-size: 11px;
  text-align: center;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.9);
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 20px;
  gap: 16px;
  position: relative;
}

/* Logo */
.site-logo { display: block; line-height: 0; flex-shrink: 0; }
.logo-img  { height: 54px; width: auto; display: block; }

/* Acciones (toggle + hamburger) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Dark toggle */
.dark-toggle {
  background: none;
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.8);
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: background var(--trans);
}
.dark-toggle:hover { background: rgba(255,255,255,.12); }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 22px;
  background: rgba(255,255,255,.85);
  border-radius: 2px;
  transition: transform .25s ease, opacity .2s ease;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav */
.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.header-nav a {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.75);
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: 7px 10px;
  border-radius: 3px;
  transition: background var(--trans), color var(--trans);
  white-space: nowrap;
}
.header-nav a:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ── Breaking ticker ────────────────────────────────────────────────────── */
.breaking-bar {
  background: var(--rojo);
  color: #fff;
  display: flex;
  align-items: center;
  height: 36px;
  overflow: hidden;
}
.breaking-label {
  background: #000;
  padding: 0 14px;
  height: 100%;
  display: flex;
  align-items: center;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  flex-shrink: 0;
  white-space: nowrap;
}
.breaking-track {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
}
.breaking-scroll {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  animation: ticker 60s linear infinite;
  padding-left: 40px;
}
.breaking-scroll:hover { animation-play-state: paused; }
.breaking-scroll a { color: #fff; font-weight: 600; }
.breaking-scroll a:hover { text-decoration: underline; }

@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.contenedor { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.portada    { padding: 28px 0 48px; }

/* ── Sección título ─────────────────────────────────────────────────────── */
.seccion-titulo {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--texto-3);
  border-left: 4px solid var(--rojo);
  padding-left: 12px;
  margin-bottom: 20px;
}

/* ── Badges de categoría ────────────────────────────────────────────────── */
.badge-cat {
  display: inline-block;
  background: var(--cat-default);
  color: #fff;
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  margin-bottom: 8px;
}
.badge-cat[data-cat="Nacional"]           { background: var(--cat-nacional); }
.badge-cat[data-cat="Pol\00EDtica"],
.badge-cat[data-cat="Politica"]           { background: var(--cat-politica); }
.badge-cat[data-cat="Econom\00EDa"],
.badge-cat[data-cat="Economia"]           { background: var(--cat-economia); }
.badge-cat[data-cat="Seguridad"]          { background: var(--cat-seguridad); }
.badge-cat[data-cat="Mundo"]              { background: var(--cat-mundo); }

/* ── Hero principal ─────────────────────────────────────────────────────── */
.grid-principal {
  display: grid;
  grid-template-columns: 1fr 296px;
  gap: 28px;
  margin-bottom: 40px;
}

.noticia-hero {
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  background: #111;
}
.hero-img-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 400px;
  overflow: hidden;
}
.hero-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.noticia-hero:hover .hero-img-wrap img { transform: scale(1.04); }
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.25) 55%, transparent 100%);
  z-index: 1;
}
.hero-fallback {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1a1a2e 0%, #8b0000 55%, var(--rojo) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  opacity: .3;
}
.hero-body {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 24px;
  z-index: 2;
}
.noticia-hero h2 {
  font-size: 26px;
  line-height: 1.22;
  margin-bottom: 8px;
  color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.noticia-hero h2 a { color: #fff; }
.noticia-hero h2 a:hover { opacity: .85; }
.noticia-hero .bajada {
  font-size: 14px;
  color: rgba(255,255,255,.8);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Sidebar última hora ─────────────────────────────────────────────────── */
.sidebar-ultimahora { display: flex; flex-direction: column; }
.sidebar-ultimahora h3 {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--rojo);
  border-bottom: 2px solid var(--rojo);
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.uh-item {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--borde);
  align-items: flex-start;
}
.uh-img-wrap {
  width: 76px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 3px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e, var(--rojo));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.uh-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.uh-titulo { font-size: 13px; font-weight: 700; line-height: 1.3; color: var(--texto); }
.uh-titulo a:hover { color: var(--rojo); }
.uh-fecha { font-family: var(--sans); font-size: 11px; color: var(--texto-3); margin-top: 4px; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.grid-recientes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--borde);
  transition: box-shadow var(--trans), transform var(--trans);
}
.card:hover { box-shadow: 0 6px 22px var(--sombra); transform: translateY(-3px); }

.card-img-wrap {
  position: relative;
  width: 100%;
  height: 162px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e 0%, #8b0000 55%, var(--rojo) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.card-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.card:hover .card-img-wrap img { transform: scale(1.07); }
.card-img-fallback { font-size: 32px; opacity: .35; user-select: none; }

.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.card h3 { font-size: 14px; line-height: 1.35; margin-bottom: 5px; color: var(--texto); }
.card h3 a:hover { color: var(--rojo); }
.card .extracto {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--texto-3);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}
.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--sans);
  font-size: 11px;
  color: var(--texto-3);
  padding-top: 8px;
  border-top: 1px solid var(--borde);
}
.card .fuente { font-weight: 600; }

/* ── Paginación ─────────────────────────────────────────────────────────── */
.paginacion {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 24px 0 8px;
  flex-wrap: wrap;
}
.paginacion a,
.paginacion span {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 4px;
  border: 1px solid var(--borde);
  color: var(--texto-2);
  transition: background var(--trans), color var(--trans), border-color var(--trans);
}
.paginacion a:hover       { background: var(--rojo); color: #fff; border-color: var(--rojo); }
.paginacion span.actual   { background: var(--rojo); color: #fff; border-color: var(--rojo); }
.paginacion span.puntos   { border: none; color: var(--texto-3); padding: 8px 4px; }

/* ── Página de noticia ───────────────────────────────────────────────────── */
.noticia-page { padding: 24px 0 56px; }
.noticia-layout {
  display: grid;
  grid-template-columns: 1fr 272px;
  gap: 48px;
  align-items: start;
}

.btn-volver {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--texto-3);
  border: 1px solid var(--borde);
  border-radius: 4px;
  padding: 7px 13px;
  margin-bottom: 16px;
  transition: color var(--trans), border-color var(--trans);
}
.btn-volver:hover { color: var(--rojo); border-color: var(--rojo); }

.breadcrumb {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--texto-3);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--texto-3); }
.breadcrumb a:hover { color: var(--rojo); }
.breadcrumb .sep { opacity: .4; font-size: 10px; }

.cat-tag {
  display: inline-block;
  background: var(--cat-default);
  color: #fff;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 2px;
  margin-bottom: 14px;
}
.cat-tag[data-cat="Nacional"]           { background: var(--cat-nacional); }
.cat-tag[data-cat="Pol\00EDtica"],
.cat-tag[data-cat="Politica"]           { background: var(--cat-politica); }
.cat-tag[data-cat="Econom\00EDa"],
.cat-tag[data-cat="Economia"]           { background: var(--cat-economia); }
.cat-tag[data-cat="Seguridad"]          { background: var(--cat-seguridad); }
.cat-tag[data-cat="Mundo"]              { background: var(--cat-mundo); }

.noticia-header h1 {
  font-size: 30px;
  line-height: 1.2;
  margin-bottom: 14px;
  color: var(--texto);
}
.bajada-art {
  font-size: 17px;
  color: var(--texto-3);
  line-height: 1.5;
  border-left: 4px solid var(--rojo);
  padding-left: 16px;
  margin-bottom: 18px;
}
.noticia-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--texto-3);
  padding: 12px 0;
  border-top: 1px solid var(--borde);
  border-bottom: 1px solid var(--borde);
  margin-bottom: 22px;
}
.noticia-meta strong { color: var(--texto-2); }
.reading-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-alt);
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.noticia-imagen-principal {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 6px;
}
.credito-imagen {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--texto-3);
  margin-bottom: 26px;
  font-style: italic;
}

.resumen-rapido {
  background: var(--bg-alt);
  border-left: 4px solid var(--rojo);
  padding: 18px 22px;
  margin: 24px 0;
  border-radius: 0 5px 5px 0;
}
.resumen-rapido h4 {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--rojo);
  margin-bottom: 10px;
}
.resumen-rapido ul { list-style: none; }
.resumen-rapido li {
  font-family: var(--sans);
  font-size: 14px;
  padding: 5px 0 5px 18px;
  position: relative;
  color: var(--texto-2);
  line-height: 1.4;
}
.resumen-rapido li::before { content: "▸"; position: absolute; left: 0; color: var(--rojo); }

.noticia-cuerpo { font-size: 17px; line-height: 1.85; color: var(--texto-2); }
.noticia-cuerpo h2 {
  font-size: 21px;
  color: var(--texto);
  margin: 28px 0 12px;
  border-left: 3px solid var(--rojo);
  padding-left: 12px;
}
.noticia-cuerpo p  { margin-bottom: 18px; }
.noticia-cuerpo a  { color: var(--rojo); text-decoration: underline; }

.fuente-link {
  font-family: var(--sans);
  font-size: 12px;
  color: var(--texto-3);
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--borde);
}
.fuente-link a { color: var(--rojo); text-decoration: underline; }

/* Share */
.share-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--borde);
}
.share-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--texto-3);
  margin-bottom: 10px;
}
.share-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  transition: opacity var(--trans), transform var(--trans);
  text-decoration: none;
}
.btn-share:hover  { opacity: .85; transform: translateY(-1px); }
.btn-share:active { transform: translateY(0); }
.btn-twitter { background: #000; color: #fff; }
.btn-copy    { background: var(--bg-alt); color: var(--texto-2); border: 1px solid var(--borde); }

/* Sidebar noticia */
.noticia-sidebar { position: sticky; top: 80px; }
.noticia-sidebar h3 {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--texto);
  border-bottom: 2px solid var(--rojo);
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.rel-item { padding: 12px 0; border-bottom: 1px solid var(--borde); }
.rel-img-wrap {
  width: 100%;
  height: 108px;
  border-radius: 4px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a2e, var(--rojo));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  font-size: 24px;
  opacity: .6;
}
.rel-img-wrap img { width: 100%; height: 100%; object-fit: cover; opacity: 1; }
.rel-item .rel-cat {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  color: var(--rojo);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 3px;
}
.rel-item h4 { font-size: 13px; line-height: 1.3; color: var(--texto); }
.rel-item h4 a:hover { color: var(--rojo); }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--footer-bg);
  color: rgba(255,255,255,.45);
  font-family: var(--sans);
  font-size: 12px;
  padding: 32px 20px 20px;
  margin-top: 56px;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.footer-brand strong { color: rgba(255,255,255,.8); font-size: 14px; }
.footer-brand p { margin-top: 4px; line-height: 1.5; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.footer-links a { color: rgba(255,255,255,.45); transition: color var(--trans); }
.footer-links a:hover { color: var(--rojo); }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  text-align: center;
}

/* ── Estado vacío ───────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--texto-3);
  font-family: var(--sans);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 18px; margin-bottom: 8px; }

/* ── Img placeholder ────────────────────────────────────────────────────── */
.img-placeholder {
  background: linear-gradient(135deg, #1a1a2e 0%, #8b0000 60%, var(--rojo) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.35);
  font-size: 22px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grid-principal { grid-template-columns: 1fr 260px; }
  .grid-recientes { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .grid-principal { grid-template-columns: 1fr; }
  .sidebar-ultimahora { display: none; }
  .grid-recientes { grid-template-columns: repeat(2, 1fr); }
  .noticia-layout { grid-template-columns: 1fr; }
  .footer-links { display: none; }
}

@media (max-width: 600px) {
  /* Header mobile */
  .logo-img    { height: 36px; }
  .header-main { padding: 8px 14px; }
  .header-top  { font-size: 10px; padding: 4px 12px; }

  .nav-toggle { display: flex; }
  .header-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: #111;
    flex-direction: column;
    padding: 6px 0 12px;
    z-index: 300;
    box-shadow: 0 6px 20px rgba(0,0,0,.5);
    gap: 0;
  }
  .header-nav.open { display: flex; }
  .header-nav a {
    padding: 13px 18px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,.06);
    font-size: 14px;
    letter-spacing: .5px;
  }

  /* Breaking */
  .breaking-bar    { height: 32px; }
  .breaking-label  { font-size: 9px; padding: 0 10px; }
  .breaking-scroll { font-size: 12px; }

  /* Hero */
  .hero-img-wrap, .noticia-hero { min-height: 250px; }
  .noticia-hero h2 { font-size: 19px; }
  .hero-body { padding: 16px; }

  /* Cards */
  .grid-recientes { grid-template-columns: 1fr; gap: 12px; }

  /* Noticia */
  .noticia-header h1 { font-size: 22px; }
  .bajada-art  { font-size: 15px; }
  .noticia-cuerpo { font-size: 16px; line-height: 1.75; }
  .noticia-meta { gap: 8px; font-size: 11px; }
  .share-btns { flex-direction: column; }
  .btn-share  { justify-content: center; }
  .breadcrumb { font-size: 11px; }

  /* Paginación */
  .paginacion a, .paginacion span { padding: 7px 11px; font-size: 12px; }

  /* General */
  .contenedor { padding: 0 14px; }
  .portada    { padding: 16px 0 32px; }
  .noticia-page { padding: 16px 0 40px; }
}
