/* =====================================================================
   MODE CONTRASTE ÉLEVÉ « CLAIR RENFORCÉ » (02/12/2026)
   Bouton « Contraste élevé » de l'en-tête (templates/header.php) : classe
   html.contraste-eleve (surtout pas « high-contrast » : le site désactive
   toute sa mise en page avec html:not(.high-contrast)), mémorisée dans
   localStorage « 2iia-high-contrast ».

   La mise en page ne bouge pas. Changent : fonds (blanc), textes (noir pur),
   images de fond et décors (retirés), liens (bleu foncé souligné), boutons
   (noirs), cartes et champs (contour noir 2 px), focus (bleu épais).
   Photos et logos restent en couleur ; le logo 2IIA passe en noir.

   Règles dans la couche « hc-a11y », déclarée en tout premier
   (templates/header-assets.php) : pour les !important, la couche la plus
   ancienne l'emporte sur tout le reste du site.
   ===================================================================== */

@layer hc-a11y {

  /* ---------- Bouton « Contraste élevé » (mode normal) ---------- */
  #arbree-header button#arbree-toggle-contrast {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: none !important;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, .09) !important;
    color: #eee2cf !important;
    -webkit-text-fill-color: #eee2cf !important;
    box-shadow: none !important;
    font-size: 0 !important;
    line-height: 0 !important;
    cursor: pointer !important;
    opacity: 1 !important;
    visibility: visible !important;
    transition: background-color .2s ease !important;
  }
  #arbree-header button#arbree-toggle-contrast:is(:hover, :focus-visible) {
    background: #ed5f54 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }
  #arbree-header button#arbree-toggle-contrast:focus-visible {
    outline: 3px solid #fff !important;
    outline-offset: 3px !important;
  }
  :is(#arbree-header button#arbree-toggle-contrast, #arbree-mobile-menu button#arbree-toggle-contrast-mobile) svg {
    display: block !important;
    margin: 0 !important;
    fill: none !important;
    stroke: currentColor !important;
    color: inherit !important;
    opacity: 1 !important;
    transform: none !important;
  }
  #arbree-header button#arbree-toggle-contrast svg { width: 22px !important; height: 22px !important; }
  #arbree-mobile-menu button#arbree-toggle-contrast-mobile svg { width: 20px !important; height: 20px !important; }
  /* Les enfants du SVG aussi : d'anciennes règles (.arbree-nav svg path…) les peignent en sombre. */
  :is(#arbree-header button#arbree-toggle-contrast, #arbree-mobile-menu button#arbree-toggle-contrast-mobile) svg circle {
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
    fill: none !important;
    stroke: currentColor !important;
    stroke-width: 1.8px !important;
    opacity: 1 !important;
  }
  :is(#arbree-header button#arbree-toggle-contrast, #arbree-mobile-menu button#arbree-toggle-contrast-mobile) svg .hc-half {
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
    fill: currentColor !important;
    stroke: none !important;
    opacity: 1 !important;
  }
  @media (max-width: 1140px) {
    #arbree-header button#arbree-toggle-contrast { display: none !important; }
  }

  /* =================================================================
     Mode actif
     ================================================================= */

  /* ---------- Base : blanc et noir pur, plus d'images de fond ---------- */
  html.contraste-eleve,
  html.contraste-eleve body {
    background: #fff !important;
    color: #000 !important;
  }
  html.contraste-eleve body *,
  html.contraste-eleve body *::before,
  html.contraste-eleve body *::after {
    background-color: transparent !important;
    background-image: none !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    text-shadow: none !important;
    box-shadow: none !important;
    filter: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    mix-blend-mode: normal !important;
  }
  /* Pseudo-éléments (icônes Font Awesome…) : couleur de leur élément, pour rester visibles
     dans les boutons noirs. */
  html.contraste-eleve body *::before,
  html.contraste-eleve body *::after {
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
  }

  /* En-tête : blanc, filet noir. */
  html.contraste-eleve #arbree-header .arbree-nav {
    background-color: #fff !important;
    outline: 2px solid #000 !important;
    outline-offset: -2px !important;
  }

  /* Panneaux qui passent par-dessus la page : fond blanc opaque, contour noir. */
  html.contraste-eleve :is(dialog, [role="dialog"], [aria-modal="true"], .mega-dropdown, .mx-dropdown, .arbree-mobile-menu,
    [class*="modal-content"], [class*="modal__box"], .chat-window, .arbree-search-suggestions, [class*="dropdown-menu"],
    [class*="cookie"], [class*="popup"], [class*="toast"], [class*="tooltip"]) {
    background-color: #fff !important;
  }
  html.contraste-eleve :is(dialog, [role="dialog"], .mega-dropdown, .mx-dropdown, .arbree-mobile-menu, .chat-window) {
    outline: 2px solid #000 !important;
    outline-offset: -2px !important;
  }
  html.contraste-eleve :is(#mega-overlay, .mega-overlay) { background-color: rgba(0, 0, 0, .55) !important; }

  /* Grands blocs (hero, boîtes bleu nuit) : blancs, avec un contour noir pour garder leur forme. */
  html.contraste-eleve :is(section.lh .lh-inner, .hm-box, .pathway-universe, .home-biz__box, .lx-panel, .lx-alumni,
    .lx-qualiopi, .school-community__layout, .parcours-panel, .parcours-app, .bootcamps-alert) {
    outline: 2px solid #000 !important;
    outline-offset: -2px !important;
  }

  /* Décors purement visuels : image de fond du hero, voiles, logo 3D. */
  html.contraste-eleve :is(.lx-scroll-bg, .lh-shade, .lh-clouds, .lh-visual, .lh-logo) {
    display: none !important;
  }

  /* ---------- Titres : mots en corail → rouge foncé ---------- */
  html.contraste-eleve :is(h1, h2, h3, h4, h5, h6) :is(em, .accent, [class*="dot"], [class*="accent"]) {
    color: #a3150c !important;
    -webkit-text-fill-color: #a3150c !important;
  }
  html.contraste-eleve mark { background-color: #ffe14d !important; }

  /* ---------- Liens : bleu foncé ---------- */
  html.contraste-eleve body a,
  html.contraste-eleve body a * {
    color: #0033cc !important;
    -webkit-text-fill-color: #0033cc !important;
  }
  html.contraste-eleve :is(p, li, td, dd, blockquote, label, small) a:not([class]),
  html.contraste-eleve main a:not([class]),
  html.contraste-eleve body a:hover {
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 3px !important;
  }

  /* ---------- Boutons : noirs, texte blanc ---------- */
  html.contraste-eleve body :is(button, [role="button"], input[type="submit"], input[type="button"], input[type="reset"],
    .btn, a[class*="btn"], a[class*="button"], a[class*="cta"], a[class*="pill"], a.hm-all, a.nx-head__all) {
    background-color: #000 !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
    text-decoration: none !important;
    opacity: 1 !important;
  }
  html.contraste-eleve body :is(button, [role="button"], .btn, a[class*="btn"], a[class*="button"], a[class*="cta"], a[class*="pill"], a.hm-all, a.nx-head__all) * {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }
  html.contraste-eleve body :is(button, [role="button"], input[type="submit"], input[type="button"], .btn, a[class*="btn"], a[class*="button"], a[class*="cta"], a[class*="pill"], a.hm-all, a.nx-head__all):is(:hover, :focus-visible) {
    background-color: #0033cc !important;
  }
  html.contraste-eleve .arbree-burger span { background-color: #fff !important; }

  /* ---------- Cartes cliquables : contour noir ---------- */
  html.contraste-eleve body :is(a.hm-card, a[class*="card"], a.parcours-ref) {
    background-color: #fff !important;
    outline: 2px solid #000 !important;
    outline-offset: -2px !important;
  }
  html.contraste-eleve body :is(a.hm-card, a[class*="card"], a.parcours-ref) * { color: #000 !important; -webkit-text-fill-color: #000 !important; }
  html.contraste-eleve body :is(a.hm-card, a[class*="card"], a.parcours-ref) :is([class*="title"], [class*="job"], h2, h3, h4) {
    color: #0033cc !important;
    -webkit-text-fill-color: #0033cc !important;
  }
  html.contraste-eleve body :is(a.hm-card, a[class*="card"], a.parcours-ref):is(:hover, :focus-visible) { background-color: #000 !important; }
  html.contraste-eleve body :is(a.hm-card, a[class*="card"], a.parcours-ref):is(:hover, :focus-visible) * { color: #fff !important; -webkit-text-fill-color: #fff !important; }

  /* ---------- Champs de formulaire ---------- */
  html.contraste-eleve body :is(input:not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]), select, textarea) {
    background-color: #fff !important;
    color: #000 !important;
    -webkit-text-fill-color: #000 !important;
    caret-color: #000 !important;
  }
  /* Contour noir : la barre de recherche du hero entière, les autres champs un par un. */
  html.contraste-eleve body form.lh-search,
  html.contraste-eleve body :is(input:not([type="submit"]):not([type="button"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not(form.lh-search input), select, textarea) {
    background-color: #fff !important;
    outline: 2px solid #000 !important;
    outline-offset: -2px !important;
  }
  html.contraste-eleve body :is(input, textarea)::placeholder {
    color: #3d3d3d !important;
    -webkit-text-fill-color: #3d3d3d !important;
    opacity: 1 !important;
  }
  html.contraste-eleve :is(input[type="checkbox"], input[type="radio"]) { accent-color: #000 !important; }

  /* ---------- Focus clavier ---------- */
  html.contraste-eleve :focus-visible {
    outline: 3px solid #0033cc !important;
    outline-offset: 3px !important;
  }

  /* ---------- Images : en couleur ; logo 2IIA (blanc à l'origine) en noir ---------- */
  html.contraste-eleve :is(img, video, picture, canvas, iframe) { filter: none !important; }
  html.contraste-eleve img[src*="LOGO-2IIA"] { filter: brightness(0) !important; }

  /* ---------- Icônes : couleur du texte autour ---------- */
  html.contraste-eleve :is(.fa, .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands, i[class*="fa-"]) {
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
  }
  html.contraste-eleve body svg { color: inherit !important; }
  html.contraste-eleve body svg :is(path, circle, line, polyline, rect)[stroke]:not([stroke="none"]),
  html.contraste-eleve body svg[stroke] :is(path, circle, line, polyline, rect) { stroke: currentColor !important; }

  /* ---------- Séparateurs, sélection ---------- */
  html.contraste-eleve hr { border: 0 !important; height: 2px !important; background-color: #000 !important; }
  html.contraste-eleve ::selection { background: #000 !important; color: #fff !important; -webkit-text-fill-color: #fff !important; }

  /* ---------- Bouton « Contraste élevé » quand le mode est actif ---------- */
  html.contraste-eleve #arbree-header button#arbree-toggle-contrast,
  html.contraste-eleve #arbree-mobile-menu button#arbree-toggle-contrast-mobile {
    background-color: #0033cc !important;
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }
  html.contraste-eleve #arbree-header button#arbree-toggle-contrast *,
  html.contraste-eleve #arbree-mobile-menu button#arbree-toggle-contrast-mobile * {
    color: #fff !important;
    -webkit-text-fill-color: #fff !important;
  }

  /* ---------- Pas d'animations ---------- */
  html.contraste-eleve *,
  html.contraste-eleve *::before,
  html.contraste-eleve *::after {
    transition-duration: 0s !important;
    animation-duration: 0s !important;
    animation-iteration-count: 1 !important;
  }
}
