/* === KAIZEN NEWS - TEMA EDITORIAL ÉLITE (VERSIÓN DEFINITIVA Y UNIFICADA) === */
@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;700&family=Inter:wght@400;500;600;700&display=swap');

/* --- DESIGN SYSTEM UNIFICADO --- */
:root {
    /* Paleta de Colores Corporativa */
    --primary: #004080;
    --primary-dark: #003366;
    --primary-light: #0066cc;
    --secondary: #d4af37;
    --secondary-dark: #b8952f;
    --dark: #222;
    --light: #f4f4f4;
    --white: #fff;
    --gray: #6c757d;
    --gray-light: #f8f9fa;

    /* Tipografía Oficial del Portal (Unificada) */
    --font-serif: 'Lora', serif;
    /* Para párrafos y cuerpo de texto largo */
    --font-sans: 'Inter', sans-serif;
    /* Para titulares, UI, y textos cortos */
    --font-size-base: 1rem;
    --line-height-base: 1.6;

    /* Espaciados */
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;

    /* Sombras */
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow-md: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);

    /* Bordes */
    --border-radius: 0.375rem;
    --border-radius-lg: 0.5rem;
    --border-radius-xl: 1rem;
}

/* --- 1. Diseño Base de Tarjetas de Noticias (Post Cards) --- */
.post-card {
    background-color: var(--white);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease;
    cursor: pointer;
    border: none;
}

/* --- ESTADO HOVER REFINADO (ESTILO PORTAL DE NOTICIAS) --- */
.post-card:hover {
    box-shadow: var(--shadow-lg);
}

.post-card:hover .post-card-title {
    color: var(--primary);
    text-decoration: underline;
}

.post-card:hover .post-card-image img {
    transform: none;
}

/* ----------------------------------------------------------- */

.post-card-image {
    height: 220px;
    overflow: hidden;
    position: relative;
    background-color: #f0f0f0;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.post-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-card-title {
    font-family: var(--font-sans);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

.post-card-excerpt {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    color: var(--gray);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.post-card-cta {
    font-family: var(--font-sans);
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    align-self: flex-start;
}

/* --- 2. Estructura de la Página de Noticias --- */
.news-page-header {
    padding: 5rem 0;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.news-page-header h1 {
    font-family: var(--font-sans);
    font-size: 3rem;
    font-weight: 800;
    color: var(--dark);
}

.news-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 4rem;
    padding: 4rem 0;
}

.news-main-content {
    min-width: 0;
}

.news-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

.widget {
    margin-bottom: 2.5rem;
}

.widget-title {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    color: var(--dark);
    text-decoration: none;
    transition: color 0.2s ease;
    font-family: var(--font-sans);
}

.category-list li a:hover {
    color: var(--primary);
}

.category-post-count {
    background-color: #e9ecef;
    color: var(--gray);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 50px;
}

/* --- 3. Vista Previa en la Página de Inicio (Index) --- */
.news-hero-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1.5rem;
}

.news-hero-main {
    grid-column: span 12;
}

.news-hero-sidebar {
    grid-column: span 12;
}

@media (min-width: 992px) {
    .news-hero-main {
        grid-column: span 8;
    }

    .news-hero-sidebar {
        grid-column: span 4;
    }
}

.main-post-card .post-card-image {
    height: 450px;
}

.main-post-card .post-card-title {
    font-size: 2rem;
}

.sidebar-post-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    text-decoration: none;
}

.sidebar-post-card .post-card-image {
    width: 100px;
    height: 75px;
    flex-shrink: 0;
    border-radius: var(--border-radius);
}

.sidebar-post-card .post-card-title {
    font-family: var(--font-sans);
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
    line-height: 1.4;
}

.news-subgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    grid-column: 1 / -1;
}

.news-subgrid .post-card-image {
    height: 180px;
}

.news-subgrid .post-card-title {
    font-size: 1.1rem;
}

.news-subgrid .post-card-content {
    padding: 1.2rem;
}

