/* ========================================== */
/* NOTICIAS - CON IMAGEN DE FONDO            */
/* ========================================== */

/* Sección principal */
.noticias-section {
    background:
        linear-gradient(135deg, rgba(0, 0, 0, 0.70), rgba(0, 0, 0, 0.80)),
        url('../img/Fondo_Noticias.jpg') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    padding: 80px 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
}

/* Overlay con gradiente naranja suave */
.noticias-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(243, 156, 18, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(243, 156, 18, 0.05) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.noticias-section .container {
    width: 95%;
    max-width: 1300px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Header - Texto blanco */
.noticias-header {
    text-align: center;
    margin-bottom: 50px;
}

.noticias-header h2 {
    font-size: 2.8rem;
    color: #ffffff;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.noticias-header h2 span {
    background: linear-gradient(135deg, #f7931f, #f37021);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.noticias-header .section-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 700px;
    margin: 0 auto;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* ========================================== */
/* GRID DE NOTICIAS - CARDS MÁS PEQUEÑOS    */
/* ========================================== */

.noticias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* ========================================== */
/* CARD DE NOTICIA - CON FONDO TRANSPARENTE  */
/* ========================================== */

.noticia-card {
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(12px);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
}

.noticia-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(243, 156, 18, 0.2);
}

/* Imagen de la card */
.noticia-card-image {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: #1a1a2e;
}

.noticia-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.noticia-card:hover .noticia-card-image img {
    transform: scale(1.05);
}

/* Badge de fecha - Mejorado */
.noticia-card-date-badge {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.noticia-card-date-badge i {
    font-size: 0.65rem;
}

/* Contenido de la card - Texto blanco */
.noticia-card-content {
    padding: 18px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.noticia-card-content h3 {
    font-size: 1.05rem;
    color: #ffffff;
    margin-bottom: 16px;
    line-height: 1.4;
    font-weight: 700;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Link "Leer más" - Color naranja */
.noticia-card-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #f39c12;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    align-self: flex-start;
    cursor: pointer;
    background: none;
    border: none;
    margin-top: auto;
}

.noticia-card-link:hover {
    border-bottom-color: #f39c12;
    gap: 14px;
    color: #e67e22;
}

.noticia-card-link i {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
}

.noticia-card-link:hover i {
    transform: translateX(4px);
}

/* ========================================== */
/* LOADING                                   */
/* ========================================== */

.noticias-loading {
    text-align: center;
    padding: 60px 0;
    display: none;
}

.noticias-loading.active {
    display: block;
}

.spinner {
    width: 45px;
    height: 45px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: #f39c12;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.noticias-loading p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
}

/* ========================================== */
/* EMPTY                                     */
/* ========================================== */

.noticias-empty {
    text-align: center;
    padding: 60px 0;
    color: rgba(255, 255, 255, 0.7);
}

.noticias-empty i {
    color: rgba(255, 255, 255, 0.2);
    margin-bottom: 15px;
}

.noticias-empty p {
    font-size: 1.05rem;
}

/* ========================================== */
/* MODAL - NOTICIA COMPLETA (TIPO PERIÓDICO) */
/* ========================================== */

.modal-noticia {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    padding: 30px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.modal-noticia.active {
    display: flex !important;
    opacity: 1;
}

.modal-noticia-content {
    background: #ffffff;
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(30px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Botones del modal */
.modal-noticia-close {
    position: sticky;
    top: 15px;
    float: right;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 10;
    margin: 10px 15px 0 0;
    backdrop-filter: blur(8px);
}

.modal-noticia-close:hover {
    background: #e74c3c;
    transform: rotate(90deg);
}

.modal-noticia-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: #2c5aa0;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 12px 25px 5px;
    transition: all 0.3s ease;
    margin-top: 5px;
}

.modal-noticia-back:hover {
    gap: 12px;
    color: #1a3f7a;
}

.modal-noticia-back i {
    transition: transform 0.3s ease;
}

.modal-noticia-back:hover i {
    transform: translateX(-4px);
}

/* ========================================== */
/* CUERPO DE LA NOTICIA - ESTILO PERIÓDICO  */
/* ========================================== */

.modal-noticia-body {
    padding: 0 40px 40px;
    clear: both;
}

/* Imagen destacada */
.modal-noticia-body .noticia-destacada {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Título */
.modal-noticia-body .noticia-titulo {
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 800;
    line-height: 1.3;
}

/* Meta información */
.modal-noticia-body .noticia-meta {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 25px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.modal-noticia-body .noticia-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.modal-noticia-body .noticia-meta i {
    color: #2c5aa0;
}

/* Contenido */
.modal-noticia-body .noticia-contenido {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #34495e;
}

.modal-noticia-body .noticia-contenido p {
    margin-bottom: 18px;
}

/* ========================================== */
/* RESPONSIVE                                */
/* ========================================== */

@media (max-width: 1024px) {
    .noticias-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .noticias-section {
        padding: 60px 0;
        background-attachment: scroll;
    }

    .noticias-header h2 {
        font-size: 2rem;
    }

    .noticias-header .section-subtitle {
        font-size: 1rem;
    }

    .noticias-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 18px;
        max-width: 600px;
        margin: 0 auto 20px;
    }

    .noticia-card-image {
        height: 150px;
    }

    .noticia-card-content {
        padding: 14px 16px 16px;
    }

    .noticia-card-content h3 {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }

    .noticia-card-link {
        font-size: 0.8rem;
    }

    /* Modal responsive */
    .modal-noticia {
        padding: 15px;
    }

    .modal-noticia-content {
        max-height: 95vh;
        border-radius: 14px;
    }

    .modal-noticia-body {
        padding: 0 20px 25px;
    }

    .modal-noticia-body .noticia-titulo {
        font-size: 1.6rem;
    }

    .modal-noticia-body .noticia-destacada {
        max-height: 250px;
        border-radius: 8px;
    }

    .modal-noticia-body .noticia-meta {
        font-size: 0.8rem;
        gap: 15px;
        padding-bottom: 15px;
        margin-bottom: 20px;
    }

    .modal-noticia-body .noticia-contenido {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .modal-noticia-close {
        width: 34px;
        height: 34px;
        font-size: 1rem;
        margin: 8px 12px 0 0;
    }

    .modal-noticia-back {
        font-size: 0.8rem;
        padding: 10px 20px 5px;
    }
}

@media (max-width: 480px) {
    .noticias-header h2 {
        font-size: 1.6rem;
    }

    .noticias-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        max-width: 100%;
    }

    .noticia-card-image {
        height: 120px;
    }

    .noticia-card-content {
        padding: 10px 12px 12px;
    }

    .noticia-card-content h3 {
        font-size: 0.82rem;
        margin-bottom: 10px;
    }

    .noticia-card-link {
        font-size: 0.7rem;
        padding: 4px 0;
    }

    .noticia-card-date-badge {
        font-size: 0.6rem;
        padding: 3px 8px;
        bottom: 8px;
        right: 8px;
    }

    /* Modal responsive */
    .modal-noticia {
        padding: 8px;
    }

    .modal-noticia-body {
        padding: 0 14px 20px;
    }

    .modal-noticia-body .noticia-titulo {
        font-size: 1.3rem;
    }

    .modal-noticia-body .noticia-destacada {
        max-height: 180px;
    }

    .modal-noticia-body .noticia-contenido {
        font-size: 0.88rem;
        line-height: 1.6;
    }

    .modal-noticia-close {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        margin: 5px 8px 0 0;
    }

    .modal-noticia-back {
        font-size: 0.75rem;
        padding: 8px 14px 5px;
    }
}

@media (max-width: 380px) {
    .noticias-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .noticia-card-image {
        height: 160px;
    }

    .noticia-card-content h3 {
        font-size: 0.9rem;
    }
}