/* ================= noticias.css ================= */

/* --- ESTRUTURA GERAL --- */
.news-container {
    max-width: 1200px;
    margin: 120px auto 50px auto; /* Topo reduzido para mobile */
    padding: 0 16px; /* Ajuste sutil nas laterais para mobile */
    position: relative;
    z-index: 10;
}

/* --- TÍTULO PRINCIPAL --- */
.news-header {
    text-align: center;
    margin-bottom: 30px; /* Reduzido no mobile */
}

.subtitle-top {
    font-family: var(--font-texto);
    font-size: 0.7rem; /* Levemente menor no mobile */
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--cor-acento);
    margin-bottom: 12px;
    font-weight: 600;
    display: block;
}

.news-header h2 {
    font-family: var(--font-titulo);
    font-size: clamp(2.2rem, 7vw, 3.5rem); /* Tamanho fluido */
    color: var(--cor-texto);
    margin-bottom: 15px;
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: 1px;
}

.news-header p {
    font-family: var(--font-texto);
    color: #b0a89f;
    max-width: 650px;
    margin: 0 auto;
    font-size: clamp(0.9rem, 3vw, 1.05rem);
    line-height: 1.6;
}

.divider {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(212, 175, 55, 0.4), transparent);
    margin: 30px 0;
}

/* --- FILTROS DE CATEGORIA --- */
.filter-container {
    margin-top: 25px;
    display: flex;
    flex-wrap: wrap; /* Permite empilhar os botões no celular */
    justify-content: center;
    gap: 10px; /* Menos espaço no mobile */
    margin-bottom: 40px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.03); /* Fundo sutil */
    border: 1px solid rgba(212, 175, 55, 0.2);
    color: #b0a89f;
    padding: 10px 15px; /* Maior área de toque no celular */
    font-family: var(--font-texto);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    border-radius: 25px;
    transition: all 0.3s ease;
    flex-grow: 1; /* Estica os botões no mobile */
    text-align: center;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--cor-acento);
    color: #111;
    border-color: var(--cor-acento);
    font-weight: 600;
}

/* --- GRID DE NOTÍCIAS --- */
.news-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile: 1 coluna */
    gap: 30px;
    margin-bottom: 60px;
}

/* Oculta itens filtrados via JS */
.grid-card.hidden {
    display: none;
}

/* --- ESTILOS COMUNS DOS CARDS --- */
article {
    background-color: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(212, 175, 55, 0.1);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 12px;
}

.news-image-wrapper {
    width: 100%;
    height: 200px; /* Altura padrão mobile */
    border-radius: 4px;
    overflow: hidden;
    background-color: #000;
}

.news-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(30%) contrast(110%) brightness(70%);
    transition: transform 0.8s ease, filter 0.6s ease;
}

.news-content {
    padding: 20px 10px 10px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-tag {
    display: inline-block;
    color: var(--cor-acento);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.news-content h4 {
    font-family: var(--font-titulo);
    color: var(--cor-texto);
    margin-bottom: 12px;
    font-size: clamp(1.3rem, 4vw, 1.5rem);
    line-height: 1.3;
    font-weight: 400;
}

.news-content p {
    color: #a39b92;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 25px;
    flex-grow: 1;
}

.read-more {
    color: var(--cor-texto);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid var(--cor-acento);
    align-self: flex-start;
    padding-bottom: 4px;
    transition: color 0.3s ease, border-color 0.3s ease;
    margin-top: auto;
}

.read-more:hover {
    color: var(--cor-acento);
    border-color: transparent;
}

/* --- EFEITOS DE HOVER (PC) --- */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.card-hover:hover {
    background-color: rgba(255, 255, 255, 0.04);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    border-color: rgba(212, 175, 55, 0.4);
}

.card-hover:hover .news-image-wrapper img {
    transform: scale(1.05);
    filter: sepia(0%) contrast(105%) brightness(100%);
}

/* ================= EDIÇÕES ANTERIORES ================= */
.past-editions {
    margin-top: 50px;
    padding: 30px 15px; /* Ajuste mobile */
    border: 1px solid rgba(212, 175, 55, 0.15);
    background: radial-gradient(circle at center, rgba(30, 26, 22, 0.3) 0%, transparent 100%);
    border-radius: 6px;
}

.past-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}

.past-header h3 {
    font-family: var(--font-cursiva);
    font-size: clamp(2rem, 6vw, 2.5rem);
    color: var(--cor-acento);
    font-weight: 400;
    margin-bottom: 10px;
}

.decorative-line {
    width: 50px;
    height: 1px;
    background-color: var(--cor-acento);
    opacity: 0.6;
}

.past-list {
    list-style: none;
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
}

.past-list li {
    border-bottom: 1px dashed rgba(212, 175, 55, 0.2);
}

.past-list li:last-child {
    border-bottom: none;
}

.past-list a {
    display: flex;
    flex-direction: column; /* Mobile: Empilha data e título */
    padding: 15px 5px;
    text-decoration: none;
    gap: 5px;
}

.past-list .date {
    font-family: var(--font-texto);
    font-size: 0.7rem;
    color: var(--cor-acento);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.past-list .title-link {
    font-family: var(--font-titulo);
    font-size: 1.1rem;
    color: var(--cor-texto);
    transition: color 0.3s ease;
}

/* ================= COMENTÁRIOS (CARTAS DOS LEITORES) ================= */
.comments-section {
    margin-top: 50px;
    padding: 30px 15px; /* Mobile mais apertadinho */
    border: 1px solid rgba(212, 175, 55, 0.15);
    background-color: rgba(255, 255, 255, 0.02); /* Leve destaque de fundo */
    border-radius: 6px;
    position: relative;
}

/* Linha decorativa no topo da seção */
.comments-section::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background-color: var(--cor-acento);
}

.comments-header {
    display: flex;
    flex-direction: column; /* Mobile: Empilhado */
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px dashed rgba(181, 168, 152, 0.2);
}

.comments-header h3 {
    font-family: var(--font-titulo);
    font-size: clamp(1.4rem, 5vw, 1.8rem);
    color: var(--cor-texto);
    font-weight: 400;
    letter-spacing: 1px;
}

.comments-count {
    font-family: var(--font-texto);
    font-size: 0.7rem;
    color: var(--cor-acento);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 40px;
}

.comment {
    display: flex;
    gap: 15px; /* Menor no mobile */
    animation: slideIn 0.4s ease forwards;
}

/* Avatar minimalista usando iniciais */
.comment-avatar {
    width: 40px; /* Menor no mobile */
    height: 40px;
    background-color: rgba(212, 175, 55, 0.05);
    border: 1px solid var(--cor-acento);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cor-acento);
    font-family: var(--font-titulo);
    font-size: 1rem;
    flex-shrink: 0;
}