/* --- 4. Publicidad --- */
.ad-placement {
    background-color: #f8f9fa;
    border: 1px dashed #ced4da;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 90px;
    text-align: center;
    color: #adb5bd;
    font-size: 0.9rem;
    margin: 2rem 0;
}

/* --- 5. Visor Modal Futurista (LightBox) --- */
.post-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 12, 15, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1055;
    visibility: hidden;
}

.post-modal-content {
    background-color: var(--white);
    width: 95%;
    max-width: 900px;
    max-height: 95vh;
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    visibility: hidden;
}

.post-modal-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    background-color: var(--primary);
    width: 0%;
    z-index: 10;
}

.post-modal-body-wrapper {
    overflow-y: auto;
}

.post-modal-image {
    max-height: 450px;
    width: 100%;
    object-fit: cover;
}

.post-modal-text-content {
    padding: 4rem 5rem;
    max-width: 720px;
    margin: 0 auto;
}

.post-modal-title {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.post-modal-meta {
    color: var(--gray);
    margin-bottom: 2.5rem;
    font-family: var(--font-sans);
}

.post-modal-body-content {
    font-family: var(--font-serif);
    line-height: 2;
    font-size: 1.2rem;
    color: #333;
}

.post-modal-body-content p {
    margin-bottom: 1.5rem;
}

.post-modal-body-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

.post-modal-nav {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-modal-nav a {
    text-decoration: none;
    color: var(--dark);
}

.post-modal-nav .nav-item {
    transition: opacity 0.3s ease;
}

.post-modal-nav .nav-item.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.post-modal-nav .nav-label {
    font-size: 0.9rem;
    color: var(--gray);
    font-family: var(--font-sans);
}

.post-modal-nav .nav-title {
    font-weight: 600;
    font-family: var(--font-sans);
}

.post-modal-nav .nav-next {
    text-align: right;
}

.post-modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1056;
}

.post-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg) scale(1.1);
}

/* --- 6. Responsive --- */
@media (max-width: 991.98px) {
    .news-layout {
        grid-template-columns: 1fr;
    }

    .featured-post-card {
        grid-template-columns: 1fr;
    }

    .featured-post-card .post-card-image {
        height: 300px;
    }

    .news-sidebar {
        position: static;
    }

    .post-modal-text-content {
        padding: 2.5rem;
    }

    .post-modal-title {
        font-size: 2.25rem;
    }
}

@media (max-width: 767.98px) {
    .main-post-card .post-card-image {
        height: 300px;
    }

    .main-post-card .post-card-title {
        font-size: 1.5rem;
    }

    .post-modal-text-content {
        padding: 1.5rem;
    }

    .post-modal-title {
        font-size: 1.8rem;
    }

    .post-modal-body-content {
        font-size: 1.1rem;
    }
}


/* --- 7. AD MODAL POPUP --- */
.ad-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-modal-content {
    position: relative;
    background-color: transparent;
    padding: 0;
    max-width: 600px;
    /* Ajusta el tamaño máximo del anuncio */
    width: 90%;
}

.ad-modal-content img {
    width: 100%;
    height: auto;
}

.ad-modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background: var(--white);
    color: var(--dark);
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.ad-modal-close:hover {
    transform: scale(1.1) rotate(90deg);
}


/* =============================================
   KAIZEN INSIGHTS — NUEVO DISEÑO EDITORIAL
   Prefijo: .ki-
============================================= */

