/* =========================================
       2. RESET E ESTILOS BASE
       ========================================= */
   body { 
        font-family: 'Plus Jakarta Sans', sans-serif;
        background-color: var(--bg); 
        color: var(--text); 
        margin: 0; 
        /* Garante que o conteúdo comece APÓS o header fixo */
        padding-top: calc(var(--header-height) + 20px); 
        transition: var(--transition); 
    }

    /* =========================================
       3. HEADER & BRANDING
       ========================================= */
    header.header-nav { 
        position: fixed;
        top: 0; 
        left: 0; 
        width: 100%; 
        height: var(--header-height);
        z-index: 1200; 
        background: var(--card-bg); 
        border-bottom: 1px solid var(--border); 
        display: flex;
        align-items: center;
        /* Adicione isto para garantir que ele não mude de tamanho */
        box-sizing: border-box; 
        padding: 0;
    }

    .header-container, .nav-content { 
        width: 100%;
        max-width: 1200px; 
        margin: 0 auto; 
        padding: 0 20px; 
        display: flex; 
        justify-content: space-between; 
        align-items: center;
        gap: 10px; 
    }

    .brand { 
        display: flex; 
        align-items: center; 
        gap: 12px; 
        text-decoration: none;
        min-width: fit-content; /* Impede a quebra do nome do blog */
    }
    .brand img { height: 38px; width: auto; }
    
    /* Espaçamento entre as palavras do título */
    .brand-text { 
        font-family: 'Outfit', sans-serif; 
        font-weight: 900; 
        font-size: 1.15rem; 
        text-transform: uppercase; 
        display: flex; 
        gap: 8px;    
        margin: 0;
    }

    .t-1 { color: var(--secondary); } 
    .t-2 { color: var(--primary); } 
    .t-3 { color: var(--accent); }
    .dark-mode .t-2 { color: #ffffff; }

    .nav-actions {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0; /* Impede que os botões diminuam ou sumam */
    }

    /* =========================================
       4. BOTÕES E COMPONENTES DE UI
       ========================================= */
    .btn-voltar, .theme-toggle-btn {
        height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        /* Alterado de 50px para 12px para efeito mais quadrado */
        border-radius: 12px; 
        border: 1px solid var(--border);
        background: var(--bg); 
        color: var(--text);
        transition: var(--transition);
        cursor: pointer;
        text-decoration: none;
    }

    .theme-toggle {
        width: 34px;
        height: 34px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        background: var(--bg); 
        color: var(--secondary); 
        border: none;
        cursor: pointer;
    }

    .theme-toggle:hover {
        transform: translateY(-2px); 
        box-shadow: 0 8px 20px rgba(26, 78, 120, 0.3); 
        filter: brightness(1.1); 
    }

    .btn-voltar { padding: 0 20px; gap: 8px; font-size: 0.75rem; font-weight: 800; }
    .btn-voltar:hover { background: var(--primary); color: #fff; border-color: var(--primary); transform: translateY(-2px); }
    
    .theme-toggle-btn { width: 40px; }
    .theme-toggle-btn:hover { border-color: var(--secondary); color: var(--secondary); }

    /* Pesquisa */
    .search-container { max-width: 1200px; margin: 0 auto; }
    .search-box {
        /* Centralização e Layout do Container */
        display: flex; 
        align-items: center;
        max-width: 600px;
        margin: 0 auto; /* Centraliza a barra horizontalmente */
        
        /* Estética */
        background: var(--card-bg);
        border: 1px solid var(--border);
        border-radius: 50px;
        padding: 5px 10px 5px 20px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    }

    .search-box input {
        flex: 1; /* Faz o campo de texto ocupar todo o espaço central */
        border: none;
        background: transparent;
        padding: 12px 15px;
        color: var(--text);
        outline: none;
    }

    .search-box button {
        background: var(--primary);
        color: white;
        border: none;
        padding: 10px 25px;
        border-radius: 50px;
        font-weight: 800;
        cursor: pointer;
    }

    /* =========================================
       5. GRID VITRINE (LISTAGEM)
       ========================================= */
    .main-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
    .blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; margin: 40px 0; }
    .post-card-ui { background: var(--card-bg); border-radius: 24px; border: 1px solid var(--border); overflow: hidden; transition: 0.3s; display: flex; flex-direction: column; text-decoration: none; color: inherit; height: 100%; }
    .post-card-ui:hover { transform: translateY(-8px); border-color: var(--accent); box-shadow: 0 20px 40px rgba(0,0,0,0.05); }
    .thumb { width: 100%; height: 200px; object-fit: cover; }
    .card-body { padding: 25px; }

    /* =========================================
       6. ARTIGO (ESTRUTURA E CONTEÚDO)
       ========================================= */
    .article-wrap { 
        max-width: 1200px; 
        margin: 0px auto; 
        background: var(--card-bg); 
        border-radius: 24px; 
        padding: clamp(10px, 5vw, 10px); 
        border: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

    /* CORREÇÃO: Usar unidades 'em' nos filhos permite que o botão de zoom funcione em tudo */
    .entry-content iframe, 
    .entry-content video, 
    .entry-content embed {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 16 / 9; /* Mantém a proporção de cinema/TV */
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        margin: 2rem 0;
    }
    /*Tamanho do Texto do Artigo */
    .entry-content p { font-size: 1.1em; margin-bottom: 1.8rem; text-align: justify; }
    .entry-content h2 { font-size: 1.8em; font-weight: 800; color: var(--primary); margin-top: 2rem; }
    .dark-mode .entry-content h2 { color: var(--secondary); }

    .entry-content h3, .article-wrap h1 {
        font-family: 'Outfit', sans-serif;
        color: var(--primary);
        margin-top: 2.5rem;
        margin-bottom: 1.2rem;
        font-weight: 800;
        line-height: 1.3;
    }

    /* Tamanhos relativos para os títulos dentro do artigo */
    .entry-content h3 { font-size: 1.4em; }

    .dark-mode .entry-content h2, .dark-mode .entry-content h3 { color: var(--secondary); }

    .entry-content a {
        color: var(--secondary);
        text-decoration: none;
        font-weight: 700;
        border-bottom: 2px solid rgba(51, 168, 199, 0.2);
        transition: var(--transition);
    }
    .entry-content a:hover { color: var(--accent); background: rgba(121, 199, 78, 0.06); border-bottom-color: var(--accent); }

    .capa-img { width: 100%; border-radius: 18px; margin-bottom: 35px; border: 1px solid var(--border); }

    .entry-content img { max-width: 100%; height: auto; border-radius: 12px; display: block; margin: 2.5rem auto; box-shadow: 0 4px 15px rgba(0,0,0,0.06); }

    /* =========================================
       7. MODO LEITURA (FOCO TOTAL)
       ========================================= */
    body.reading-active .capa-img, 
    body.reading-active .author-box, 
    body.reading-active footer,
    body.reading-active .search-container { 
        display: none !important; 
    }

    /* Garante que o corpo da página mantenha o espaço do header */
    body.reading-active { 
        padding-top: 0 !important; /* Remove espaço do header */
    }
    body.reading-active .article-wrap {
        border: none !important; 
        box-shadow: none !important; 
        background: transparent;
        max-width: 1100px; 
        margin: 0 auto; 
        /* Adiciona um respiro extra para o título do post não colar no header */
        padding-top: 40px !important; 
    }

    /* Opcional: Deixa o header mais discreto no modo foco */
    body.reading-active header {
        box-shadow: none;
        border-bottom: 1px solid var(--border);
    }
    body.reading-active header.header-nav { 
        display: none !important; /* Esconde o header no modo foco */
    }
    body.reading-active .entry-content iframe {
        max-width: 100%; /* Garante que o vídeo use toda a largura do foco */
        margin: 3rem 0;
    }

    /* =========================================
       8. UTILITÁRIOS E MISC
       ========================================= */

    .author-box { margin-top: 50px; padding: 30px; background: var(--bg); border-radius: 20px; display: flex; align-items: center; gap: 20px; border: 1px solid var(--border); }
    .author-avatar { width: 70px; height: 70px; border-radius: 15px; object-fit: cover; }

    .floating-bar { position: fixed; top: 50%; right: 25px; transform: translateY(-50%); background: var(--card-bg); padding: 15px 8px; border-radius: 20px; display: flex; flex-direction: column; gap: 15px; box-shadow: 0 10px 40px rgba(0,0,0,0.08); z-index: 999; border: 1px solid var(--border); }
    .tool-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; width: 45px; }
    .tool-btn span { font-size: 0.55rem; font-weight: 800; margin-top: 5px; text-transform: uppercase; }

    /* Estilização da Tag do Desenvolvedor */
    .dev-tag {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: var(--card-bg);
        padding: 8px 16px;
        border-radius: 50px;
        text-decoration: none;
        color: var(--text);
        font-size: 0.75rem;
        font-weight: 700;
        border: 1px solid var(--border);
        margin-top: 20px;
        transition: var(--transition);
    }
    .dev-tag:hover {
        border-color: var(--secondary);
        transform: translateY(-2px);
        box-shadow: var(--shadow);
    }
    .dev-tag img {
        filter: grayscale(1);
        transition: var(--transition);
    }
    .dev-tag:hover img {
        filter: grayscale(0);
    }

    /* =========================================
       9. RESPONSIVIDADE (MEDIA QUERIES)
       ========================================= */
    @media (max-width: 1100px) {
        .floating-bar { top: auto; bottom: 20px; right: 50%; transform: translateX(50%); flex-direction: row; border-radius: 50px; padding: 10px 25px; }
    }

    @media (max-width: 768px) {
        :root {
            --header-height: 65px; /* Reduz um pouco a altura no mobile */
        }
        body { padding-top: calc(var(--header-height) + 10px); transition: none !important;}
        .brand-text { font-size: 0.9rem; gap: 4px;} /* Diminui um pouco o texto no mobile */
        .btn-voltar {
            width: 40px;
            height: 40px;
            padding: 0;
            border-radius: 10px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }
        .btn-voltar i {
            font-size: 1.1rem; /* Garante que o ícone tenha tamanho */
            margin: 0;
            display: block;
        }
        .btn-voltar span {
            display: none; /* Esconde apenas o texto, preservando o ícone */
        }
        .brand-text .t-2:last-of-type, 
        .brand-text .t-1:last-of-type { 
            display: none; 
        }
        .btn-voltar span { display: none; }
        .brand img {
            height: 30px; /* Logo menor no mobile */
        }
        .entry-content { font-size: 1.1rem; text-align: left; }
        .capa-img { max-height: 250px; }
        
        body.reading-active .article-wrap {
            padding: 40px 5px !important; /* Respiro interno lateral */
            width: 100% !important;
            max-width: 100vw !important; /* Trava na largura da janela */
            margin: 0 !important;
            border-radius: 0;
            overflow-x: hidden; /* Corta qualquer transbordamento interno */
        }
        body.reading-active {
            overflow-x: hidden;
            position: relative;
            width: 100%;
        }
        body.reading-active .floating-bar {
            bottom: 10px;
            opacity: 0.8;
        }
        .theme-toggle-btn {
            width: 40px;
            height: 40px;
            border-radius: 10px;
        }
    }

    /* Estilo Base do Selo (Modo Light) */
    .badge-origem {
        font-size: 0.6rem;
        font-weight: 800;
        padding: 2px 10px;
        border-radius: 50px;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        text-transform: uppercase;
        /* Cores Modo Light: Azul Profundo com fundo suave */
        color: #1A4E78; 
        background: rgba(26, 78, 120, 0.1);
        border: 1px solid rgba(26, 78, 120, 0.2);
        transition: var(--transition);
    }

    /* Estilo Fluorescente (Modo Dark) */
    .dark-mode .badge-origem {
        /* Verde Neon Fluorescente */
        color: #ADFF2F; 
        background: rgba(173, 255, 47, 0.1);
        border: 1px solid rgba(173, 255, 47, 0.3);
        box-shadow: 0 0 10px rgba(173, 255, 47, 0.2);
        text-shadow: 0 0 5px rgba(173, 255, 47, 0.5);
    }

    @media (max-width: 600px) {
        .author-box { flex-direction: column; text-align: center; padding: 20px; }
        .author-avatar { width: 80px; height: 80px; }
    }
    @media (max-width: 480px) {
        .brand-text {
            font-size: 0.85rem;
        }
        /* Opcional: Esconde o " | BLOG" em telas muito pequenas para dar espaço aos botões */
        .brand-text .t-2:last-of-type, 
        .brand-text .t-1:last-of-type { 
            display: none; 
        }
    }


/* =========================================
   FILTROS DE BUSCA (CHIPS)
   ========================================= */
.filter-chips {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.chips-wrapper {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding: 0 10px;
}

.chip {
    padding: 6px 14px; /* Redução leve para ocupar menos espaço lateral */
    border-radius: 50px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text);
    /* 0.7rem (~11px) costuma ser o limite inferior para legibilidade em maiúsculas */
    font-size: 0.7rem; 
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    transition: var(--transition);
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.5px; /* Melhora a leitura de fontes pequenas e em uppercase */
}

/* Estado Hover */
.chip:hover {
    border-color: #ffffff;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: var(--accent);
}

/* Estado Ativo (Selecionado) */
.chip.active {
    background: var(--secondary) !important;
    color: #ffffff !important;
    border-color: var(--secondary) !important;
    box-shadow: 0 6px 15px rgba(51, 168, 199, 0.3);
}

/* Ajuste Mobile Refinado (768px para manter consistência com o menu) */
@media (max-width: 768px) {
    .filter-chips {
        margin-top: 20px;
    }

    .chips-wrapper {
        display: flex;
        flex-wrap: nowrap;       /* Impede a quebra de linha */
        overflow-x: auto;        /* Ativa o scroll lateral */
        justify-content: flex-start; /* Alinha os itens à esquerda */
        padding: 5px 15px;       /* Padding lateral para o chip não encostar na borda */
        gap: 8px;
        -webkit-overflow-scrolling: touch; /* Scroll suave no iOS */
    }
    .chips-wrapper::-webkit-scrollbar {
        display: none;           /* Esconde a barra de scroll para um visual cleaner */
    }

    .chip {
        font-size: 0.65rem;
    }
    
    .chip.active {
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    }
    .cookie-wrapper { flex-direction: row; text-align: left; }
    .btn-cookie { width: auto; min-width: 140px; }
}
 /* Container de Cookies */
    .cookie-container { 
        position: fixed; bottom: -200px; left: 50%; transform: translateX(-50%); 
        width: 92%; max-width: 550px; 
        background: var(--card-bg); 
        border: 1px solid var(--border);
        border-top: 4px solid var(--secondary); 
        border-radius: 20px; 
        box-shadow: 0 20px 40px -10px rgba(0,0,0,0.3); 
        z-index: 10001; padding: 20px; 
        transition: 0.7s cubic-bezier(0.19, 1, 0.22, 1);
        backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    }
    .cookie-container.show { bottom: 20px; }

    .cookie-wrapper { display: flex; flex-direction: column; gap: 15px; align-items: center; text-align: center; }
    .cookie-text { font-size: 0.85rem; line-height: 1.4; color: var(--text); }
    .cookie-text a { color: var(--secondary); font-weight: 700; text-decoration: none; transition: 0.2s; }
    .cookie-text a:hover { text-decoration: underline; }

    .btn-cookie { 
        width: 100%; background: var(--primary); color: #fff; border: none; 
        padding: 14px; border-radius: 14px; font-weight: 800; font-size: 0.9rem;
        cursor: pointer; transition: 0.3s; text-transform: uppercase; letter-spacing: 1px;
    }

    html {
        background-color: #F1F5F9; /* Cor do seu --bg light */
    }
    html.dark-mode {
        background-color: #0B0F1A; /* Cor do seu --bg dark */
    }