/**
 * Module d'accessibilité
 *Gère le mode contraste élevé et l'agrandissement de la typographie
 */

/* Boutons d'accessibilité dans la top-menu-bar */
.accessibility-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.accessibility-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.accessibility-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.accessibility-btn.active {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}

.accessibility-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
}

/* ============================================
   MODE CONTRASTE ÉLEVÉ - VERSION NOIR ET BLANC
   ============================================ */

/* Couleurs de base */
body.high-contrast {
    background: #fff !important;
    color: #000 !important;
}

/* Suppression des ombres et effets */
body.high-contrast *,
body.high-contrast *::before,
body.high-contrast *::after {
    text-shadow: none !important;
    box-shadow: none !important;
}

/* Textes */
body.high-contrast h2,
body.high-contrast h3,
body.high-contrast h4,
body.high-contrast h5,
body.high-contrast h6,
body.high-contrast p,
body.high-contrast li,
body.high-contrast div:not(.btn):not(.blog-enbrief__label):not(.blog-enbrief__content),
body.high-contrast label,
body.high-contrast td,
body.high-contrast th {
    color: #000 !important;
}

body.high-contrast h1{
    color: white!important;
}
/* Liens */
body.high-contrast a {
    color: #000 !important;
    text-decoration: underline !important;
}

body.high-contrast a:hover,
body.high-contrast a:focus {
    color: #000 !important;
    text-decoration: none !important;
}

/* Boutons */
body.high-contrast .btn,
body.high-contrast button:not(.menu-burger),
body.high-contrast button *,
body.high-contrast input[type="submit"],
body.high-contrast input[type="button"] {
    background: #000 !important;
    color: #fff !important;
    border: 2px solid #000 !important;
}

body.high-contrast .btn:hover,
body.high-contrast .btn:hover *,
body.high-contrast button:hover,
body.high-contrast button:hover *,
body.high-contrast input[type="submit"]:hover,
body.high-contrast input[type="button"]:hover {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #000 !important;
}

/* Bordures et séparateurs */
body.high-contrast hr,
body.high-contrast .separator,
body.high-contrast .border {
    border-color: #000 !important;
}

/* Formulaires */
body.high-contrast input,
body.high-contrast textarea,
body.high-contrast select {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #000 !important;
}

body.high-contrast input::placeholder,
body.high-contrast textarea::placeholder {
    color: #666 !important;
}

body.high-contrast input:focus,
body.high-contrast textarea:focus,
body.high-contrast select:focus {
    outline: 3px solid #000 !important;
}

/* Images - Conversion en noir et blanc */
body.high-contrast img,
body.high-contrast picture,
body.high-contrast svg:not(.accessibility-btn svg) {
    filter: grayscale(100%) contrast(1.2) !important;
}

/* Header */
body.high-contrast header,
body.high-contrast .top-menu-bar,
body.high-contrast .header-logo-row,
body.high-contrast nav {
    background: #fff !important;
}

body.high-contrast .top-menu-bar .menu-item a {
    color: #000 !important;
}

/* En mode accessibilité, toujours afficher logo-alt dans le header */
body.high-contrast .header-logo.has-logo-alt .logo-default,
body.large-text-1 .header-logo.has-logo-alt .logo-default,
body.large-text-2 .header-logo.has-logo-alt .logo-default,
body.large-text-3 .header-logo.has-logo-alt .logo-default {
    opacity: 0 !important;
}

body.high-contrast .header-logo.has-logo-alt .logo-alt,
body.large-text-1 .header-logo.has-logo-alt .logo-alt,
body.large-text-2 .header-logo.has-logo-alt .logo-alt,
body.large-text-3 .header-logo.has-logo-alt .logo-alt {
    opacity: 1 !important;
}

/* Menu burger : garantir la visibilité des traits en contraste */
body.high-contrast .menu-burger__bar,
body.high-contrast #masthead.masthead-sticky--scrolled .menu-burger__bar {
    background-color: #000 !important;
}

body.high-contrast .burger-menu-overlay {
    background: #000 !important;
}

body.high-contrast .menu-burger.opened .menu-burger__bar {
    background-color: #fff !important;
}

/* Footer */
body.high-contrast footer {
    background: #000 !important;
    color: #fff !important;
}

body.high-contrast .site-footer,
body.high-contrast .site-footer .footer-main,
body.high-contrast .site-footer .footer-partners,
body.high-contrast .site-footer .footer-legal,
body.high-contrast .site-footer .footer-wave {
    background: #000 !important;
}

body.high-contrast .site-footer .footer-wave svg,
body.high-contrast .site-footer .footer-wave path {
    fill: #000 !important;
}

body.high-contrast .site-footer,
body.high-contrast .site-footer [class*="footer-"],
body.high-contrast .site-footer [class*="footer-"] * {
    color: #fff ;
}

body.high-contrast .site-footer a,
body.high-contrast .site-footer a:hover,
body.high-contrast .site-footer a:focus {
    color: #fff !important;
    text-decoration: underline !important;
}

body.high-contrast .site-footer .btn,
body.high-contrast .site-footer input[type="submit"],
body.high-contrast .site-footer input[type="button"] {
    background: #fff !important;
    color: #000 !important;
    border: 2px solid #fff !important;
}

body.high-contrast .site-footer .btn:hover,
body.high-contrast .site-footer input[type="submit"]:hover,
body.high-contrast .site-footer input[type="button"]:hover {
    background: #000 !important;
    color: #fff !important;
    border: 2px solid #fff !important;
}

