/* ================= VARIABLES & RESET ================= */
:root {
    --bg-white: #ffffff;
    --bg-light: #f4f5f7;
    --text-dark: #111111;
    --text-muted: #555555;
    --rojo: #8A0100;
    --rojo-hover: #a00101;
    --border: #e0e0e0;
    --font-head: 'Poppins', sans-serif;
    --font-body: 'Montserrat', sans-serif;
    
    /* Alturas Fijas */
    --header-top-h: 62px;
    --header-bottom-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--bg-white);
    color: var(--text-dark);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    /* FIX: Espacio suficiente para que el header no tape el título */
    padding-top: 130px; 
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ============================================
   SMART HEADER STYLES (Fixed & Animated)
   ============================================ */
.news-header {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    background: #fff;
    transition: transform 0.3s cubic-bezier(0.215, 0.610, 0.355, 1.000);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

/* Animación: Esconde la barra blanca al bajar */
.news-header.slide-up {
    transform: translateY(-62px); 
}

/* --- Top Bar (Blanca) --- */
.header-top {
    background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    height: var(--header-top-h);
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1000;
}

.top-inner {
    width: 100%;
    display: flex;
    justify-content: flex-start; /* Logo a la izquierda */
    align-items: center;
}

.main-logo-link img {
    display: block;
    height: 28px;
    width: auto;
    /* FIX: Si no tienes el logo negro, esto invierte el blanco a negro */
    /* Si ya tienes el logo negro, borra esta línea de filter */
    /* filter: invert(1); */ 
}

/* --- Bottom Bar (Negra) --- */
.header-bottom {
    background-color: #111111;
    color: #ffffff;
    height: var(--header-bottom-h);
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1000;
}

.bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.insights-brand {
    font-family: var(--font-head);
    font-weight: 900;
    color: var(--rojo);
    font-size: 1.3rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* --- Navegación Desktop --- */
.news-nav {
    display: flex;
    gap: 40px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
}

.nav-link {
    font-weight: 600;
    font-size: 0.85rem;
    color: #ffffff;
    letter-spacing: 1px;
    opacity: 0.8;
}
.nav-link:hover { opacity: 1; color: var(--rojo); }

/* --- Idiomas Desktop --- */
.lang-switch {
    margin-left: 10px;
    display: flex;
    gap: 5px;
    color: #666;
    font-size: 0.8rem;
}
.lang-btn {
    background: none; border: none; color: #888; cursor: pointer; font-weight: 700; padding: 0;
}
.lang-btn.active { color: var(--rojo); }
.lang-btn:hover { color: #fff; }

/* ============================================
   CONTROLES MÓVILES (OCULTOS EN DESKTOP)
   ============================================ */
/* FIX: Ocultar todo lo móvil por defecto en escritorio */
.mobile-controls { display: none; }
.mobile-menu-overlay { display: none; }
.expandable-search { display: none; }

/* Buscador Desktop Fijo (dentro de la barra negra) */
.header-search-wrapper {
    display: block;
    width: 220px;
}
.header-search-wrapper form { position: relative; }
.header-search-wrapper input {
    width: 100%;
    background: #222;
    border: 1px solid #333;
    color: #fff;
    padding: 6px 35px 6px 15px;
    font-size: 0.85rem;
    border-radius: 4px;
}
.header-search-wrapper .search-btn {
    position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: #888; cursor: pointer;
}

/* ============================================
   MEDIA QUERY: VERSIÓN MÓVIL (Max 768px)
   ============================================ */
@media (max-width: 768px) {
    
    /* 1. Ocultar Elementos de Desktop */
    .news-nav.desktop-only { display: none !important; }
    .header-search-wrapper { display: none !important; }

    /* 2. Mostrar Controles Móviles */
    .mobile-controls { 
        display: flex; 
        align-items: center; 
        gap: 20px; 
    }

    /* 3. Estilos Botones Móviles */
    .icon-btn {
        background: none; border: none; color: white; cursor: pointer; padding: 5px;
    }
    
    /* Hamburguesa */
    .hamburger span {
        display: block; width: 25px; height: 2px; background: white; margin: 5px 0; transition: 0.3s;
    }
    .hamburger.active span:nth-child(1) { transform: rotate(-45deg) translate(-5px, 6px); }
    .hamburger.active span:nth-child(2) { opacity: 0; }
    .hamburger.active span:nth-child(3) { transform: rotate(45deg) translate(-5px, -6px); }

    /* 4. Menú Desplegable (Overlay) */
    .mobile-menu-overlay { 
        display: block; /* Se activa el bloque, pero escondido arriba */
        position: fixed; top: 122px; left: 0; width: 100%; 
        background: #111; padding: 30px 20px;
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        z-index: 90;
        border-bottom: 2px solid var(--rojo);
    }
    .mobile-menu-overlay.open { transform: translateY(0); }

    .mobile-nav-content { display: flex; flex-direction: column; gap: 25px; text-align: center; }
    .mobile-nav-content a { 
        color: white; font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; letter-spacing: 1px;
    }
    .mobile-lang-switch { 
        margin-top: 20px; border-top: 1px solid #333; padding-top: 20px; display: flex; justify-content: center; gap: 20px; 
    }
    .mobile-lang-switch button {
        background: transparent; border: 1px solid #444; color: #ccc; padding: 8px 16px; border-radius: 20px;
    }

    /* 5. Buscador Expandible (Overlay sobre la barra negra) */
    .expandable-search {
        display: flex;
        position: absolute;
        top: 0; left: 0; width: 100%; height: 100%;
        background: #111;
        z-index: 102;
        align-items: center; padding: 0 10px;
        transform: scaleX(0); /* Oculto comprimido */
        transform-origin: right;
        transition: transform 0.3s ease;
    }
    .expandable-search.active { transform: scaleX(1); }

    .search-form-expanded { width: 100%; display: flex; gap: 10px; }
    .search-form-expanded input {
        width: 100%; background: #222; border: none; color: white; padding: 10px 15px; border-radius: 4px;
        font-size: 16px; /* Evita zoom en iOS */
    }
    .search-confirm-btn {
        background: var(--rojo); color: white; border: none; width: 40px; border-radius: 4px;
    }
    .close-btn {
        background: none; border: none; color: #888; font-size: 1.2rem; padding: 0 10px;
    }
    
    /* Ajuste de Logo en barra negra móvil */
    .insights-brand { font-size: 1.1rem; }
}

/* =======================================================
   ESTILOS GENERALES DEL SITIO (HERO, CARDS, FOOTER...)
   ======================================================= */
/* (MANTÉN EL RESTO DE TU CSS DE CARDS, HERO, FOOTER AQUÍ ABAJO) */
/* Copia aquí los estilos de .insights-hero, .section-block, .card, .footer, etc. que ya tenías */

.insights-hero {
    padding: 60px 0 80px;
    text-align: center;
    background: linear-gradient(to bottom, #fff, var(--bg-light));
    border-bottom: 1px solid var(--border);
}
.hero-brand { font-family: var(--font-head); font-weight: 900; font-size: 1.2rem; color: var(--text-dark); margin-bottom: 30px; display: inline-block; }
.red-dot { color: var(--rojo); }
.insights-hero h1 { font-family: var(--font-head); font-size: clamp(2.5rem, 5vw, 3.8rem); font-weight: 900; line-height: 1.1; margin-bottom: 40px; color: var(--text-dark); }

/* --- Search Bar Hero --- */
.search-bar-container { max-width: 600px; margin: 0 auto; position: relative; }
.search-form { position: relative; display: flex; }
.search-form input { width: 100%; padding: 16px 55px 16px 25px; border-radius: 50px; border: 2px solid var(--border); font-family: var(--font-body); font-size: 1rem; outline: none; transition: 0.3s; background: white; }
.search-form input:focus { border-color: var(--rojo); box-shadow: 0 4px 20px rgba(138,1,0,0.1); }
.search-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; background: var(--rojo); color: white; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.3s; }
.search-btn:hover { background: var(--rojo-hover); }

/* --- Sections --- */
.main-content { padding-top: 60px; padding-bottom: 100px; }
.section-block { margin-bottom: 80px; }
.section-header { display: flex; align-items: center; gap: 20px; margin-bottom: 30px; }
.section-title { font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; color: var(--rojo); white-space: nowrap; }
.line-divider { height: 2px; background: var(--border); width: 100%; }

/* --- Grids --- */
.featured-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; }
@media (max-width: 900px) { .featured-grid { grid-template-columns: 1fr; } }
.recent-grid, .archive-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 30px; }

/* --- Cards --- */
.card { background: white; display: flex; flex-direction: column; height: 100%; border-radius: 12px; overflow: hidden; transition: transform 0.3s ease; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.card-img-wrap { height: 220px; overflow: hidden; position: relative; }
.card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover img { transform: scale(1.05); }
.tag { position: absolute; top: 15px; left: 15px; background: var(--rojo); color: white; padding: 4px 10px; font-size: 0.7rem; font-weight: 700; border-radius: 4px; text-transform: uppercase; }
.card-body { padding: 20px; display: flex; flex-direction: column; flex-grow: 1; }
.meta { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; margin-bottom: 10px; display: flex; gap: 10px; }
.author { color: var(--rojo); }
.card-title { font-family: var(--font-head); font-size: 1.3rem; font-weight: 700; line-height: 1.3; margin-bottom: 12px; color: var(--text-dark); }
.card:hover .card-title { color: var(--rojo); }
.card-excerpt { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 20px; }
.card-featured-main .card-img-wrap { height: 400px; }
.card-featured-main .card-title { font-size: 2.2rem; }

/* --- Footer --- */
.news-footer { background-color: #050505; color: #ffffff; padding: 60px 0 30px; margin-top: 100px; border-top: 4px solid var(--rojo); }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-bottom: 50px; }
.f-col h4 { font-family: var(--font-head); font-weight: 800; color: #ffffff; margin-bottom: 25px; font-size: 1rem; letter-spacing: 1px; }
.f-col ul { list-style: none; }
.f-col ul li { margin-bottom: 12px; }
.f-col ul li a { color: #888; font-size: 0.95rem; font-weight: 500; transition: color 0.3s; }
.f-col ul li a:hover { color: var(--rojo); }
.social-icons { display: flex; gap: 15px; }
.social-icons a { background: #1a1a1a; width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background 0.3s, transform 0.3s; }
.social-icons a img { width: 20px; height: 20px; filter: invert(1); }
.social-icons a:hover { background: var(--rojo); transform: translateY(-3px); }
.footer-bottom { border-top: 1px solid #222; padding-top: 30px; text-align: center; }
.footer-bottom p { color: #555; font-size: 0.85rem; }

@media (max-width: 768px) {
    .footer-grid { grid-template-columns: 1fr; text-align: center; }
    .social-icons { justify-content: center; }
    .card-featured-main .card-title { font-size: 1.5rem; }
    .card-featured-main .card-img-wrap { height: 250px; }
}

/* =======================================================
   ESTILOS RESTAURADOS (BOTONES Y GRIDS)
   ======================================================= */

/* --- Contenedor y Botón "View All" --- */
.view-all-container {
    margin-top: 50px;
    text-align: center;
    padding-bottom: 20px;
}

.btn-view-all {
    display: inline-block;
    padding: 14px 35px;
    background: transparent;
    border: 2px solid var(--text-dark); /* Borde Negro elegante */
    color: var(--text-dark);
    font-family: var(--font-head);
    font-weight: 800; /* Letra gruesa */
    font-size: 0.9rem;
    border-radius: 50px; /* Redondo estilo píldora */
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.btn-view-all:hover {
    background: var(--text-dark); /* Se llena de negro al pasar mouse */
    color: #ffffff;
    transform: translateY(-3px); /* Pequeña elevación */
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* --- Restauración de las Grids (Rejillas de noticias) --- */
.featured-grid {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Una grande, una pequeña */
    gap: 30px;
    margin-bottom: 40px;
}

.recent-grid, .archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Responsive automático */
    gap: 30px;
}

/* --- Ajuste Mobile de las Grids --- */
@media (max-width: 900px) {
    .featured-grid { 
        grid-template-columns: 1fr; /* En tablet/móvil una sola columna */
    }
}

/* --- Estilo extra para el botón de búsqueda del Footer (si lo agregaste) --- */
.footer-search-btn {
    background: var(--rojo);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 10px;
}

/* =======================================================
   FIX: VISIBILIDAD BUSCADOR DESKTOP (HEADER NEGRO)
   ======================================================= */

/* 1. Asegurar contraste del Input */
.header-search-wrapper input {
    background-color: #1a1a1a !important; /* Gris muy oscuro, no negro total */
    color: #ffffff !important;            /* Texto BLANCO puro */
    border: 1px solid #333 !important;    /* Borde sutil */
    font-weight: 500;
}

/* 2. Color del texto "fantasma" (placeholder) */
.header-search-wrapper input::placeholder {
    color: #999999 !important; /* Gris claro para que se vea */
    opacity: 1;
}

/* 3. Cuando le das clic para escribir */
.header-search-wrapper input:focus {
    background-color: #000000 !important; /* Fondo negro al escribir */
    border-color: var(--rojo) !important; /* Borde rojo Nexumbite */
    color: #ffffff !important;
    outline: none;
    box-shadow: 0 0 5px rgba(138, 1, 0, 0.5); /* Resplandor rojo suave */
}

/* 4. Asegurar que el botón de la lupa no tape el texto */
.header-search-wrapper .search-btn {
    color: #ffffff !important; /* Lupa blanca */
    z-index: 10; /* Encima del input */
    pointer-events: none; /* Dejar que el click pase al input si es necesario, o ponlo 'auto' si es botón submit */
    pointer-events: auto; 
    cursor: pointer;
}

.header-search-wrapper .search-btn:hover {
    color: var(--rojo) !important; /* Lupa roja al pasar mouse */
}

/* =========================================
   ESTILOS FALTANTES PARA EL ARTÍCULO (p1.html)
   ========================================= */

.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Encabezado del Artículo */
.article-header { margin-bottom: 40px; text-align: center; }

.breadcrumbs {
    font-size: 0.85rem; color: var(--text-muted); margin-bottom: 20px;
    font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
}
.breadcrumbs a:hover { color: var(--rojo); }

.article-title {
    font-family: var(--font-head);
    font-size: clamp(2rem, 5vw, 3rem); /* Responsivo */
    font-weight: 900;
    line-height: 1.1;
    color: var(--text-dark);
    margin-bottom: 20px;
}

.article-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 30px;
    font-weight: 400;
}

/* Meta Data */
.article-meta {
    display: flex; justify-content: space-between; align-items: center;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 20px 0; margin-bottom: 40px;
}

.author-info { display: flex; align-items: center; gap: 15px; text-align: left; }
.author-avatar {
    width: 45px; height: 45px; background: var(--text-dark); color: white;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-family: var(--font-head); font-size: 1.2rem;
}
.author-name { display: block; font-weight: 700; color: var(--text-dark); font-size: 0.9rem; }
.publish-date { display: block; font-size: 0.8rem; color: var(--text-muted); }

.share-links { font-weight: 700; font-size: 0.85rem; display: flex; gap: 15px; align-items: center; }
.share-links a { color: var(--text-dark); border-bottom: 1px solid transparent; }
.share-links a:hover { color: var(--rojo); border-color: var(--rojo); }

/* Imagen Hero */
.article-hero-img { margin: 0 0 60px 0; width: 100%; }
.article-hero-img img { width: 100%; height: auto; border-radius: 12px; }
.article-hero-img figcaption {
    font-size: 0.85rem; color: var(--text-muted); text-align: center; margin-top: 10px; font-style: italic;
}

/* Cuerpo del Texto */
.article-body {
    font-family: var(--font-body); /* Montserrat */
    font-size: 1.15rem;
    line-height: 1.8;
    color: #2c2c2c;
}

.article-body p { margin-bottom: 25px; }

/* Letra Capital Roja */
.dropcap::first-letter {
    font-size: 3.5rem; float: left; margin-top: -10px; margin-right: 10px;
    color: var(--rojo); font-weight: 900; line-height: 1; font-family: var(--font-head);
}

.article-body h2 {
    font-family: var(--font-head); font-weight: 800; font-size: 1.8rem;
    margin-top: 50px; margin-bottom: 20px; color: var(--text-dark);
}

.article-body h3 {
    font-family: var(--font-head); font-weight: 700; font-size: 1.4rem;
    margin-top: 40px; margin-bottom: 15px; color: var(--text-dark);
}

.article-body ul, .article-body ol { margin-bottom: 30px; padding-left: 20px; }
.article-body li { margin-bottom: 10px; }
.article-body li strong { color: var(--rojo); }

/* Citas Destacadas */
.article-body blockquote {
    border-left: 4px solid var(--rojo);
    padding-left: 25px;
    margin: 40px 0;
    font-style: italic;
    font-size: 1.4rem;
    color: var(--text-dark);
    font-weight: 500;
    background: var(--bg-light);
    padding: 30px;
    border-radius: 0 12px 12px 0;
}

/* Tags */
.article-tags { margin-top: 60px; display: flex; gap: 10px; flex-wrap: wrap; }
.article-tags span {
    background: var(--bg-light); color: var(--text-muted);
    padding: 8px 16px; border-radius: 50px; font-size: 0.85rem; font-weight: 600;
    transition: 0.2s; cursor: default;
}
.article-tags span:hover { background: var(--text-dark); color: white; }

/* Sección Relacionados */
.related-section { margin-top: 60px; }
.related-section h3 { font-family: var(--font-head); font-weight: 800; margin-bottom: 30px; font-size: 1.5rem; }

/* Responsive Article */
@media (max-width: 768px) {
    .article-meta { flex-direction: column; gap: 20px; align-items: flex-start; }
    .article-title { font-size: 2rem; }
    .article-body { font-size: 1rem; }
    .article-body blockquote { font-size: 1.1rem; padding: 20px; }
}

/* =========================================
   ESTILOS DE PAGINACIÓN (FALTANTES)
   ========================================= */

.pagination-container {
    margin-top: 60px;
    display: flex;
    justify-content: center;
    gap: 10px; /* Espacio entre botones */
    padding-bottom: 40px;
}

.page-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%; /* Botones perfectamente redondos */
    border: 1px solid var(--border);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.2s ease;
    font-family: var(--font-head);
    color: var(--text-dark);
}

/* Efecto Hover (Al pasar el mouse) */
.page-btn:hover {
    border-color: var(--rojo);
    color: var(--rojo);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

/* Botón Activo (Página actual) */
.page-btn.active {
    background: var(--rojo);
    color: white;
    border-color: var(--rojo);
    box-shadow: 0 4px 10px rgba(138, 1, 0, 0.3); /* Sombra roja suave */
}

/* Botones Deshabilitados (Flechas al inicio/final) */
.page-btn:disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
    background: #f9f9f9;
    border-color: #eee;
}

/* =========================================
   ESTILOS PARA BÚSQUEDA SIN RESULTADOS
   ========================================= */

.no-results-container {
    text-align: center;
    padding: 60px 20px;
    display: none; /* Se muestra vía JS */
}

.no-results-msg {
    font-family: var(--font-head);
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    font-weight: 600;
}

.btn-reset {
    display: inline-block;
    background-color: var(--rojo);
    color: #ffffff;
    border: none;
    padding: 12px 30px;
    border-radius: 50px; /* Estilo píldora */
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(138, 1, 0, 0.2);
}

.btn-reset:hover {
    background-color: var(--rojo-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(138, 1, 0, 0.3);
}