/* === 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: #ffd700;
    --secondary-dark: #e6c300;
    --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);
}