/* --- Hero de la página --- */
.ki-hero {
    background: linear-gradient(160deg, #030d1e 0%, #041630 45%, #061d3d 100%);
    padding: 7.5rem 0 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.ki-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px),
        radial-gradient(ellipse 60% 50% at 20% 60%, rgba(212,175,55,0.07) 0%, transparent 70%),
        radial-gradient(ellipse 50% 50% at 80% 20%, rgba(0,100,200,0.09) 0%, transparent 60%);
    background-size: 44px 44px, 44px 44px, 100% 100%, 100% 100%;
    pointer-events: none;
}
.ki-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(212,175,55,0.1);
    border: 1px solid rgba(212,175,55,0.28);
    color: #d4af37;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 5px 16px;
    border-radius: 50px;
    margin-bottom: 1.25rem;
    position: relative;
}
.ki-hero-badge::before {
    content: '';
    width: 6px; height: 6px;
    background: #d4af37;
    border-radius: 50%;
    flex-shrink: 0;
    animation: ki-pulse 2s infinite;
}
@keyframes ki-pulse { 0%,100%{opacity:1} 50%{opacity:0.25} }
.ki-hero-title {
    font-size: clamp(2.8rem, 6vw, 4.2rem);
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 0.4rem;
    line-height: 1.1;
    position: relative;
}
.ki-hero-title span {
    background: linear-gradient(135deg, #d4af37 0%, #b8952f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.ki-hero-subtitle {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    margin-bottom: 2rem;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    font-weight: 600;
    position: relative;
}
.ki-hero-search {
    max-width: 640px;
    margin: 0 auto 1.5rem;
    transition: max-width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.ki-hero-search.has-answer { max-width: min(860px, 92vw); }
.ki-search-form-row { position: relative; }
#ai-search-form { width: 100%; }
.ki-search-box-wrap {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.055);
    border: 1px solid rgba(255,255,255,0.13);
    border-radius: 16px;
    padding: 0.75rem 0.75rem 0.75rem 1.25rem;
    gap: 0.75rem;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
    backdrop-filter: blur(12px);
}
.ki-search-box-wrap:focus-within {
    border-color: rgba(212,175,55,0.5);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 3px rgba(212,175,55,0.08), 0 8px 32px rgba(0,0,0,0.3);
}
.ki-search-icon { color: rgba(255,255,255,0.3); font-size: 1.1rem; flex-shrink: 0; }
.ki-search-input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 0.95rem;
    font-family: inherit;
    min-width: 0;
}
.ki-search-input::placeholder { color: rgba(255,255,255,0.32); }
.ki-search-btn {
    background: linear-gradient(135deg, #d4af37 0%, #b8952f 100%);
    color: #0a0a0a;
    border: none;
    border-radius: 10px;
    padding: 0.6rem 1.3rem;
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
    white-space: nowrap;
}
.ki-search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(212,175,55,0.35);
}
.ki-search-btn:disabled { opacity: 0.7; transform: none; }

/* Chips de categoría bajo la búsqueda */
.ki-hero-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    margin-top: 1.25rem;
}

/* --- Barra de canales --- */
.ki-channels-bar {
    background: var(--white);
    border-bottom: 1px solid #e9ecef;
    padding: 0.75rem 0;
    position: sticky;
    top: 70px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ki-channels-inner {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 0 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.ki-channels-inner::-webkit-scrollbar { display: none; }

/* --- Chips (canales y filtros) --- */
.ki-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray);
    background: var(--gray-light);
    border: 1px solid #e9ecef;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
}

.ki-chip:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: rgba(0, 64, 128, 0.05);
}

.ki-chip.active {
    color: var(--white);
    background: var(--primary);
    border-color: var(--primary);
}

.ki-chip-hero {
    color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.ki-chip-hero:hover,
.ki-chip-hero.active {
    color: var(--dark);
    background: var(--secondary);
    border-color: var(--secondary);
}

/* --- Post destacado --- */
.ki-featured-post {
    position: relative;
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    min-height: 440px;
    display: flex;
    align-items: flex-end;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-lg);
    text-decoration: none;
}

.ki-featured-post-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s ease;
}

.ki-featured-post:hover .ki-featured-post-bg {
    transform: scale(1.03);
}

.ki-featured-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 15, 40, 0.92) 0%, rgba(0, 30, 70, 0.6) 50%, rgba(0, 40, 85, 0.1) 100%);
}

.ki-featured-content {
    position: relative;
    z-index: 1;
    padding: 2.5rem;
    width: 100%;
}

