/* ==========================================================================
   EL COMUNERO — estilos base
   ========================================================================== */

:root{
  --rojo: #ef1d38;
  --rojo-oscuro: #cf1730;
  --azul-oscuro: #0e1b2c;
  --texto: #16202c;
  --texto-gris: #6b7684;
  --fondo-header: #eef2f6;
  --fondo-body: #ffffff;
  --borde: #e7eaee;
  --sombra: 0 2px 18px rgba(16, 24, 40, .07);
  --radio: 6px;
  --maxw: 1500px;
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  font-family: "Encode Sans Condensed", "Helvetica Neue", Arial, sans-serif;
  color: var(--texto);
  background: var(--fondo-body);
  -webkit-font-smoothing: antialiased;
}

img{ max-width: 100%; display:block; }

a{ color: inherit; text-decoration: none; }

.container{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------------------------------------------------------------- */
/* Header                                                                  */
/* ---------------------------------------------------------------------- */
.site-header{
  background: var(--fondo-header);
  padding: 22px 0;
}

.header-inner{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.site-header .logo{
  display: inline-block;
  width: 350px;
  max-width: 70vw;
  height: auto;
  aspect-ratio: 350 / 100;
  background: url('../img/logo-comunero.webp') no-repeat center center;
  background-size: contain;
  text-indent: -9999px;
  overflow: hidden;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------- */
/* Franja de título de categoría                                          */
/* ---------------------------------------------------------------------- */
.page-title-bar{
  background: var(--fondo-header);
  padding: 28px 0;
  border-bottom: 1px solid var(--borde);
}
.page-title-bar h1{
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.02em;
}

/* ---------------------------------------------------------------------- */
/* Badge de categoría (etiqueta roja)                                     */
/* ---------------------------------------------------------------------- */
.cat-tag{
  display: inline-block;
  background: var(--rojo);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-style: italic;
  padding: 5px 14px 5px 18px;
  clip-path: polygon(8% 0, 100% 0, 92% 100%, 0% 100%);
  margin-bottom: 12px;
}
.cat-tag + .cat-tag{ margin-left: 4px; }
.cat-tags{ display:flex; gap:4px; margin-bottom:12px; }

/* ---------------------------------------------------------------------- */
/* Layout de dos columnas (listado + sidebar)                             */
/* ---------------------------------------------------------------------- */
.content-layout{
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 48px;
  padding: 40px 0 60px;
}

/* ---------------------------------------------------------------------- */
/* Artículo en lista (categoría)                                          */
/* ---------------------------------------------------------------------- */
.post-row{
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--borde);
}
.post-row:first-child{ padding-top: 0; }

.post-row .thumb{
  border-radius: var(--radio);
  overflow: hidden;
  aspect-ratio: 4/3;
}
.post-row .thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-row h2{
  font-size: 22px;
  line-height: 1.28;
  margin: 0 0 10px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.post-row h2 a:hover{ color: var(--rojo); }

.post-row p{
  margin: 0;
  color: var(--texto-gris);
  font-size: 15px;
  line-height: 1.5;
}

/* ---------------------------------------------------------------------- */
/* Sidebar "Lo Ultimo"                                                     */
/* ---------------------------------------------------------------------- */
.sidebar h3{
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 6px;
}
.sidebar .squiggle{
  color: var(--rojo);
  font-size: 14px;
  letter-spacing: 2px;
  margin-bottom: 18px;
  display:block;
}
.sidebar-list{
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidebar-list li{
  padding: 16px 0;
  border-bottom: 1px solid var(--borde);
  font-size: 22px;
  line-height: 1.3;
}
.sidebar-list li:first-child{ padding-top: 0; }
.sidebar-list li a:hover{ color: var(--rojo); }

/* ---------------------------------------------------------------------- */
/* Paginación                                                              */
/* ---------------------------------------------------------------------- */
.pagination{
  display:flex;
  gap: 8px;
  align-items:center;
  padding: 10px 0 30px;
}
.pagination a{
  min-width: 36px;
  height: 36px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 4px;
  background: #f2f4f7;
  font-weight: 700;
  font-size: 14px;
}
.pagination a.active{
  background: var(--rojo);
  color: #fff;
}
.pagination a.next{
  background: var(--rojo);
  color: #fff;
}

/* ---------------------------------------------------------------------- */
/* Nav principal: en desktop es una píldora centrada debajo del logo, y    */
/* se pega sola arriba al scrollear (sticky independiente de su padre).   */
/* ---------------------------------------------------------------------- */
.site-nav{
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  box-shadow: var(--sombra);
  border-radius: 40px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  display:flex;
  align-items:center;
  justify-content: center;
  padding: 14px 30px;
}
.site-nav ul{
  list-style:none;
  display:flex;
  gap: 26px;
  margin:0;
  padding:0;
  font-weight: 700;
  font-size: 23px;
}
.site-nav ul a{ white-space: nowrap; }
.site-nav ul a:hover{ color: var(--rojo); }

.nav-toggle{
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span{
  display:block;
  width: 22px;
  height: 2.5px;
  border-radius: 2px;
  background: var(--azul-oscuro);
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-7.5px) rotate(-45deg); }

/* ---------------------------------------------------------------------- */
/* Botón volver arriba                                                     */
/* ---------------------------------------------------------------------- */
.back-to-top{
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--rojo);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: var(--sombra);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.back-to-top.visible{ opacity: 1; pointer-events:auto; }

/* ---------------------------------------------------------------------- */
/* Footer                                                                  */
/* ---------------------------------------------------------------------- */
.site-footer{
  background: var(--fondo-header);
  border-top: 1px solid var(--borde);
  padding: 40px 0;
  text-align:center;
}
.site-footer img.aligncenter{
  display:inline-block;
  margin: 0 auto;
}

/* ==========================================================================
   INDEX / HOME
   ========================================================================== */

.hero-carousel{
  position: relative;
  overflow: hidden;
  background: #0b1220;
}
.hero-track{
  display:flex;
  gap: 2px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.hero-track::-webkit-scrollbar{ display:none; }
.hero-slide{
  position: relative;
  flex: 0 0 20%;
  min-width: 220px;
  aspect-ratio: 4/3;
  scroll-snap-align: start;
}
.hero-slide img{
  width:100%; height:100%; object-fit:cover;
}
.hero-slide .caption{
  position:absolute;
  left:0; right:0; bottom:0;
  padding: 16px;
  background: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,0));
  color:#fff;
  font-weight: 700;
  font-size: 30px;
  line-height: 1.2;
}
.hero-arrow{
  position:absolute;
  top:50%; transform: translateY(-50%);
  width:38px; height:38px;
  background: rgba(255,255,255,.9);
  border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer;
  z-index: 5;
  border: none;
}
.hero-arrow.prev{ left: 14px; }
.hero-arrow.next{ right: 14px; }

.section{
  padding: 40px 0 10px;
}
.section h2.section-title{
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--azul-oscuro);
  display: inline-block;
}

/* bloque destacado + lista lateral (estilo "Ciudad de Buenos Aires") */
.feature-grid{
  display:grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}
.feature-main{
  position:relative;
  border-radius: var(--radio);
  overflow:hidden;
  min-height: 380px;
  color:#fff;
}
.feature-main img{
  position:absolute; inset:0;
  width:100%; height:100%; object-fit:cover;
  z-index: 0;
}
.feature-main .overlay{
  position:relative;
  z-index:1;
  height:100%;
  display:flex;
  flex-direction: column;
  align-items:flex-start;
  justify-content:flex-end;
  padding: 24px;
  background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,.05) 60%);
}
.feature-main-title{
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -.01em;
  color: #fff;
}

