/* ---------------------------------- */
/* Paleta de Cores e Configurações Base */
/* ---------------------------------- */
:root {
    --color-background: #f8f9fa;
    /* Um branco levemente acinzentado */
    --color-surface: #ffffff;
    /* Branco puro para o card principal */
    --color-primary: #1a3a6b;
    /* Azul-marinho profundo */
    --color-secondary: #343a40;
    /* Grafite escuro para texto principal */
    --color-muted: #6c757d;
    /* Cinza suave para textos secundários */
    --color-accent: #c2995e;
    /* Dourado/Ocre para destaque */
    --color-border: #dee2e6;
    /* Cor da borda sutil */
    --primary-dark: #001b34;
    /* 60% usage */
    --accent-red: #ff162a;
    /* 30% usage */
    --accent-gold: #ffd700;
    --font-primary: 'Inter', sans-serif;
}

/* -------------------- */
/* Estilos Gerais */
/* -------------------- */
body {
    font-family: var(--font-primary);
    background-color: var(--color-background);
    color: var(--color-secondary);
}

/* Card principal do artigo */
article {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.07);
    border: 1px solid var(--color-border);
}

/* -------------------- */
/* Tipografia */
/* -------------------- */
h1 {
    color: var(--color-primary);
    letter-spacing: -0.025em;
    /* Aproxima um pouco as letras */
}

h2 {
    color: var(--color-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-border);
    margin-top: 3rem;
    /* Aumenta o espaçamento superior */
}

/* Estilização da classe .prose do Tailwind */
.prose p,
.prose ul {
    line-height: 1.75;
    /* Aumenta o espaçamento entre linhas para leitura */
}

.prose a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    background-image: linear-gradient(var(--color-accent), var(--color-accent));
    background-position: 0% 100%;
    background-repeat: no-repeat;
    background-size: 0% 2px;
    transition: background-size .3s;
}

.prose a:hover {
    background-size: 100% 2px;
}

/* -------------------- */
/* Imagens e Legendas */
/* -------------------- */
figure img {
    border: 1px solid var(--color-border);
}

figcaption {
    color: var(--color-muted);
    font-style: italic;
}

/* -------------------- */
/* Seção de FAQ */
/* -------------------- */
#faq h2 {
    border-bottom: none;
    /* Remove a borda do H2 do FAQ */
    text-align: center;
    margin-bottom: 2rem;
}

details.group {
    background-color: transparent;
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

details.group:hover {
    border-color: var(--color-accent);
    background-color: #fff;
}

details.group[open] {
    background-color: var(--color-surface);
    border-color: var(--color-primary);
}

summary {
    font-size: 1.125rem;
    /* 18px */
    font-weight: 600;
    color: var(--color-secondary);
    position: relative;
}

details[open] summary {
    color: var(--color-primary);
}

summary .icon {
    transition: transform 0.3s ease;
}

details[open] summary .icon {
    transform: rotate(45deg);
}

.faq-answer {
    color: var(--color-muted);
    border-top: 1px solid var(--color-border);
    padding-top: 1rem;
    margin-top: 1rem;
}


/* -------------------- */
/* Call to Action (CTA) */
/* -------------------- */
.cta-section1 {
    background-color: var(--color-primary) !important;
    border: 1px solid var(--color-accent) !important;
}

.cta-section1 h3 {
    color: #fff !important;
}

.cta-section p {
    color: rgba(255, 255, 255, 0.85) !important;
}

.cta-button {
    background-color: var(--color-accent) !important;
    color: var(--color-primary) !important;
    font-weight: 700 !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.2) !important;
}

.cta-button:hover {
    background-color: #d6a96a !important;
    /* Um dourado um pouco mais claro */
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 15px -3px rgba(0, 0, 0, 0.3) !important;
}

/* CSS adicional para sidebars fixas */
@media (min-width: 1280px) {
    .xl:sticky {
        position: sticky;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }

    .xl:sticky::-webkit-scrollbar {
        width: 4px;
    }

    .xl:sticky::-webkit-scrollbar-track {
        background: transparent;
    }

    .xl:sticky::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }

    .xl:sticky::-webkit-scrollbar-thumb:hover {
        background: rgba(0, 0, 0, 0.3);
    }
}

/* Responsividade para telas menores */
@media (max-width: 1279px) {
    /* FORÇA overflow-x hidden em TUDO */
    html, body {
        overflow-x: hidden !important;
        max-width: 100vw !important;
    }

    /* Container principal */
    .container.mx-auto {
        max-width: 100vw !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        overflow-x: hidden !important;
    }

    /* Flex container principal */
    .flex.flex-col.xl\\:flex-row {
        gap: 1rem !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Sidebars */
    .xl\\:w-72 {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Artigo principal */
    article.flex-1 {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.75rem !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    /* Remove margin-top dos includes no mobile */
    aside > div[style*="margin-top: 100px"] {
        margin-top: 0 !important;
    }

    /* Todos os elementos dentro das sidebars */
    aside * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Elementos específicos que podem causar overflow */
    .bg-gradient-to-br,
    .bg-white.rounded-lg,
    .shadow-2xl,
    .shadow-lg {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Ordem dos elementos */
    .order-2 {
        order: 2;
    }

    .order-1 {
        order: 1;
    }

    .order-3 {
        order: 3;
    }

    /* REGRA BRUTAL - FORÇA TUDO A FICAR DENTRO DA TELA */
    * {
        max-width: 100vw !important;
        box-sizing: border-box !important;
    }

    /* Especificamente para elementos que podem ter translate ou transform */
    *[class*="translate"],
    *[class*="transform"] {
        transform: none !important;
    }

    /* Para elementos com position absolute que podem sair da tela */
    .absolute {
        max-width: 100% !important;
        right: 0 !important;
        left: auto !important;
    }

    /* Para gradientes e elementos decorativos */
    .absolute.top-0.right-0,
    .absolute.bottom-0.left-0 {
        display: none !important;
    }
}

/* Layout específico para telas muito grandes */
@media (min-width: 1536px) {
    .container {
        max-width: 1400px;
    }
}