/* ==========================================================================
   NOTICIAS - DISEÑO PREMIUM (GRID + MODAL + SEPARADORES INFINITOS)
   ========================================================================== */

/* 1. CONFIGURACIÓN DE LA SECCIÓN (Diferenciación de fondo) */
#noticias-section {
    background: #0f172a; /* Fondo Deep Space para resaltar */
    color: #ffffff;
    position: relative;
    overflow: hidden;
    padding: 140px 8% 160px;
}

/* Capa de profundidad visual (Glow sutil) */
#noticias-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

/* 2. SEPARADORES INFINITOS (Conexión Arriba y Abajo) */
/* Este bloque crea la transición visual con las secciones de arriba y abajo */
#noticias-section::before,
#noticias-section + section::before {
    content: '';
    position: absolute;
    top: -80px;
    left: 0;
    width: 100%;
    height: 160px;
    background: 
        linear-gradient(to bottom, transparent 0%, rgba(241, 212, 17, 0.08) 50%, transparent 100%),
        repeating-linear-gradient(90deg,
            transparent 0px,
            transparent 30px,
            rgba(241, 212, 17, 0.12) 30px,
            rgba(241, 212, 17, 0.12) 60px);
    background-size: 100% 160px, 60px 160px;
    pointer-events: none;
    z-index: 10;
}

/* Ajuste de encabezados dentro de fondo oscuro */
#noticias-section .section-header h2 {
    color: #ffffff !important;
}

#noticias-section .section-header p {
    color: rgba(255, 255, 255, 0.6) !important;
}

/* 3. GRID DE NOTICIAS */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 40px;
    margin-top: 50px;
    position: relative;
    z-index: 2;
}

.news-card {
    background: rgba(255, 255, 255, 0.03); /* Card semi-transparente sobre fondo oscuro */
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 32px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
    position: relative;
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-15px);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--color-yellow);
    box-shadow: 0 35px 70px -15px rgba(0, 0, 0, 0.7);
}

.news-image {
    width: 100%;
    height: 260px;
    object-fit: cover;
    transition: transform 0.8s ease;
    filter: brightness(0.9);
}

.news-card:hover .news-image {
    transform: scale(1.08);
    filter: brightness(1.1);
}

.news-content {
    padding: 35px;
}

.news-date {
    color: var(--color-yellow); /* Resalta más en fondo oscuro */
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    color: #ffffff;
    margin-bottom: 15px;
    line-height: 1.2;
}

.news-excerpt {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 25px;
}

.news-read-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-blue);
    font-weight: 700;
    text-decoration: none;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.news-read-more:hover {
    color: var(--color-yellow);
    gap: 16px;
}

.news-read-more i {
    font-size: 1.1rem;
    transition: transform 0.4s ease;
}

.news-card:hover .news-read-more i {
    transform: translateX(8px);
}

/* 4. MODAL LECTOR DE NOTICIAS PREMIUM */
.news-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.96);
    backdrop-filter: blur(20px);
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.news-modal-overlay.active {
    opacity: 1;
}

.modal-close-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: 0.3s;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close-btn:hover {
    background: var(--color-red);
    transform: scale(1.1);
}

.news-modal-card {
    background: #ffffff;
    border-radius: 40px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
}

.modal-image-wrapper {
    height: 400px;
    width: 100%;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.modal-header-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-body-scroll {
    padding: 50px;
    overflow-y: auto;
    flex: 1;
    color: var(--text-main);
}

.modal-date-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--color-purple);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-news-title {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 30px;
}

.modal-news-fulltext {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #475569;
}

.modal-news-fulltext p {
    margin-bottom: 20px;
}

/* 5. RESPONSIVE */
@media (max-width: 768px) {
    #noticias-section { padding: 80px 5% 100px; }
    
    #noticias-section::before,
    #noticias-section + section::before {
        height: 100px;
        top: -50px;
        background-size: 100% 100px, 40px 100px;
    }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .news-content { padding: 30px; }
    .news-title { font-size: 1.6rem; }

    .modal-image-wrapper { height: 300px; }
    .modal-body-scroll { padding: 30px; }
    .modal-news-title { font-size: 2.2rem; }
    .modal-close-btn { top: 15px; right: 15px; width: 40px; height: 40px; font-size: 1.5rem; }
}