.feature-side-list{
  list-style:none;
  margin:0; padding:0;
  display:flex;
  flex-direction:column;
  gap: 4px;
}
.feature-side-item{
  display:grid;
  grid-template-columns: 80px 1fr;
  gap:14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--borde);
}
.feature-side-item:last-child{ border-bottom:none; }
.feature-side-item img{
  width:100%; aspect-ratio:1/1; object-fit:cover; border-radius:4px;
}
.feature-side-item h4{
  margin:0;
  font-size: 22px;
  line-height:1.35;
  font-weight:700;
}

/* Dos grandes + 4 chicas (estilo "Argentina") */
.big-two{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 22px;
}
.big-two figure, .big-two .card{ margin:0; }
.card img{
  border-radius: var(--radio);
  aspect-ratio: 16/10;
  object-fit:cover;
  margin-bottom: 14px;
}
.card h3{
  font-size: 19px;
  line-height:1.3;
  margin: 0 0 8px;
  font-weight: 800;
}
.card p{
  color: var(--texto-gris);
  font-size: 14px;
  line-height:1.5;
  margin:0;
}

.small-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.small-grid .card img{ aspect-ratio: 4/3; margin-bottom: 10px; }
.small-grid .card h3{ font-size: 15px; }

/* Lista tipo "Política": una grande arriba + dos abajo con overlay */
.list-feature{
  display:grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--borde);
}
.list-feature img{ border-radius: var(--radio); aspect-ratio:4/3; object-fit:cover; }
.list-feature h3{ font-size: 20px; margin:0 0 8px; font-weight:800; }
.list-feature p{ color:var(--texto-gris); font-size:14px; margin:0; }