.ki-badge-featured {
    display: inline-block;
    background: var(--secondary);
    color: var(--dark);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.ki-featured-title {
    font-family: var(--font-sans);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    color: var(--white);
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

.ki-featured-excerpt {
    font-family: var(--font-serif);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    margin-bottom: 1.25rem;
    max-width: 600px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ki-featured-meta {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.25rem;
}

.ki-btn-featured {
    display: inline-block;
    border: 2px solid var(--secondary);
    color: var(--secondary);
    padding: 0.55rem 1.5rem;
    border-radius: 50px;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.25s ease;
}

.ki-btn-featured:hover {
    background: var(--secondary);
    color: var(--dark);
}

/* --- Grilla de posts --- */
.ki-post-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
}

@media (max-width: 991.98px) {
    .ki-post-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 575.98px) {
    .ki-post-grid { grid-template-columns: 1fr; }
}

/* --- Card de post --- */
.ki-post-card {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f0f0f0;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    position: relative;
}

.ki-post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
    border-bottom: 3px solid var(--secondary);
}

.ki-post-card-img-wrap {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.ki-post-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.ki-post-card:hover .ki-post-card-img-wrap img {
    transform: scale(1.05);
}

/* --- Badge de categoría --- */
.ki-post-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary);
    color: var(--white);
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    z-index: 1;
}

.ki-post-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ki-post-card-title {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.5rem;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.ki-post-card:hover .ki-post-card-title {
    color: var(--primary);
}

.ki-post-card-excerpt {
    font-family: var(--font-serif);
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 1rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Meta de post --- */
.ki-post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--gray);
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f0f0;
}

.ki-post-meta i {
    font-size: 0.75rem;
}

.ki-read-more {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-left: auto;
    white-space: nowrap;
}

/* --- Sidebar widgets mejorados --- */
.ki-sidebar-widget {
    background: var(--white);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.75rem;
    border: 1px solid #f0f0f0;
    box-shadow: var(--shadow-sm);
}

.ki-sidebar-widget .widget-title {
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    margin-bottom: 1.25rem;
}

/* Paginación mejorada */
.ki-pagination .page-link {
    color: var(--primary);
    border-color: #dee2e6;
    border-radius: 6px;
    margin: 0 2px;
    transition: all 0.2s ease;
}

.ki-pagination .page-link:hover {
    background: rgba(212,175,55, 0.15);
    border-color: var(--secondary);
    color: var(--primary-dark);
}

.ki-pagination .page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

/* --- Respuesta IA dentro del hero --- */
.ki-ai-answer-box {
    margin-top: 0.85rem;
    background: rgba(4, 18, 48, 0.88);
    border: 1px solid rgba(212,175,55,0.18);
    border-radius: 16px;
    overflow: hidden;
    text-align: left;
    display: none;
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 48px rgba(0,0,0,0.5);
}
.ki-ai-answer-box.visible { display: block; }
.ki-ai-answer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.ki-ai-identity { display: flex; align-items: center; gap: 10px; }
.ki-ai-avatar {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, #004080, #002855);
    border: 1px solid rgba(212,175,55,0.4);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; font-weight: 900; color: #d4af37; letter-spacing: 0.5px;
    flex-shrink: 0;
}
.ki-ai-name { font-size: 0.83rem; font-weight: 700; color: rgba(255,255,255,0.92); line-height: 1.2; }
.ki-ai-model { font-size: 0.68rem; color: rgba(255,255,255,0.38); }
.ki-ai-header-actions { display: flex; gap: 6px; }
.ki-ai-action-btn {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.45);
    border-radius: 6px;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 0.85rem;
    transition: all 0.2s;
}
.ki-ai-action-btn:hover { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.8); }
.ki-ai-answer-body {
    padding: 1.1rem 1.4rem;
    color: rgba(255,255,255,0.84);
    font-size: 0.9rem;
    line-height: 1.8;
}
.ki-ai-answer-body strong { color: #d4af37; font-weight: 700; }
.ki-ai-answer-body ol, .ki-ai-answer-body ul { padding-left: 1.4rem; margin-bottom: 0.5rem; }
.ki-ai-answer-body li { margin-bottom: 0.55rem; color: rgba(255,255,255,0.82); }
.ki-ai-answer-body p { margin-bottom: 0.75rem; }
.ki-ai-answer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.ki-ai-source { font-size: 0.7rem; color: rgba(255,255,255,0.3); display: flex; align-items: center; gap: 5px; }
.ki-answer-close-btn {
    background: none; border: none;
    font-size: 0.7rem; color: rgba(255,255,255,0.3);
    cursor: pointer; display: flex; align-items: center; gap: 4px;
    transition: color 0.2s;
}
.ki-answer-close-btn:hover { color: rgba(255,255,255,0.65); }

/* --- Estilos para casos de éxito (welcome hub) --- */
.case-study-detail {
    padding: 0.5rem 0;
}

.case-client-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.case-client-logo {
    height: 50px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    flex-shrink: 0;
}

.case-client-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0 0 0.3rem;
    line-height: 1.2;
}

