/* Reset y estilos base */
*{
     box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
        height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
}
.cabecera-search-head {
            display: flex;
            max-height: 350px;
            /* align-items: center; */
            background: #f0f0f0;
            gap: 2rem;
            padding: 2rem;
            /* max-width: 1200px; */
            margin: 0;
            height: 100%;
        }
.search-modal-container {
    width: 100%;
    max-width: 100%;
    height: 100%;
    background: white;
    border-radius: 1px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.search-modal-header {
    padding: 1rem;
    background-color: #a81729;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-modal-close {
   background: rgba(255, 255, 255, 0.2);
        border: none;
        color: white;
        font-size: 24px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.3s ease;
}

.search-modal-content {
    flex-grow: 1;
}
body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background: #fff;
  color: #333;
  text-decoration: none;
  line-height: 1.6;
}
body a{
    text-decoration: none;
}
.pagination-controls-php{
    padding: 0.9em;
}

/* Estilos para comentarios */
.alert {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.comment-form button:hover {
    background: #2980b9 !important;
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

.comment-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15) !important;
    transition: all 0.3s ease;
}


/* Estilos para la paginación */
        .posts-per-page-selector {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 20px;
            padding: 15px;
            background: #f8f9fa;
            border-radius: 8px;
            border: 1px solid #e9ecef;
        }

        .posts-per-page-selector label {
            font-weight: 600;
            color: #495057;
        }

        .posts-per-page-select {
            padding: 8px 12px;
            border: 1px solid #ced4da;
            border-radius: 4px;
            background: white;
            font-size: 14px;
            cursor: pointer;
        }

        .pagination-controls {
            margin-top: 30px;
            padding: 20px;
            background: #f8f9fa;
            border-radius: 10px;
            border: 1px solid #e9ecef;
        }

        .pagination-info {
            text-align: center;
            margin-bottom: 20px;
            color: #6c757d;
        }

        .pagination-info span {
            display: block;
            margin-bottom: 5px;
        }

        .posts-count {
            font-size: 0.9em;
            color: #868e96;
        }

        .pagination-buttons {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
                padding: 1.9em;
                border-top: 1px solid #e7e7e7;
            margin-bottom: 10px;
    margin-top: 20px;
            
        }

        .btn-pagination {
            padding: 8px 16px;
            background: #fff;
            border: 1px solid #dee2e6;
            border-radius: 6px;
            color: #495057;
            text-decoration: none;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.2s ease;
            min-width: 40px;
            text-align: center;
        }

        .btn-pagination:hover {
            background: #e9ecef;
            border-color: #adb5bd;
            transform: translateY(-1px);
        }

        .btn-pagination.active {
            background: #007bff;
            color: white;
            border-color: #007bff;
            font-weight: 600;
        }

        .btn-pagination:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .pagination-dots {
            padding: 8px 4px;
            color: #6c757d;
            font-weight: bold;
        }

        .pagination-jump {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 10px;
            padding-top: 15px;
            border-top: 1px solid #dee2e6;
        }

        .page-input {
            padding: 8px 12px;
            border: 1px solid #ced4da;
            border-radius: 4px;
            width: 120px;
            text-align: center;
            font-size: 14px;
        }

        .btn-jump {
            padding: 8px 16px;
            background: #28a745;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            transition: background 0.2s ease;
        }

        .btn-jump:hover {
            background: #218838;
        }

        @keyframes loading {
            0% {
                background-position: 200% 0;
            }
            100% {
                background-position: -200% 0;
            }
        }

        .error {
            text-align: center;
            padding: 40px;
            color: #dc3545;
            background: #f8d7da;
            border-radius: 8px;
            margin: 20px 0;
        }


/* Header */
/*header {*/
/*  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
/*  color: white;*/
/*  padding: 2rem 1rem;*/
/*  text-align: center;*/
/*  box-shadow: 0 2px 10px rgba(0,0,0,0.1);*/
/*}*/


/*card de destacados con chatgpt*/
header-destacado h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.grid-container-destacado {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  grid-auto-rows: 300px;
}


.header-middle a{
    color:#fff;
}
.breadcrumbs-categorias{
    display: flex; 
    justify-content: space-between; 
    padding: 1rem; 
    gap: 20px;
}
.card-destacado {
  position: relative;
  background-size: cover;
  background-position: center;
  /*border-radius: 10px;*/
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  color: white;
  transition: transform 0.3s ease;
    text-align: justify;
}