.overlay-two{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 22px 0;
}
.overlay-card{
  position:relative;
  border-radius: var(--radio);
  overflow:hidden;
  min-height: 180px;
  color:#fff;
}
.overlay-card img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.overlay-card .overlay{
  position:relative;
  height:100%;
  display:flex;
  align-items:flex-end;
  padding:18px;
  font-weight: 700;
  font-size: 16px;
  background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,.05) 65%);
}

.ad-row{
  display:flex;
  gap: 24px;
  justify-content:center;
  padding: 30px 0;
  flex-wrap: wrap;
}
.ad-row img{ border-radius: 8px; max-height: 260px; }

/* ==========================================================================
   NOTICIA INDIVIDUAL
   ========================================================================== */

.article-header{
  padding-top: 36px;
}
.article-header h1{
  font-size: 45px;
  line-height:1.2;
  font-weight: 800;
  letter-spacing:-.01em;
  margin: 0 0 24px;
}
.article-cover{
  border-radius: var(--radio);
  overflow:hidden;
  margin-bottom: 26px;
}
.article-cover img{ width:100%; }

.article-body p{
  font-size: 22px;
  line-height: 1.3;
  color: #2a3441;
  margin: 0 0 20px;
}

.article-share{
  display:flex;
  align-items:center;
  gap: 12px;
  padding: 20px 0;
  border-top: 1px solid var(--borde);
  border-bottom: 1px solid var(--borde);
  margin-bottom: 30px;
}
.share-btn{
  width: 38px; height:38px;
  border-radius:50%;
  background: #1878c9;
  color:#fff;
  display:flex; align-items:center; justify-content:center;
}

/* ---------------------------------------------------------------------- */
/* Responsive                                                              */
/* ---------------------------------------------------------------------- */
@media (max-width: 900px){
  .content-layout{ grid-template-columns: 1fr; }
  .feature-grid{ grid-template-columns: 1fr; }
  .big-two{ grid-template-columns: 1fr; }
  .small-grid{ grid-template-columns: repeat(2,1fr); }
  .list-feature{ grid-template-columns: 1fr; }
  .overlay-two{ grid-template-columns: 1fr; }
  .post-row{ grid-template-columns: 1fr; }
  .article-header h1{ font-size: 28px; }
  .feature-main-title{ font-size: 19px; }
  .page-title-bar h1{ font-size: 24px; }
  .section h2.section-title{ font-size: 19px; }

  /* Header mobile: logo chico + hamburguesa en una sola fila, sticky */
  .site-header{
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 12px 0;
    border-bottom: 1px solid var(--borde);
  }
  .header-inner{
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    position: relative;
  }
  .site-header .logo{
    width: 190px;
    max-width: 48vw;
  }

  /* Nav: hamburguesa + menú desplegable en vez de la píldora centrada */
  .site-nav{
    position: static;
    background: none;
    box-shadow: none;
    border-radius: 0;
    max-width: none;
    width: auto;
    margin: 0;
    padding: 0;
    justify-content: flex-end;
  }
  .nav-toggle{ display: flex; }
  .site-nav ul{
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--sombra);
    padding: 8px;
    font-size: 17px;
    z-index: 55;
  }
  .site-nav.abierto ul{ display: flex; }
  .site-nav ul li{ width: 100%; }
  .site-nav ul li a{
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    white-space: normal;
  }
  .site-nav ul li a:hover,
  .site-nav ul li a.activo{ background: var(--fondo-header); }
}