.case-service-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-light);
    background: rgba(0, 102, 204, 0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

.case-block {
    margin-bottom: 1rem;
}

.case-block h5 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--primary);
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.case-block h5 i { font-size: 0.8rem; }

.case-block p {
    font-size: 0.9rem;
    color: #444;
    line-height: 1.6;
    margin: 0;
}

.case-result h5 { color: #198754; }
.case-result p { color: #2d6a4f; }

/* --- Responsive hero --- */
@media (max-width: 767.98px) {
    /* 3rem (48px) era menos que el navbar fijo (67px): tapaba 19px de la cabecera. */
    .ki-hero { padding: 5.75rem 0 2rem; }
    .ki-channels-inner { justify-content: flex-start; padding: 0 0.5rem; }
    .ki-featured-post { min-height: 320px; }
    .ki-featured-content { padding: 1.5rem; }
}

/* =============================================
   VISTA INDIVIDUAL DE POST — MEJORAS
============================================= */

/* Header hero del post */
.post-hero-banner {
    width: 100%;
    height: 420px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.post-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 10, 30, 0.88) 0%, rgba(0, 20, 50, 0.5) 50%, rgba(0,0,0,0.1) 100%);
}

.post-hero-content {
    position: relative;
    z-index: 1;
    padding: 2.5rem 5rem;
    max-width: 820px;
}

.post-hero-content .post-modal-title {
    color: var(--white);
    margin-bottom: 0.75rem;
}

.post-hero-content .post-modal-meta {
    color: rgba(255,255,255,0.7);
    margin-bottom: 0;
}

/* Videos responsive dentro del contenido */
.video-responsive {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

.video-responsive iframe,
.video-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Botón IA flotante (mobile) */
.ki-mobile-ai-btn {
    display: none;
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 1060;
    box-shadow: 0 4px 15px rgba(0, 64, 128, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ki-mobile-ai-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 64, 128, 0.5);
}

@media (max-width: 767.98px) {
    .post-hero-banner { height: 280px; }
    .post-hero-content { padding: 1.5rem; }
    .ki-mobile-ai-btn { display: flex; align-items: center; justify-content: center; }
}

/* === READING PROGRESS BAR === */
#kai-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #004080, #d4af37);
    z-index: 99999;
    transition: width 0.1s linear;
    border-radius: 0 2px 2px 0;
}
/* Buscador en telefonos: con el boton al lado quedaban 124px utiles para el campo
   y el texto de ayuda se cortaba en "Pregunta sobre sa...". El boton baja a su propia
   linea dentro de la misma caja; main.js acorta ademas el texto de ayuda. */
@media (max-width: 575.98px) {
    .ki-search-box-wrap { flex-wrap: wrap; padding: 0.75rem; row-gap: 0.65rem; }
    .ki-search-input { flex: 1 1 0; font-size: 0.92rem; }
    .ki-search-btn { flex: 1 1 100%; padding: 0.7rem 1rem; }
}

/* ── Insights: acabado profesional (2026-09-30) ─────────────────────────── */

/* Hover sin salto: el borde inferior pasaba de 1px a 3px y el contenido se movia 2px. */
.ki-post-card:hover {
    border-bottom: 1px solid #f0f0f0;
    box-shadow: var(--shadow-md), inset 0 -3px 0 var(--secondary);
}

