/* css/style-news.css */

body {
    background-color: #f4f6f9;
}

.page-header {
    padding: 60px 0;
    background: linear-gradient(rgba(40, 40, 60, 0.8), rgba(20, 20, 30, 0.9)), url('https://picsum.photos/1600/400?random=202') center center/cover;
    color: white;
    text-align: center;
    margin-bottom: 50px;
}
.page-header h1 { margin: 0; font-size: 42px; text-shadow: 2px 2px 4px rgba(0,0,0,0.3); }
.page-header p { margin: 10px 0 0 0; font-size: 18px; opacity: 0.9; }

/* --- Layout a due colonne con sidebar per filtri --- */
.page-wrapper {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
    padding-bottom: 60px;
}
.news-main-content { flex: 1; min-width: 0; }
.filters-sidebar {
    flex-basis: 320px;
    flex-shrink: 0;
    padding: 25px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.07);
    position: sticky;
    top: 20px;
}

/* --- Stili per i filtri (simili a eventi.php) --- */
.filter-form h3 { margin: 0 0 20px 0; font-size: 22px; padding-bottom: 15px; border-bottom: 2px solid #0056b3; color: #333; }
.filter-widget { margin-bottom: 20px; }
.filter-widget:last-child { margin-bottom: 0; }
.filter-widget label { display: block; font-weight: bold; margin-bottom: 8px; font-size: 14px; color: #495057; }
.filter-widget input[type="text"], 
.filter-widget select, 
.filter-widget input[type="date"] {
    width: 100%; padding: 10px 12px; border: 1px solid #ced4da; border-radius: 5px; font-size: 15px; box-sizing: border-box; font-family: inherit;
}
.filter-widget-group { display: flex; gap: 10px; }
.filter-actions { display: flex; gap: 10px; }
.filter-actions .btn-submit, .filter-actions .reset-filters {
    flex: 1; text-align: center; padding: 12px 10px; border-radius: 5px; font-weight: bold; cursor: pointer; text-decoration: none; font-size: 15px; transition: background-color 0.2s; border: none; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
}
.filter-actions .btn-submit { background-color: #0056b3; color: white; }
.filter-actions .reset-filters { background-color: #6c757d; color: white; }

/* --- GRIGLIA NOTIZIE PRINCIPALE --- */
.news-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.news-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
}
.news-card-link { text-decoration: none; color: inherit; display: flex; flex-direction: column; height: 100%; }
.news-card-link:hover h3 { color: #0056b3; }
.news-card-image { position: relative; }
.news-card-image img { width: 100%; height: 200px; object-fit: cover; display: block; transition: transform 0.3s ease; }
.news-card-link:hover .news-card-image img { transform: scale(1.05); }
.news-content { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.news-date { font-size: 13px; color: #6c757d; margin-bottom: 10px; display: block; }
.news-content h3 { font-size: 20px; margin: 0 0 15px 0; color: #1a1a1a; line-height: 1.4; transition: color 0.2s; }
.news-excerpt { font-size: 15px; color: #495057; line-height: 1.6; flex-grow: 1; }
.news-category {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 86, 179, 0.9);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

/* --- Stili per le reazioni sulla card delle news --- */
.card-ratings {
    display: flex;
    gap: 15px;
    margin-top: auto; /* Spinge le reazioni in fondo alla card */
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    font-size: 14px;
    color: #6c757d;
    font-weight: bold;
}
/* Rimuovi o sostituisci il vecchio stile .card-ratings se presente */
.card-ratings {
    display: none; /* Nascondiamo il vecchio stile */
}

/* NUOVI stili per le statistiche sulla card */
.card-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: auto; /* Spinge le statistiche in fondo alla card */
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.card-stats .stat-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.card-stats .stat-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

/* --- PAGINAZIONE (simile a eventi.php) --- */
.pagination-container { margin-top: 50px; display: flex; justify-content: center; }
.pagination { display: flex; gap: 8px; }
.pagination a { color: #0056b3; padding: 10px 15px; text-decoration: none; border: 1px solid #dee2e6; border-radius: 5px; background-color: #fff; font-weight: bold; }
.pagination a:hover { background-color: #e9ecef; }
.pagination a.active { background-color: #0056b3; color: white; border-color: #0056b3; }

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 992px) {
    .page-wrapper { flex-direction: column; align-items: center; }
    .filters-sidebar { position: static; width: 100%; max-width: none; margin-bottom: 40px; top: unset; }
    .filter-form h3 { text-align: center; }
    .filter-widget-group { flex-direction: column; gap: 20px; }
    .filter-widget input[type="text"], .filter-widget select, .filter-widget input[type="date"],
    .filter-actions .btn-submit, .filter-actions .reset-filters {
        font-size: 16px; padding: 14px;
    }
}