﻿:root {
    --bg: #ffffff;
    --text: #111111;
    --text-muted: #64748b;
    --primary: #0b3d91;
    --primary-hover: #0284c7;
    --card: #f4f7fb;
    --glass: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.1);

    /* Landing / Dark sections */
    --bg-dark: #0b1220;
    --bg-card-dark: #111a2e;
    --text-light: #e5e7eb;
}

/* ================= DARK MODE ================= */

body.dark {
    --bg: #0f172a;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --card: #1e293b;
    --glass: rgba(15, 23, 42, 0.9);
    --border-color: rgba(255, 255, 255, 0.1);
}

/* ================= RESET & BASE ================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    transition: background 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ================= HEADER & NAV ================= */

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    backdrop-filter: blur(12px);
    background: var(--glass);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

.header.scrolled {
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo img {
    height: 45px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links a {
    margin-left: 25px;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-hover);
}

.nav-links button#darkToggle {
    margin-left: 25px;
    cursor: pointer;
    background: none;
    border: 1px solid var(--text);
    color: var(--text);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    transition: 0.3s ease;
}

.nav-links button#darkToggle:hover {
    border-color: var(--primary-hover);
    color: var(--primary-hover);
}

.hamburger {
    display: none;
    font-size: 26px;
    cursor: pointer;
    color: var(--text);
}

/* ================= HERO SECTION ================= */

.hero {
    padding: 160px 0 80px 0;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    width: 100%;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
    color: var(--text);
}

.hero-text p {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hero-image img {
    max-width: 320px;
    width: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    border: 4px solid var(--primary);
}

/* ================= BUTTONS ================= */

.btn-primary, .btn-outline {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.95rem;
    text-align: center;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
    border: none;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(11, 61, 145, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* ================= SECTIONS & GRIDS ================= */

.section {
    padding: 80px 0;
}

.section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    font-weight: 700;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.card {
    background: var(--card);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 12px;
    color: var(--text);
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ================= FORMULÁRIO DE CONTATO (CORREÇÃO DE LAYOUT) ================= */

.form-contato {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 600px;
    width: 100%;
    margin-top: 20px;
}

.form-contato input,
.form-contato textarea {
    display: block;
    width: 100%;
    padding: 14px 18px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--card);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-contato input:focus,
.form-contato textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11, 61, 145, 0.15);
}

.form-contato textarea {
    resize: vertical;
    min-height: 140px;
}

.form-contato button[type="submit"] {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    border: none;
    cursor: pointer;
}

/* ================= CORREÇÃO DO ESPAÇAMENTO DO CONTEÚDO ================= */

/* Define padding superior automático para evitar que o header cubra o título */
.main-container,
.hero,
.container-artigos-interno {
    padding-top: 130px;
}

/* ================= PÁGINA INTERNA DE ARTIGOS ================= */

.container-artigos-interno {
    max-width: 850px;
    margin: 0 auto;
    padding-bottom: 80px;
}

.artigo-header {
    text-align: left;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.artigo-header h1 {
    font-size: 2.3rem;
    color: var(--text);
    margin: 15px 0;
    line-height: 1.3;
}

.artigo-header .subtitulo {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.artigo-conteudo {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text);
}

.artigo-conteudo h2, 
.artigo-conteudo h3 {
    color: var(--text);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.artigo-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

/* Garante que os cards gerados via JSON no artigo apareçam visíveis imediatamente */
#lista-posts .card.fade-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ================= CORREÇÃO DE SEGURANÇA PARA O FADE-IN ================= */
/* Evita que elementos fiquem invisíveis caso o script demore ou não dispare */
.fade-in {
    opacity: 1; /* Garante visibilidade padrão */
    transform: translateY(0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* Se o JS adicionar o efeito de rolagem, aplica a animação suave */
.js .fade-in {
    opacity: 0;
    transform: translateY(20px);
}

.js .fade-in.show {
    opacity: 1;
    transform: translateY(0);
}

/* ================= FADE IN ANIMATION ================= */

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.show {
    opacity: 1;
    transform: translateY(0);
}

/* ================= FOOTER ================= */

.footer {
    background: var(--card);
    border-top: 1px solid var(--border-color);
    text-align: center;
    padding: 50px 20px;
    margin-top: 60px;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 6px 0;
}

.footer strong {
    color: var(--text);
}

/* ================= RESPONSIVO (MOBILE) ================= */

@media (max-width: 768px) {
    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        gap: 30px;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero {
        padding: 120px 0 50px 0;
        min-height: auto;
    }

    .hero-text h1 {
        font-size: 2.2rem;
    }

    .hamburger {
        display: block !important;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        right: 15px;
        left: 15px;
        flex-direction: column;
        background: var(--bg);
        padding: 25px;
        border-radius: 12px;
        display: none !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
        border: 1px solid var(--border-color);
        z-index: 999;
    }

    .nav-links.active {
        display: flex !important;
    }

    .nav-links a {
        margin: 12px 0 !important;
        font-size: 1.1rem;
        text-align: center;
    }

    .nav-links button#darkToggle {
        margin: 15px 0 0 0 !important;
        width: 100%;
        padding: 10px;
        text-align: center;
        display: block !important;
    }
}