/* YemaNova — accessibilité : focus visible, lien d'évitement, thèmes à contraste renforcé, options de lisibilité,
   bouton et panneau « Accessibilité ». Chargé par toutes les pages publiques, après css/styles.css. */
/* =====================================================================================================
   Personnalisation de l'affichage (js/yn-a11y.js) — thèmes à contraste renforcé et options de lisibilité.
   Les couleurs sont centralisées dans les variables --a-* ; le thème standard YemaNova n'est pas modifié.
   ===================================================================================================== */
html[data-yn-contrast="clair"]{--a-bg:#ffffff;--a-surface:#f1f3f4;--a-text:#111417;--a-muted:#2b3135;--a-link:#035c66;--a-h2:#035c66;--a-h3:#8a3b1e;--a-accent:#6b5200;--a-btn-bg:#035c66;--a-btn-text:#ffffff;--a-btn2-bg:#8a3b1e;--a-btn2-text:#ffffff;--a-border:#2b3135;--a-focus:#8a3b1e;color-scheme:light}
html[data-yn-contrast="sombre"]{--a-bg:#0f1214;--a-surface:#1b2023;--a-text:#ffffff;--a-muted:#e3e8ea;--a-link:#7fe3ec;--a-h2:#7fe3ec;--a-h3:#ffc2a8;--a-accent:#ffd84d;--a-btn-bg:#ffd84d;--a-btn-text:#0f1214;--a-btn2-bg:#7fe3ec;--a-btn2-text:#0f1214;--a-border:#e3e8ea;--a-focus:#ffd84d;color-scheme:dark}
html[data-yn-contrast]{--bg:var(--a-bg);--bg-deep:var(--a-bg);--card:var(--a-surface);--muted:var(--a-muted);--white:var(--a-text);--gold:var(--a-accent);--teal:var(--a-h2);--teal-text:var(--a-h2);--terracotta-text:var(--a-h3);--focus:var(--a-focus);background:var(--a-bg)}
html[data-yn-contrast] body{background:var(--a-bg)!important;color:var(--a-text)!important}
html[data-yn-contrast] body :where(*:not(img,svg,svg *,video,iframe,picture)){color:var(--a-text)!important;background-color:transparent!important;background-image:none!important;border-color:var(--a-border)!important;box-shadow:none!important;text-shadow:none!important}
html[data-yn-contrast] :is(header,footer,.page-hero,.hero-premium,.course-hero,.profile-hero,.newsletter-section,.legal-content,.error-container,#navLinks){background:var(--a-bg)!important}
html[data-yn-contrast] header{border-bottom:2px solid var(--a-border)!important}
html[data-yn-contrast] footer{border-top:2px solid var(--a-border)!important}
html[data-yn-contrast] :is(.premium-card,.sticky-card,.trainer-card,.referent-card,.accessibility-note,.toc,.legal-container,.contact-card,.inline-trainer,.facts>div,.link-cards a,.accordion-list details,.hero-card,.feature-panel,.partner-card,.course-keyfacts span,.mini-list li,.tag-list li,.contact-highlight,.yn-eb-banner,.yn-programme){background:var(--a-surface)!important;border:2px solid var(--a-border)!important}
html[data-yn-contrast] body :is(h1,h2,.legal-title){color:var(--a-h2)!important}
html[data-yn-contrast] body :is(h3,h4){color:var(--a-h3)!important}
html[data-yn-contrast] body :is(.eyebrow,.card-kicker,.role,.facts dt,.text-link){color:var(--a-accent)!important}
html[data-yn-contrast] body a{color:var(--a-link)!important;text-decoration:underline!important;text-underline-offset:.18em}
html[data-yn-contrast] body .logo .y,html[data-yn-contrast] body .logo .n,html[data-yn-contrast] body .footer-logo .y,html[data-yn-contrast] body .footer-logo .n{color:var(--a-h2)!important}
html[data-yn-contrast] body .logo .other,html[data-yn-contrast] body .footer-logo .other{color:var(--a-h3)!important}
html[data-yn-contrast] body .logo{text-decoration:none!important}
html[data-yn-contrast] body :is(.cta-button,.submit-btn,button,input[type=submit],input[type=button],.nav-links a.nav-espace,.icon-badge,.expertise-item,.skip-link){background:var(--a-btn-bg)!important;color:var(--a-btn-text)!important;border:2px solid var(--a-btn-bg)!important;text-decoration:none!important}
html[data-yn-contrast] body .cta-button.secondary{background:var(--a-btn2-bg)!important;color:var(--a-btn2-text)!important;border-color:var(--a-btn2-bg)!important}
html[data-yn-contrast] body :is(.cta-button,.submit-btn,button,.nav-espace) *{color:inherit!important}
html[data-yn-contrast] body :is(input:not([type=submit]):not([type=button]):not([type=radio]):not([type=checkbox]),select,textarea){background:var(--a-bg)!important;color:var(--a-text)!important;border:2px solid var(--a-border)!important}
html[data-yn-contrast] body ::placeholder{color:var(--a-muted)!important;opacity:1}
html[data-yn-contrast] body :is(.session-open,.session-full,.session-upcoming,.yn-eb-tag,.yn-eb-ribbon,.badge){border:2px solid var(--a-border)!important;background:var(--a-surface)!important;color:var(--a-text)!important}
html[data-yn-contrast] body :is(.muted,.session-access,.form-hint,small){color:var(--a-muted)!important}
html[data-yn-contrast] body :is(hr,table,th,td){border-color:var(--a-border)!important}
html[data-yn-contrast] body img{filter:none!important}
html[data-yn-contrast] body .bar-fill{background:var(--a-link)!important}

/* Indicateur de focus visible, dans tous les thèmes */
:focus-visible{outline:3px solid var(--focus,#f6ca31)!important;outline-offset:3px!important}
html[data-yn-contrast] :focus-visible{outline:3px solid var(--a-focus)!important;outline-offset:3px!important;box-shadow:0 0 0 6px var(--a-bg)!important}

/* Taille du texte (les tailles en rem suivent ; le zoom du navigateur reste disponible) */
html[data-yn-text="-1"]{font-size:90%}
html[data-yn-text="1"]{font-size:115%}
html[data-yn-text="2"]{font-size:130%}
html[data-yn-text="3"]{font-size:150%}
html[data-yn-text="4"]{font-size:175%}
html[data-yn-text] body{font-size:1rem!important}
/* Interlignes et espacements (critère WCAG 1.4.12) */
html[data-yn-lh] body :where(*:not(svg *)){line-height:1.9!important}
html[data-yn-lh] body :where(p,li,dd){margin-bottom:1.1em}
html[data-yn-ls] body :where(*:not(svg *)){letter-spacing:.12em!important;word-spacing:.16em!important}
/* Police simplifiée */
html[data-yn-font] body,html[data-yn-font] body :where(*:not(svg *)){font-family:Verdana,"DejaVu Sans",Tahoma,Arial,sans-serif!important}
/* Liens soulignés */
html[data-yn-links] body a{text-decoration:underline!important;text-underline-offset:.18em;text-decoration-thickness:max(1px,.08em)}
html[data-yn-links] body .logo{text-decoration:none!important}
/* Sans animations ni transitions (et préférence système « réduire les animations ») */
html[data-yn-motion] *,html[data-yn-motion] *::before,html[data-yn-motion] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
@media (prefers-reduced-motion: reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}
/* Moins de distractions : fonds décoratifs, ombres et images purement décoratives estompés */
html[data-yn-calm] body :where(*){background-image:none!important;box-shadow:none!important;text-shadow:none!important}
html[data-yn-calm] body :is(img[alt=""],.hero-visual>img,.profile-secondary){filter:grayscale(1);opacity:.35}
html[data-yn-calm] body :is(.yn-eb-ribbon){animation:none!important}

/* Bouton et panneau « Accessibilité » */
.skip-link:focus{top:6px!important;z-index:3000}
.skip-links{position:absolute;left:0;top:0;z-index:3000}
.yn-a11y{position:fixed;left:14px;bottom:14px;z-index:2500;font-size:1rem}
.yn-a11y-toggle{display:inline-flex;align-items:center;gap:.45rem;min-height:44px;padding:.55rem .95rem;border-radius:999px;border:2px solid #fff;background:var(--teal-strong,#037c89);color:#fff;font:700 .95rem/1.2 inherit;font-family:inherit;cursor:pointer;box-shadow:0 6px 18px rgba(0,0,0,.35)}
.yn-a11y-toggle:hover{background:#025f69}
.yn-a11y-icon{display:inline-grid;place-items:center;width:1.6rem;height:1.6rem;border-radius:50%;background:#fff;color:#025f69;font-size:.8rem;font-weight:800}
.yn-a11y-panel{position:absolute;left:0;bottom:calc(100% + 10px);width:min(360px,calc(100vw - 28px));max-height:calc(100vh - 100px);overflow:auto;background:#252b2f;color:#fff;border:2px solid #cbd2d6;border-radius:16px;padding:1rem 1.1rem 1.1rem;box-shadow:0 18px 50px rgba(0,0,0,.5);text-align:left}
.yn-a11y-panel[hidden]{display:none}
.yn-a11y-head{display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-bottom:.4rem}
.yn-a11y-panel h2{font-size:1.15rem!important;margin:0!important;color:#fff;text-align:left;max-width:none}
.yn-a11y-close{min-width:44px;min-height:44px;border-radius:50%;border:2px solid #cbd2d6;background:transparent;color:#fff;font-size:1.4rem;line-height:1;cursor:pointer}
.yn-a11y-panel fieldset{border:1px solid rgba(255,255,255,.25);border-radius:12px;padding:.6rem .8rem .7rem;margin:.7rem 0}
.yn-a11y-panel legend{padding:0 .3rem;font-weight:700;color:#e9b80f}
.yn-a11y-choice{display:flex;gap:.55rem;align-items:flex-start;padding:.3rem 0;cursor:pointer;line-height:1.4}
.yn-a11y-choice input{margin-top:.2rem;width:1.15rem;height:1.15rem;flex:0 0 auto;accent-color:#5ccbd6}
.yn-a11y-size{display:flex;align-items:center;gap:.8rem}
.yn-a11y-size legend{float:left;width:100%;margin-bottom:.4rem}
.yn-a11y-size button{min-width:52px;min-height:44px;border-radius:10px;border:2px solid #cbd2d6;background:#30373b;color:#fff;font-weight:800;font-size:1rem;cursor:pointer}
.yn-a11y-size output{min-width:4.5rem;text-align:center;font-weight:700}
.yn-a11y-actions{display:flex;flex-wrap:wrap;gap:.6rem 1rem;align-items:center;margin-top:.4rem}
.yn-a11y-reset{min-height:44px;padding:.5rem .9rem;border-radius:999px;border:2px solid #e9b80f;background:#e9b80f;color:#252b2f;font-weight:700;cursor:pointer}
.yn-a11y-actions a{color:#e9b80f}
.yn-a11y-note{font-size:.82rem;color:#cbd2d6;margin:.7rem 0 0}
.yn-a11y-live{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
html[data-yn-contrast] .yn-a11y-panel{background:var(--a-surface)!important;border-color:var(--a-border)!important}
html[data-yn-contrast] .yn-a11y-panel legend{color:var(--a-accent)!important}
html[data-yn-contrast] .yn-a11y-toggle .yn-a11y-icon{background:var(--a-btn-text)!important;color:var(--a-btn-bg)!important}
@media(max-width:700px){.yn-a11y{left:10px;bottom:10px}.yn-a11y-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}.yn-a11y-toggle{padding:.5rem;min-width:48px;justify-content:center}}
@media print{.yn-a11y,.skip-link{display:none!important}}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.skip-link{position:absolute;top:-200px;left:6px;white-space:nowrap;background:#037c89;color:#fff;padding:8px 12px;text-decoration:none;border-radius:4px;z-index:3000;font-family:inherit}
#contenu:focus{outline:none}
