/*!
 * WC AttribPress — tokens du SITE v0.3 (direction A « Atelier », DT-36 ; usage allégé DT-56)
 * Pour site\ (wcattribpress.com). Le plugin charge wcap-tokens-admin_v0.2.css,
 * JAMAIS ce fichier (il agit sur :root et passerait l'admin WP en sombre).
 * Contrastes vérifiés WCAG 2.2 AA (ratios en commentaire ; revue Fable 17/11).
 *
 * Thème sombre : automatique (prefers-color-scheme) ou forcé par
 * <html data-theme="dark|light">. Les deux blocs sombres DOIVENT rester identiques.
 *
 * Polices : IBM Plex Sans / Mono (SIL OFL 1.1), woff2 latin hébergés localement.
 * Le dossier fonts/ doit rester À CÔTÉ de ce fichier (chemins relatifs) ; sinon,
 * déclarer les @font-face dans le thème enfant avec les bons chemins.
 *
 * Règles d'usage des couleurs :
 *  - pas de texte accent sur surface-sunken (4,36:1) : utiliser accent-hover ;
 *  - l'accent ne porte jamais seul une information (toujours texte ou icône).
 */

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/ibm-plex-sans-700.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-mono-600.woff2") format("woff2"); }

:root {
  /* ---------- Couleurs : thème clair ---------- */
  --wcap-color-bg: #faf8f5;             /* fond de page */
  --wcap-color-surface: #ffffff;        /* cartes, encadrés */
  --wcap-color-surface-sunken: #efebe4; /* pied de page, code */
  --wcap-color-border: #e7e2d9;         /* filets décoratifs */
  --wcap-color-border-strong: #8a8275;  /* bords de champs, pastilles : 3,8:1 sur blanc */
  --wcap-color-text: #27241d;           /* 14,6:1 sur bg */
  --wcap-color-text-muted: #625d52;     /* 6,2:1 sur bg, 5,5:1 sur sunken */
  --wcap-color-accent: #c2410c;         /* 5,2:1 sur blanc, 4,9:1 sur bg */
  --wcap-color-accent-hover: #9a3412;   /* 7,3:1 sur blanc, 6,2:1 sur sunken */
  --wcap-color-accent-subtle: #fff1e6;  /* accent-hover dessus : 6,6:1 */
  --wcap-color-on-accent: #ffffff;      /* 5,2:1 sur accent */
  --wcap-color-focus: #c2410c;          /* anneau de focus : ≥ 4,3:1 sur tous les fonds */

  --wcap-color-success: #15803d;  --wcap-color-success-subtle: #ecfdf3; --wcap-color-success-text: #14532d;
  --wcap-color-warning: #a16207;  --wcap-color-warning-subtle: #fefce8; --wcap-color-warning-text: #713f12;
  --wcap-color-danger:  #b91c1c;  --wcap-color-danger-subtle:  #fef2f2; --wcap-color-danger-text:  #7f1d1d;
  --wcap-color-info:    #1d4ed8;  --wcap-color-info-subtle:    #eff6ff; --wcap-color-info-text:    #1e3a8a;

  /* ---------- Typographie ---------- */
  --wcap-font-sans: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --wcap-font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --wcap-weight-regular: 400;
  --wcap-weight-semibold: 600;
  --wcap-weight-bold: 700;
  --wcap-text-xs: 0.75rem;   /* 12 */
  --wcap-text-sm: 0.875rem;  /* 14 */
  --wcap-text-md: 1rem;      /* 16 */
  --wcap-text-lg: 1.25rem;   /* 20 */
  --wcap-text-xl: 1.5rem;    /* 24 */
  --wcap-text-2xl: 2rem;     /* 32 */
  --wcap-text-3xl: clamp(2rem, 1.4rem + 2.6vw, 3rem); /* 32 → 48 */
  --wcap-leading-tight: 1.15;
  --wcap-leading-snug: 1.35;
  --wcap-leading-normal: 1.6;
  --wcap-measure: 68ch;

  /* ---------- Espacements (grille de 4 px) ---------- */
  --wcap-space-1: 0.25rem;  /* 4 */
  --wcap-space-2: 0.5rem;   /* 8 */
  --wcap-space-3: 0.75rem;  /* 12 */
  --wcap-space-4: 1rem;     /* 16 */
  --wcap-space-5: 1.5rem;   /* 24 */
  --wcap-space-6: 2rem;     /* 32 */
  --wcap-space-7: 3rem;     /* 48 */
  --wcap-space-8: 4rem;     /* 64 */
  --wcap-space-9: 6rem;     /* 96 */
  --wcap-container: 72rem;  /* 1152, contenu (box-sizing: border-box, gouttières comprises) */
  --wcap-gutter: 1rem;

  /* ---------- Dimensions de contrôle ---------- */
  --wcap-control-height: 44px;
  --wcap-control-height-sm: 36px;
  --wcap-header-height: 64px;

  /* ---------- Rayons ---------- */
  --wcap-radius-sm: 4px;
  --wcap-radius-md: 6px;
  --wcap-radius-lg: 10px;
  --wcap-radius-xl: 16px;
  --wcap-radius-full: 999px;

  /* ---------- Ombres ---------- */
  --wcap-shadow-sm: 0 1px 2px rgba(39, 36, 29, 0.06);
  --wcap-shadow-md: 0 1px 2px rgba(39, 36, 29, 0.06), 0 4px 12px rgba(39, 36, 29, 0.08);
  --wcap-shadow-lg: 0 2px 4px rgba(39, 36, 29, 0.06), 0 12px 32px rgba(39, 36, 29, 0.12);

  /* ---------- États ---------- */
  --wcap-focus-ring: 0 0 0 2px var(--wcap-color-surface), 0 0 0 4px var(--wcap-color-focus);
  --wcap-opacity-disabled: 0.5;
  --wcap-transition: 150ms ease-out;
  --wcap-border-width: 1px;
  --wcap-border-width-strong: 2px;

  color-scheme: light;
}

