/* 10-06 (Gerb): accessibility controls, pair of js/a11y.js. Page modes are classes on <html>;
   the widget (#a11y-w) lives outside <body> so the modes never touch it. */

/* ---------- page modes ---------- */
html.a11y-zoom body { zoom: var(--a11y-zoom); }

html.a11y-contrast body, html.a11y-contrast body *, html.a11y-contrast body *::before, html.a11y-contrast body *::after {
  background-color: #000 !important; background-image: none !important; color: #fff !important;
  -webkit-text-fill-color: currentColor !important; border-color: #fff !important;
  text-shadow: none !important; box-shadow: none !important;
}
html.a11y-contrast body a, html.a11y-contrast body a * { color: #ffe44d !important; }
html.a11y-contrast body :is(button, input, select, textarea) { border: 2px solid #fff !important; }
html.a11y-contrast #gf-steel { display: none !important; }

html.a11y-font body, html.a11y-font body *:not(svg, svg *) {
  font-family: Verdana, Tahoma, 'Segoe UI', Arial, sans-serif !important; font-stretch: normal !important;
  letter-spacing: .06em !important; word-spacing: .16em !important;
}

html.a11y-spacing body :is(p, li, dd, dt, td, th, blockquote, label, figcaption, small) { line-height: 1.85 !important; }
html.a11y-spacing body p { margin-bottom: 1.2em !important; }

html.a11y-links body a {
  background: #ffe44d !important; color: #000 !important; -webkit-text-fill-color: #000 !important;
  text-decoration: underline 2px !important; text-underline-offset: .2em; outline: 2px solid #000; outline-offset: 1px;
}
html.a11y-links body a * { color: #000 !important; -webkit-text-fill-color: #000 !important; }

html.a11y-still, html.a11y-still body * { scroll-behavior: auto !important; }
html.a11y-still body *, html.a11y-still body *::before, html.a11y-still body *::after {
  animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
  transition-duration: .001ms !important; transition-delay: 0s !important;
}

html.a11y-cursor, html.a11y-cursor * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M4 2l15 11-7 1 4 8-3 1-4-8-5 5z' fill='%23000' stroke='%23fff' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") 8 4, auto !important;
}
html.a11y-cursor :is(a, button, [role=button], label, select, summary), html.a11y-cursor :is(a, button, [role=button], label, select, summary) * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M9 1.5a1.6 1.6 0 0 1 3.2 0V9l5.6.9c1.4.3 2.4 1.5 2.2 3l-.9 6.1c-.2 1.3-1.3 2.3-2.6 2.3h-6.6c-.9 0-1.7-.4-2.2-1.1L3.6 15a1.6 1.6 0 0 1 2.5-2L9 15.4z' fill='%23000' stroke='%23fff' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") 20 4, pointer !important;
}

/* ---------- the widget ---------- */
#a11y-w { --a11y-ink: #111113; --a11y-gold: #D4AF55; --a11y-bone: #EEEAE1;
  position: fixed; left: 16px; bottom: var(--a11y-b, 16px); z-index: 2147483000;
  font: 400 15px/1.35 var(--f-text, system-ui, -apple-system, 'Segoe UI', sans-serif); color: var(--a11y-bone); }
#a11y-w * { box-sizing: border-box; margin: 0; font: inherit; color: inherit; letter-spacing: normal; }
#a11y-w button { cursor: pointer; }
#a11y-w :focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px #000; }

#a11y-btn { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border-radius: 50%;
  border: 2px solid var(--a11y-ink); background: var(--a11y-gold); color: var(--a11y-ink);
  box-shadow: 0 0 0 2px rgba(238, 234, 225, .9), 0 8px 22px -8px rgba(0, 0, 0, .7); }
#a11y-btn[aria-expanded="true"] { background: var(--a11y-bone); }

#a11y-panel { position: absolute; left: 0; bottom: 60px; width: min(340px, calc(100vw - 32px));
  max-height: calc(100vh - var(--a11y-b, 16px) - 80px); overflow: auto; padding: 16px;
  background: var(--a11y-ink); border: 1px solid rgba(212, 175, 85, .45); border-radius: 12px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .85); }
#a11y-panel[hidden] { display: none; }
.a11y-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px !important; }
#a11y-h { font-weight: 700; font-size: 17px; color: var(--a11y-gold); letter-spacing: .02em; }
.a11y-x { width: 44px; height: 44px; margin: -8px -8px -8px 0 !important; border: 0; border-radius: 8px; background: transparent; font-size: 26px !important; line-height: 1 !important; }
.a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y-grid button { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 10px; text-align: left;
  border: 1px solid rgba(238, 234, 225, .28); border-radius: 8px; background: #1b1b1e; font-weight: 600 !important; }
.a11y-grid button:hover { border-color: var(--a11y-gold); }
.a11y-grid button[aria-pressed="true"] { background: var(--a11y-gold); color: var(--a11y-ink); border-color: var(--a11y-gold); }
.a11y-v { margin-left: auto !important; font-weight: 400 !important; color: var(--a11y-gold) !important; }
.a11y-sw { flex: none; width: 16px; height: 16px; border: 2px solid currentColor; border-radius: 4px; }
[aria-pressed="true"] > .a11y-sw { background: currentColor; box-shadow: inset 0 0 0 2px var(--a11y-gold); }
.a11y-reset { width: 100%; min-height: 44px; margin-top: 10px !important; border: 1px solid rgba(238, 234, 225, .28);
  border-radius: 8px; background: transparent; text-decoration: underline; }
.a11y-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: no-preference) {
  #a11y-btn { transition: transform .15s ease, background-color .15s ease; }
  #a11y-btn:hover { transform: scale(1.06); }
}
@media print { #a11y-w { display: none; } }
