/* ==========================================================
   CATEGORIA.CSS — Versão Master 13.6 (Visual Fix & Grid)
   * Objetivo: Cards uniformes, Badges corrigidas e Layout Blindado.
   ========================================================== */

:root {
    --cat-primary: #0d6efd;
    --cat-bg-light: #f8fafc;
    --cat-text-heading: #0f172a;
    --cat-text-body: #334155;
    --cat-border: #e2e8f0;
}

/* ------------------------------
   1. HERO DA CATEGORIA
--------------------------------*/
.category-hero {
    text-align: center;
    padding: 80px 20px 60px;
    background: radial-gradient(circle at top center, #f1f5f9 0%, #ffffff 100%);
    border-bottom: 1px solid var(--cat-border);
    margin-bottom: 50px;
    position: relative;
}

.cat-breadcrumb {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}
.cat-breadcrumb a { text-decoration: none; color: #94a3b8; transition: 0.2s; }
.cat-breadcrumb a:hover { color: var(--cat-primary); }
.cat-breadcrumb i { font-size: 0.7em; margin: 0 8px; opacity: 0.5; }
.cat-breadcrumb span { color: var(--cat-primary); }

.cat-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 900;
    color: var(--cat-text-heading);
    margin-bottom: 15px;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.cat-desc {
    font-size: 1.15rem;
    color: #64748b;
    max-width: 700px;
    margin: 0 auto 25px;
    line-height: 1.6;
}

.cat-meta-info {
    display: inline-flex; align-items: center; gap: 8px;
    background: #fff; padding: 8px 20px;
    border-radius: 50px; border: 1px solid var(--cat-border);
    font-size: 0.9rem; font-weight: 600; color: #475569;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}
.cat-meta-info i { color: var(--cat-primary); }

/* ------------------------------
   2. LAYOUT PRINCIPAL (GRID + SIDEBAR)
   * Importante: display: grid forçado para segurar a sidebar
--------------------------------*/
.layout-sidebar {
    display: grid !important;
    grid-template-columns: 1fr 340px !important; /* Conteúdo Flexível + Sidebar Fixa */
    gap: 50px !important;
    align-items: start;
}

.content-col { min-width: 0; }

/* ------------------------------
   3. GRID DE POSTS & CORREÇÃO DE CARDS
--------------------------------*/
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* [FIX] Força estilo nos cards dentro da categoria */
.posts-grid .post-card {
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.02);
    display: flex; flex-direction: column; height: 100%;
    border-radius: 16px; overflow: hidden; background: #fff;
    transition: transform 0.3s ease;
}
.posts-grid .post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.08);
}

/* [FIX IMAGEM] Garante que a foto não distorça */
.posts-grid .card-thumb {
    height: 200px !important; /* Altura fixa */
    width: 100%;
    position: relative;
    overflow: hidden;
}
.posts-grid .card-thumb img {
    width: 100%; height: 100%;
    object-fit: cover !important; /* Corta para preencher, não estica */
    transition: transform 0.5s ease;
}
.posts-grid .post-card:hover .card-thumb img { transform: scale(1.05); }

/* [FIX BADGE] Arruma a etiqueta "Geral" */
.posts-grid .card-badge {
    position: absolute; top: 12px; left: 12px;
    z-index: 10;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    color: #fff !important;
    background: var(--cat-primary); /* Azul padrão */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* ------------------------------
   4. SIDEBAR (WIDGETS)
--------------------------------*/
.sidebar-col { position: sticky; top: 100px; }

.sidebar-widget {
    background: #fff;
    border: 1px solid var(--cat-border);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.widget-title {
    font-size: 1.1rem; font-weight: 800; color: var(--cat-text-heading);
    margin-bottom: 20px; padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9;
    display: flex; align-items: center; gap: 10px;
}
.widget-title i { color: var(--cat-primary); }

/* Mini Posts (Mais Lidos) */
.widget-list { display: flex; flex-direction: column; gap: 20px; }

.mini-post { display: flex; gap: 15px; align-items: flex-start; }
.mini-thumb-link { flex-shrink: 0; }

.mini-thumb {
    width: 80px; height: 80px;
    border-radius: 10px; object-fit: cover;
    background: #f1f5f9; transition: transform 0.3s;
}
.mini-post:hover .mini-thumb { transform: scale(1.05); }

.mini-content h4 {
    font-size: 0.95rem; font-weight: 700; line-height: 1.4; margin: 0 0 8px;
}
.mini-content h4 a {
    color: var(--cat-text-body); text-decoration: none; transition: 0.2s;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.mini-post:hover h4 a { color: var(--cat-primary); }

.mini-meta { font-size: 0.75rem; color: #94a3b8; font-weight: 600; }

/* Espaço de Anúncio Sidebar */
.ad-space .ad-placeholder {
    background: #f8fafc; border: 2px dashed #cbd5e1;
    border-radius: 12px; height: 250px;
    display: flex; align-items: center; justify-content: center;
}
.ad-space span {
    font-size: 0.8rem; color: #94a3b8; font-weight: 700;
    letter-spacing: 1px; text-transform: uppercase;
}

/* ------------------------------
   5. PAGINAÇÃO E EMPTY STATE
--------------------------------*/
.load-more-container { margin-top: 50px; text-align: center; }

.btn-load-more {
    padding: 12px 35px; background: #fff;
    color: var(--cat-text-body); border: 1px solid var(--cat-border);
    border-radius: 50px; font-weight: 700; cursor: pointer;
    transition: all 0.3s ease; box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}
.btn-load-more:hover {
    background: var(--cat-primary); color: #fff;
    border-color: var(--cat-primary); transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(13, 110, 253, 0.2);
}

.empty-state {
    text-align: center; padding: 80px 20px; background: #fff;
    border-radius: 20px; border: 2px dashed var(--cat-border);
}
.empty-icon { font-size: 4rem; color: #cbd5e1; margin-bottom: 20px; }
.empty-state h3 { font-size: 1.5rem; color: var(--cat-text-heading); margin-bottom: 10px; }
.empty-state p { color: #64748b; margin-bottom: 25px; }
.btn-back {
    display: inline-block; padding: 10px 25px; background: #f1f5f9;
    color: #475569; border-radius: 50px; text-decoration: none; font-weight: 700;
    transition: 0.2s;
}
.btn-back:hover { background: var(--cat-primary); color: #fff; }

/* ------------------------------
   6. RESPONSIVIDADE
--------------------------------*/
@media (max-width: 1024px) {
    .layout-sidebar {
        grid-template-columns: 1fr !important; /* Coluna única no Tablet */
        gap: 60px !important;
    }
    .sidebar-col { position: static; order: 2; }
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .category-hero { padding: 60px 20px 40px; }
    .cat-title { font-size: 2.2rem; }
    .posts-grid { grid-template-columns: 1fr !important; } /* Coluna única no Mobile */
}
