/* ================================================================
   temas.css — V2.0
   Sistema de temas claro/escuro via atributo data-tema no <body>
   Tema padrão: escuro (controlado por Settings.configuracoes.tema)
================================================================ */

/* ── VARIÁVEIS GLOBAIS ── */
:root {
    /* Tema escuro (padrão) — alinhado ao visual da home */
    --t-bg:           #0a0b0e;
    --t-surface:      #14161b;
    --t-surface2:     #1c1f26;
    --t-surface3:     #2a2e38;
    --t-border:       rgba(255, 255, 255, 0.08);
    --t-border-md:    rgba(255, 255, 255, 0.14);
    --t-text:         #f5f5f7;
    --t-text-dim:     #a3a7b3;
    --t-text-faint:   rgba(255, 255, 255, 0.22);
    --t-accent:       #d4a73c;
    --t-accent-soft:  #f0cf72;
    --t-accent-dim:   rgba(212, 167, 60, 0.15);
    --t-accent-text:  #16120a;
    --t-violet:       #8b5cf6;
    --t-shadow:       0 4px 24px rgba(0, 0, 0, 0.45);
    --t-shadow-sm:    0 2px 10px rgba(0, 0, 0, 0.3);
    --t-overlay:      rgba(0, 0, 0, 0.88);
    --t-overlay-md:   rgba(0, 0, 0, 0.60);
    --t-success:      #2ecc71;
    --t-warning:      #f39c12;
    --t-danger:       #e74c3c;

    /* Carrossel */
    --ce-card-w:      280px;
    --ce-card-h:      430px;
    --ce-gap:         16px;
    --ce-radius:      24px;
    --ce-transition:  0.38s cubic-bezier(0.4, 0, 0.2, 1);

    /* ── Design tokens V2.1 ── */
    /* Tipografia (system stack moderna, sem CDN) */
    --t-font:         -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                      "Helvetica Neue", Arial, sans-serif;
    --t-font-mono:    ui-monospace, "SF Mono", Menlo, Consolas, monospace;

    /* Escala tipográfica */
    --t-fs-xs:        0.75rem;   /* 12px */
    --t-fs-sm:        0.875rem;  /* 14px */
    --t-fs-md:        1rem;      /* 16px */
    --t-fs-lg:        1.125rem;  /* 18px */
    --t-fs-xl:        1.375rem;  /* 22px */
    --t-fs-2xl:       1.75rem;   /* 28px */
    --t-fs-3xl:       2.25rem;   /* 36px */

    /* Pesos */
    --t-fw-regular:   400;
    --t-fw-medium:    500;
    --t-fw-semibold:  600;
    --t-fw-bold:      700;
    --t-fw-extrabold: 800;

    /* Escala de espaçamento (base 4px) */
    --t-sp-1:         4px;
    --t-sp-2:         8px;
    --t-sp-3:         12px;
    --t-sp-4:         16px;
    --t-sp-5:         20px;
    --t-sp-6:         24px;
    --t-sp-8:         32px;
    --t-sp-10:        40px;
    --t-sp-12:        48px;
    --t-sp-16:        64px;

    /* Raio */
    --t-r-sm:         6px;
    --t-r-md:         10px;
    --t-r-lg:         14px;
    --t-r-xl:         20px;
    --t-r-pill:       999px;

    /* Tap target mínimo (acessibilidade mobile) */
    --t-tap:          44px;

    /* Linhas */
    --t-lh-tight:     1.2;
    --t-lh-normal:    1.45;
    --t-lh-relaxed:   1.6;
}

/* ── TEMA CLARO ── */
[data-tema="claro"] .ce-wrap {
    --ce-fade-bg: var(--t-bg, #f2f3f7);
    --ce-edge-line: linear-gradient(
        90deg,
        transparent 0%,
        rgba(120, 80, 190, 0.22) 14%,
        rgba(140, 95, 200, 0.65) 50%,
        rgba(90, 130, 220, 0.22) 86%,
        transparent 100%
    );
    --ce-edge-glow: linear-gradient(
        90deg,
        transparent 0%,
        rgba(110, 75, 180, 0.1) 10%,
        rgba(120, 80, 190, 0.3) 50%,
        rgba(80, 120, 210, 0.1) 90%,
        transparent 100%
    );
}

[data-tema="claro"] {
    --t-bg:           #f2f3f7;
    --t-surface:      #ffffff;
    --t-surface2:     #e8eaef;
    --t-surface3:     #d8dae0;
    --t-border:       rgba(0, 0, 0, 0.08);
    --t-border-md:    rgba(0, 0, 0, 0.14);
    --t-text:         #1a1c22;
    --t-text-dim:     rgba(0, 0, 0, 0.45);
    --t-text-faint:   rgba(0, 0, 0, 0.22);
    --t-accent:       #c08a10;
    --t-accent-dim:   rgba(192, 138, 16, 0.12);
    --t-accent-text:  #ffffff;
    --t-shadow:       0 4px 16px rgba(0, 0, 0, 0.10);
    --t-shadow-sm:    0 2px 6px rgba(0, 0, 0, 0.07);
    --t-overlay:      rgba(0, 0, 0, 0.75);
    --t-overlay-md:   rgba(0, 0, 0, 0.40);
    --t-success:      #27ae60;
    --t-warning:      #e67e22;
    --t-danger:       #c0392b;
}

/* ── APLICAÇÃO GLOBAL ── */
body {
    background-color: var(--t-bg);
    color: var(--t-text);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── MOBILE — card central ~76vw deixa ~12vw de peek por lateral ── */
@media (max-width: 640px) {
    :root {
        --ce-card-w: 240px;
        --ce-card-h: 380px;
        --ce-gap:    12px;
    }
}

/* ── MOBILE MUITO PEQUENO ── */
@media (max-width: 380px) {
    :root {
        --ce-card-w: 220px;
        --ce-card-h: 340px;
        --ce-gap:    8px;
    }
}
