/*
=========================================
ESTILOS PARA A PÁGINA DE NOTÍCIAS
=========================================
*/

/* Estilos gerais para a página */
header {
    text-align: center;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    color: #1c1e21;
}

header p {
    font-size: 1.1rem;
    color: #606770;
}

/* Grelha que organiza as notícias */
.news-grid {
    display: grid;
    /* Começa com 3 colunas em ecrãs grandes */
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto; /* Centraliza a grelha */
}

/* Estilo para cada artigo de notícia */
.news-article {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-article:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.news-article img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-category {
    background-color: #007bff;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 20px;
    align-self: flex-start;
    margin-bottom: 15px;
}

.news-content h3 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
    color: #1c1e21;
}

.news-content p {
    margin: 0 0 20px 0;
    color: #606770;
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
}

.read-more {
    display: inline-block;
    background-color: #1c1e21;
    color: white !important;
    padding: 10px 15px;
    text-decoration: none !important;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease;
    margin-top: auto;
}

.read-more:hover {
    background-color: #333;
}


/* --- RESPONSIVIDADE PARA MOBILE E TABLETS --- */

/* Para tablets (até 992px) */
@media (max-width: 992px) {
    .news-grid {
        /* A grelha passa a ter 2 colunas */
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Para telemóveis (até 600px) */
@media (max-width: 600px) {
    .news-grid {
        /* A grelha passa a ter 1 coluna */
        grid-template-columns: 1fr;
    }

    header h1 {
        font-size: 2rem;
    }
}