:root {
    --bg-color: #f0f2f5;
    --text-main: #1a1a1a;
    --text-muted: #5f6368;
    --accent: #007bff;
    --card-bg: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

header {
    background: linear-gradient(135deg, #1d212f 0%, #4b5563 100%);
    color: white;
    padding: 70px 20px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.header-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -1px;
}

.header-content p {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.9;
}

main {
    max-width: 1200px;
    margin: -40px auto 40px; /* L'effetto "sovrapposizione" all'header */
    padding: 0 20px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.article {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    border-top: 4px solid var(--accent); /* Linea colorata in cima alla card */
}

.article:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.article h2 {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 15px;
    line-height: 1.3;
}

.article p {
    color: var(--text-muted);
    font-size: 1rem;
    flex-grow: 1; /* Spinge il pulsante sempre in basso */
    margin-bottom: 25px;
}

.article a {
    display: inline-block;
    background-color: var(--text-main);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    transition: background-color 0.2s;
    align-self: flex-start;
}

.article a:hover {
    background-color: var(--accent);
}

/* Animazione di caricamento */
.loader {
    text-align: center;
    grid-column: 1 / -1;
    padding: 60px;
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 600;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

footer {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Adattamento per i cellulari */
@media (max-width: 768px) {
    header { padding: 50px 20px; }
    .header-content h1 { font-size: 2.2rem; }
    main { margin-top: 20px; }
    .grid-container { gap: 20px; }
    .article { padding: 25px; }
}

.update-badge {
    display: inline-block;
    margin-top: 15px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 400;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.article {
    overflow: hidden; /* Importante per arrotondare l'immagine in alto */
    padding: 0; /* Togliamo il padding interno per far toccare l'immagine ai bordi */
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

/* Stile per l'immagine della news */
.news-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #ddd;
}

.article-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.article h2 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text-main);
}

.article p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.article a {
    align-self: flex-start;
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
}
.article {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 30px; /* Rimettiamo lo spazio interno! */
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    border-top: 4px solid var(--accent); 
}