/* ======== Estilos Generales ======== */
body {
    margin: 0;
    padding: 0;
    background: #f4f4f4;
    color: #333;
    font-family: 'Arial', sans-serif;
}

/* ======== Página de Noticias (Encabezado y Fondo) ======== */
.noticias-page {
    padding: 15px 0;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    text-align: center;
}

.noticias-page .container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

/* ======== Título Principal ======== */
.noticias-page h1 {
    font-size: 2.5rem;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 1s ease;
    margin-bottom: 40px;
}

/* ======== Grid de Noticias ======== */
.noticias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

/* ======== Tarjetas de Noticias (Listado) ======== */
.noticia-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.noticia-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.noticia-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.noticia-item:hover img {
    transform: scale(1.1);
}

.noticia-item h2 {
    font-size: 1.5rem;
    margin: 15px;
    color: #fff;
}

.noticia-item p {
    font-size: 1rem;
    margin: 0 15px 15px;
    color: #eee;
}

.noticia-item .fecha {
    font-size: 0.9rem;
    color: #bbb;
    text-align: right;
    margin: 0 15px 15px;
}

/* ======== Modal ======== */
.modal {
    display: none;          /* Oculto por defecto */
    position: fixed;        /* Para que ocupe toda la pantalla */
    z-index: 1000;          /* Encima de todo */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center; /* Centra horizontalmente */
    align-items: center;     /* Centra verticalmente */
}

/* Contenido del Modal */
.modal-contenido {
    background: #fafafa;    /* Fondo tipo “papel” */
    padding: 30px;
    border-radius: 12px;
    max-width: 800px;       /* Ancho para estilo editorial */
    width: 90%;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease-in-out;

    /* Para texto largo */
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
}

/* Botón Cerrar (arriba a la derecha) */
.cerrar {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    transition: 0.3s;
}

.cerrar:hover {
    color: #000;
}

/* Contenido interno del modal (estilo “artículo”) */
#noticia-detalle h2 {
    font-family: 'Georgia', serif;
    font-size: 2rem;
    color: #333;
    margin-bottom: 0.5rem;
    text-align: center;
}

/* Fecha dentro del modal (estilo periodístico) */
#noticia-detalle .fecha-detalle {
    font-family: 'Georgia', serif;
    font-size: 0.9rem;
    color: #888;
    text-align: right;
    margin-bottom: 1rem;
    font-style: italic;
}

#noticia-detalle img {
    max-width: 80%;
    height: auto;
    display: block;
    margin: 1rem auto;
    border-radius: 8px;
}

#noticia-detalle p {
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1.2rem;
    color: #444;
    text-align: justify; /* Justificado para un look más editorial */
}

/* Botón "Volver" para regresar a noticias.php */
.btn-volver {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #ff6f61, #ff4b2b);
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    font-size: 1rem;
    text-align: center;
    transition: transform 0.3s ease, background 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.btn-volver:hover {
    background: linear-gradient(135deg, #ff4b2b, #ff6f61);
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Animaciones */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ======== Responsividad ======== */
@media (max-width: 768px) {
    .noticias-page h1 {
        font-size: 2rem;
    }

    .noticia-item h2 {
        font-size: 1.3rem;
    }

    .noticia-item p {
        font-size: 0.9rem;
    }

    .modal-contenido {
        width: 95%;
        padding: 20px;
    }

    #noticia-detalle h2 {
        font-size: 1.5rem;
    }

    #noticia-detalle p {
        font-size: 1rem;
    }
}
