/* ==========================================================================
   VARIABLES Y CONFIGURACIÓN BÁSICA
   ========================================================================== */
:root {
    --red-primary: #b71c1c; 
    --red-dark: #7f0000;
    --red-light: #f05545;
    --gray-bg: #f4f6f8; 
    --text-dark: #2c3e50;
    --text-light: #606f7b;
    --white: #ffffff;
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--gray-bg);
    color: var(--text-dark);
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ==========================================================================
   HEADER UNIFICADO (Logo Izquierda, Menú Derecha)
   ========================================================================== */
.custom-header {
    background-color: var(--white);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    width: 100%;
    position: relative;
    z-index: 1000;
}

.header-unified {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

/* Logo Oficial */
.site-logo {
    max-height: 75px; /* Evita que el escudo se vea gigante */
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.site-logo:hover {
    transform: scale(1.05);
}

/* Contenedor del Menú y Botón */
.nav-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.nav-menu li a {
    color: var(--text-dark);
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    font-size: 13px;
    transition: color 0.3s;
}

.nav-menu li a:hover {
    color: var(--red-primary);
}

/* ==========================================================================
   SUBMENÚ DESPLEGABLE (Compañías)
   ========================================================================== */
.nav-menu li.has-dropdown {
    position: relative;
}

.nav-menu .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--white);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    list-style: none;
    padding: 10px 0;
    margin: 0;
    min-width: 200px;
    border-radius: 6px;
    z-index: 1001;
    border-top: 3px solid var(--red-primary);
}

.nav-menu li.has-dropdown:hover .dropdown {
    display: block;
    animation: fadeIn 0.3s ease;
}

.nav-menu .dropdown li a {
    padding: 10px 20px;
    display: block;
    text-transform: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.nav-menu .dropdown li a:hover {
    background-color: var(--gray-bg);
    color: var(--red-primary);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Botón de Intranet */
.intranet-btn {
    background-color: var(--red-primary);
    color: var(--white);
    padding: 10px 22px;
    border-radius: 6px;
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    font-size: 13px;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 4px 6px rgba(183, 28, 28, 0.2);
    white-space: nowrap;
}

.intranet-btn:hover {
    background-color: var(--red-dark);
    color: var(--white);
    transform: translateY(-2px);
}

/* ==========================================================================
   MENÚ HAMBURGUESA Y RESPONSIVO (Solo Móviles)
   ========================================================================== */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: var(--red-primary);
    padding: 5px;
}

@media (max-width: 900px) {
    .header-unified {
        flex-wrap: wrap; 
    }

    .menu-toggle {
        display: block;
    }

    /* Ocultar el menú por defecto en móviles */
    .nav-right {
        display: none;
        width: 100%;
        flex-direction: column;
        padding-top: 20px;
        border-top: 1px solid var(--border-color);
        margin-top: 15px;
        gap: 15px; /* Espaciado entre elementos en móvil */
    }

    /* Clase activa que inyecta el Javascript para abrir el menú */
    .nav-right.active {
        display: flex;
        animation: fadeIn 0.3s ease;
    }

    .nav-menu {
        flex-direction: column;
        width: 100%;
        gap: 15px;
        margin-bottom: 20px;
    }

    .nav-menu li a {
        display: block;
        padding: 10px 0;
        border-bottom: 1px solid var(--gray-bg);
    }

    /* Ajuste del submenú para móviles */
    .nav-menu .dropdown {
        position: relative;
        box-shadow: none;
        border-top: none;
        background-color: var(--gray-bg);
        padding-left: 15px;
        margin-top: 10px;
        display: none;
    }
    
    .nav-menu li.has-dropdown:hover .dropdown,
    .nav-menu li.has-dropdown:active .dropdown {
        display: block;
    }
    
    .intranet-btn {
        text-align: center;
        width: 100%;
    }
}

/* ==========================================================================
   SECCIÓN DE BLOG (Hero Grid)
   ========================================================================== */
.hero-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 250px;
    gap: 15px;
    padding: 30px 0;
}

.hero-item {
    position: relative;
    background-color: #e2e8f0; 
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.hero-item:hover img { transform: scale(1.05); }

.hero-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.hero-item.large {
    grid-column: span 2;
    grid-row: span 2;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, transparent 100%);
    color: var(--white);
    padding: 30px 20px 20px;
}

.hero-overlay h3, .hero-overlay h4 { margin-top: 8px; line-height: 1.3; }
.hero-overlay h3 { font-size: 24px; }
.hero-overlay h4 { font-size: 16px; font-weight: 600; }

