/* =============================================================================
   base.css — tokens de design + reset + tipografia
   ÚNICO arquivo onde cores/espacos/fontes sao definidos. Todos os componentes
   consomem via var(--nome). Pra mudar a identidade do site, muda aqui.
   ============================================================================= */

/* --------- Tokens (design variables) --------- */
:root {
    /* Paleta da marca */
    --cor-marca:         #008a20;  /* verde Janete */
    --cor-marca-escura:  #006b18;
    --cor-marca-clara:   #10b981;
    --cor-destaque:      #8a2be2;  /* roxo (assinante/IA) */
    --cor-atencao:       #ffd500;  /* amarelo pacote/copa */
    --cor-alerta:        #dc2626;

    /* Texto e fundo */
    --cor-texto:         #0f172a;
    --cor-texto-suave:   #475569;
    --cor-texto-fraco:   #94a3b8;
    --cor-fundo:         #ffffff;
    --cor-fundo-suave:   #f8fafc;
    --cor-fundo-esc:     #0f172a;  /* footer */
    --cor-borda:         #e2e8f0;
    --cor-borda-forte:   #cbd5e1;

    /* Escala tipografica (rem) */
    --texto-xs:  0.75rem;    /* 12px */
    --texto-sm:  0.875rem;   /* 14px */
    --texto-md:  1rem;       /* 16px base */
    --texto-lg:  1.125rem;   /* 18px */
    --texto-xl:  1.5rem;     /* 24px */
    --texto-2xl: 2rem;       /* 32px */
    --texto-3xl: 2.5rem;     /* 40px */

    /* Escala de espacamento (rem) — multiplos de 4px */
    --espaco-1: 0.25rem;   /*  4px */
    --espaco-2: 0.5rem;    /*  8px */
    --espaco-3: 0.75rem;   /* 12px */
    --espaco-4: 1rem;      /* 16px */
    --espaco-5: 1.5rem;    /* 24px */
    --espaco-6: 2rem;      /* 32px */
    --espaco-7: 3rem;      /* 48px */
    --espaco-8: 4rem;      /* 64px */

    /* Raio de borda */
    --raio-sm: 4px;
    --raio-md: 8px;
    --raio-lg: 12px;
    --raio-xl: 16px;
    --raio-pill: 9999px;

    /* Sombras */
    --sombra-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --sombra-md: 0 4px 10px rgba(15, 23, 42, 0.08);
    --sombra-lg: 0 12px 24px rgba(15, 23, 42, 0.12);

    /* Transicoes */
    --transicao-rapida: 150ms ease;
    --transicao-media:  250ms ease;

    /* Layout */
    --container-max: 1280px;
    --altura-header: 80px;

    /* Fontes */
    --fonte-principal: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --fonte-destaque:  "Yanone Kaffeesatz", "Averia Serif Libre", Georgia, serif;
    --fonte-mono:      ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    /* Z-index layers */
    --z-dropdown: 100;
    --z-header:   200;
    --z-overlay:  900;
    --z-modal:    1000;
    --z-toast:    1100;
}

/* --------- Reset minimalista (inspirado no modern-normalize) --------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    margin: 0;
    font-family: var(--fonte-principal);
    font-size: var(--texto-md);
    line-height: 1.5;
    color: var(--cor-texto);
    background: var(--cor-fundo);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
body.cw-sem-scroll { overflow: hidden; }

/* tira margin default de bloco */
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd {
    margin: 0;
}

ul, ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

/* --------- Tipografia --------- */
h1 { font-size: var(--texto-3xl); font-weight: 700; line-height: 1.2; }
h2 { font-size: var(--texto-2xl); font-weight: 700; line-height: 1.25; }
h3 { font-size: var(--texto-xl);  font-weight: 600; line-height: 1.3;  }
h4 { font-size: var(--texto-lg);  font-weight: 600; line-height: 1.4;  }

p { line-height: 1.6; }

/* Links de conteudo (dentro de paragrafos etc) */
.cw-prose a {
    color: var(--cor-marca);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cw-prose a:hover { color: var(--cor-marca-escura); }

/* --------- Helpers de acessibilidade --------- */
.cw-sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Foco visivel consistente */
:focus-visible {
    outline: 2px solid var(--cor-marca);
    outline-offset: 2px;
    border-radius: var(--raio-sm);
}