body.high-contrast footer h1,
body.high-contrast footer h2,
body.high-contrast footer h3,
body.high-contrast footer h4,
body.high-contrast footer h5,
body.high-contrast footer h6,
body.high-contrast footer p,
body.high-contrast footer li,
body.high-contrast footer span,
body.high-contrast footer a {
    color: #fff !important;
}

/* Conteneurs et blocs */
body.high-contrast section,
body.high-contrast article,
body.high-contrast aside,
body.high-contrast [class*="bloc"] {
    background: #fff !important;
}

/* Backgrounds colorés → blanc */
body.high-contrast [class*="bg-"],
body.high-contrast .background,
body.high-contrast .overlay {
    background: #fff !important;
}

/* Cards et éléments en boîte */
body.high-contrast .card,
body.high-contrast .box,
body.high-contrast .panel {
    background: #fff !important;
}

/* Tables */
body.high-contrast thead,
body.high-contrast th {
    background: #000 !important;
    color: #fff !important;
}

/* Icons SVG dans les boutons d'accessibilité - garder blanc */
body.high-contrast .accessibility-btn svg {
    filter: none !important;
    fill: #fff !important;
}

body.high-contrast .accessibility-btn {
    background: rgba(0, 0, 0, 0.8) !important;
}

body.high-contrast .accessibility-btn:hover {
    background: rgba(0, 0, 0, 1) !important;
}

/* Navigation active */
body.high-contrast .current-menu-item a,
body.high-contrast .active {
    font-weight: bold !important;
}

/* Masquer tous les séparateurs décoratifs en mode contraste */
body.high-contrast hr,
body.high-contrast .separator,
body.high-contrast .block-separator,
body.high-contrast .footer-wave,
body.high-contrast [class*="separator"] {
    display: none !important;
}


/* ============================================
   AGRANDISSEMENT DE LA TYPOGRAPHIE
   ============================================ */

/* Niveaux progressifs: zoom assure un effet visible même avec des tailles en px */
body.large-text-1 {
    zoom: 1.08;
    font-size: 108%;
}

body.large-text-2 {
    zoom: 1.16;
    font-size: 116%;
}

body.large-text-3 {
    zoom: 1.24;
    font-size: 124%;
}

@supports not (zoom: 1) {
    body.large-text-1 { font-size: 108%; }
    body.large-text-2 { font-size: 116%; }
    body.large-text-3 { font-size: 124%; }
}


body.high-contrast .btn-primary.navy a{
    color: white!important;
}

body.high-contrast footer .btn a,
body.high-contrast footer .btn span{
    color: black!important;
}

body.high-contrast .blocImageTexte__accordion-question-text,
body.high-contrast .blocaccordeon__question-text{
    background: black!important;
}

body.high-contrast .blocEtapes__step,
body.high-contrast .blocEtapes__content,
body.high-contrast .blocEtapes__content *:not(.btn):not(.btn *){
    background: #e5e5e5!important;
}

body.high-contrast .blocEtapes__step *:not(.btn):not(.btn-text):not(.blocEtapes__number span){
    color: black!important;
}

body.high-contrast .blocEtapes__number{
    background: transparent!important;
    &:before{
        background: black!important;
    }
}

body.high-contrast {
    .blocEtapes__step[data-dec1-url]:before, 
    .blocEtapes__step[data-dec2-url]:before{
        filter: contrast(0) invert(1);
    }
    .page-header__background img,
    .page-header__background::before{
        display: none!important;
    }
    .page-header__title{
        color: black!important;
    }
    .page-header__breadcrumb *{
        color: black!important
    }
    .btn.btn-primary.yellow::before,
    .btn.btn-secondary.orange::before{
        filter: invert(1) brightness(21.7);
    }
    .btn.btn-primary.yellow:hover::before,
    .btn.btn-secondary.orange:hover::before{
        filter: contrast(0) brightness(0);
    }
    span[style*="color: #007fb4"],
    span[style*="color:#007fb4"] { /* Sécurité si espace manquant */
        color: black!important;
    }
    .main-nav .main-menu-class > li.menu-item-has-children > a::after,
    .main-nav .main-menu-class > li.menu-item-has-children > .main-menu-trigger::after{
        filter: brightness(0);
    }
    .page-parent-back::before{
        filter: invert(1) brightness(40.5);
    }
    .page-parent-back:hover::before{
        filter: invert(1) brightness(0);
    }
    .blocImageTexte.alignwide{
        *{
            color: black!important;
        }
        &::before{
            background: white!important;
        }
    }
    .blocBoites__description strong,
    .blog-introduction__content *{
        color: black!important;
    }
    .blog-enbrief{
        background: black!important;
        *{
            color: white!important;
        }
    }
    .bloclisteicone__numero span{
        color: white!important;
    }
    .bloclisteicone__numero{
                &::before{
            background: black!important;
        }
    }
    .btn.adherent{
        *{
            color: white!important;
        }
        &:hover{
            *{
                color: black!important;
            }
        }
    }
    .blocRemonteesContenus__card,
    .formation-sessions__card{
        border-color: black!important;
    }
    .blocRemonteesContenus .badge-pill{
        background:black!important;
        color: white!important; 
    }
    .formation-sessions__card-text{
        color:#000!important;
    }
    .formation-form__inner{
        background: black!important;
        *{
            color:white!important;
        }
    }
    .single-job__conditions{
        background: black!important;
        *{
            color: white!important;
        }
    }
    .single-job__apply-inner{
        background: black!important;
        *{
            color: white!important;
        }
    }
    .job-apply-btn:hover{
        color: black!important;
    }
    .blocContact.bg-white .blocContact__inner{
        border-color:#000!important;
        *{
            color: black!important;
        }
    }
    .blocContact__inner::before{
        filter: grayscale(1);
    }
}