/* France Collège — réglages de lecture (accessibilité) : bouton « Aa », panneau, polices adaptées, taille, espacement,
   contraste renforcé, animations réduites. Classes posées sur <html> par assets/js/a11y.js (avant l'affichage).
   Polices libres hébergées sur le site (SIL OFL) : fonctionnent hors ligne et respectent la CSP (font-src 'self'). */
@font-face{font-family:"Cap6e Lisible";src:url("../fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");font-weight:400 600;font-style:normal;font-display:swap}
@font-face{font-family:"Cap6e Lisible";src:url("../fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");font-weight:700 1000;font-style:normal;font-display:swap}
@font-face{font-family:"Cap6e Dys";src:url("../fonts/opendyslexic-latin-400-normal.woff2") format("woff2");font-weight:400 600;font-style:normal;font-display:swap}
@font-face{font-family:"Cap6e Dys";src:url("../fonts/opendyslexic-latin-700-normal.woff2") format("woff2");font-weight:700 1000;font-style:normal;font-display:swap}

/* ---- Polices (si la police ne charge pas : pile de polices système lisibles) */
html.a11y-font-lisible body,html.a11y-font-lisible body :is(h1,h2,h3,h4,h5,p,li,a,span,strong,b,em,small,label,button,input,select,textarea,td,th,dd,dt,div,blockquote,figcaption,summary,legend){font-family:"Cap6e Lisible",Verdana,Tahoma,"Segoe UI","DejaVu Sans",Arial,sans-serif!important}
html.a11y-font-dys body,html.a11y-font-dys body :is(h1,h2,h3,h4,h5,p,li,a,span,strong,b,em,small,label,button,input,select,textarea,td,th,dd,dt,div,blockquote,figcaption,summary,legend){font-family:"Cap6e Dys","Comic Sans MS",Verdana,Tahoma,"DejaVu Sans",Arial,sans-serif!important}
html.a11y-font-dys body h1{letter-spacing:0!important}
/* Les pictogrammes et émojis gardent leur police */
html[class*="a11y-font-"] body :is(.k,.ic,.emoji,[aria-hidden="true"]){font-family:inherit}

/* ---- Taille du texte : agrandit le contenu (l'en-tête garde sa taille pour rester utilisable) */
html.a11y-size-115 main,html.a11y-size-115 .site-footer{zoom:1.15}
html.a11y-size-130 main,html.a11y-size-130 .site-footer{zoom:1.3}
html.a11y-size-115 .a11y-panel,html.a11y-size-130 .a11y-panel{zoom:1}

/* Garde-fous quand le texte prend plus de place (police large, zoom, espacement) : pas de défilement horizontal sur mobile */
html.a11y-text main *,html.a11y-text header *,html.a11y-text .site-footer *{min-width:0}
html.a11y-text :is(main,header,.site-footer) *{overflow-wrap:anywhere}
html.a11y-text :is(main,header,.site-footer) :is(h1,h2,h3,h4,h5,p,li,span,strong,b,em,a,button,label,small,td,th,dd,dt,figcaption,summary,div){white-space:normal}
html.a11y-text main :is(img,video,canvas,svg){max-width:100%}

/* ---- Interlignage et espacement des lettres */
html.a11y-spacing body{word-spacing:.12em}
html.a11y-spacing .a11y-panel{word-spacing:normal}
html.a11y-spacing body :is(p,li,dd,dt,td,th,label,blockquote,figcaption,.speech,.bubble,.captionbox span,.key span,.memo span,.qtext,.ev-opt,.opts button,summary):not(.a11y-panel *){line-height:1.8!important;letter-spacing:.05em!important;word-spacing:.14em!important}
html.a11y-spacing body :is(h1,h2,h3,h4):not(.a11y-panel *){line-height:1.3!important;letter-spacing:.02em!important}
html.a11y-spacing body p{margin-bottom:.9em}

