/**
 * Nsite — design tokens (palette zinc, sémantique shadcn/ui, shell OpenAI)
 *
 * Rôles :
 * - **Palette** (`--zinc-*`) : échelle de référence (mode sombre), stable pour ajuster le thème.
 * - **Sémantique** (`--background`, `--card`, `--primary`, …) : noms alignés sur la doc shadcn.
 * - **Extensions nsite** (`--canvas-subtle`, `--elevated`, …) : surfaces / bordures entre deux niveaux zinc.
 * - **Alias legacy** (`--oai-*`) : consommés par `cms-openai-default.css` ; mappent vers la sémantique.
 *
 * Chargé après `style.css`, avant `cms-openai-default.css`.
 * @see https://ui.shadcn.com/docs/theming
 */

:root {
    /* ------------------------------------------------------------------
       Palette zinc (réf. Tailwind zinc — mode sombre)
       Ajuster ici propage partout via les tokens sémantiques.
       ------------------------------------------------------------------ */
    --zinc-950: #09090b;
    --zinc-925: #0f0f12;
    --zinc-900: #18181b;
    --zinc-850: #1f1f23;
    --zinc-800: #27272a;
    --zinc-700: #3f3f46;
    --zinc-600: #52525b;
    --zinc-500: #71717a;
    --zinc-400: #a1a1aa;
    --zinc-300: #d4d4d8;
    --zinc-50: #fafafa;

    /* ------------------------------------------------------------------
       Surfaces & texte (sémantique shadcn)
       ------------------------------------------------------------------ */
    --background: var(--zinc-950);
    --foreground: var(--zinc-50);

    --card: var(--zinc-900);
    --card-foreground: var(--zinc-50);

    --popover: var(--zinc-900);
    --popover-foreground: var(--zinc-50);

    /* Option thème CMS Botble (`theme_option` / CSS injecté) */
    --primary: var(--primary-color, var(--zinc-50));
    --primary-foreground: var(--zinc-950);

    --secondary: var(--zinc-800);
    --secondary-foreground: var(--zinc-50);

    --muted: var(--zinc-800);
    --muted-foreground: var(--zinc-400);

    --accent: var(--zinc-800);
    --accent-foreground: var(--zinc-50);

    --destructive: #7f1d1d;
    --destructive-foreground: var(--zinc-50);

    --border: var(--zinc-800);
    --input: var(--zinc-800);
    --ring: rgba(255, 255, 255, 0.22);

    /* ------------------------------------------------------------------
       Extensions nsite (non standard shadcn, utiles au shell / formulaires)
       ------------------------------------------------------------------ */
    --canvas-subtle: var(--zinc-925);
    --elevated: var(--zinc-850);
    --border-emphasis: var(--zinc-600);
    --subtle-foreground: #8b8b90;

    /* ------------------------------------------------------------------
       Rayons & focus
       ------------------------------------------------------------------ */
    --radius-sm: 0.25rem;
    --radius: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;

    --ring-offset: 2px;

    /* ------------------------------------------------------------------
       Typographie
       ------------------------------------------------------------------ */
    --font-sans: var(--primary-font, "Inter", "DM Sans", system-ui, sans-serif);
    --tracking-tight: -0.02em;

    /* ------------------------------------------------------------------
       Shell OpenAI (header, recherche plein écran)
       ------------------------------------------------------------------ */
    --shell-header-bg: #000000;
    --shell-header-border: rgba(255, 255, 255, 0.06);
    --shell-header-shadow: 0 10px 36px rgba(0, 0, 0, 0.42);
    --shell-nav-link: #e8e8e8;
    --shell-nav-link-hover: var(--zinc-50);
    --shell-search-rule: rgba(255, 255, 255, 0.2);
    --shell-search-submit-bg: rgba(63, 63, 70, 0.55);
    --shell-search-submit-bg-hover: rgba(82, 82, 91, 0.85);

    /* ------------------------------------------------------------------
       Mesures composants (hauteur contrôles, header)
       ------------------------------------------------------------------ */
    --control-height: 2.5rem;
    --control-height-sm: 2.25rem;
    --control-font-size: 0.875rem;
    --control-line-height: 1.25rem;
    --header-bar-height: 4rem;

    /* ------------------------------------------------------------------
       Alias `--oai-*` (cms-openai-default.css) — ne pas supprimer sans migration
       ------------------------------------------------------------------ */
    --oai-bg: var(--background);
    --oai-bg-soft: var(--canvas-subtle);
    --oai-surface: var(--card);
    --oai-surface-raised: var(--elevated);
    --oai-surface-hover: var(--accent);
    --oai-border: var(--border);
    --oai-border-input: var(--border-emphasis);
    --oai-text: var(--foreground);
    --oai-text-muted: var(--muted-foreground);
    --oai-text-dim: var(--subtle-foreground);

    --oai-input-h: var(--control-height);
    --oai-btn-h: var(--control-height);
    --oai-btn-h-sm: var(--control-height-sm);
    --oai-radius: var(--radius);
    --oai-radius-lg: var(--radius-lg);
    --oai-font-size-input: var(--control-font-size);
    --oai-line-input: var(--control-line-height);
    --oai-header-h: var(--header-bar-height);
    --oai-ring: var(--ring);
    --oai-ring-offset: var(--ring-offset);

    --oai-header-border: var(--shell-header-border);
    --oai-header-sticky-shadow: var(--shell-header-shadow);
    --oai-nav-link: var(--shell-nav-link);
    --oai-nav-link-hover: var(--shell-nav-link-hover);
    --oai-search-rule: var(--shell-search-rule);
    --oai-search-submit-bg: var(--shell-search-submit-bg);
    --oai-search-submit-bg-hover: var(--shell-search-submit-bg-hover);
}

html {
    color-scheme: dark;
    font-family: var(--font-sans);
}