.contenedor {
  max-width: 100%;
  width: 100%;
  margin: auto;
  padding: 10px;
  box-sizing: border-box;
}


.card-destacado::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  z-index: 0;
}

.content-destacado {
  position: relative;
  z-index: 1;
}

.content-destacado h2 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}


.tag-destacado {
  background-color: crimson;
  padding: 5px 10px;
  font-size: 0.75rem;
  border-radius: 5px;
  font-weight: bold;
}

.grande-destacado {
  grid-column: span 2;
  grid-row: span 2;
}



/* cards de destacados con chagpts*/




/* Navegación */
/*nav {
  /*background: rgba(44, 44, 44, 0.95);*/
  /*padding: 0.8rem;
  /*display: flex;
  /*justify-content: center;
  /*gap: 2rem;
  /*backdrop-filter: blur(10px);
/*}*/

nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  transition: all 0.3s ease;
}

nav a:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-2px);
}

/* Layout principal */
/*.container {
 /* display: flex;
 /* flex-direction: row;
  /*padding: 2rem;
  /*gap: 2rem;
  /*max-width: 1200px;
 /* margin: 0 auto;
/*}*/

main {
  flex: 3;
  padding: 0;
  background: #fff;
}

#posts {
  padding: 0.1rem;
  max-width: 1000px;
  margin: 0 auto;
}

/* Sidebar */
.sidebar {
  flex: 1;
  position: static;
  top: 2rem;
  /*height: fit-content;*/
  /*background: white;*/
  /*padding: 1.5rem;*/
  border-radius: 15px;
  /*box-shadow: 0 8px 25px rgba(0,0,0,0.1);*/
  /*border: 1px solid rgba(255,255,255,0.2);*/
}

/* Cards de posts */
.card {
  background: white;
  border-radius: 5px;
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
  overflow: hidden;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(255,255,255,0.2);
}

/*.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}*/


.horizontal-scroll-container {
            display: flex;
            justify-content: space-between;
            flex-wrap: nowrap;
            gap: 0.2rem;
            padding: 0.2rem;
            max-width: 100%;
                background-color: #e9e9e9;
        }

        .card-article-destacadoshead {
            flex: 1 1 calc(33.33% - 1rem);
            /*background: #fff;*/
            border-radius: 2px;
            overflow: hidden;
            display: flex;
            align-items: center;
            padding: 0.2rem;
            /*box-shadow: 0 4px 12px rgba(0,0,0,0.1);*/
            min-width: 0; /* Importante para el text overflow */
            transition: transform 0.2s ease, box-shadow 0.2s ease;
        }

        .card-article-destacadoshead:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(0,0,0,0.15);
        }

        /* Contenedor de imagen y texto */
        .card-article-inner {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            width: 100%;
            min-width: 0; /* Importante */
        }

        /* Enlaces */
        .post-link-img, .post-link-text, .post-link {
         display: flex;
        align-items: center;
        text-decoration: none;
        padding: 0.2rem;
        border-radius: 4px;
        border: 1px solid #c5c5c5;
        color: #c90f0f;
        /* width: 110px; */
        justify-content: center;
        }
        .post-link:hover{
            color: #fff;
            background:#c90f0f;
            transition: all 0.3s ease;
        }

        /* Imagen */
        .card-img-destacadoshead {
            width: 50px;
            height: 50px;
            border-radius: 50%;
            object-fit: cover;
            flex-shrink: 0; /* No se reduce */
        }

        /* Contenedor del texto */
        .card-body-destacadoshead {
            flex: 1;
            min-width: 0; /* Permite que el texto se ajuste */
            overflow: hidden;
        }

        /* Título con texto que se ajusta en múltiples líneas */
        .card-title-destacadoshead {
            font-size: 0.85rem;
            font-weight: 500;
            line-height: 1.3;
            margin: 0;
            color: #333;
            /* Limitar a 2 líneas máximo */
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            text-overflow: ellipsis;
        }



        /* Botón genérico */
        .btn-destacados-head {
            background: transparent;
            border: none;
            padding: 0;
            cursor: pointer;
            text-decoration: none;
        }


