/* public/css/news-block.css */

/* =========================================
   ESTRUTURA DA SEÇÃO
   ========================================= */
.news-section {
    /* Puxa a seção para cima do Hero (efeito overlap) */
    margin-top: calc(-1 * var(--spacing-xxl)); 
    position: relative;
    z-index: var(--z-index-fixed); 
    padding-top: var(--spacing-xl); 
}

.news-section-title {
    margin-bottom: var(--spacing-lg);
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-bold);
}

/* =========================================
   CARD DE NOTÍCIA (Base)
   ========================================= */
.news-block-item {
    background-color: var(--clr-bg-base); 
    border: var(--border-thin); 
    border-radius: var(--radius-lg); 
    box-shadow: var(--shadow-default); 
    overflow: hidden;
    height: 100%; 
    display: flex;
    flex-direction: column;
    justify-content: flex-end; 
    position: relative; 
    color: var(--clr-text-primary); 
    transition: transform var(--transition-default), box-shadow var(--transition-default);
}

.news-block-item:hover {
    box-shadow: var(--shadow-lg); 
    transform: translateY(-4px); /* Leve subida no hover */
    cursor: pointer;
}

/* Ajustes Específicos */
.news-block-item.main-news {
    min-height: 550px; 
}

.news-block-item.secondary-news {
    min-height: 315px;
    box-shadow: var(--shadow-sm);
}

/* =========================================
   MÍDIA E FUNDOS
   ========================================= */
.news-media-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-size: cover;
    background-position: center;
    z-index: var(--z-index-base); 
    transition: transform var(--transition-slow);
}

/* Zoom na imagem ao passar o mouse */
.news-block-item:hover .news-media-background {
    transform: scale(1.05);
}

.news-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: calc(var(--z-index-base) + 1); 
    /* Gradiente preto para garantir leitura do texto */
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 40%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

/* =========================================
   CONTEÚDO DE TEXTO
   ========================================= */
.news-content-wrapper {
    position: relative;
    z-index: calc(var(--z-index-base) + 2); 
    padding: var(--spacing-lg); 
    width: 100%;
}

.news-block-item h3 {
    padding: 0;
    font-size: 1.8rem; 
    line-height: 1.2;
    margin: 0 0 var(--spacing-sm) 0;
    font-weight: var(--font-weight-bold);
}

.news-block-item h4 {
    margin: 0 0 6px 0; 
    font-size: 1.15em; 
    line-height: 1.3;
    font-weight: var(--font-weight-semibold);
}

/* =========================================
   META DADOS E CATEGORIAS (Main & Secondary)
   ========================================= */

/* BADGE: Categoria Principal (Acima do título) */
.news-badge-wrapper {
    margin-bottom: var(--spacing-xs);
}

.news-badge-main {
    background: var(--clr-accent-m);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
}

/* METADATA: Linha inferior (Data e Autor) */
.news-meta-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
}

/* BADGE & META: Notícias Secundárias (Categoria | Data) */
.news-meta-sec {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.news-badge-sec {
    color: var(--clr-accent-l); 
    font-weight: bold; 
    text-transform: uppercase; 
    font-size: 0.75rem; 
    letter-spacing: 0.5px;
    display: flex; 
    align-items: center; 
    gap: 4px;
}

.news-separator {
    opacity: 0.4;
    font-size: 0.7rem;
}

.news-meta-date-sec {
    font-size: 0.8em; 
    color: rgba(255,255,255,0.6);
}

/* =========================================
   LAYOUTS E UTILITÁRIOS
   ========================================= */
/* Container para empilhar as notícias secundárias */
.secondary-news-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg); /* Espaçamento entre os cards pequenos */
    height: 100%;
}

/* Estado Vazio (Sem notícias) */
.news-empty-state {
    width: 100%;
    padding: 60px;
    text-align: center;
    color: var(--clr-text-tertiary);
    border: 2px dashed var(--clr-border);
    border-radius: var(--radius-lg);
    background: rgba(0,0,0,0.2);
}

.news-empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
    opacity: 0.5;
}

/* =========================================
   RESPONSIVIDADE MOBILE
   ========================================= */

@media (max-width: 992px) {
    /* Em tablets, os cards secundários viram grid */
    .secondary-news-container {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .news-block-item.secondary-news {
        flex: 1 1 calc(50% - var(--spacing-md));
        min-height: 250px;
    }
}

@media (max-width: 768px) {
    /* Remover overlap do hero em mobile */
    .news-section {
        margin-top: 0;
    }

    .news-section-title {
        font-size: 1.5rem;
    }

    /* Main news menor em mobile */
    .news-block-item.main-news {
        min-height: 400px;
    }

    .news-block-item.main-news h3 {
        font-size: 1.4rem;
    }

    /* Cards secundários ocupam 100% */
    .news-block-item.secondary-news {
        flex: 1 1 100%;
        min-height: 200px;
    }

    .news-content-wrapper {
        padding: var(--spacing-md);
    }
}

@media (max-width: 480px) {
    .news-block-item.main-news {
        min-height: 350px;
    }

    .news-block-item.main-news h3 {
        font-size: 1.25rem;
    }

    .news-block-item h4 {
        font-size: 1rem;
    }

    .news-meta-row {
        font-size: 0.75rem;
    }
}