/* ================================================================
   ACSBLT · Accessibilité — version autonome (WordPress / vanilla JS)
   1) Effets runtime des profils & réglages (classes sur <html>)
   2) Styles du widget (bouton + modal), préfixés .acsblta11y
   Aucune dépendance. Surchargez via --a11y-accent sur :root.
   ================================================================ */

/* ---------- 1) Effets runtime ---------- */
:root { --a11y-font-scale: 1; }
html.a11y-font-scaled { font-size: calc(1rem * var(--a11y-font-scale)) !important; }
html.a11y-low-vision { font-size: calc(1rem * var(--a11y-font-scale)) !important; }
html.a11y-low-vision a { text-decoration: underline !important; }
html.a11y-low-vision :focus-visible { outline: 4px solid var(--a11y-accent, #006828) !important; outline-offset: 3px !important; }
html.a11y-dyslexia, html.a11y-dyslexia * { font-family: 'OpenDyslexic','Comic Sans MS',Arial,sans-serif !important; letter-spacing: .05em !important; line-height: 1.9 !important; text-align: left !important; }
html.a11y-adhd * { animation: none !important; transition: none !important; }
html.a11y-adhd [aria-hidden="true"] { opacity: .4; }
html.a11y-motion *, html.a11y-reduce-motion * { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; }
html.a11y-color a { text-decoration: underline !important; }
html.a11y-senior { font-size: calc(1.1rem * var(--a11y-font-scale)) !important; }
html.a11y-senior button, html.a11y-senior .btn { min-height: 52px !important; padding: 14px 22px !important; }
html.a11y-high-contrast { filter: contrast(1.5); }
html.a11y-dark { filter: invert(1) hue-rotate(180deg); }
html.a11y-dark img, html.a11y-dark video, html.a11y-dark svg, html.a11y-dark [style*="background-image"] { filter: invert(1) hue-rotate(180deg); }
html.a11y-grayscale { filter: grayscale(1); }
html.a11y-underline-links a { text-decoration: underline !important; }
html.a11y-highlight-btns button, html.a11y-highlight-btns .btn, html.a11y-highlight-btns [role="button"] { outline: 3px solid var(--a11y-accent, #006828) !important; outline-offset: 2px; }
html.a11y-no-transitions * { transition: none !important; }
html.a11y-strong-focus :focus-visible { outline: 4px solid var(--a11y-accent, #006828) !important; outline-offset: 4px !important; box-shadow: 0 0 0 8px rgba(0,104,40,.18) !important; }
html.a11y-big-targets button, html.a11y-big-targets a, html.a11y-big-targets [role="button"], html.a11y-big-targets input, html.a11y-big-targets select { min-height: 44px !important; }
html.a11y-big-cursor * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24'%3E%3Cpath fill='%23006828' d='M4 0l16 12-7 1-4 8z'/%3E%3C/svg%3E") 0 0, auto !important; }
html.a11y-visible-errors [aria-invalid="true"], html.a11y-visible-errors .field-error, html.a11y-visible-errors .wpcf7-not-valid-tip { outline: 2px solid #c00 !important; font-weight: 700 !important; }
html.a11y-line-height * { line-height: 2 !important; }
html.a11y-letter-spacing * { letter-spacing: .06em !important; }
html.a11y-readable-font * { font-family: Arial,'Helvetica Neue',sans-serif !important; }
html.a11y-left-align * { text-align: left !important; }
html.a11y-max-width main, html.a11y-max-width .entry-content, html.a11y-max-width article { max-width: 72ch !important; margin-inline: auto !important; }

/* ---------- 2) Widget (tokens) ---------- */
.acsblta11y {
  --accent: var(--a11y-accent, #006828);
  --accent-soft: var(--a11y-accent-soft, rgba(0,104,40,.1));
  --navy: var(--a11y-navy, #0a1930);
  --bg-2: var(--a11y-bg-2, #ffffff);
  --surface: var(--a11y-surface, #ffffff);
  --surface-2: var(--a11y-surface-2, #f5f6f8);
  --line: var(--a11y-line, #e3e6ea);
  --line-strong: var(--a11y-line-strong, #c7ccd2);
  --text: var(--a11y-text, #1a1f26);
  --muted: var(--a11y-muted, #5a6470);
  --muted-2: var(--a11y-muted-2, #8a939e);
  --r-md: var(--a11y-radius-md, 12px);
  --r-xl: var(--a11y-radius-xl, 20px);
  box-sizing: border-box;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}
.acsblta11y *, .acsblta11y *::before, .acsblta11y *::after { box-sizing: border-box; }

/* Bouton flottant par défaut */
.acsblta11y-fab {
  position: fixed; z-index: 1099; bottom: 22px; right: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; padding: 0; border: none; border-radius: 99px;
  background: var(--accent); color: #fff;
  cursor: pointer; box-shadow: 0 8px 24px -6px rgba(10,25,48,.45);
  transition: transform .15s ease, box-shadow .15s ease;
}
.acsblta11y-fab:hover { transform: scale(1.05); }
.acsblta11y-fab svg { width: 32px; height: 32px; }
.acsblta11y-fab:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.acsblta11y-fab.is-left { left: 22px; right: auto; }

/* Overlay */
.acsblta11y-overlay {
  position: fixed; inset: 0; z-index: 1100; padding: 20px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,25,48,.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.acsblta11y-sr { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }

/* Panel */
.acsblta11y-panel {
  background: var(--bg-2); border-radius: var(--r-xl);
  box-shadow: 0 40px 100px -30px rgba(10,25,48,.55);
  width: min(680px, 100%); max-height: 90vh;
  display: flex; flex-direction: column; border: 1px solid var(--line);
  color: var(--text);
}

.acsblta11y-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.acsblta11y-head-l { display: flex; align-items: center; gap: 10px; }
.acsblta11y-badge-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.acsblta11y-title { font-size: 18px; font-weight: 800; letter-spacing: -.01em; margin: 0; color: var(--text); }
.acsblta11y-count { font-size: 12px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 2px 8px; margin-top: 3px; display: inline-block; }
.acsblta11y-head-r { display: flex; gap: 8px; }
.acsblta11y-reset { height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: flex; align-items: center; gap: 7px; padding: 0 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.acsblta11y-close { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; color: var(--muted); }

.acsblta11y-tabs { display: flex; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.acsblta11y-tab { flex: 1; border: none; background: none; cursor: pointer; padding: 12px 20px; font-size: 14.5px; font-weight: 700; color: var(--muted); border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.acsblta11y-tab[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }

.acsblta11y-body { overflow-y: auto; flex: 1; padding: 20px 24px; }
.acsblta11y-intro { font-size: 13.5px; color: var(--muted); margin: 0 0 18px; line-height: 1.6; }
.acsblta11y-kicker { font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--muted-2); margin-bottom: 10px; }
.acsblta11y-list { display: flex; flex-direction: column; gap: 10px; }
.acsblta11y-list + .acsblta11y-kicker { margin-top: 24px; }

/* Cards */
.acsblta11y-card { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.acsblta11y-card.is-active { border-color: var(--accent); background: var(--accent-soft); }
.acsblta11y-card-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.acsblta11y-card-ic { width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); color: var(--muted); display: grid; place-items: center; flex-shrink: 0; }
.acsblta11y-card.is-active .acsblta11y-card-ic { background: var(--accent); color: #fff; }
.acsblta11y-card-main { flex: 1; min-width: 0; }
.acsblta11y-card-label { font-weight: 700; font-size: 14.5px; color: var(--text); }
.acsblta11y-card-desc { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.acsblta11y-std-headline { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 99px; padding: 3px 10px; }
.acsblta11y-cta { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.acsblta11y-detail { border-top: 1px solid var(--line); padding: 14px 18px; background: var(--surface-2); }
.acsblta11y-improve { border-top: 1px dashed var(--line); padding: 10px 16px; background: rgba(0,104,40,.04); }
.acsblta11y-improve-btn { background: none; border: none; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent); padding: 0; display: flex; align-items: center; gap: 6px; }
.acsblta11y-ul { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.acsblta11y-ul li { display: flex; gap: 10px; font-size: 14px; color: var(--muted); align-items: flex-start; }
.acsblta11y-ul li svg { color: var(--accent); flex-shrink: 0; margin-top: 2px; }

/* Settings */
.acsblta11y-group { margin-bottom: 26px; }
.acsblta11y-group-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.acsblta11y-group-head span { font-size: 13px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted-2); }
.acsblta11y-group-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0 16px; }
.acsblta11y-srow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.acsblta11y-group-box .acsblta11y-srow:last-child { border-bottom: none; }
.acsblta11y-srow label { font-size: 14.5px; font-weight: 600; color: var(--text); cursor: pointer; }
.acsblta11y-select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; font-size: 13.5px; font-weight: 600; color: var(--text); background: var(--surface); cursor: pointer; outline: none; }

/* Toggle (switch) */
.acsblta11y-switch { width: 44px; height: 24px; border-radius: 12px; border: none; cursor: pointer; background: var(--line-strong); position: relative; flex-shrink: 0; transition: background .2s; padding: 0; }
.acsblta11y-switch[aria-checked="true"] { background: var(--accent); }
.acsblta11y-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.acsblta11y-switch[aria-checked="true"]::after { left: 23px; }

.acsblta11y-foot { border-top: 1px solid var(--line); padding: 14px 24px; flex-shrink: 0; background: var(--surface-2); border-radius: 0 0 var(--r-xl) var(--r-xl); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.acsblta11y-foot span { font-size: 13px; color: var(--muted-2); display: flex; align-items: center; gap: 8px; }
.acsblta11y-foot a { font-size: 13px; font-weight: 700; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }

/* Vue simple : taille du texte, réglages essentiels, accès aux réglages complets */
.acsblta11y-sizes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.acsblta11y-size { min-height: 52px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--text); font-family: inherit; font-weight: 800; cursor: pointer; }
.acsblta11y-size:hover { border-color: var(--accent); }
.acsblta11y-size[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.acsblta11y-slabel { display: flex; align-items: center; gap: 10px; }
.acsblta11y-slabel svg { color: var(--muted); }
.acsblta11y-more { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); color: var(--text); font-family: inherit; text-align: left; cursor: pointer; }
.acsblta11y-more:hover { border-color: var(--accent); }
.acsblta11y-more-ic { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.acsblta11y-more-main { flex: 1; min-width: 0; }
.acsblta11y-more-main strong { display: block; font-size: 14.5px; }
.acsblta11y-more-main span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.acsblta11y-more > svg { color: var(--muted); }
.acsblta11y-viewbar { padding: 10px 24px 0; flex-shrink: 0; }
.acsblta11y-back { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px 0 6px; border: 0; border-radius: 8px; background: none; color: var(--accent); font-family: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.acsblta11y-back:hover { background: var(--accent-soft); }
.acsblta11y-size:focus-visible, .acsblta11y-more:focus-visible, .acsblta11y-back:focus-visible, .acsblta11y-switch:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.acsblta11y-hidden { display: none !important; }

/* Libellés courts (affichés uniquement < 600px) */
.acsblta11y-lbl-short { display: none; }

/* Responsive : viewport étroit */
@media (max-width: 600px) {
  /* "Voir les détails" / "Voir les raccourcis" -> "Voir" */
  .acsblta11y-lbl-full { display: none; }
  .acsblta11y-lbl-short { display: inline; }
  /* Réinitialiser : on garde l'icône, on masque le libellé */
  .acsblta11y-reset-lbl { display: none; }
  .acsblta11y-reset { width: 36px; padding: 0; gap: 0; justify-content: center; }
}
