/* ==========================================================================
   Widget de confort de lecture — bouton « Aa » et panneau
   --------------------------------------------------------------------------
   Sorti de layout.css le 3 octobre 2026 pour être chargé AUSSI dans
   l'administration et l'éditeur de blocs : ces écrans n'avaient aucun moyen
   de passer en fond clair, ni de changer la taille du texte — alors que
   l'équipe qui administre le site est aussi concernée par la dyslexie.

   Le balisage est partials/_a11y.php, les préférences a11y.js, les
   interactions a11y-widget.js. Tout passe par les jetons : le widget suit le
   thème là où il est posé.
   ========================================================================== */

.a11y__bouton {
    position: fixed;
    left: 16px; bottom: 16px;
    z-index: 240;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border: 2px solid var(--violet);
    border-radius: var(--r-pill);
    background: var(--fond-carte);
    color: var(--violet-lien);
    font-family: inherit;
    font-weight: 700;
    font-size: .9rem;
    cursor: pointer;
    box-shadow: 0 12px 28px -10px rgba(42, 33, 69, .4);
}
.a11y__aa { font-family: var(--police-titre); font-size: 1.05rem; }

.a11y__panneau {
    position: fixed;
    left: 16px; bottom: 74px;
    z-index: 241;
    width: min(370px, calc(100vw - 32px));
    max-height: min(560px, calc(100vh - 100px));
    overflow-y: auto;
    background: var(--fond-carte);
    border: 1px solid var(--bord-champ);
    border-radius: var(--r-lg);
    box-shadow: 0 30px 60px -20px rgba(42, 33, 69, .45);
    padding: 20px;
    color: var(--texte);
}
.a11y__panneau[hidden] { display: none; }
.a11y__tete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 1rem;
}
.a11y__tete h2 { font-size: 1.1rem; margin: 0; color: var(--texte-fort); }
.a11y__tete-actions { display: flex; gap: 8px; align-items: center; }
.a11y__fermer {
    width: 30px; height: 30px;
    border: 0;
    border-radius: 50%;
    background: var(--fond-violet-2);
    color: var(--texte);
    cursor: pointer;
}
.a11y__taille {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: var(--fond-carte-2);
    border: 1px solid var(--bord-doux);
    border-radius: var(--r-md);
    margin-bottom: 12px;
}
.a11y__taille button {
    width: 38px; height: 38px;
    border: 1.5px solid var(--bord-violet);
    border-radius: var(--r-sm);
    background: var(--fond-carte);
    color: var(--texte);
    font-weight: 700;
    cursor: pointer;
}
.a11y__taille span { min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }

.a11y__switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1px solid var(--bord-doux);
    border-radius: var(--r-md);
    background: var(--fond-carte);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color var(--t-rapide), background var(--t-rapide);
}
.a11y__switch:hover { border-color: var(--violet-pale); }
.a11y__switch[aria-checked="true"] { background: var(--fond-doux); border-color: var(--bord-violet); }
.a11y__switch-texte { display: flex; flex-direction: column; gap: 2px; }
.a11y__switch-label { font-size: .95rem; color: var(--texte); font-weight: 600; }
.a11y__switch-aide  { font-size: .82rem; color: var(--texte-3); }
.a11y__piste {
    position: relative;
    flex-shrink: 0;
    width: 46px; height: 26px;
    border-radius: var(--r-pill);
    background: var(--bord-violet);
    transition: background var(--t-base);
}
.a11y__switch[aria-checked="true"] .a11y__piste { background: var(--violet); }
.a11y__piste i {
    position: absolute;
    top: 3px; left: 3px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #fff;
    transition: left var(--t-base);
}
.a11y__switch[aria-checked="true"] .a11y__piste i { left: 23px; }
.a11y__note { font-size: .82rem; color: var(--texte-3); margin: 12px 0 0; }

/* Dans l'administration, le coin bas-gauche est celui de la barre latérale
   (« ← Voir le site ») : le bouton y recouvrirait un lien. On le passe à
   droite, et le panneau avec lui. Même chose dans l'éditeur de blocs, dont le
   panneau d'ajout de blocs occupe la gauche. */
body.admin .a11y__bouton  { left: auto; right: 16px; }
body.admin .a11y__panneau { left: auto; right: 16px; }

/* L'éditeur reste sombre quel que soit le thème (data-toujours-sombre sur
   <body>) : le widget y suit les jetons sombres, sans rien de plus à faire. */
