:root {
  --primary: #5175cf;       /* azul del tema Newser (cartelera real) */
  --primary-dark: #3a57b3;
  --primary-light: #eaeefb;
  --accent: #f12b63;        /* rosa de acento (destacadas/badges) */
  --cat-pink: #f12b63;
  --cat-gold: #d19e29;
  --cat-green: #90c963;
  --cat-blue: #1e73be;
  --red: #e5192c;           /* rojo de acento del tema Newser (etiquetas) */
  --topbar: #32373c;        /* barra superior oscura */
  --footer: #080808;        /* footer oscuro */
  --text: #2b2f36;
  --muted: #6b7280;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --border: #e4e8ef;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 1rem; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--primary);
  color: #fff; padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

/* --- Barra superior (oscura) --------------------------------------- */
.topbar { background: var(--topbar); color: #fff; }
.topbar-inner { display: flex; align-items: center; gap: 1rem; min-height: 40px; }
.topbar-tag {
  background: var(--primary); color: #fff; font-weight: 700; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .04em; padding: .7rem 1rem;
  margin-left: -1rem; align-self: stretch; display: flex; align-items: center;
}
.topbar-tag:hover { background: var(--primary-dark); text-decoration: none; }
.topbar-ticker {
  flex: 1; min-width: 0; color: #cfd3d8; font-size: .82rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-ticker:hover { color: #fff; text-decoration: none; }
.topbar-ticker b { color: #fff; }
.topbar-social { display: flex; gap: .5rem; margin-left: auto; }
.topbar-social .dot { width: 22px; height: 22px; border-radius: 50%; display: block; }
.topbar-social .dot.tw { background: #1da1f2; }
.topbar-social .dot.ig { background: #f12b63; }

/* --- Header (blanco con logo) -------------------------------------- */
.site-header { background: #fff; }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.3rem 1rem;
}
.brand { display: flex; align-items: center; }
.brand-logo { max-height: 76px; width: auto; }
.brand-fallback { font-size: 1.5rem; font-weight: 800; color: var(--primary-dark);
  align-items: center; }
.single-tags { margin: 1rem 0 0; }
.nav-toggle {
  display: none; background: none; border: 0; font-size: 1.7rem;
  color: var(--primary-dark); cursor: pointer;
}

/* --- Nav principal (blanco, activo azul) --------------------------- */
.main-nav { background: #fff; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border); }
.main-nav ul {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap;
}
.main-nav a {
  display: block; color: var(--text); padding: .9rem 1rem; font-weight: 700;
  font-size: .82rem; text-transform: uppercase; letter-spacing: .03em;
  border-bottom: 3px solid transparent;
}
.main-nav a:hover { color: var(--primary); text-decoration: none; }
.main-nav a.active { color: var(--primary); border-bottom-color: var(--primary); }
.nav-external { color: var(--muted) !important; }

/* --- Layout: contenido + sidebar ----------------------------------- */
.layout { padding-top: 1.5rem; padding-bottom: 2rem; }
.layout.has-sidebar {
  display: grid; grid-template-columns: 1fr 300px; gap: 2rem; align-items: start;
}
.layout.full-width { display: block; }
.content { min-width: 0; }

.sidebar { position: sticky; top: 1rem; }
.widget {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
}
.widget-title {
  margin: 0 0 .6rem; font-size: 1.05rem; color: var(--primary-dark);
  border-bottom: 2px solid var(--primary-light); padding-bottom: .4rem;
}
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: .4rem 0; border-bottom: 1px dashed var(--border);
}
.cat-list li:last-child { border-bottom: 0; }
.cat-count {
  background: var(--primary-light); color: var(--primary-dark);
  border-radius: 20px; padding: .05rem .55rem; font-size: .8rem; font-weight: 700;
}

/* --- Títulos / breadcrumb ------------------------------------------- */
.page-title { margin: .2rem 0 1rem; color: var(--primary-dark); }
.page-sub { color: var(--muted); margin-top: -.6rem; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: .8rem; }
.breadcrumb a { color: var(--primary); }
.breadcrumb span { margin: 0 .35rem; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  border-bottom: 2px solid var(--primary); margin: 2rem 0 1rem;
}
.section-head h2 { margin: 0 0 .4rem; color: var(--primary-dark); font-size: 1.4rem; }
.ver-mas { font-weight: 600; font-size: .9rem; }

/* --- Grillas / tarjetas -------------------------------------------- */
.grid { display: grid; gap: 1.2rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,.1); }
.card-media { display: block; aspect-ratio: 16/9; background: var(--primary-light); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media-empty {
  display: flex; align-items: center; justify-content: center; height: 100%;
  color: var(--primary); font-weight: 700; opacity: .5;
}
.card-body { padding: .9rem 1rem 1.1rem; }
.card-cat {
  display: inline-block; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .04em; color: var(--accent); font-weight: 700; margin-bottom: .3rem;
}
.card-title { margin: 0 0 .4rem; font-size: 1.08rem; line-height: 1.35; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--primary); }
.card-meta { color: var(--muted); font-size: .8rem; margin: 0 0 .5rem; }
.card-excerpt { color: var(--muted); font-size: .9rem; margin: 0; }

/* --- Carrusel de destacadas ---------------------------------------- */
.carousel {
  position: relative; border-radius: var(--radius); overflow: hidden;
  margin-bottom: 1.5rem; box-shadow: var(--shadow); background: #000;
}
.carousel-track { position: relative; height: 420px; }
.slide {
  position: absolute; inset: 0; opacity: 0; visibility: hidden;
  transition: opacity .6s ease;
}
.slide.is-active { opacity: 1; visibility: visible; }
.slide a { display: block; height: 100%; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide .card-media-empty { height: 100%; background: var(--primary); color: #fff; }
.slide-caption {
  position: absolute; inset: auto 0 0 0; padding: 1.6rem 1.8rem;
  background: linear-gradient(transparent, rgba(0,0,0,.85)); color: #fff;
}
.slide-caption h2 { margin: .4rem 0 .3rem; font-size: 1.8rem; line-height: 1.2; }
.slide-caption p { margin: 0; max-width: 60ch; opacity: .9; font-size: .95rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.badge {
  display: inline-block; background: var(--accent); color: #fff;
  font-size: .72rem; padding: .15rem .6rem; border-radius: 4px;
  text-transform: uppercase; font-weight: 700; letter-spacing: .03em;
}
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,.4); color: #fff; border: 0; width: 44px; height: 44px;
  font-size: 1.8rem; line-height: 1; cursor: pointer; border-radius: 50%;
  transition: background .2s; z-index: 2;
}
.carousel-btn:hover { background: var(--primary); }
.carousel-btn.prev { left: 1rem; }
.carousel-btn.next { right: 1rem; }
.carousel-dots {
  position: absolute; bottom: .8rem; left: 0; right: 0; z-index: 2;
  display: flex; gap: .4rem; justify-content: center;
}
.carousel-dots .dot {
  width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff;
  background: transparent; cursor: pointer; padding: 0;
}
.carousel-dots .dot.is-active { background: #fff; }
@media (max-width: 640px) {
  .carousel-track { height: 280px; }
  .slide-caption h2 { font-size: 1.2rem; }
  .slide-caption p { display: none; }
}

/* --- Home: destacadas (slider grid) -------------------------------- */
.featured { margin: 1.6rem 0 .4rem; }
.feat-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1rem; }
.feat-big, .feat-card { position: relative; border-radius: 4px; overflow: hidden;
  background: var(--primary-light); }
.feat-big { min-height: 380px; }
.feat-small { display: grid; grid-template-rows: 1fr 1fr; gap: 1rem; }
.feat-card { min-height: 182px; }
.feat-big img, .feat-card img { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; }
.feat-empty { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; color: var(--primary); font-weight: 700; opacity: .5; }
.feat-cap { position: absolute; inset: auto 0 0 0; padding: 1rem; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.8)); z-index: 1; }
.feat-big .feat-cap { padding: 1.5rem; }
.feat-cap h2 { margin: .5rem 0 .3rem; font-size: 1.4rem; line-height: 1.25; color: #fff; }
.feat-cap h3 { margin: .4rem 0 0; font-size: 1rem; line-height: 1.3; color: #fff; }
.feat-cap time { font-size: .72rem; color: #dfe2e7; }

/* Etiqueta de categoría (roja por defecto, azul variante) */
.cat-label { display: inline-block; background: var(--red); color: #fff; font-size: .66rem;
  font-weight: 700; padding: .22rem .55rem; text-transform: uppercase; letter-spacing: .04em;
  border-radius: 2px; }
.cat-label:hover { color: #fff; text-decoration: none; }
.cat-label.blue { background: var(--primary); }
/* Badge de categoría posicionado arriba a la derecha (destacadas), para no
   pisar el título que va abajo. */
.feat-tag { position: absolute; top: .7rem; right: .7rem; z-index: 2; }

/* --- Home: bloque de sección (título tipo Newser) ------------------ */
.block { margin-top: 2.2rem; }
.block-head { border-bottom: 2px solid var(--red); margin-bottom: 1.1rem;
  display: flex; align-items: flex-end; justify-content: space-between; }
.block-head h2 { display: inline-block; margin: 0; background: var(--red); color: #fff;
  font-size: .95rem; text-transform: uppercase; letter-spacing: .04em;
  padding: .45rem .9rem; border-radius: 3px 3px 0 0; }
.block-head.blue { border-bottom-color: var(--primary); }
.block-head.blue h2 { background: var(--primary); }
.block-head .ver-mas { padding-bottom: .4rem; }

/* 3 columnas por categoría */
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; }
.col-lead { display: block; }
.col-lead .col-media { display: block; aspect-ratio: 16/9; border-radius: 4px;
  overflow: hidden; background: var(--primary-light); }
.col-lead .col-media img { width: 100%; height: 100%; object-fit: cover; }
.col-lead h3 { font-size: 1.05rem; margin: .55rem 0 .2rem; line-height: 1.3; color: var(--text); }
.col-lead:hover h3 { color: var(--primary); }
.col-lead time { font-size: .72rem; color: var(--muted); }
.col-list { list-style: none; margin: 1rem 0 0; padding: 0; border-top: 1px solid var(--border); }
.col-list li { padding: .7rem 0; border-bottom: 1px solid var(--border); }
.col-list li:last-child { border-bottom: 0; }
.col-list a { font-weight: 600; font-size: .9rem; line-height: 1.3; color: var(--text); }
.col-list a:hover { color: var(--primary); }
.col-list time { display: block; font-size: .7rem; color: var(--muted); margin-top: .2rem; }

/* Post simple (grilla "Todas las noticias", sin caja) */
.post-simple .post-media { display: block; aspect-ratio: 16/9; border-radius: 4px;
  overflow: hidden; background: var(--primary-light); }
.post-simple .post-media img { width: 100%; height: 100%; object-fit: cover; }
.post-simple .post-cat { color: var(--red); font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; margin-top: .6rem; display: inline-block; }
.post-simple h3 { font-size: 1.02rem; margin: .3rem 0 .25rem; line-height: 1.3; }
.post-simple h3 a { color: var(--text); }
.post-simple h3 a:hover { color: var(--primary); }
.post-simple time { font-size: .72rem; color: var(--muted); }

/* --- Single post ---------------------------------------------------- */
.single { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.single-head h1 { margin: .2rem 0 .5rem; color: var(--primary-dark); }
.single-meta { color: var(--muted); font-size: .9rem; }
.single-cats { margin: .5rem 0; }
.chip, .chip-sm {
  display: inline-block; background: var(--primary-light); color: var(--primary-dark);
  padding: .15rem .6rem; border-radius: 20px; font-size: .8rem; margin: 0 .3rem .3rem 0;
}
.single-featured { margin: 1.2rem 0; }
.single-featured img { width: 100%; border-radius: var(--radius); }
.single-body { font-size: 1.05rem; }
.single-body h2, .single-body h3 { color: var(--primary-dark); }
.single-body img { border-radius: var(--radius); margin: 1rem 0; }
.single-body iframe { max-width: 100%; border: 0; border-radius: var(--radius); }
.single-body table { border-collapse: collapse; width: 100%; }
.single-body th, .single-body td { border: 1px solid var(--border); padding: .5rem; }
.single-body blockquote {
  border-left: 4px solid var(--primary); margin: 1rem 0; padding: .5rem 1rem;
  background: var(--primary-light); color: var(--primary-dark);
}

/* --- Compartir ------------------------------------------------------ */
.share { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.share-label { font-weight: 700; color: var(--muted); }
.share-btn { color: #fff; padding: .4rem .8rem; border-radius: 4px; font-size: .85rem; font-weight: 600; }
.share-btn:hover { text-decoration: none; opacity: .9; }
.share-fb { background: #1877f2; }
.share-tw { background: #111; }
.share-in { background: #0a66c2; }
.share-wa { background: #25d366; }

/* --- Comentarios ---------------------------------------------------- */
.comentarios { background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; margin-top: 1.5rem; box-shadow: var(--shadow); }
.comentario-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.comentario { border-bottom: 1px solid var(--border); padding: .8rem 0; }
.comentario-head { display: flex; justify-content: space-between; }
.comentario-fecha { color: var(--muted); font-size: .8rem; }
.comentario-form { background: var(--bg); padding: 1.2rem; border-radius: var(--radius); }
.form-note { color: var(--muted); font-size: .85rem; }
.hp { position: absolute; left: -5000px; }

/* --- Paginación ----------------------------------------------------- */
.pagination { display: flex; justify-content: center; align-items: center; gap: 1rem;
  margin: 2rem 0; }
.pagination a { background: var(--primary); color: #fff; padding: .5rem 1rem; border-radius: 4px; }
.pagination a:hover { background: var(--primary-dark); text-decoration: none; }
.pag-info { color: var(--muted); }

/* --- Formularios / botones ----------------------------------------- */
input, textarea, select {
  width: 100%; padding: .55rem .7rem; border: 1px solid var(--border);
  border-radius: 6px; font: inherit; background: #fff; color: var(--text);
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--primary-light); border-color: var(--primary);
}
label { display: block; margin-bottom: .8rem; font-weight: 600; font-size: .92rem; }
label input, label textarea, label select { margin-top: .25rem; font-weight: 400; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.btn {
  display: inline-block; background: #fff; color: var(--primary-dark);
  border: 1px solid var(--primary); padding: .5rem 1.1rem; border-radius: 6px;
  font-weight: 600; cursor: pointer; font-size: .95rem;
}
.btn:hover { background: var(--primary-light); text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-block { width: 100%; }

.login-wrap { max-width: 380px; margin: 2rem auto; background: var(--surface);
  padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow); }

/* --- Flashes -------------------------------------------------------- */
.flashes { margin-bottom: 1rem; }
.flash { padding: .7rem 1rem; border-radius: 6px; margin-bottom: .5rem; font-size: .92rem; }
.flash-error { background: #fdecea; color: #b71c1c; border: 1px solid #f5c6cb; }
.flash-info { background: #e8f5e9; color: #1b5e20; border: 1px solid #c8e6c9; }

.empty { color: var(--muted); padding: 1rem 0; }

/* --- Footer (oscuro) ------------------------------------------------ */
.site-footer { background: var(--footer); color: rgba(255,255,255,.6); margin-top: 2.6rem; }
.footer-inner { padding: 2.4rem 1rem 1rem; display: grid; grid-template-columns: 2fr 1fr;
  gap: 1.5rem; align-items: start; }
.footer-logo { max-height: 56px; margin-bottom: .6rem; }
.footer-brand strong { color: #fff; display: block; margin-bottom: .4rem; }
.footer-brand p { margin: 0; max-width: 52ch; }
.footer-social b { color: #fff; display: block; text-transform: uppercase;
  letter-spacing: .08em; font-size: .8rem; margin-bottom: .7rem; }
.footer-social .dots { display: flex; gap: .5rem; margin-bottom: .6rem; }
.footer-social .dot { width: 24px; height: 24px; border-radius: 50%; display: block; }
.footer-social .dot.tw { background: #1da1f2; }
.footer-social .dot.ig { background: #f12b63; }
.footer-social a { color: #fff; }
.footer-copy { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 1rem; margin: 1rem 0 0; font-size: .8rem; text-align: center; opacity: .85; }
.footer-widgets { grid-column: 1 / -1; display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem;
  margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.12); }
.footer-widget b { color: #fff; display: block; text-transform: uppercase;
  letter-spacing: .06em; font-size: .8rem; margin-bottom: .6rem; }
.footer-widget .widget-html, .footer-widget .widget-html a { color: rgba(255,255,255,.7); }
.footer-widget .widget-html a:hover { color: #fff; }

/* Contenido HTML de un widget (sanitizado) */
.widget-html { font-size: .9rem; line-height: 1.55; }
.widget-html :first-child { margin-top: 0; }
.widget-html :last-child { margin-bottom: 0; }
.widget-html img { border-radius: 4px; }
.widget-html iframe { max-width: 100%; border: 0; }

/* --- Responsive ----------------------------------------------------- */
@media (max-width: 900px) {
  .layout.has-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .cols3 { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .feat-grid { grid-template-columns: 1fr; }
  .feat-big { min-height: 260px; }
}
@media (max-width: 640px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; }
  body.nav-open .main-nav { display: block; }
  .main-nav ul { flex-direction: column; }
  .main-nav a { border-bottom: 1px solid var(--border); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .topbar-ticker { display: none; }

  /* Header / logo en mobile */
  .header-inner { padding: .7rem 1rem; }
  .brand-logo { max-height: 42px; }

  /* Destacadas más compactas y legibles en mobile */
  .feat-big, .feat-card { min-height: 200px; }
  .feat-big .feat-cap { padding: 1rem; }
  .feat-cap h2 { font-size: 1.15rem; }
  .feat-cap h3 { font-size: .95rem; }

  /* Bloques por categoría: el título no se corta */
  .block-head h2 { font-size: .85rem; padding: .4rem .7rem; }
  .container.featured, .featured { margin-top: 1rem; }
}