@media (max-width: 560px){
  .small-grid{ grid-template-columns: 1fr 1fr; }
  .site-header .logo{ width: 150px; }
  .hero-slide{ min-width: 78vw; }
  .hero-slide .caption{ font-size: 17px; padding: 12px; }
  .hero-arrow{ width: 34px; height: 34px; }
  .article-header h1{ font-size: 23px; }
  .article-body p{ font-size: 15.5px; }
  .post-row h2{ font-size: 19px; }
  .feature-side-item{ grid-template-columns: 64px 1fr; gap: 10px; }
  .btn-escuchar{ width: 100%; justify-content: center; }
  .pagination a{ min-width: 40px; height: 40px; }
  .container{ padding: 0 16px; }
}

@media (max-width: 380px){
  .site-header .logo{ width: 130px; max-width: 42vw; }
  .article-header h1{ font-size: 21px; }
  .page-title-bar h1{ font-size: 21px; }
  .card h3{ font-size: 16px; }
}

/* ---------------------------------------------------------------------- */
/* Estado activo del menú + elementos propios de la versión dinámica (PHP) */
/* ---------------------------------------------------------------------- */
.site-nav ul a.activo{ color: var(--rojo); }

.not-found{
  padding: 80px 20px;
  text-align: center;
}
.not-found h1{ font-size: 26px; margin-bottom: 12px; }
.not-found a{ color: var(--rojo); font-weight: 700; }

.empty-msg{
  padding: 40px 0;
  color: var(--texto-gris);
}
.empty-msg a{ color: var(--rojo); font-weight: 700; }

/* banners con ancho variable según la cantidad cargada */
.ad-row a{ display:block; }
.ad-row img{ width: auto; max-width: 100%; }

/* ---------------------------------------------------------------------- */
/* Banners: Bloque 1 / Bloque 2 (home) y Lateral (sidebar)                 */
/* ---------------------------------------------------------------------- */
.ad-row-bloque{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 34px 0;
}
.ad-row-bloque img{
  height: 300px;
  max-height: 300px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 6px;
}
@media (max-width: 900px){
  .ad-row-bloque img{ height: 220px; max-height: 220px; }
}
@media (max-width: 560px){
  .ad-row-bloque img{ height: 150px; max-height: 150px; }
}

.banner-sidebar{
  margin-top: 24px;
  display:flex;
  flex-direction: column;
  gap: 16px;
}
.banner-sidebar img{
  width: 100%;
  border-radius: 6px;
}

/* ---------------------------------------------------------------------- */
/* Botón "Escuchar noticia" (lectura en voz alta con el navegador)         */
/* ---------------------------------------------------------------------- */
.btn-escuchar{
  display:inline-flex;
  align-items:center;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 28px;
  padding: 10px 18px;
  border: none;
  border-radius: 30px;
  background: var(--azul-oscuro);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 20px;
  cursor: pointer;
  transition: background .15s ease;
}
.btn-escuchar:hover{ background: var(--rojo); }
.btn-escuchar.activo{ background: var(--rojo); }
.btn-escuchar .icono{ font-size: 16px; }