.category-badge {
    background-color: var(--red-primary);
    color: white;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 5px;
}

/* ==========================================================================
   DISEÑO DEL CONTENIDO PRINCIPAL Y SIDEBAR
   ========================================================================== */
.main-content {
    display: flex;
    padding: 20px 0 60px;
    gap: 40px;
}

.sidebar-left, .sidebar-right { width: 25%; }
.feed-center { width: 50%; }

/* Widgets */
.widget {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.03);
    margin-bottom: 30px;
}

.widget-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--red-primary);
}

.widget ul { list-style: none; }
.widget ul li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 14px;
    transition: color 0.3s;
}

.widget ul li:last-child { border-bottom: none; padding-bottom: 0; }
.widget ul li:hover { color: var(--red-primary); cursor: pointer; padding-left: 5px; }

/* Buscador (Search Box) */
.search-box { 
    display: flex; 
    width: 100%;
}

.search-box input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px 0 0 6px;
    outline: none;
    font-family: 'Open Sans', sans-serif;
}

.search-box input:focus {
    border-color: var(--red-primary);
}

.search-box button {
    background-color: var(--red-primary);
    color: var(--white);
    border: none;
    padding: 0 20px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Montserrat', sans-serif;
    transition: background 0.3s;
}

.search-box button:hover {
    background-color: var(--red-dark);
}

/* ==========================================================================
   NOTICIAS (Lista Horizontal)
   ========================================================================== */
.post-card { 
    background: var(--white); 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.04); 
    margin-bottom: 20px; 
    display: flex; 
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.post-card-image-link {
    width: 35%;
    flex-shrink: 0;
    height: 190px; 
    display: block;
    overflow: hidden;
}

.post-card-image-link .post-image {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    transition: transform 0.5s ease;
}

.post-card:hover .post-image {
    transform: scale(1.05); 
}

.post-content {
    padding: 20px 25px;
    width: 65%;
    flex-grow: 1;
}

.post-card h2 { 
    font-size: 20px; 
    margin-bottom: 8px; 
    color: var(--text-dark); 
    line-height: 1.3;
}

.post-card h2 a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.3s;
}

.post-card h2 a:hover { 
    color: var(--red-primary); 
}

.post-meta {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
    font-weight: 600;
}

.post-excerpt { 
    font-size: 13px; 
    color: var(--text-light); 
    margin-bottom: 15px;
    line-height: 1.5;
}

.read-more {
    display: inline-block;
    padding: 8px 18px;
    background-color: transparent;
    color: var(--red-primary);
    border: 2px solid var(--red-primary);
    border-radius: 6px;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    text-decoration: none;
}

.read-more:hover {
    background-color: var(--red-primary);
    color: var(--white);
}

/* ==========================================================================
   ESTILOS DE PAGINACIÓN
   ========================================================================== */
.pagination {
    margin-top: 40px;
    text-align: center;
    width: 100%;
}

.pagination .nav-links {
    display: inline-flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--white);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.pagination .page-numbers:hover {
    background-color: var(--gray-bg);
    color: var(--red-primary);
    border-color: var(--red-primary);
}

.pagination .page-numbers.current {
    background-color: var(--red-primary);
    color: var(--white);
    border-color: var(--red-primary);
}

/* ==========================================================================
   ADAPTACIÓN PARA EL CONTENIDO DEL BLOG (Tablets y Móviles)
   ========================================================================== */
@media (max-width: 1024px) {
    .hero-section {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 200px;
    }
    
    .hero-item.large {
        grid-column: span 2; 
        grid-row: span 2;
    }

    .main-content {
        flex-direction: column;
        gap: 30px;
    }
    
    .sidebar-left, 
    .sidebar-right, 
    .feed-center {
        width: 100%;
    }
    
    .feed-center { order: 1; }
    .sidebar-left { order: 2; }
    .sidebar-right { order: 3; }
}

@media (max-width: 768px) {
    .hero-section {
        grid-template-columns: 1fr;
        grid-auto-rows: 250px;
    }
    
    .hero-item.large {
        grid-column: span 1;
        grid-row: span 1;
    }

    .post-card {
        flex-direction: column;
    }
    
    .post-card-image-link, .post-content {
        width: 100%;
    }
    
    .post-card-image-link {
        height: 200px;
    }
    
    .post-content {
        padding: 20px; 
    }
    
    .post-card h2 {
        font-size: 22px;
    }
    
    .post-meta {
        flex-direction: column; 
        gap: 8px;
    }
}
/* ==========================================================================
   ESTILOS DEL PIE DE PÁGINA (FOOTER)
   ========================================================================== */
