/* Accessibility menu (replaces the old Sogo toolbar). Everything is scoped under .b9a11y or
   the html.b9a11y-* classes the script sets, so it can't disturb the theme. */

.b9a11y {
  --b9a11y-blue: #0780c3;
  --b9a11y-ink: #222328;
  --b9a11y-muted: #6b6f76;
  --b9a11y-line: #e6e8eb;
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 2147483000;
  font-family: Montserrat, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: var(--b9a11y-ink);
}
.b9a11y *, .b9a11y *::before, .b9a11y *::after { box-sizing: border-box; }

.b9a11y-toggle {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--b9a11y-blue);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.b9a11y-toggle:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, .22); }
.b9a11y-toggle svg { width: 26px; height: 26px; }

.b9a11y-panel {
  position: absolute;
  left: 0;
  bottom: 60px;
  width: 280px;
  max-width: calc(100vw - 32px);
  padding: 16px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .08);
}
.b9a11y-panel[hidden] { display: none; }
.b9a11y-panel:focus { outline: none; }

.b9a11y-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.b9a11y-title { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .02em; color: var(--b9a11y-ink); }
.b9a11y-close {
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--b9a11y-muted); cursor: pointer;
}
.b9a11y-close:hover { background: #f2f4f6; color: var(--b9a11y-ink); }
.b9a11y-close svg { width: 18px; height: 18px; }

.b9a11y-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--b9a11y-line);
  background: transparent; color: var(--b9a11y-ink); font: inherit; text-align: left; cursor: pointer;
}
.b9a11y-row:first-of-type { border-top: 0; }
.b9a11y-switch {
  position: relative; flex: none; width: 36px; height: 20px; border-radius: 10px; background: #cfd4da;
  transition: background .15s ease;
}
.b9a11y-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s ease;
}
.b9a11y-row[aria-checked="true"] .b9a11y-switch { background: var(--b9a11y-blue); }
.b9a11y-row[aria-checked="true"] .b9a11y-switch::after { transform: translateX(16px); }

.b9a11y-size { padding: 10px 0 4px; border-top: 1px solid var(--b9a11y-line); }
.b9a11y-size-label { display: block; margin-bottom: 8px; }
.b9a11y-size-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.b9a11y-size-group button {
  height: 36px; padding: 0; border: 1px solid var(--b9a11y-line); border-radius: 8px;
  background: #fff; color: var(--b9a11y-ink); font-family: inherit; font-weight: 600; cursor: pointer;
}
.b9a11y-size-group button:nth-child(1) { font-size: 13px; }
.b9a11y-size-group button:nth-child(2) { font-size: 16px; }
.b9a11y-size-group button:nth-child(3) { font-size: 19px; }
.b9a11y-size-group button[aria-pressed="true"] { border-color: var(--b9a11y-blue); background: var(--b9a11y-blue); color: #fff; }

.b9a11y-reset {
  margin-top: 12px; padding: 0; border: 0; background: none; color: var(--b9a11y-blue);
  font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer;
}

.b9a11y button:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .b9a11y-toggle, .b9a11y-switch, .b9a11y-switch::after { transition: none; }
}

/* ---- effects on the page (never on the menu itself) ---- */

html.b9a11y-dark body,
html.b9a11y-dark body *:not(.b9a11y):not(.b9a11y *):not(img):not(video):not(iframe):not(svg):not(svg *):not(.navbar-toggler-icon) {
  background-color: #000 !important;
  background-image: none !important;
  color: #fff !important;
  border-color: #fff !important;
  text-shadow: none !important;
}
html.b9a11y-dark body a:not(.b9a11y *), html.b9a11y-dark body a:not(.b9a11y *) * { color: #ffe14d !important; }
/* Bootstrap draws the menu icon as a background image: keep it, made light on the dark page */
html.b9a11y-dark .navbar-toggler-icon { filter: invert(1) brightness(2); }

html.b9a11y-light body,
html.b9a11y-light body *:not(.b9a11y):not(.b9a11y *):not(img):not(video):not(iframe):not(svg):not(svg *):not(.navbar-toggler-icon) {
  background-color: #fff !important;
  background-image: none !important;
  color: #000 !important;
  border-color: #000 !important;
  text-shadow: none !important;
}
html.b9a11y-light body a:not(.b9a11y *), html.b9a11y-light body a:not(.b9a11y *) * { color: #0645ad !important; }

html.b9a11y-readable body *:not(.b9a11y *):not(i):not([class*="fa-"]):not([class*="icon"]) {
  font-family: Verdana, Arial, sans-serif !important;
  letter-spacing: .01em !important;
}

html.b9a11y-underline body a:not(.b9a11y *) { text-decoration: underline !important; }

html.b9a11y-size-2 body { zoom: 1.15; }
html.b9a11y-size-3 body { zoom: 1.3; }
/* keep the menu itself at its normal size and pinned to the viewport */
html.b9a11y-size-2 .b9a11y { zoom: calc(1 / 1.15); }
html.b9a11y-size-3 .b9a11y { zoom: calc(1 / 1.3); }