/* ---------- Thème sombre : bloc 1 (préférence système) ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wcap-color-bg: #1c1a16;
    --wcap-color-surface: #26231e;
    --wcap-color-surface-sunken: #141210;
    --wcap-color-border: #3a352d;
    --wcap-color-border-strong: #7a7266;   /* 3,3:1 sur surface */
    --wcap-color-text: #f2efe9;            /* 13,6:1 sur surface */
    --wcap-color-text-muted: #a8a29e;      /* 6,2:1 sur surface */
    --wcap-color-accent: #fb923c;          /* 6,9:1 sur surface, 8,3:1 sur sunken */
    --wcap-color-accent-hover: #fdba74;
    --wcap-color-accent-subtle: #3b2414;
    --wcap-color-on-accent: #1c1a16;       /* 7,7:1 sur accent */
    --wcap-color-focus: #fb923c;
    --wcap-color-success: #4ade80; --wcap-color-success-subtle: #12261a; --wcap-color-success-text: #86efac;
    --wcap-color-warning: #facc15; --wcap-color-warning-subtle: #2a2310; --wcap-color-warning-text: #fde68a;
    --wcap-color-danger:  #f87171; --wcap-color-danger-subtle:  #2c1414; --wcap-color-danger-text:  #fca5a5;
    --wcap-color-info:    #93c5fd; --wcap-color-info-subtle:    #131f33; --wcap-color-info-text:    #bfdbfe;
    --wcap-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --wcap-shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.35);
    --wcap-shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
/* ---------- Thème sombre : bloc 2 (forcé), identique au bloc 1 ---------- */
:root[data-theme="dark"] {
  --wcap-color-bg: #1c1a16;
  --wcap-color-surface: #26231e;
  --wcap-color-surface-sunken: #141210;
  --wcap-color-border: #3a352d;
  --wcap-color-border-strong: #7a7266;
  --wcap-color-text: #f2efe9;
  --wcap-color-text-muted: #a8a29e;
  --wcap-color-accent: #fb923c;
  --wcap-color-accent-hover: #fdba74;
  --wcap-color-accent-subtle: #3b2414;
  --wcap-color-on-accent: #1c1a16;
  --wcap-color-focus: #fb923c;
  --wcap-color-success: #4ade80; --wcap-color-success-subtle: #12261a; --wcap-color-success-text: #86efac;
  --wcap-color-warning: #facc15; --wcap-color-warning-subtle: #2a2310; --wcap-color-warning-text: #fde68a;
  --wcap-color-danger:  #f87171; --wcap-color-danger-subtle:  #2c1414; --wcap-color-danger-text:  #fca5a5;
  --wcap-color-info:    #93c5fd; --wcap-color-info-subtle:    #131f33; --wcap-color-info-text:    #bfdbfe;
  --wcap-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --wcap-shadow-md: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.35);
  --wcap-shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 12px 32px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}