.imagen-derecha .card-article{
    background: #fff;
    border-radius: 15px 15px 0 0;
    padding: 0.4rem;
}
.card-article .card-img {
  width: 100%;
  height: 350px;
  /*object-fit: cover;*/
  transition: transform 0.3s ease;
}

.card:hover .card-img {
  transform: scale(1.05);
}

.card-body {
  padding: 2rem;
}

.card-title {
  font-size: 1.5rem;
  margin: 0 0 0.8rem;
  font-weight: 600;
  color: #2c3e50;
  line-height: 1.3;
  text-decoration: none;
}

.card-date {
  font-size: 0.9rem;
  color: #7f8c8d;
  margin-bottom: 1rem;
  font-weight: 500;
}

.card-excerpt {
  color: #444;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}
.card-excerpt a{
    color: #444;
}
.article-excerpt a{
     color: #444;
}
.card-excerpt p {
  margin: 0;
}


/* Footer */
footer {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 2rem;
  text-align: center;
  /*margin-top: 3rem;*/
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

footer p {
  margin: 0;
  font-size: 1rem;
}

/* Posts destacados y populares */
.destacado img,
.popular-article img {
  height: 200px;
  object-fit: cover;
  width: 100%;
  border-radius: 10px;
  transition: transform 0.3s ease;
}

.destacado:hover img,
.popular-article:hover img {
  transform: scale(1.05);
}

/* Estados de carga y error */
.loading {
  text-align: center;
  padding: 3rem;
  font-size: 1.2rem;
  color: #7f8c8d;
}

.error {
  text-align: center;
  padding: 3rem;
  color: #e74c3c;
  font-size: 1.2rem;
}


/* Estilos para el grid de destacados */
.contenedor {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 20px;
}

.grid-container-destacado {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 200px);
  gap: 5px;
  margin-bottom: 2rem;
}

.card-destacado {
  background-size: cover;
  background-position: center;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.card-destacado:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

/* Posicionamiento específico para cada tarjeta */
.card-destacado:nth-child(1) {
  grid-column: 1 / 2;
  grid-row: 1 / 2;
}

.card-destacado:nth-child(2) {
  grid-column: 2 / 4;
  grid-row: 1 / 3;
}

.card-destacado:nth-child(3) {
  grid-column: 4 / 5;
  grid-row: 1 / 3;
}

.card-destacado:nth-child(4) {
  grid-column: 1 / 2;
  grid-row: 2 / 4;
}

.card-destacado:nth-child(5) {
  grid-column: 2 / 5;
  grid-row: 3 / 4;
}

/* Overlay oscuro para mejorar legibilidad */
.card-destacado::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.3) 0%,
    rgba(0,0,0,0.1) 50%,
    rgba(0,0,0,0.8) 100%
  );
  z-index: 1;
}

