﻿/* ========================================
   Importação de Fonte e Reset Básico
======================================== */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ========================================
   Base do Body
======================================== */
body {
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.7;
}

/* ========================================
   Cabeçalho
======================================== */
.header {
    background-color: #000;
    color: #fff;
    text-align: center;
    padding: 15px;
    margin-bottom: 20px;
    position: relative;
}

    /* ajustando para o <h2> que você usou */
    .header h2 {
        margin: 0;
        font-size: 2em;
        font-weight: bold;
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 15px;
    }

        /* se usar link dentro do h2 */
        .header h2 a {
            color: inherit;
            text-decoration: none;
        }

            .header h2 a:hover {
                color: #ddd;
            }

/* ========================================
   Área de Notícias (Grid Principal)
======================================== */
.news-list {
    width: 90%;
    max-width: 800px;
    margin: 0 auto 20px;
}

/* Cada notícia no formato horizontal quando tiver imagem */
.news-item-horizontal {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px;
    margin: 10px 0;
}

/* Miniatura da notícia */
.news-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
}

/* Conteúdo da notícia */
.news-content {
    flex: 1;
}

    .news-content h3 {
        font-size: 1.2rem;
        margin: 0 0 5px;
        color: #000;
        font-weight: bold;
        line-height: 1.3;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* Limita a 2 linhas */
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        word-wrap: break-word;
        white-space: normal;
    }

    .news-content a {
        text-decoration: none;
        color: inherit;
        display: block;
    }

        .news-content a:hover h3 {
            color: #007bff;
        }

    .news-content p {
        font-size: 0.95rem;
        color: #555;
        display: -webkit-box;
        -webkit-line-clamp: 3; /* Limita a 3 linhas */
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.4;
        max-height: calc(1.4em * 3);
    }

/* Notícias sem imagem */
.news-item {
    background: #fff;
    font-size: 1.6rem;
    font-weight: bold;
    line-height: 1.4;
    color: #000;
    border: 1px solid #ddd;
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

    .news-item a {
        text-decoration: none;
        color: #000;
    }

        .news-item a:hover {
            color: #007bff;
        }

/* ========================================
   Rodapé
======================================== */
.footer {
    text-align: center;
    padding: 20px;
    background-color: #000;
    color: #fff;
}

    .footer a {
        color: #fff;
        text-decoration: none;
    }

        .footer a:hover {
            text-decoration: underline;
        }

/* ========================================
   Responsividade
======================================== */
/* Grandes tablets / desktops estreitos */
@media (max-width: 992px) {
    .header h2 {
        font-size: 1.75em;
        gap: 12px;
    }

    .news-thumbnail {
        width: 90px;
        height: 90px;
        margin-right: 12px;
    }
}

/* Tablets e landscape phones */
@media (max-width: 768px) {
    .header h2 {
        font-size: 1.5em;
        gap: 10px;
        flex-wrap: wrap;
    }

        .header h2 img {
            height: 50px;
        }

    .news-thumbnail {
        width: 80px;
        height: 80px;
        margin-right: 10px;
    }
}

/* Phones portrait */
@media (max-width: 480px) {
    .header h2 {
        font-size: 1.2em;
        gap: 8px;
    }

        .header h2 img {
            height: 40px;
        }
    /* empilha as notícias no mobile */
    .news-item-horizontal {
        flex-direction: column;
        align-items: flex-start;
    }

    .news-thumbnail {
        width: 100%;
        height: auto;
        margin: 0 0 10px;
    }

    .news-content h3 {
        font-size: 1.1rem;
    }

    .news-content p {
        font-size: 0.9rem;
    }
}