.site-footer {
    background-color: #111827; /* Gris muy oscuro, casi negro */
    color: #9ca3af;
    padding-top: 60px;
    margin-top: 40px;
    border-top: 4px solid var(--red-primary);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    max-height: 80px;
    width: auto;
    margin-bottom: 20px;
    display: block;
}

.footer-title {
    color: var(--white);
    font-size: 16px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-col p {
    font-size: 14px;
    line-height: 1.8;
    margin-bottom: 10px;
}

.footer-col a {
    color: #9ca3af;
    transition: color 0.3s ease;
}

.footer-col a:hover {
    color: var(--white);
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 12px;
    font-size: 14px;
}

.footer-socials {
    display: flex;
    gap: 15px;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #1f2937;
    color: var(--white) !important;
    border-radius: 50%;
    font-weight: bold;
    font-size: 13px;
    transition: all 0.3s ease !important;
}

.social-icon:hover {
    background-color: var(--red-primary);
    transform: translateY(-3px);
}

.footer-bottom {
    background-color: #030712;
    padding: 20px 0;
    text-align: center;
    font-size: 13px;
    color: #6b7280;
}

/* Responsivo para el footer */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-logo {
        margin: 0 auto 20px;
    }

    .footer-socials {
        justify-content: center;
    }
}
/* Devolver los colores globales perdidos a Elementor */
:root {
    --ast-global-color-2: #ffffff !important; /* Fuerza los títulos dependientes a blanco */
}

/* Restaurar el filtro oscuro de los fondos de Elementor */
.elementor-background-overlay {
    background-color: #000000 !important;
    opacity: 0.65 !important; /* 65% de oscuridad sobre la foto */
}
/* ==========================================================================
   PÁGINA DE NOTICIA INDIVIDUAL (SINGLE.PHP)
   ========================================================================== */
.single-header {
    text-align: center;
    padding: 50px 20px 30px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--white);
}

.single-header-container {
    max-width: 900px;
    margin: 0 auto;
}

.single-badge {
    margin-bottom: 20px;
    font-size: 14px;
    padding: 6px 15px;
}

.single-title {
    font-size: 42px;
    margin-bottom: 20px;
    color: var(--text-dark);
    line-height: 1.2;
}

.single-meta {
    font-size: 14px;
    color: var(--text-light);
    display: flex;
    justify-content: center;
    flex-wrap: wrap; /* Permite que los datos bajen de línea si no caben */
    gap: 15px 25px;
    font-weight: 600;
}

.single-container {
    margin-top: 40px;
    margin-bottom: 60px;
}

.single-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.single-main-col {
    width: 70%;
}

.single-sidebar-col {
    width: 30%;
}

.post-detail {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
    overflow: hidden;
}

.single-featured-image {
    width: 100%;
    max-height: 450px;
    overflow: hidden;
}

.single-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.post-single-content {
    padding: 50px;
    font-size: 17px;
    line-height: 1.9;
    color: #4a5568;
}

/* Evita que las imágenes dentro del texto rompan la pantalla */
.post-single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.single-post-nav {
    display: flex;
    justify-content: space-between;
    padding: 30px 50px;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    gap: 20px;
}

.nav-prev, .nav-next {
    width: 48%;
}

.nav-next {
    text-align: right;
}

.nav-label {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-light);
    font-weight: bold;
    letter-spacing: 1px;
}

.nav-link {
    font-weight: bold;
    font-size: 15px;
    font-family: 'Montserrat', sans-serif;
}

.nav-link a {
    color: var(--text-dark);
    transition: color 0.3s;
}

.nav-link a:hover {
    color: var(--red-primary);
}

/* ==========================================================================
   ADAPTACIÓN PARA CELULARES (DISEÑO RESPONSIVO DEL SINGLE)
   ========================================================================== */
@media (max-width: 1024px) {
    /* En tablets, la noticia y el sidebar se apilan uno sobre otro al 100% */
    .single-layout {
        flex-direction: column;
    }
    .single-main-col, .single-sidebar-col {
        width: 100%;
    }
}

@media (max-width: 768px) {
    /* En celulares, achicamos los textos y márgenes internos */
    .single-title {
        font-size: 28px;
    }
    .post-single-content {
        padding: 25px; /* Menos espacio en blanco a los lados */
        font-size: 16px;
    }
    .single-post-nav {
        flex-direction: column;
        padding: 25px;
        text-align: center;
    }
    .nav-prev, .nav-next {
        width: 100%;
        text-align: center;
    }
    .single-featured-image {
        max-height: 250px; /* Imagen de portada más pequeña */
    }
}