/* PTL Accessibilité : panneau visiteurs et effets des préférences.
   Le panneau a sa propre palette, indépendante du thème : contrastes
   garantis (texte #16171b sur #fff, 17:1), focus toujours visible. */
@font-face { font-family: 'Luciole'; src: url('fonts/Luciole-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Luciole'; src: url('fonts/Luciole-Bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }

.ptl-rgaa-racine { --ptl-r-encre: #16171b; --ptl-r-fond: #ffffff; --ptl-r-doux: #f2f3f6; --ptl-r-trait: #c9ccd4; --ptl-r-accent: #0b6b5c; --ptl-r-aide: #4a4f5c;
	position: fixed; bottom: 18px; z-index: 2147482000; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 16px; line-height: 1.45; color: var(--ptl-r-encre); letter-spacing: normal; word-spacing: normal; }
.ptl-rgaa-racine--droite { right: 18px; }
.ptl-rgaa-racine--gauche { left: 18px; }
.ptl-rgaa-racine *, .ptl-rgaa-racine *::before, .ptl-rgaa-racine *::after { box-sizing: border-box; }
.ptl-rgaa-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ptl-rgaa-racine button { font: inherit; color: inherit; cursor: pointer; }
.ptl-rgaa-racine :focus-visible { outline: 3px solid #f5b400; outline-offset: 2px; box-shadow: 0 0 0 6px #16171b; }

.ptl-rgaa-ouvrir { width: 54px; height: 54px; border-radius: 50%; border: 2px solid #ffffff; background: #16171b; color: #ffffff !important; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); transition: transform .2s; }
.ptl-rgaa-ouvrir:hover { transform: scale(1.06); }
.ptl-rgaa-ouvrir[aria-expanded="true"] { background: var(--ptl-r-accent); }

.ptl-rgaa-panneau { position: absolute; bottom: 66px; width: min(380px, calc(100vw - 36px)); max-height: min(78vh, 680px); overflow: auto; background: var(--ptl-r-fond); color: var(--ptl-r-encre); border: 2px solid var(--ptl-r-encre); border-radius: 16px; box-shadow: 0 18px 48px rgba(0, 0, 0, .35); }
.ptl-rgaa-racine--droite .ptl-rgaa-panneau { right: 0; }
.ptl-rgaa-racine--gauche .ptl-rgaa-panneau { left: 0; }
.ptl-rgaa-panneau[hidden] { display: none; }
.ptl-rgaa-panneau__tete { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; background: var(--ptl-r-encre); color: #fff; }
.ptl-rgaa-panneau__tete h2 { margin: 0; font-size: 17px; font-weight: 700; color: #fff; font-family: inherit; letter-spacing: normal; line-height: 1.3; }
.ptl-rgaa-fermer { width: 40px; height: 40px; border: 2px solid #fff; border-radius: 10px; background: transparent; color: #fff !important; display: grid; place-items: center; }
.ptl-rgaa-panneau__corps { padding: 6px 16px 16px; }
.ptl-rgaa-groupe { border-bottom: 1px solid var(--ptl-r-trait); padding: 12px 0; }
.ptl-rgaa-groupe h3 { margin: 0 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--ptl-r-aide); font-weight: 700; font-family: inherit; }

.ptl-rgaa-tailles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ptl-rgaa-tailles button { min-height: 44px; border: 2px solid var(--ptl-r-trait); border-radius: 10px; background: var(--ptl-r-fond); font-weight: 600; font-size: 14px; }
.ptl-rgaa-tailles button[aria-checked="true"] { background: var(--ptl-r-encre); color: #fff !important; border-color: var(--ptl-r-encre); }

.ptl-rgaa-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ptl-rgaa-interrupteur { width: 100%; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border: 2px solid var(--ptl-r-trait); border-radius: 12px; background: var(--ptl-r-fond); text-align: left; font-weight: 600; }
.ptl-rgaa-interrupteur__piste { flex: none; position: relative; width: 44px; height: 26px; border-radius: 13px; background: #8a8f9c; transition: background .2s; }
.ptl-rgaa-interrupteur__piste::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.ptl-rgaa-interrupteur[aria-checked="true"] { border-color: var(--ptl-r-accent); background: #e7f5f2; }
.ptl-rgaa-interrupteur[aria-checked="true"] .ptl-rgaa-interrupteur__piste { background: var(--ptl-r-accent); }
.ptl-rgaa-interrupteur[aria-checked="true"] .ptl-rgaa-interrupteur__piste::after { transform: translateX(18px); }
.ptl-rgaa-interrupteur[aria-checked="true"] .ptl-rgaa-interrupteur__libelle::after { content: ' (activé)'; font-weight: 400; color: var(--ptl-r-accent); }
.ptl-rgaa-option__aide { display: block; margin: 4px 2px 0; font-size: 13.5px; color: var(--ptl-r-aide); }

.ptl-rgaa-ecoute audio { width: 100%; }
.ptl-rgaa-lecteur { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ptl-rgaa-lecteur button { min-height: 44px; padding: 0 16px; border: 2px solid var(--ptl-r-encre); border-radius: 10px; background: var(--ptl-r-encre); color: #fff !important; font-weight: 600; }
.ptl-rgaa-lecteur button[data-arret] { background: var(--ptl-r-fond); color: var(--ptl-r-encre) !important; }
.ptl-rgaa-lecteur button:disabled { opacity: .45; cursor: not-allowed; }
.ptl-rgaa-lecteur label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.ptl-rgaa-lecteur select { min-height: 40px; border: 2px solid var(--ptl-r-trait); border-radius: 8px; font: inherit; font-size: 14px; color: var(--ptl-r-encre); background: #fff; }

.ptl-rgaa-panneau__pied { padding-top: 14px; }
.ptl-rgaa-reinit { min-height: 44px; padding: 0 16px; border: 2px solid var(--ptl-r-encre); border-radius: 10px; background: var(--ptl-r-fond); font-weight: 600; }
.ptl-rgaa-panneau__pied p { margin: 12px 0 0; font-size: 14px; line-height: 1.7; }
.ptl-rgaa-panneau__pied a { color: var(--ptl-r-accent) !important; text-decoration: underline; font-weight: 600; }

@media (max-width: 560px) {
	.ptl-rgaa-racine { bottom: 12px; }
	.ptl-rgaa-racine--droite { right: 12px; }
	.ptl-rgaa-racine--gauche { left: 12px; }
	.ptl-rgaa-panneau { position: fixed; left: 8px !important; right: 8px !important; bottom: 76px; width: auto; max-height: 72vh; }
}

/* ---------------- Effets des préférences sur la page ---------------- */
/* Tout sauf le panneau lui-même (taille et réglages fixes) et la barre
   d'administration de WordPress, qui n'est vue que par l'équipe du site. */
html.ptl-a11y-zoom body > *:not(.ptl-rgaa-racine):not(.ptl-rgaa-guide):not(#wpadminbar):not(.cursor-dot):not(.cursor-halo):not(.cursor-ring):not(.cursor-follower):not(.custom-cursor):not(#cursor):not([data-ptl-rgaa-sans-zoom]) { zoom: var(--ptl-a11y-zoom, 1); }
/* Pointeur personnalisé d'un thème (élément qui suit la souris en position
   fixe) : zoomé, il s'affiche à 1,5 fois sa vraie position et on clique à
   côté de ce qu'on vise (vécu sur agence-ptl.fr). Agrandir l'affichage rend
   donc la main au pointeur natif, que le système sait lui-même agrandir.
   Liste fermée de noms courants (pas de [class*=cursor] : il masquerait
   les classes utilitaires type cursor-pointer). Un thème peut exclure
   d'autres éléments du zoom avec l'attribut data-ptl-rgaa-sans-zoom. */
html.ptl-a11y-zoom :is(.cursor-dot, .cursor-halo, .cursor-ring, .cursor-follower, .custom-cursor, #cursor) { display: none !important; }
html.ptl-a11y-zoom body, html.ptl-a11y-zoom body * { cursor: revert !important; }

/* Espacements du critère 10.12 (WCAG 1.4.12). */
html.ptl-a11y-espacement body *:not(.ptl-rgaa-racine):not(.ptl-rgaa-racine *):not(#wpadminbar):not(#wpadminbar *) { line-height: 1.5 !important; letter-spacing: .12em !important; word-spacing: .16em !important; }
html.ptl-a11y-espacement body p:not(.ptl-rgaa-racine *) { margin-bottom: 2em !important; }

html.ptl-a11y-police body *:not(.ptl-rgaa-racine):not(.ptl-rgaa-racine *):not(#wpadminbar):not(#wpadminbar *):not(svg):not(svg *):not(i):not([class*="icon"]):not([class*="ico"]) { font-family: 'Luciole', system-ui, sans-serif !important; }

/* Le filtre s'applique aux enfants directs du body, pas au body : un filtre
   sur un ancêtre casserait les éléments en position fixe (en-tête, bannière). */
html.ptl-a11y-contraste body > *:not(.ptl-rgaa-racine):not(.ptl-rgaa-guide):not(#wpadminbar) { filter: contrast(1.35) saturate(1.1); }

html.ptl-a11y-liens a:not(.ptl-rgaa-racine a):not(#wpadminbar a) { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px !important; }
html.ptl-a11y-liens a:not(.ptl-rgaa-racine a):focus-visible { outline: 3px solid #f5b400 !important; }

html.ptl-a11y-animations *, html.ptl-a11y-animations *::before, html.ptl-a11y-animations *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }

.ptl-rgaa-guide { position: fixed; left: 0; right: 0; top: 0; height: 44px; z-index: 2147481999; pointer-events: none; background: rgba(255, 214, 10, .14); border-top: 2px solid rgba(255, 214, 10, .85); border-bottom: 2px solid rgba(255, 214, 10, .85); }

@media (prefers-reduced-motion: reduce) { .ptl-rgaa-ouvrir, .ptl-rgaa-interrupteur__piste, .ptl-rgaa-interrupteur__piste::after { transition: none; } }
@media print { .ptl-rgaa-racine, .ptl-rgaa-guide { display: none !important; } }
