/*
 * CSS para Layout Editorial de Notícias (Estrutura 1 + 2 + 2)
 * Versão Final v4.1: Corrige o layout para cards infinitos (n+4).
 */

/* --- 1. FUNDAÇÃO E ESTILOS GLOBAIS --- */
*, *::before, *::after {
    box-sizing: border-box;
}
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f6;
}
img {
    max-width: 100%;
    display: block;
}
h1 {
    display: none;
}

/* --- 2. CONTÊINER PRINCIPAL --- */
.news-grid-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 40px 30px;
}
.news-grid-container > div {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 30px;
}

/* --- 3. ESTILO GERAL DOS CARDS --- */
.listing-item {
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}
.listing-item a {
    text-decoration: none;
    color: inherit; /* Será sobrescrito pelas regras de título */
}
.listing-item .excerpt {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* --- ALTERAÇÃO AQUI: Novas regras de cor para os títulos --- */
.listing-item .title a {
    color: #fc8027; /* Cor Laranja padrão */
    transition: color 0.3s ease; /* Adiciona uma transição suave de cor */
}
.listing-item .title a:hover {
    color: #111111; /* Cor Preta no hover (um preto suave) */
}


/* --- 4. LAYOUT DA GRADE (1 + 2 + 2) --- */

/* --- ARTIGO PRINCIPAL (1) --- */
.listing-item:first-child {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
}
.listing-item:first-child a.image {
    flex: 0 0 55%;
    align-self: stretch;
    aspect-ratio: 16 / 9;
    height: auto;
}
.listing-item:first-child .content {
    flex: 1;
    padding: 30px 40px;
}
.listing-item:first-child .title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
}

/* --- ARTIGOS SECUNDÁRIOS (2) --- */
.listing-item:nth-child(2),
.listing-item:nth-child(3) {
    grid-column: span 6;
    flex-direction: column;
}
.listing-item:nth-child(2) a.image,
.listing-item:nth-child(3) a.image {
    height: 250px;
}
.listing-item:nth-child(2) .content,
.listing-item:nth-child(3) .content {
    padding: 25px;
}
.listing-item:nth-child(2) .title,
.listing-item:nth-child(3) .title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

/* --- ARTIGOS TERCIÁRIOS (TODOS OS SEGUINTES) --- */
/* Esta é a correção para aplicar a todos após o 3º */
.listing-item:nth-child(n+4) {
    grid-column: span 6;
    flex-direction: column;
}
.listing-item:nth-child(n+4) a.image {
    height: 200px;
}
.listing-item:nth-child(n+4) .content {
    padding: 20px;
}
.listing-item:nth-child(n+4) .title {
    font-size: 1.2rem;
    font-weight: 700;
}
.listing-item:nth-child(n+4) .excerpt {
    display: none;
}
/* --- FIM DA CORREÇÃO --- */


/* --- ALTERAÇÃO AQUI: Cores para os cards menores (sobre a imagem) --- */
.listing-item:nth-child(n+4) .title a {
    color: #FC8027; /* Mantém o branco por padrão para legibilidade */
}
.listing-item:nth-child(n+4) .title a:hover {
    color: #fc8027; /* Muda para laranja no hover para consistência */
}


/* --- 5. ESTILOS DE IMAGEM E RESPONSIVIDADE --- */
.listing-item a.image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Tablets (até 1024px) */
@media (max-width: 1024px) {
    .news-grid-container { padding: 30px 20px; }
    .news-grid-container > div { grid-template-columns: 1fr; }
    .listing-item, .listing-item:first-child, .listing-item:nth-child(n+2) { grid-column: span 1; }
    .listing-item:first-child { flex-direction: column; }
}

/* Mobile (até 767px) */
@media (max-width: 767px) {
    .news-grid-container { padding: 20px 15px; }
    .news-grid-container > div { gap: 20px; }
    .listing-item:first-child a.image { aspect-ratio: 16 / 9; height: auto; }
    .listing-item:first-child .title { font-size: 1.8rem; }
    .listing-item:first-child .content { padding: 25px; }
}