/* ============================================================
   ACCESSIBILITY — BOUTON CONTRASTE & MODE HAUT CONTRASTE
   Cabinet Dr. Meliani Samira
   ============================================================
   Palette identique au thème, ratio WCAG AA/AAA renforcé.
   Référence couleurs :
     Normal   →  Haut contraste
     #71a5de  →  #1A5FA8   (bleu principal  | ratio ≈ 7.5:1 sur blanc)
     #4f87c8  →  #0E4A8A   (bleu foncé      | ratio ≈ 10:1 sur blanc)
     #C8A96E  →  #7A5A1A   (or              | ratio ≈ 7.2:1 sur blanc)
     #f8f9fb  →  #FFFFFF   (fond            | blanc pur)
     #2A2A2A  →  #000000   (texte           | noir pur, 21:1)
     #555555  →  #111111   (texte moyen     | ratio ≈ 18:1)
     #888888  →  #3D3D3D   (texte clair     | ratio ≈ 9.5:1)
   ============================================================ */

/* ── BOUTON ACCESSIBILITÉ ────────────────────────────────── */

.a11y-contrast-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width:  36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 2px solid var(--c-border);
  border-radius: var(--r-full);
  color: var(--c-primary-dark);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
  /* Alignement vertical avec les autres éléments du header */
  vertical-align: middle;
}

.a11y-contrast-btn svg {
  width:  18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

.a11y-contrast-btn:hover {
  background: var(--c-primary-light);
  border-color: var(--c-primary);
  color: var(--c-primary-dark);
}

.a11y-contrast-btn:focus-visible {
  outline: 3px solid var(--c-primary);
  outline-offset: 3px;
}

/* État actif (haut contraste ON) */
.a11y-contrast-btn[aria-pressed="true"] {
  background: var(--c-primary);
  border-color: var(--c-primary-dark);
  color: var(--c-white);
}

.a11y-contrast-btn[aria-pressed="true"]:hover {
  background: var(--c-primary-dark);
  border-color: var(--c-primary-dark);
}

/* ── MODE HAUT CONTRASTE ─────────────────────────────────── */
/*
  La classe .high-contrast est ajoutée sur <html> par JS.
  On surcharge uniquement les variables CSS et quelques propriétés
  qui ne passent pas par les variables, en restant dans la même
  famille chromatique bleue du thème.
*/

html.high-contrast {
  /* Bleu principal : #71a5de → #1A5FA8  (ratio 7.5:1 / blanc) */
  --c-primary:       #1A5FA8;
  --c-primary-dark:  #0E4A8A;
  --c-primary-light: #C5DEF4;

  /* Accents bleus */
  --c-accent:        #1A5FA8;
  --c-accent-light:  #D8EAF7;

  /* Or : #C8A96E → #7A5A1A  (ratio 7.2:1 / blanc) */
  --c-gold:          #7A5A1A;
  --c-gold-light:    #F5E8CC;

  /* Fonds : snow #f8f9fb → blanc pur */
  --c-bg:            #FFFFFF;
  --c-bg-alt:        #E0EEF8;
  --c-white:         #FFFFFF;

  /* Bordures : bleu bien visible */
  --c-border:        #1A5FA8;

  /* Textes : renforcés */
  --c-text:          #000000;   /* 21:1 */
  --c-text-md:       #111111;   /* 18:1 */
  --c-text-light:    #3D3D3D;   /* 9.5:1 */

  /* Ombres : légèrement renforcées */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.18);
  --shadow-md:  0 4px 16px rgba(0,0,0,.22);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.26);
  --shadow-xl:  0 16px 48px rgba(0,0,0,.30);
}

/* ── Surcharges ciblées ────────────────────────────────────
   Pour les éléments qui utilisent des valeurs codées en dur
   plutôt que des variables CSS.
   ────────────────────────────────────────────────────────── */

/* Base */
html.high-contrast body {
  background-color: #FFFFFF;
  color: #000000;
}

html.high-contrast a {
  color: #1A5FA8;
}

html.high-contrast a:hover,
html.high-contrast a:focus {
  color: #0E4A8A;
  text-decoration: underline;
}

/* Header */
html.high-contrast .site-header {
  background: #FFFFFF;
  border-bottom: 2px solid #1A5FA8;
}

