/* V6.5-fix-48 — Palette canonique Almaviva Santé.
 *
 * Ce fichier est la source unique des couleurs identitaires + gris warm. Il
 * doit être enqueué EN PREMIER (no deps) pour que toutes les vars soient
 * définies avant utilisation dans portail.css, custom.css, sections.css, etc.
 *
 * Convention de nommage : préfixe --alm-* (nouveau standard).
 * Les anciens préfixes --almaviva-* / --av-* sont conservés en ALIAS
 * rétro-compat (cf. bloc inférieur) — DO NOT supprimer sans audit refs.
 *
 * Palette gris warm dérivée du #DDDDD5 charte :
 *   #DDDDD5 = gray-200 (ancrage identitaire CMJN C16 M11 J17 N0)
 *   échelle interpolée HSL teinte=60° (jaune neutre), S=3-8%, L=10-98%
 *
 * Palette WP admin native (--alm-admin-* préfixe distinct) volontairement
 * NON aliasée — usage explicite en hex dans inc/cookies/admin-portail.php,
 * inc/portail/admin-portail.php pour cohérence avec wp-admin natif.
 *
 * --alm-gray-400 (#AAAA9F) : interpolation HSL midpoint entre gray-300 et
 * gray-500. HSL strict = #AAAAA0 (rgb 170,170,160), retenu #AAAA9F
 * (rgb 170,170,159) — écart de 1 unité sur canal B, perceptuellement
 * identique. Documenté DECISIONS.md fix-48.
 */

:root {
  /* ===== Gris warm Almaviva (ancrage charte #DDDDD5 = gray-200) ===== */
  --alm-gray-50:  #FBFAF7;  /* presque blanc, fond hover subtil */
  --alm-gray-100: #F4F4F0;  /* fond top-bar, surface secondaire */
  --alm-gray-200: #DDDDD5;  /* CHARTE — fonds clairs, bordures soft, filigranes */
  --alm-gray-300: #C8C8BF;  /* bordures, dividers */
  --alm-gray-400: #AAAA9F;  /* mid-tone (HSL interp 300↔500) */
  --alm-gray-500: #8A8A82;  /* texte secondaire, captions */
  --alm-gray-700: #4A4A45;  /* texte principal mute, labels */
  --alm-gray-900: #1A1A1A;  /* texte body, noir identitaire */

  /* ===== Couleurs identitaires charte ===== */
  --alm-blue:     #004899;  /* bleu identitaire principal */
  --alm-blue-2:   #003674;  /* bleu foncé hover */
  --alm-blue-3:   #00264F;  /* bleu très foncé */
  --alm-orange:   #EE7203;  /* orange identitaire CTA */
  --alm-orange-2: var(--alm-orange);  /* orange hover */
  --alm-bg-soft:  #F4F7FB;  /* fond doux bleuté */

  /* ===== Alias rétro-compat (NE PAS supprimer sans audit refs) ===== */
  /* Anciens préfixes --almaviva-* (custom.css historique) */
  --almaviva-bleu:        var(--alm-blue);
  --almaviva-orange:      var(--alm-orange);
  --almaviva-gris-clair:  var(--alm-gray-200);
  --almaviva-noir:        var(--alm-gray-900);
  --almaviva-fond-doux:   var(--alm-bg-soft);

  /* Anciens préfixes --av-* (sections.css inline historique) */
  --av-b:    var(--alm-blue);
  --av-b2:   var(--alm-blue-2);
  --av-b3:   var(--alm-blue-3);
  --av-o:    var(--alm-orange);
  --av-o2:   var(--alm-orange-2);
  --av-bg:   var(--alm-bg-soft);
  --av-gr:   var(--alm-gray-200);
  --av-ink:  var(--alm-gray-900);

  /* ====================================================================
     Phase 3.7 fix WCAG — tokens contrastes texte/fond, réseau-wide.
     Définis ici pour être disponibles sur TOUS les sites (portail + 24
     établissements). Portail.css redéfinit en local sans impact.
     ==================================================================== */
  --on-blue:       #ffffff;                       /* texte sur fond --alm-blue */
  --on-blue-soft:  rgba(255,255,255,0.92);        /* texte secondaire sur bleu */
  --on-white-body: var(--alm-gray-700);           /* texte body sur fond blanc */
/* alias de --alm-orange */
  --cta-bg-hover:  var(--alm-orange);                       /* hover plus foncé */
  --cta-text:      #ffffff;                       /* texte forcé sur --cta-bg */

  /* ====================================================================
     Conteneur reseau — cible unique. Deux largeurs, une seule gouttiere.
     La gouttiere est PORTEE PAR LA FORMULE : les conteneurs passent en
     padding-inline 0, ce qui evite le cumul padding + max-width en
     border-box. Les fonds de section restent pleine largeur : seuls les
     conteneurs de contenu sont contraints.
     ==================================================================== */
  --alm-gutter:             clamp(20px, 4vw, 64px);
  --alm-container:          min(1320px, 100% - 2 * var(--alm-gutter));
  --alm-container-lecture:  min(1180px, 100% - 2 * var(--alm-gutter));
}

/* ====================================================================
   Phase 3.7 fix WCAG — Garde-fous color forcés sur les blocs CTA orange
   (anti-régression au cas où --cta-text serait écrasé par un thème enfant).
   ==================================================================== */
.alm-block-cta--orange,
.alm-block-cta--orange .alm-block-cta__title,
.alm-block-cta--orange .alm-block-cta__text {
  color: #fff;
}
.alm-block-cta--blue,
.alm-block-cta--blue .alm-block-cta__title,
.alm-block-cta--blue .alm-block-cta__text,
.alm-block-cta--gradient,
.alm-block-cta--gradient .alm-block-cta__title,
.alm-block-cta--gradient .alm-block-cta__text {
  color: #fff;
}
