/* Estilos generales */
.container {
    padding-top: 20px;
    padding-bottom: 50px;
}

h2 {
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #007bff;
}

/* Grid para las noticias */
#noticias-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Estilos para cada tarjeta de noticia */
.noticia {
    background: white;
    border-radius: 10px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.noticia:hover {
    transform: translateY(-5px);
    box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.2);
}

.noticia .carousel {
    width: 100%;
}

.noticia .carousel img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.noticia .contenido {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.noticia h5 {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.noticia .categoria {
    font-weight: bold;
    color: #e82121;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.noticia .resumen {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
    flex-grow: 1;
}

.fecha-y-boton {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.fecha {
    font-size: 0.8rem;
    color: #666;
}

.btn-leer {
    display: inline-block;
    background-color: #ec7474;
    color: white;
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: background 0.3s ease;
}

.btn-leer:hover {
    background-color: #e12a2a;
}

/* Noticia destacada */
.noticia.featured {
    grid-column: 1 / -1;
    flex-direction: row;
}

.noticia.featured .carousel {
    width: 50%;
}

.noticia.featured .contenido {
    width: 50%;
    padding: 25px;
}

.noticia.featured .carousel img {
    height: 100%;
    min-height: 300px;
}

.noticia.featured h5 {
    font-size: 1.8rem;
}

.noticia.featured .resumen {
    font-size: 1.1rem;
}

/* Paginación */
.pagination {
    margin: 30px 0 0 0;
}

.page-item.active .page-link {
    background-color: #000;
    border-color: #000;
}

.page-link {
    color: #000;
}

/* Responsive */
@media (max-width: 768px) {
    #noticias-container {
        grid-template-columns: 1fr;
    }
    
    .noticia.featured {
        flex-direction: column;
    }
    
    .noticia.featured .carousel,
    .noticia.featured .contenido {
        width: 100%;
    }
    
    .noticia.featured .carousel img {
        min-height: 200px;
    }
    
    .noticia.featured h5 {
        font-size: 1.4rem;
    }
}



/* LOADER PARA LA VISTA CONTENIDO DE NOTICIAS */

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.loader-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.8); /* opcional: fondo semitransparente */
    z-index: 999;
}



.spinner {
    width: 40px;
    height: 40px;
    border: 5px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