.tags-destacado {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-destacado {
  background: rgba(196, 30, 58, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-destacado.rojo {
  background: rgba(196, 30, 58, 0.9);
}

.content-destacado {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px;
  z-index: 2;
  color: white;
}

.content-destacado h2 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 8px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.content-destacado p {
  font-size: 0.8rem;
  opacity: 0.9;
  margin: 0;
}

/* Tarjeta grande */
.grande-destacado .content-destacado h2 {
  font-size: 1.4rem;
  line-height: 1.2;
}

.grande-destacado .content-destacado {
  padding: 20px;
}



    
    /* Header Styles */
    .header-top {
      background: #1a1a1a;
      color: #fff;
      padding: 8px 0;
      font-size: 12px;
    }
    
    .header-top .container {
      max-width: 1200px;
      margin: 0 auto;
      padding: 0 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    
    .header-top a {
      color: #fff;
      text-decoration: none;
      margin-right: 15px;
    }
    
    .header-middle {
      background: #c41e3a;
      color: white;
      padding: 20px 0;
      text-align: center;
    }
    
    .header-middle h1 {
      font-size: 3rem;
      font-weight: 700;
      margin: 0;
    }
    
    .header-middle .tagline {
      font-size: 1rem;
      opacity: 0.9;
      margin-top: 5px;
    }
    
    
    /*estilos menu responsive */
   .header-bottom {
            background: #a81729;
            padding: 10px 0;
            position: relative;
        }
        
        .header-bottom .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
         .header-bottom-2 {
            background: #830010;
            padding: 2px 0;
            margin-bottom: 1px;
            position: relative;
        }
        
        .header-bottom-2 .container-2 {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .social-links a {
            color: white;
            margin-right: 15px;
            text-decoration: none;
            font-size: 18px;
            gap: 0.5em;
        }
        
        .main-menu {
            display: flex;
            gap: 2px;
        }
        
        .main-menu a {
            color: white;
            text-decoration: none;
            padding: 8px 5px;
            border-radius: 2px;
            transition: background 0.3s;
        }
        
        .main-menu a:hover {
            background: rgba(255,255,255,0.1);
        }
        
        .language-selector {
            color: white;
            background: rgba(255,255,255,0.1);
            padding: 5px 10px;
            border-radius: 4px;
            text-decoration: none;
        }
         .language-selector a {
            color: white;
            text-decoration: none;
        }


        /* Botón hamburguesa */
        .menu-toggle {
            display: none;
            background: none;
            border: none;
            color: white;
            font-size: 24px;
            cursor: pointer;
            padding: 5px;
        }

        /* Menú móvil tipo "off canvas hacia abajo" */
        .mobile-menu {
            overflow: hidden;
            height: 0;
            transition: height 0.4s ease;
            background: #a81729;
             z-index: 1001; /* MÁS que el overlay */
        }
        
        /* Al activarse, se expande dinámicamente con JS */
        .mobile-menu.active {
            /* height será seteado dinámicamente en JS */
        }
        
        .mobile-menu-content {
            padding: 20px;
            overflow-y: auto;
        
        }
        
        .mobile-menu .main-menu {
            display: flex;
            flex-direction: column;
            gap: 0;
            margin-bottom: 20px;
        }
        
        .mobile-menu .main-menu a {
            display: block;
            padding: 5px 10px 5px 10px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
            color: white;
            text-decoration: none;
            width: -webkit-fill-available;
        }
        
        .mobile-menu .main-menu a:last-child {
            border-bottom: none;
        }
        
        .mobile-menu .social-links {
            margin-bottom: 20px;
            padding-bottom: 20px;
            border-bottom: 1px solid rgba(255,255,255,0.1);
        }
        
        .cerrar {
            background: none;
            border: none;
            font-size: 24px;
            color: white;
            top: 15px;
            right: 15px;
            cursor: pointer;
            padding: 8px;
            border-radius: 50%;
            transition: background 0.3s ease;
        }
        
        .cerrar:hover {
            background: rgba(255,255,255,0.1);
        }
        .mobile-menu .language-selector {
            display: inline-block;
        }



        /* Estilos adicionales para demo */
        .container {
            max-width: 1300px;
            margin: 0 auto;
            padding: 0 20px;
        }
        
        .main-content {
            display: grid;
            grid-template-columns: 1fr 300px;
            gap: 10px;
            margin-top: 20px;
        }

    
    /* Featured Articles - Top 3 */
    .featured-top {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 20px;
      margin-bottom: 30px;
    }
    
    .featured-article {
      background: white;
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 2px 10px rgba(0,0,0,0.1);
      transition: transform 0.3s;
    }
    
    .featured-article:hover {
      transform: translateY(-5px);
    }
    
    .featured-article img {
      width: 100%;
      height: 200px;
      object-fit: cover;
    }
    
    .featured-article .content {
      padding: 15px;
    }
    
    .featured-article h3 {
      font-size: 1.1rem;
      margin-bottom: 10px;
      color: #333;
    }
    
    .featured-article .meta {
      font-size: 0.85rem;
      color: #666;
      margin-bottom: 10px;
    }
    
    .featured-article .excerpt {
      font-size: 0.9rem;
      color: #666;
      line-height: 1.4;
    }
  
    /* Advertisement Section */
    .matrona-global {
      background: #f0f0f0;
      padding: 20px;
      text-align: center;
     margin: 2.3rem 0 7rem 0;
      border-radius: 0 0px 8px 8px;
    }
        /* Cabecera categorias */
    .category-header{
        /*font-size: 2rem;*/
            display: flex;
    justify-content: space-between;
    align-items: center;
    }
    .url-category{
        text-align: center;
    color: #c41e3a;
    padding: 2px;
    }
       .cabecera-categoria {
            display: flex;
            max-height: 350px;
            /* align-items: center; */
            background: #f0f0f0;
            gap: 2rem;
            padding: 2rem;
            /* max-width: 1200px; */
            margin: 0 auto 3rem;
            min-height: 600px;
        }
        .cabecera-page-categoria {
            display: flex;
            max-height: 350px;
            /* align-items: center; */
            background: #f0f0f0;
            gap: 2rem;
            padding: 2rem;
            /* max-width: 1200px; */
            margin: 0 auto 3rem;
            height: 100%;
        }

        .contenido-izquierda {
            flex: 1;
            max-width: 600px;
        }

        .category-header h1 {
            font-size: 2.5rem;
            font-weight: bold;
            color: #333;
            margin-bottom: 1rem;
            line-height: 1.2;
        }

        .category-description {
            font-size: 1.1rem;
            line-height: 1.6;
            color: #666;
            text-align: justify;
            margin-top: 0.5rem;
        }

        .imagen-derecha {
            flex: 1;
            /*max-width: 500px;*/
            /*height: 300px;*/
        }

        .imagen-derecha img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 15px;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .imagen-derecha img:hover {
            transform: translateY(-5px);
            box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
        }


      

.searchher{
    padding: 2rem;
}
.searchher2{
  padding: 1.5rem;
}
.boton-search-page{
            padding: 0.75rem 1.5rem;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
        }
        
        .form-search-page{
            padding:0.75rem; 
            width:100%; 
            max-width:400px; 
            border-radius:6px;
            border:2px solid #ddd; 
            font-size: 1rem;
        }
    /* Featured Grid - 5 articles */
    .featured-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 20px;
      margin-bottom: 40px;
    }
    
    .featured-grid h2 {
      grid-column: 1 / -1;
      color: #c41e3a;
      font-size: 2rem;
      margin-bottom: 20px;
      text-align: center;
    }
    
    /* Left Content Area */
    .left-content {
      display: flex;
      flex-direction: column;
      margin-bottom: 1rem;
      gap: 30px;
    }
    
    /* Popular Section */
    .popular-section {
      /*background: white;*/
      padding: 5px;
      border-radius: 8px;
      /*box-shadow: 0 2px 10px rgba(0,0,0,0.1);*/
    }
    
    .popular-section h3 {
      color: #c41e3a;
      font-size: 1.5rem;
      margin-bottom: 20px;
      border-bottom: 2px solid #c41e3a;
      padding-bottom: 10px;
    }
    
    .slider-container {
      position: relative;
      overflow: hidden;
    }
    
    .slider {
      display: flex;
      transition: transform 0.3s ease;
    }
    
    .slide {
      min-width: 100%;
      display: flex;
      gap: 15px;
      align-items: center;
    }
    
    .slide img {
      width: 120px;
      height: 80px;
      object-fit: cover;
      border-radius: 4px;
    }
    
    .slide-content h4 {
      font-size: 1rem;
      margin-bottom: 5px;
      color: #333;
    }
    
    .slide-content .meta {
      font-size: 0.8rem;
      color: #666;
    }
    
    /* Latest Articles */
    .latest-section {
      /*background: white;*/
      padding: 20px;
      border-radius: 8px;
      /*box-shadow: 0 2px 10px rgba(0,0,0,0.1);*/
      margin-bottom: 30px;
    }
    
    .latest-section h3 {
      color: #c41e3a;
      font-size: 1.5rem;
      margin-bottom: 20px;
      border-bottom: 2px solid #c41e3a;
      padding-bottom: 10px;
    }
    
    .latest-article {
      display: flex;
      gap: 15px;
      margin-bottom: 15px;
      padding-bottom: 15px;
      border-bottom: 1px solid #eee;
    }
    
    .latest-article:last-child {
      border-bottom: none;
      margin-bottom: 0;
      padding-bottom: 0;
    }
    
    .latest-article img {
      width: 80px;
      height: 60px;
      object-fit: cover;
      border-radius: 4px;
    }
    
    .latest-article .content h4 {
      font-size: 0.95rem;
      margin-bottom: 5px;
      color: #333;
    }
    
    .latest-article .meta {
      font-size: 0.8rem;
      color: #666;
    }
    /* Latest Articles Section - Improved Design */

.latest-section h3 {
  color: #c41e3a;
  font-size: 1.8rem;
  margin-bottom: 25px;
  border-bottom: 3px solid #c41e3a;
  padding-bottom: 12px;
  font-weight: 700;
}

/* Improved Latest Article Cards */
.latest-article {
    display: flex;
    /* gap: 20px; */
    /* margin-bottom: 20px; */
    padding: 5px;
    border-radius: 2px;
    background: #fff;
    /* box-shadow: 0 3px 15px rgba(0, 0, 0, 0.06); */
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.latest-article:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
  border-color: rgba(196, 30, 58, 0.2);
}

.latest-article:last-child {
  margin-bottom: 0;
}

/* Image styling */
.latest-article .article-image, .ancho {
    width: 470px;
    height: 264px;
    flex-shrink: 0;
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}
.latest-article .article-image img,
.latest-article img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.latest-article:hover .article-image img,
.latest-article:hover img {
  transform: scale(1.05);
}

/* Content styling */
.latest-article .article-content,
.latest-article .content {
      flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.latest-article .article-content h4,
.latest-article .content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin: 0 0 8px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.latest-article .article-content h4:hover,
.latest-article .content h4:hover {
  color: #c41e3a;
}

.latest-article .article-excerpt {
  font-size: 0.9rem;
  color: #666;
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.latest-article .article-meta,
.latest-article .meta {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 0.85rem;
  color: #888;
}

.latest-article .article-meta .date,
.latest-article .meta .date {
  display: flex;
  align-items: center;
  gap: 5px;
}

.latest-article .article-meta .category,
.latest-article .meta .category {
  background: linear-gradient(135deg, #c41e3a, #a81729);
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.latest-article .article-meta .read-time,
.latest-article .meta .read-time {
  display: flex;
  align-items: center;
  gap: 5px;
}
.category .badge-home{
    /* background: rgba(196, 30, 58, 0.9); */
    color: #cf4f4f;
    /* padding: 4px 8px; */
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 0.5px;
}


/* Loading skeleton - Updated */
.latest-article.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 12px;
  height: 130px;
  margin-bottom: 20px;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

    /* Sidebar */
    .sidebar {
      display: flex;
      flex-direction: column;
      gap: 20px;
    }
    
    .search-box {
      /*background: white;*/
      padding: 20px;
      border-radius: 8px;
     /* box-shadow: 0 2px 10px rgba(0,0,0,0.1);*/
    }
    
    .search-box h4, .sidebar-daa h4 {
    color: #c41e3a;
    font-size: 1rem;
    margin-bottom: 20px;
    border-bottom: 2px solid #c41e3a;
    padding-bottom: 10px;
    }
    
    .search-box input {
      width: 100%;
      padding: 10px;
      border: 1px solid #ddd;
      border-radius: 4px;
      font-size: 14px;
    }
    
    .search-box button {
      width: 100%;
      padding: 10px;
      background: #c41e3a;
      color: white;
      border: none;
      border-radius: 4px;
      margin-top: 10px;
      cursor: pointer;
    }
    
    .sidebar-daa {
      /*background: white;*/
      padding: 20px;
      border-radius: 8px;
      /*box-shadow: 0 2px 10px rgba(0,0,0,0.1);*/
      text-align: center;
      position: sticky;
      top: 50px;
    }
    
    /* Loading Skeleton */
    .loading-skeleton {
      background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
      background-size: 200% 100%;
      animation: loading 1.5s infinite;
    }
    
    @keyframes loading {
      0% { background-position: 200% 0; }
      100% { background-position: -200% 0; }
    }
    
    /* Footer */
    footer {
      background: #1a1a1a;
      color: white;
      padding: 40px 0 20px;
      margin-top: 5rem;
    }
    
    .footer-content {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 30px;
      margin-bottom: 30px;
    }
    
    .footer-section h4 {
      color: #c41e3a;
      margin-bottom: 15px;
    }
    
    .footer-section a {
      color: #ccc;
      text-decoration: none;
    }
    
    .footer-section a:hover {
      color: #c41e3a;
    }
    
    .footer-bottom {
      text-align: center;
      padding-top: 20px;
      border-top: 1px solid #333;
      opacity: 0.7;
    }
    
    
    
    
    
    





/* Media Queries Combinados y Organizados */

/* Para pantallas medianas (laptops pequeñas o tablets en landscape) */
@media (max-width: 1200px) {
  .grid-container-destacado {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Para tablets o pantallas medianas */
@media (max-width: 1035px) {
  .main-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .featured-top {
    grid-template-columns: 1fr;
  }
  
  .featured-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  .header-bottom .container {
    flex-direction: column;
    gap: 15px;
  }
  
  .main-menu {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Para tablets */
@media (max-width: 1024px) and (min-width: 769px) {
  .card-title-destacadoshead {
    font-size: 0.8rem;
  }
}

@media (max-width: 1024px) {
  .header-bottom .container {
    padding: 0 15px;
  }
  
  .main-menu {
    gap: 1px;
  }
  
  .main-menu a {
    padding: 6px 6px;
    font-size: 14px;
  }
  
  .grid-container-destacado {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 180px);
  }
  
  .card-destacado:nth-child(1) {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
  }
  
  .card-destacado:nth-child(2) {
    grid-column: 2 / 4;
    grid-row: 1 / 3;
  }
  
  .card-destacado:nth-child(3) {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
  }
  
  .card-destacado:nth-child(4) {
    grid-column: 1 / 4;
    grid-row: 3 / 4;
  }
  
  .card-destacado:nth-child(5) {
    grid-column: 1 / 4;
    grid-row: 4 / 5;
  }
}

/* Para tablets */
@media (max-width: 968px) {
  .cabecera-categoria {
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .category-header h1 {
    font-size: 2rem;
  }

  .imagen-derecha {
    height: 250px;
  }
}

/* Para tablets o pantallas pequeñas */
@media (max-width: 900px) {
  .grid-container-destacado {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Para móviles - Media Query Principal */
@media (max-width: 768px) {
  /* Comentarios */
  .comment-form > div:first-child {
    grid-template-columns: 1fr !important;
  }
  
  .comment-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem;
  }

  /* Paginación */
  .pagination-buttons {
    gap: 4px;
  }
  
  .btn-pagination {
    padding: 6px 12px;
    font-size: 12px;
    min-width: 35px;
  }
  
  .pagination-jump {
    flex-direction: column;
    gap: 10px;
  }
  
  .page-input {
    width: 100px;
  }
  
  #posts {
    grid-template-columns: 1fr;
  }

  /* Contenedor horizontal scroll */
  .horizontal-scroll-container {
    flex-direction: column;
    gap: 0.75rem;
    display: none;
  }
  
  .card-article-destacadoshead {
    flex: none;
    width: 100%;
  }
  
  .card-title-destacadoshead {
    font-size: 0.9rem;
    -webkit-line-clamp: 3; /* Más líneas en móvil */
  }

  /* Layout principal */
  .container {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
  }
  
  /* Header */
  header h1 {
    font-size: 2rem;
  }
  
  /* Post detail */
  .post-detail {
    padding: 0.2rem 0.2rem;
    margin: 0.2rem;
  }
  
  .post-detail h2 {
    font-size: 2rem;
  }
  
  /* Cards */
  .card-body {
    padding: 1.5rem;
  }
  
  /* Navegación */
  nav {
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  #posts {
    padding: 1rem;
  }

  /* Menu toggle */
  .menu-toggle {
    display: block;
  }
  
  .header-top .span {
    display: none;
  }
  
  .header-bottom .ocult {
    display: none;
  }
  
  .header-bottom {
    padding: 5px;
  }
  
  .desktop-content {
    display: none;
  }

  .header-bottom .container {
    justify-content: space-between;
  }

  /* Social links */
  .social-links {
    display: flex;
    align-items: center;
    gap: 0.5em;
  }

  .social-links a {
    margin-right: 10px;
  }

  /* Cabecera categoría */
  .cabecera-categoria {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
    margin-bottom: 3rem;
    min-height: max-content;
    gap: 1.5rem;
  }

  .contenido-izquierda {
    max-width: 100%;
  }

  .category-header h1 {
    font-size: 1.8rem;
  }

  .category-description {
    font-size: 1rem;
    text-align: left;
  }

  .imagen-derecha {
    max-width: 100%;
    height: 200px;
  }

  /* Latest article */
  .latest-article {
    flex-direction: column;
    gap: 15px;
    padding: 5px;
  }

  .latest-article .article-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .latest-article .article-meta,
  .latest-article .meta {
    flex-wrap: wrap;
    gap: 10px;
  }

  .latest-section {
    padding: 5px 5px;
  }

  /* Mobile menu */
  #mobile-menu-toggle {
    display: block !important;
  }
  
  nav ul {
    display: none;
    width: 100%;
    flex-direction: column;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
  }
  
  nav ul.active {
    display: flex;
  }
  
  nav ul li {
    margin: 0.5rem 0;
  }
  
  header h1 {
    font-size: 2rem !important;
  }
  
  header p {
    font-size: 1.1rem !important;
  }
  
  .hero-stats {
    gap: 1.5rem !important;
  }
  
  /* Breadcrumb search */
  .breadcrumb-search {
    flex-direction: column;
    gap: 1rem;
  }
  
  .breadcrumb-search input {
    width: 100% !important;
  }

  /* Breadcrumbs categorías */
  .breadcrumbs-categorias {
    display: flex;
    padding: 1rem;
    gap: 20px;
    flex-direction: column;
  }

  /* Grande destacado - FIX IMPORTANTE */
  .grande-destacado {
    grid-column: span 1;
    grid-row: span 1;
  }
  
  .grid-container-destacado {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(5, 200px);
  }
  
  .card-destacado:nth-child(1),
  .card-destacado:nth-child(2),
  .card-destacado:nth-child(3),
  .card-destacado:nth-child(4),
  .card-destacado:nth-child(5) { 
    grid-column: 1 / 2;
  }
  
  .card-destacado:nth-child(1) { grid-row: 1 / 2; }
  .card-destacado:nth-child(2) { grid-row: 2 / 3; }
  .card-destacado:nth-child(3) { grid-row: 3 / 4; }
  .card-destacado:nth-child(4) { grid-row: 4 / 5; }
  .card-destacado:nth-child(5) { grid-row: 5 / 6; }
  
  .content-destacado h2 {
    font-size: 1.1rem;
  }
  
  .grande-destacado .content-destacado h2 {
    font-size: 1.2rem;
  }
}

/* Para pantallas muy pequeñas */
@media (max-width: 651px) {
  .boton-search-page {
    width: 100%;
  }
  
  .form-search-page {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Para móviles */
@media (max-width: 600px) {
  .grid-container-destacado {
    grid-template-columns: 1fr;
  }
  
  /* Hacemos que las tarjetas grandes ya no ocupen dos columnas */
  .grande-destacado {
    grid-column: span 1 !important;
    grid-row: span 1 !important;
  }
  
  .breadcrumbs-categorias {
    display: flex;
    padding: 1rem;
    gap: 20px;
    flex-direction: column;
  }
}

/* Para móviles - Media Query Complementario */
@media (max-width: 480px) {
  .header-bottom .container {
    padding: 0 10px;
  }
  
  .social-links a {
    margin-right: 8px;
    font-size: 16px;
    gap: 0.5em;
  }
  
  .language-selector {
    padding: 4px 8px;
    font-size: 14px;
  }
  
  /* Header */
  header h1 {
    font-size: 1.8rem;
  }
  
  .post-detail {
    padding: 0rem 0rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .card-title {
    font-size: 1.3rem;
  }

  /* Cabecera categoría */
  .cabecera-categoria {
    padding: 0.5rem;
  }

  .category-header h1 {
    font-size: 2rem;
  }
  
  .category-header {
           display: flex;
        justify-content: center;
        align-items: center;
  }
  
  .url-category {
    text-align: center;
    color: #c41e3a;
    padding: 2px;
  }

  .category-description {
    font-size: 0.9rem;
  }

  .imagen-derecha {
    height: 180px;
  }
  
  .cabecera-search-head {
    display: flex;
    max-height: 350px;
    background: #f0f0f0;
    gap: 2rem;
    padding: 2rem;
    margin: 0;
    height: 100%;
    flex-direction: column;
  }
  
  .searchher {
    padding: 1px !important;
  }
  
  .searchher2 {
    padding: 1px !important;
  }
  
  .boton-search-page {
    width: 100%;
  }

  /* Latest articles */
  .latest-section h3 {
    font-size: 1.5rem;
  }

  .latest-article .article-content h4,
  .latest-article .content h4 {
    font-size: 1rem;
  }

  .latest-article .article-excerpt {
    font-size: 0.85rem;
  }

  /* Hero stats */
  .hero-stats {
    flex-direction: column;
    gap: 1rem !important;
  }
  
  .hero-stats > div {
    padding: 1rem;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
  }
}