/* ================================
   Tokens
==================================*/
:root {
    /* Paleta da marca (mantida) */
    --brand-10000: #6b6b6b;
    --brand-1000: #413130;
    --brand-950: #4B3621;
    --brand-900: #543F2C;
    --brand-850: #5D4A37;
    --brand-800: #675448;
    --brand-750: #6F5E4D;
    --brand-700: #786959;
    --brand-650: #817264;
    --brand-600: #8A7D6F;
    --brand-550: #93867A;
    --brand-500: #9C9185;
    --brand-450: #A59A90;
    --brand-400: #AFA59C;
    --brand-350: #C2B9B1;
    --brand-300: #C9C3BC;
    --brand-250: #D4CFCA;
    --brand-200: #DBD7D3;
    --brand-150: #E6E2DF;
    --brand-100: #EDEBE9;
    --brand-050: #F6F6F5;
    --brand-040: #F8F8F7;
    --brand-030: #FAFAF9;
    --brand-020: #FCFCFB;
    --brand-010: #FEFEFD;
    --brand-000: #FFFFFF;

    /* Variáveis derivadas (uso global) */
    --fg: var(--brand-900);
    --muted: var(--brand-10000);
    --bg: var(--brand-030);
    --card: var(--brand-000);
    --border: var(--brand-150);
    --radius: 2px;

    /* Layout: altura do header para compensar sticky headers */
    --header-h: 120px;

    --font: 'Gotham', system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

@media (max-width: 991px) {
    :root {
        --header-h: 124px;
    }
}

/* ================================
   Base
==================================*/
html {
    font-family: var(--font);
    scroll-behavior: smooth;
    color-scheme: light;
}

html, body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--fg);
    background: var(--bg);
    display: flex;
    flex-direction: column;

    /* Mobile moderno: considera barras do navegador */
    min-height: 100dvh;
}

/* Conteúdo principal cresce para empurrar o footer */
.conteudo-principal {
    flex: 1;
    /* Compensa header fixo */
    margin-top: var(--header-h);
}

/* Caso use <main> diretamente */
main {
    flex: 1;
    margin-top: var(--header-h);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        /* none evita containing block residual (quebra sticky/fixed dos filhos) */
        transform: none;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

html body main > * {
    animation: fadeUp 0.45s ease both;
}

html body main > *:nth-child(2) { animation-delay: 0.06s; }
html body main > *:nth-child(3) { animation-delay: 0.12s; }

/*
 * Header: só opacity (sem transform).
 * Transform no nav cria containing block e prende #menu-categorias (fixed) ao header.
 */
html body div.menu-container nav.barra-navegacao {
    animation: fadeIn 0.45s ease both;
}

/* Links de categoria injetados via JS */
html body div.menu-container nav.barra-navegacao div#menu a,
html body div.menu-container nav.barra-navegacao div#menu-categorias div.categorias a {
    animation: fadeUp 0.35s ease both;
}

/* Bottom bar mobile: sobe + fade */
html body nav.bottom-bar {
    animation: fadeUp 0.45s ease both;
}

/* Rodapé: sobe + fade com stagger interno */
html body footer.site-footer {
    animation: fadeUp 0.5s ease both;
}

html body footer.site-footer .footer-top {
    animation: fadeUp 0.45s ease both;
    animation-delay: 0s;
}

html body footer.site-footer .footer-links {
    animation: fadeUp 0.45s ease both;
    animation-delay: 0.08s;
}

html body footer.site-footer .footer-bottom {
    animation: fadeUp 0.45s ease both;
    animation-delay: 0.14s;
}

@media (prefers-reduced-motion: reduce) {
    html body main > *,
    html body div.menu-container nav.barra-navegacao,
    html body div.menu-container nav.barra-navegacao div#menu a,
    html body div.menu-container nav.barra-navegacao div#menu-categorias div.categorias a,
    html body nav.bottom-bar,
    html body footer.site-footer,
    html body footer.site-footer .footer-top,
    html body footer.site-footer .footer-links,
    html body footer.site-footer .footer-bottom {
        animation: none;
    }
}

body > footer {
    margin-top: auto;
}

/* Bloqueia seleção em h3 e p */
h3, p {
    -webkit-user-select: none; /* iOS/Safari */
    -moz-user-select: none;    /* Firefox antigo */
    -ms-user-select: none;     /* IE/Edge antigo */
    user-select: none;         /* Padrão */
}



/* ================================
   Fontes (com font-display: swap)
   Dica: mantenha apenas pesos usados
==================================*/
@font-face {
    font-family: 'Gotham';
    src: url('/sistema/recurso/fonte/gotham/thin.woff2') format('woff2'),
    url('/sistema/recurso/fonte/gotham/thin.woff') format('woff');
    font-weight: 100;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url('/sistema/recurso/fonte/gotham/thin-italic.woff2') format('woff2'),
    url('/sistema/recurso/fonte/gotham/thin-italic.woff') format('woff');
    font-weight: 100;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url('/sistema/recurso/fonte/gotham/xlight.woff2') format('woff2'),
    url('/sistema/recurso/fonte/gotham/xlight.woff') format('woff');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url('/sistema/recurso/fonte/gotham/xlight-italic.woff2') format('woff2'),
    url('/sistema/recurso/fonte/gotham/xlight-italic.woff') format('woff');
    font-weight: 200;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url('/sistema/recurso/fonte/gotham/light.woff2') format('woff2'),
    url('/sistema/recurso/fonte/gotham/light.woff') format('woff');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url('/sistema/recurso/fonte/gotham/light-italic.woff2') format('woff2'),
    url('/sistema/recurso/fonte/gotham/light-italic.woff') format('woff');
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url('/sistema/recurso/fonte/gotham/book.woff2') format('woff2'),
    url('/sistema/recurso/fonte/gotham/book.woff') format('woff');
    font-weight: 400; /* normal */
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url('/sistema/recurso/fonte/gotham/book-italic.woff2') format('woff2'),
    url('/sistema/recurso/fonte/gotham/book-italic.woff') format('woff');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url('/sistema/recurso/fonte/gotham/medium.woff2') format('woff2'),
    url('/sistema/recurso/fonte/gotham/medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url('/sistema/recurso/fonte/gotham/medium-italic.woff2') format('woff2'),
    url('/sistema/recurso/fonte/gotham/medium-italic.woff') format('woff');
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url('/sistema/recurso/fonte/gotham/bold.woff2') format('woff2'),
    url('/sistema/recurso/fonte/gotham/bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url('/sistema/recurso/fonte/gotham/bold-italic.woff2') format('woff2'),
    url('/sistema/recurso/fonte/gotham/bold-italic.woff') format('woff');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url('/sistema/recurso/fonte/gotham/black.woff2') format('woff2'),
    url('/sistema/recurso/fonte/gotham/black.woff') format('woff');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url('/sistema/recurso/fonte/gotham/black-italic.woff2') format('woff2'),
    url('/sistema/recurso/fonte/gotham/black-italic.woff') format('woff');
    font-weight: 800;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url('/sistema/recurso/fonte/gotham/ultra.woff2') format('woff2'),
    url('/sistema/recurso/fonte/gotham/ultra.woff') format('woff');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Gotham';
    src: url('/sistema/recurso/fonte/gotham/ultra-italic.woff2') format('woff2'),
    url('/sistema/recurso/fonte/gotham/ultra-italic.woff') format('woff');
    font-weight: 900;
    font-style: italic;
    font-display: swap;
}