/* Titulo de la cuadricula bajo el destacado */
.ki-section-label {
    display: flex; align-items: center; gap: 12px;
    font-family: var(--font-sans);
    font-size: 0.78rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
    color: #5c636a;
    margin: 0 0 1.25rem;
}
.ki-section-label::after { content: ''; flex: 1; height: 1px; background: #e3e6ea; }

/* Fecha y lectura: cada pieza en una sola linea (antes "agosto 4, / 2025", "1 / min") */
.ki-post-meta { flex-wrap: wrap; row-gap: 4px; }
.ki-meta-item { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ki-post-meta .ki-read-more { margin-left: auto; white-space: nowrap; }

/* Un solo articulo en la cuadricula: tarjeta horizontal a todo el ancho, en vez de
   una columna estrecha con dos tercios vacios a su derecha. */
.ki-post-grid--single { grid-template-columns: 1fr; }
.ki-post-grid--single .ki-post-card { flex-direction: row; }
.ki-post-grid--single .ki-post-card-img-wrap { flex: 0 0 42%; aspect-ratio: auto; min-height: 220px; }
.ki-post-grid--single .ki-post-card-body { padding: 1.6rem 1.75rem; justify-content: center; }
.ki-post-grid--single .ki-post-card-title { font-size: 1.3rem; -webkit-line-clamp: 3; }
.ki-post-grid--single .ki-post-card-excerpt { -webkit-line-clamp: 3; flex-grow: 0; }
@media (max-width: 575.98px) {
    .ki-post-grid--single .ki-post-card { flex-direction: column; }
    .ki-post-grid--single .ki-post-card-img-wrap { flex: none; aspect-ratio: 16 / 9; min-height: 0; }
    .ki-post-grid--single .ki-post-card-body { padding: 1.25rem; }
    .ki-post-grid--single .ki-post-card-title { font-size: 1.1rem; }
}

/* Barra lateral: llamada a la accion (antes, un buscador duplicado del hero) */
.ki-cta-widget {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #0a1c36 0%, #030d1e 100%);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: #fff;
}
.ki-cta-widget::before {
    content: ''; position: absolute; top: 0; left: 20px; right: 20px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.6), transparent);
}
.ki-cta-eyebrow {
    display: inline-block;
    font-size: 0.66rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
    color: #d4af37;
    margin-bottom: 0.5rem;
}
.ki-cta-title { font-family: var(--font-sans); font-size: 1.15rem; font-weight: 800; line-height: 1.3; color: #fff; margin: 0 0 0.6rem; }
.ki-cta-text  { font-size: 0.88rem; line-height: 1.55; color: rgba(255, 255, 255, 0.68); margin: 0 0 1.1rem; }
.ki-cta-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #d4af37 0%, #b8952f 100%);
    color: #0a0a0a; font-weight: 800; font-size: 0.9rem; text-decoration: none;
    transition: transform .2s, box-shadow .2s;
}
.ki-cta-btn:hover, .ki-cta-btn:focus-visible { color: #0a0a0a; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(212, 175, 55, 0.25); }
.ki-cta-link {
    display: flex; align-items: center; justify-content: center; gap: 7px;
    margin-top: 0.75rem;
    font-size: 0.84rem; font-weight: 600; text-decoration: none;
    color: rgba(255, 255, 255, 0.75);
}
.ki-cta-link:hover, .ki-cta-link:focus-visible { color: #5ddba0; }

.ki-ask-widget .widget-title i { color: #b8952f; margin-right: 4px; }
.ki-ask-widget p { font-size: 0.86rem; line-height: 1.5; color: #5c636a; margin: 0 0 0.9rem; }
.ki-ask-btn {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    border: 1px solid #d9dde3;
    background: #fff;
    color: #0a1c36; font-weight: 700; font-size: 0.88rem;
    transition: border-color .2s, background .2s;
}
.ki-ask-btn:hover, .ki-ask-btn:focus-visible { border-color: #b8952f; background: #fbf7ea; outline: none; }

/* ── Avance de Insights en el inicio ────────────────────────────────────── */
.main-post-card .post-card-image { height: 400px; }
.news-side-label {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-sans);
    font-size: 0.72rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
    color: #5c636a;
    margin-bottom: 1rem;
}
.news-side-label::after { content: ''; flex: 1; height: 1px; background: #e3e6ea; }
@media (min-width: 992px) {
    .news-hero-sidebar { display: flex; flex-direction: column; }
}
/* Tarjeta que invita a usar la IA: rellena la columna mientras haya pocos articulos */
.news-ask-card {
    position: relative;
    overflow: hidden;
    display: flex; flex-direction: column; justify-content: center;
    flex: 1 1 auto;
    min-height: 220px;
    margin-top: 0.5rem;
    padding: 1.6rem 1.5rem;
    border-radius: var(--border-radius-lg);
    background:
        radial-gradient(circle at 85% 15%, rgba(0, 102, 204, 0.28), transparent 55%),
        linear-gradient(160deg, #0a1c36 0%, #030d1e 100%);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: #fff;
    text-decoration: none;
    transition: transform .25s, box-shadow .25s;
}
.news-ask-card::before {
    content: ''; position: absolute; top: 0; left: 20px; right: 20px; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.6), transparent);
}
.news-ask-card:hover, .news-ask-card:focus-visible { color: #fff; transform: translateY(-3px); box-shadow: 0 18px 40px rgba(3, 13, 30, 0.35); }
.news-ask-eyebrow { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: #d4af37; margin-bottom: 0.7rem; }
.news-ask-card h4 { font-family: var(--font-sans); font-size: 1.2rem; font-weight: 800; line-height: 1.3; margin: 0 0 0.6rem; color: #fff; }
.news-ask-card p { font-size: 0.9rem; line-height: 1.55; color: rgba(255, 255, 255, 0.68); margin: 0 0 1.1rem; }
.news-ask-cta { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.9rem; color: #d4af37; }
.news-ask-card:hover .news-ask-cta i { transform: translateX(3px); }
.news-ask-cta i { transition: transform .2s; }
/* La tarjeta pasa a contenedor (dentro hay varios enlaces): reparte su alto */
.news-ask-card { justify-content: space-between; gap: 1.1rem; }
.news-ask-card:hover { transform: none; box-shadow: none; }
.news-ask-sugerencias { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.news-ask-sugerencias a {
    display: flex; align-items: center; gap: 10px;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.88rem; line-height: 1.35;
    text-decoration: none;
    transition: background .2s, border-color .2s, transform .2s;
}
.news-ask-sugerencias a i { color: #d4af37; flex-shrink: 0; }
.news-ask-sugerencias a:hover,
.news-ask-sugerencias a:focus-visible { background: rgba(212, 175, 55, 0.1); border-color: rgba(212, 175, 55, 0.4); color: #fff; transform: translateX(3px); outline: none; }
.news-ask-cta { text-decoration: none; }
.news-ask-cta:hover, .news-ask-cta:focus-visible { color: #f0d77a; }

/* ── Visor de artículos en móvil (2026-10-01) ──────────────────────────────
   La × quedaba sobre la foto del artículo con fondo casi transparente; el
   botón del rayo era azul Bootstrap. Ahora: navy con borde dorado, como el
   resto del sitio. */
.post-modal-close {
    background: rgba(6, 20, 42, 0.78);
    border-color: rgba(212, 175, 55, 0.55);
    line-height: 1;
}
.post-modal-close:hover,
.post-modal-close:focus-visible {
    background: rgba(6, 20, 42, 0.92);
    border-color: #d4af37;
}
.ki-mobile-ai-btn {
    background: #0a1628;
    color: #d4af37;
    border: 1px solid rgba(212, 175, 55, 0.6);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    right: 16px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}
@media (max-width: 767.98px) {
    .post-modal-close { top: 14px; right: 14px; width: 40px; height: 40px; font-size: 1.5rem; }
}