.comment-body {
    flex-grow: 1;
    padding-top: 2px;
}

.comment-info {
    display: flex;
    flex-wrap: wrap; /* Evita quebra feia se o nome for grande */
    justify-content: space-between;
    gap: 5px;
    margin-bottom: 8px;
    align-items: baseline;
}

.comment-info strong {
    font-family: var(--font-texto);
    color: var(--cor-texto);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.comment-date {
    font-family: var(--font-cursiva);
    color: #8c8273;
    font-size: 1.1rem;
}

.comment-body p {
    color: #e5e0d8; /* Mais clarinho pra melhorar a leitura */
    font-size: 0.95rem;
    line-height: 1.6;
    font-family: var(--font-texto);
}

/* --- Área do Input e Botão de Publicar --- */
.comment-form {
    display: flex;
    flex-direction: column; /* Mobile: Input em cima, botão embaixo */
    gap: 12px;
    margin-top: 20px;
}

.comment-input {
    flex-grow: 1;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(181, 168, 152, 0.3);
    color: var(--cor-texto);
    padding: 15px;
    border-radius: 4px;
    font-family: var(--font-texto);
    font-size: 0.95rem; /* Ajustado para evitar zoom automático no iOS */
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.comment-input:focus:not(:disabled) {
    outline: none;
    border-color: var(--cor-acento);
    background-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
}

.comment-input::placeholder {
    color: #6a6256;
    font-style: italic;
    opacity: 1;
}

.comment-btn {
    background-color: rgba(212, 175, 55, 0.1); /* Destaque sutil no mobile */
    color: var(--cor-texto);
    font-family: var(--font-texto);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid var(--cor-acento);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    width: 100%; /* Botão ocupa tudo no mobile */
    text-align: center;
}

.comment-btn:hover {
    background-color: var(--cor-acento);
    color: #111;
}

/* Botão de Deletar Comentário */
.btn-delete {
    background: none;
    border: none;
    color: #8c8273;
    cursor: pointer;
    padding: 8px; /* Maior área de toque */
    margin-left: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
    opacity: 0.7;
}

.btn-delete:hover {
    color: #e74c3c;
    opacity: 1;
    background-color: rgba(231, 76, 60, 0.1);
    transform: scale(1.1);
}

/* Estado de input desabilitado */
.comment-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: rgba(0, 0, 0, 0.3) !important;
}

/* Mensagem quando não há comentários */
.no-comments {
    text-align: center;
    padding: 40px 20px;
}

.no-comments p {
    color: #8c8273;
    font-family: var(--font-cursiva);
    font-size: clamp(1.2rem, 4vw, 1.5rem);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ==========================================
   TABLETS E DESKTOPS
   ========================================== */

/* 📐 TABLET (≥ 768px) */
@media (min-width: 768px) {
    .news-container {
        padding: 0 30px;
        margin-top: 150px;
    }

    .filter-container {
        flex-wrap: nowrap; /* Desliga a quebra de linha dos botões */
    }

    .filter-btn {
        flex-grow: 0;
        padding: 8px 20px;
    }

    .news-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 Colunas */
        gap: 35px;
    }

    .past-list a {
        flex-direction: row; /* Data e título lado a lado */
        align-items: baseline;
        gap: 20px;
    }
    
    .past-list .date {
        min-width: 80px;
    }

    /* Comentários */
    .comments-section {
        padding: 40px;
    }

    .comments-header {
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
    }

    .comment-avatar {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }

    .comment-form {
        flex-direction: row; /* Input e botão lado a lado no PC */
        gap: 15px;
    }

    .comment-btn {
        width: auto;
        padding: 0 30px; /* Restaura o botão compacto */
        background-color: transparent;
    }
}

/* 🖥️ DESKTOP (≥ 1024px) */
@media (min-width: 1024px) {
    .news-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 Colunas */
        gap: 40px;
    }

    .news-image-wrapper {
        height: 240px;
    }

    .past-list li:hover {
        background-color: rgba(255, 255, 255, 0.03);
    }
    
    .past-list a:hover .title-link {
        color: var(--cor-destaque);
    }
}

/* ♿ ACESSIBILIDADE */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; transform: none !important; animation: none !important; }
}