/* ---- Contraste renforcé (les textes gris pâles sur fond clair sont foncés par a11y.js : classe .a11y-dk) */
html.a11y-contrast .a11y-dk{color:#0b1730!important}
html.a11y-contrast body main a:not([class]),html.a11y-contrast .site-footer a{text-decoration:underline!important;text-underline-offset:3px}
html.a11y-contrast body :is(input,select,textarea){border-color:#10234f!important;border-width:2px!important}
html.a11y-contrast body :is(.box,.sidebox,.q,.card,.ev-box,.ev-q,.memo,.key,.stat){border-color:#5b6b88!important}
html.a11y-contrast :focus-visible{outline:4px solid #000!important;outline-offset:2px!important;box-shadow:0 0 0 7px #ffd23f!important}
html.a11y-contrast body img{filter:contrast(1.08)}

/* ---- Réduire les animations (réglage du site OU préférence du système) */
html.a11y-calm *,html.a11y-calm *::before,html.a11y-calm *::after{animation-duration:.001ms!important;animation-delay:0s!important;animation-iteration-count:1!important;transition-duration:.001ms!important;transition-delay:0s!important;scroll-behavior:auto!important}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}}

/* ---- Bouton flottant « Aa » */
.a11y-fab{position:fixed;right:max(12px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom));z-index:1100;width:48px;height:48px;border-radius:16px;border:2px solid #10234f;background:#fff;color:#10234f;font:1000 19px/1 Arial,"Helvetica Neue",sans-serif!important;letter-spacing:-.5px!important;cursor:pointer;box-shadow:0 6px 0 #10234f,0 12px 24px rgba(16,35,79,.18);display:grid;place-items:center;opacity:.92;transition:transform .12s,opacity .12s}
.a11y-fab:hover{opacity:1;transform:translateY(-1px)}
.a11y-fab:active{transform:translateY(3px);box-shadow:0 3px 0 #10234f}
.a11y-fab[aria-expanded="true"]{background:#10234f;color:#fff}
.a11y-fab:focus-visible{outline:3px solid #ff7a24;outline-offset:3px}
body:has(.ev-timer) .a11y-fab{bottom:calc(max(12px,env(safe-area-inset-bottom)) + 84px)}
@media print{.a11y-fab,.a11y-panel{display:none!important}}

/* ---- Panneau */
.a11y-panel{position:fixed;right:max(12px,env(safe-area-inset-right));bottom:calc(max(12px,env(safe-area-inset-bottom)) + 62px);z-index:1101;width:min(360px,calc(100vw - 24px));max-height:calc(100vh - 100px);max-height:calc(100dvh - 100px);overflow:auto;overscroll-behavior:contain;background:#fff;color:#10234f;border:3px solid #10234f;border-radius:22px;box-shadow:0 8px 0 #10234f,0 20px 50px rgba(16,35,79,.25);padding:16px 16px 14px;font:15px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;text-align:left}
body:has(.ev-timer) .a11y-panel{bottom:calc(max(12px,env(safe-area-inset-bottom)) + 146px)}
.a11y-panel[hidden]{display:none}
.a11y-panel h2{margin:0;font-size:19px;font-weight:1000;line-height:1.2}
.a11y-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:8px}
.a11y-x{width:44px;height:44px;flex:0 0 44px;border-radius:14px;border:1px solid #d9e2f0;background:#f4f7fc;color:#10234f;font-size:22px;font-weight:900;cursor:pointer;line-height:1}
.a11y-panel fieldset{border:0;margin:12px 0 0;padding:0;min-width:0}
.a11y-panel legend{font-weight:1000;font-size:14px;color:#1769d7;text-transform:uppercase;letter-spacing:.4px;margin-bottom:6px;padding:0}
.a11y-seg{display:flex;flex-wrap:wrap;gap:6px}
.a11y-seg label{flex:1 1 auto;position:relative}
.a11y-seg input{position:absolute;opacity:0;inset:0;width:100%;height:100%;margin:0;cursor:pointer}
.a11y-seg span{display:flex;align-items:center;justify-content:center;min-height:44px;padding:6px 10px;border-radius:13px;border:2px solid #d9e2f0;background:#f7faff;font-weight:900;font-size:15px;text-align:center;line-height:1.15}
.a11y-seg input:checked+span{border-color:#1769d7;background:#eaf3ff;color:#0f4fa8;box-shadow:inset 0 0 0 1px #1769d7}
.a11y-seg input:focus-visible+span{outline:3px solid #ff7a24;outline-offset:2px}
.a11y-seg .f-lisible{font-family:"Cap6e Lisible",Verdana,sans-serif}
.a11y-seg .f-dys{font-family:"Cap6e Dys","Comic Sans MS",Verdana,sans-serif}
.a11y-sw{display:flex;align-items:center;gap:10px;min-height:44px;padding:4px 2px;font-weight:800;cursor:pointer}
.a11y-sw input{width:22px;height:22px;flex:0 0 22px;accent-color:#1769d7;margin:0;cursor:pointer}
.a11y-tts{display:flex;flex-wrap:wrap;gap:8px}
.a11y-btn{min-height:44px;padding:8px 14px;border-radius:13px;border:0;background:#10234f;color:#fff;font:inherit;font-weight:1000;cursor:pointer}
.a11y-btn.ghost{background:#f4f7fc;color:#10234f;border:1px solid #d9e2f0}
.a11y-btn:focus-visible,.a11y-x:focus-visible{outline:3px solid #ff7a24;outline-offset:2px}
.a11y-note{margin:6px 0 0;font-size:14px;color:#3d4f70;min-height:1.2em}
.a11y-foot{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:14px;padding-top:12px;border-top:1px solid #e2e8f3}
.a11y-install[hidden]{display:none!important}
html.a11y-calm .a11y-fab,html.a11y-calm .a11y-panel{transition:none}
@media (max-width:480px){.a11y-fab{width:46px;height:46px;font-size:18px!important}}
