/* static/css/noticias.css - ESTILOS ESPECÍFICOS PARA NOTICIAS */

:root {
    --primary-blue: #1e40af;
    --secondary-blue: #3b82f6;
    --accent-yellow: #fbbf24;
    --light-yellow: #fef3c7;
}

/* Estilos generales para la página de noticias */
body.noticias-page {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f7fb;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column; /* IMPORTANTE: Flexbox para footer sticky */
}

/* Contenedor principal para empujar el footer hacia abajo */
main.content-wrapper {
    flex: 1 0 auto; /* Esto hace que el contenido principal ocupe el espacio disponible */
}

/* SECCIÓN DE NOTICIAS */
.news-section {
    padding-top: 100px;
    padding-bottom: 3rem; /* Espacio adicional en la parte inferior */
    min-height: calc(100vh - 400px); /* Altura mínima considerando header y footer */
    background-color: #f8fafc;
    flex: 1; /* Ocupa el espacio disponible */
}

.hero-news {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    padding: 4rem 0;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-news::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 100" preserveAspectRatio="none"><path d="M0,0 L1000,0 L1000,100 Q500,150 0,100 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: cover;
}

/* TARJETAS DE NOTICIAS */
.news-card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    height: 100%;
}

.news-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

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

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

.featured-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--accent-yellow);
    color: #1f2937;
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.8rem;
    z-index: 2;
    box-shadow: 0 3px 10px rgba(251, 191, 36, 0.3);
}

.news-title {
    color: var(--primary-blue);
    font-weight: 700;
    line-height: 1.3;
}

.news-excerpt {
    color: #6b7280;
    line-height: 1.6;
}

.read-more-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.read-more-btn:hover {
    background: var(--secondary-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 64, 175, 0.3);
    color: white;
    text-decoration: none;
}

/* BARRA DE BÚSQUEDA */
.search-box {
    max-width: 500px;
    margin: 0 auto;
}

.search-box .form-control {
    border: 2px solid var(--primary-blue);
    border-radius: 30px;
    padding: 12px 20px;
    font-size: 1rem;
}

.search-box .btn {
    border-radius: 30px;
    padding: 12px 25px;
    background: var(--accent-yellow);
    border: none;
    color: #1f2937;
    font-weight: 600;
}

/* FILTROS */
.filter-buttons .btn {
    border-radius: 20px;
    padding: 8px 20px;
    margin: 0 5px 10px;
    border: 2px solid var(--primary-blue);
    color: var(--primary-blue);
    background: white;
    transition: all 0.3s ease;
}

.filter-buttons .btn.active,
.filter-buttons .btn:hover {
    background: var(--primary-blue);
    color: white;
}

/* MENSAJES */
.no-news-message {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    min-height: 300px; /* Altura mínima para mensaje sin noticias */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* PAGINACIÓN */
.pagination .page-link {
    color: var(--primary-blue);
    border: 1px solid #d1d5db;
    margin: 0 3px;
    border-radius: 6px;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
}

.pagination .page-link:hover {
    background-color: #f3f4f6;
    border-color: var(--primary-blue);
}

/* NEWSLETTER */
.newsletter-card {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    margin-bottom: 3rem; /* Espacio antes del footer */
}

/* Loading Bar para noticias */
.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-yellow));
    width: 0;
    z-index: 9999;
    transition: width 0.3s ease;
}

/* Botones de noticias */
.btn-primary-custom {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
    color: white;
    transition: all 0.3s ease;
}

.btn-primary-custom:hover {
    background-color: var(--secondary-blue);
    border-color: var(--secondary-blue);
    transform: translateY(-2px);
}

.btn-accent {
    background-color: var(--accent-yellow);
    border-color: var(--accent-yellow);
    color: #1f2937;
    transition: all 0.3s ease;
}

.btn-accent:hover {
    background-color: #f59e0b;
    border-color: #f59e0b;
    transform: translateY(-2px);
}

/* Ajustes para cuando hay pocas noticias */
.noticias-content {
    min-height: 400px; /* Altura mínima para el contenido de noticias */
}

/* Contenedor de grid de noticias */
.news-grid-container {
    min-height: 300px; /* Altura mínima para el grid */
}

/* Footer fix */
footer.footer-custom {
    flex-shrink: 0; /* Evita que el footer se encoja */
    margin-top: auto; /* Empuja el footer hacia abajo */
    width: 100%;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .news-section {
        padding-top: 80px;
        min-height: calc(100vh - 350px);
    }
    
    .hero-news {
        padding: 3rem 0;
    }
    
    .hero-news h1 {
        font-size: 1.8rem;
    }
    
    .news-card img {
        height: 180px;
    }
    
    .filter-buttons .btn {
        margin: 0 3px 8px;
        padding: 6px 15px;
        font-size: 0.9rem;
    }
    
    .no-news-message {
        min-height: 250px;
        padding: 3rem 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-news {
        padding: 2rem 0;
    }
    
    .hero-news h1 {
        font-size: 1.5rem;
    }
    
    .search-box {
        margin-bottom: 1.5rem;
    }
    
    .filter-buttons {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 10px;
    }
    
    .news-section {
        min-height: calc(100vh - 300px);
    }
}

/* Clase para contenido vacío */
.empty-content {
    padding: 3rem 0;
    text-align: center;
    color: #6b7280;
}

.empty-content i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}