html.high-contrast .site-logo__name {
  color: #000000;
}

html.high-contrast .site-logo__title {
  color: #111111;
}

/* Navigation */
html.high-contrast .site-nav a {
  color: #000000;
}

html.high-contrast .site-nav a:hover,
html.high-contrast .site-nav a:focus {
  color: #1A5FA8;
}

html.high-contrast .site-nav .current-menu-item > a,
html.high-contrast .site-nav [aria-current="page"] {
  color: #0E4A8A;
  font-weight: 700;
}

/* Bouton CTA */
html.high-contrast .btn--primary {
  background: #1A5FA8;
  border-color: #1A5FA8;
  color: #FFFFFF;
}

html.high-contrast .btn--primary:hover,
html.high-contrast .btn--primary:focus {
  background: #0E4A8A;
  border-color: #0E4A8A;
  color: #FFFFFF;
}

html.high-contrast .btn--outline,
html.high-contrast .btn--secondary {
  border-color: #1A5FA8;
  color: #1A5FA8;
}

html.high-contrast .btn--outline:hover {
  background: #1A5FA8;
  color: #FFFFFF;
}

/* Téléphone header */
html.high-contrast .header-phone {
  color: #000000;
}

html.high-contrast .header-phone:hover {
  color: #1A5FA8;
}

html.high-contrast .header-phone svg {
  fill: currentColor;
}

/* Burger mobile */
html.high-contrast .nav-toggle span {
  background-color: #000000;
}

/* Sélecteur de langue */
html.high-contrast .lang-switcher__toggle {
  color: #000000;
  border-color: #1A5FA8;
}

html.high-contrast .lang-switcher__dropdown {
  background: #FFFFFF;
  border: 2px solid #1A5FA8;
  box-shadow: 0 4px 16px rgba(0,0,0,.22);
}

html.high-contrast .lang-switcher__dropdown a {
  color: #000000;
}

html.high-contrast .lang-switcher__dropdown a:hover {
  background: #C5DEF4;
  color: #0E4A8A;
}

/* Titres */
html.high-contrast h1,
html.high-contrast h2,
html.high-contrast h3,
html.high-contrast h4,
html.high-contrast h5,
html.high-contrast h6 {
  color: #000000;
}

/* Sections alternées */
html.high-contrast [class*="--alt"],
html.high-contrast .section--alt,
html.high-contrast .bg-alt {
  background-color: #E0EEF8;
}

/* Cartes et blocs génériques */
html.high-contrast [class*="card"],
html.high-contrast [class*="-card"] {
  border: 1px solid #1A5FA8;
}

/* Formulaires */
html.high-contrast input,
html.high-contrast textarea,
html.high-contrast select {
  background: #FFFFFF;
  color: #000000;
  border: 2px solid #1A5FA8;
}

html.high-contrast input::placeholder,
html.high-contrast textarea::placeholder {
  color: #3D3D3D;
}

html.high-contrast input:focus,
html.high-contrast textarea:focus,
html.high-contrast select:focus {
  outline: 3px solid #1A5FA8;
  outline-offset: 2px;
}

/* Focus universel renforcé */
html.high-contrast *:focus-visible {
  outline: 3px solid #1A5FA8;
  outline-offset: 3px;
}

/* Footer */
html.high-contrast .site-footer {
  border-top: 2px solid #1A5FA8;
  color: #000000;
}

html.high-contrast .site-footer a {
  color: #1A5FA8;
}

html.high-contrast .site-footer a:hover {
  color: #0E4A8A;
  text-decoration: underline;
}

/* Or / étoiles / décorations */
html.high-contrast [class*="star"],
html.high-contrast [class*="gold"],
html.high-contrast [class*="rating"] {
  color: #7A5A1A;
  fill: #7A5A1A;
}

/* Bouton contraste lui-même en mode actif */
html.high-contrast .a11y-contrast-btn {
  border-color: #1A5FA8;
  color: #1A5FA8;
  background: transparent;
}

html.high-contrast .a11y-contrast-btn[aria-pressed="true"] {
  background: #1A5FA8;
  border-color: #0E4A8A;
  color: #FFFFFF;
}

html.high-contrast .a11y-contrast-btn:focus-visible {
  outline: 3px solid #0E4A8A;
  outline-offset: 3px;
}
