/* InnerShift accessibility widget + global a11y aids (v20261001) */

/* ---------- skip link ---------- */
.a11y-skip {
  position: fixed; left: 12px; top: -100px; z-index: 2147483600;
  background: #D4AF37; color: #000 !important; font: 600 15px/1.2 'DM Sans', system-ui, sans-serif;
  padding: 10px 16px; border-radius: 8px; text-decoration: none; box-shadow: 0 6px 20px rgba(0,0,0,.4);
}
.a11y-skip:focus { top: 8px; outline: 3px solid #fff; outline-offset: 2px; }

/* ---------- visible keyboard focus everywhere ---------- */
:focus-visible { outline: 3px solid #D4AF37 !important; outline-offset: 2px !important; }
html.theme-light :focus-visible { outline-color: #1a4fd6 !important; }
#a11y-main:focus { outline: none; }

/* ---------- launcher ---------- */
.a11y-launch {
  position: fixed; left: 18px; bottom: 18px; z-index: 99996;
  width: 52px; height: 52px; border-radius: 50%; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: #1a4fd6; color: #fff; border: 2px solid #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,.45); transition: transform .15s ease;
}
.a11y-launch:hover { transform: scale(1.06); }
.a11y-launch svg { width: 30px; height: 30px; }

/* ---------- panel ---------- */
.a11y-panel {
  position: fixed; left: 18px; bottom: 80px; z-index: 99996;
  width: 340px; max-width: calc(100vw - 24px); max-height: calc(100vh - var(--stb-h, 44px) - 100px); overflow-y: auto;
  background: #111118; color: #fff; border: 1px solid rgba(212,175,55,.45); border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0,0,0,.6); padding: 14px 14px 16px;
  font: 14px/1.4 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: normal; word-spacing: normal; text-align: left;
}
.a11y-panel[hidden] { display: none !important; }
.a11y-panel *, .a11y-panel *::before, .a11y-panel *::after { box-sizing: border-box; }
.a11y-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.a11y-title { margin: 0; font: 700 17px/1.2 'DM Sans', system-ui, sans-serif; color: #fff; }
.a11y-x { background: transparent; border: 1px solid rgba(255,255,255,.25); color: #fff; width: 32px; height: 32px; border-radius: 8px; font-size: 20px; line-height: 1; cursor: pointer; }
.a11y-sec { border-top: 1px solid rgba(255,255,255,.1); padding-top: 10px; margin-top: 10px; }
.a11y-sec h3 { margin: 0 0 8px; font: 600 12px/1.2 'DM Sans', system-ui, sans-serif; text-transform: uppercase; letter-spacing: .08em; color: #D4AF37; }
.a11y-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.a11y-btn {
  flex: 1 1 auto; min-height: 36px; padding: 6px 10px; border-radius: 8px; cursor: pointer;
  background: #1c1c27; color: #fff; border: 1px solid rgba(255,255,255,.2); font: 600 13px/1.2 inherit; font-family: inherit;
}
.a11y-btn:hover { border-color: #D4AF37; }
.a11y-btn[disabled] { opacity: .45; cursor: not-allowed; }
.a11y-size-val { min-width: 52px; text-align: center; font-weight: 700; color: #fff; }
.a11y-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.a11y-tog { text-align: left; display: flex; align-items: center; gap: 8px; }
.a11y-tog::before { content: ''; flex: 0 0 auto; width: 26px; height: 15px; border-radius: 8px; background: #3a3a48; box-shadow: inset 0 0 0 2px #3a3a48; transition: background .15s; }
.a11y-tog[aria-pressed="true"] { border-color: #D4AF37; background: rgba(212,175,55,.15); }
.a11y-tog[aria-pressed="true"]::before { background: #D4AF37; box-shadow: inset -11px 0 0 2px #D4AF37, inset 0 0 0 2px #fff; }
.a11y-select { min-height: 36px; border-radius: 8px; background: #1c1c27; color: #fff; border: 1px solid rgba(255,255,255,.2); padding: 0 8px; font: inherit; }
.a11y-label { font-size: 13px; color: #cfcbe0; }
.a11y-note { font-size: 12px; color: #a9a5b8; margin: 6px 0 0; }
.a11y-reset { width: 100%; margin-top: 12px; background: #3a1414; border-color: rgba(255,120,120,.5); }
.a11y-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

html.theme-light .a11y-panel { background: #fff; color: #111; border-color: rgba(0,0,0,.2); box-shadow: 0 18px 48px rgba(0,0,0,.2); }
html.theme-light .a11y-title, html.theme-light .a11y-x, html.theme-light .a11y-size-val { color: #111 !important; }
html.theme-light .a11y-x { border-color: rgba(0,0,0,.25); }
html.theme-light .a11y-sec { border-top-color: rgba(0,0,0,.1); }
html.theme-light .a11y-sec h3 { color: #7a5f0c; }
html.theme-light .a11y-btn, html.theme-light .a11y-select { background: #f3f3f5 !important; color: #111 !important; border-color: rgba(0,0,0,.2) !important; }
html.theme-light .a11y-reset { background: #fde8e8 !important; }
html.theme-light .a11y-label, html.theme-light .a11y-note { color: #444 !important; }

/* currently-read block */
.a11y-reading { outline: 3px dashed #D4AF37 !important; outline-offset: 3px; background-color: rgba(212,175,55,.12) !important; }

@media (max-width: 600px) {
  .a11y-launch { left: 10px; bottom: 10px; width: 46px; height: 46px; }
  .a11y-panel { left: 6px; right: 6px; width: auto; bottom: 64px; }
}

/* ---------- FEATURE CLASSES (on <html>) ---------- */

/* High contrast */
:root.a11y-contrast.a11y-contrast, :root.a11y-contrast.a11y-contrast body { background: #000 !important; color: #fff !important; }
:root.a11y-contrast.a11y-contrast body *:not(img):not(video):not(svg):not(svg *):not(canvas):not(iframe):not(.a11y-skip) {
  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;
}
:root.a11y-contrast.a11y-contrast body a, :root.a11y-contrast.a11y-contrast body a * { color: #ffff00 !important; text-decoration: underline !important; }
:root.a11y-contrast.a11y-contrast body button, :root.a11y-contrast.a11y-contrast body input, :root.a11y-contrast.a11y-contrast body select, :root.a11y-contrast.a11y-contrast body textarea { border: 2px solid #fff !important; }
:root.a11y-contrast.a11y-contrast .a11y-tog[aria-pressed="true"] { background-color: #333 !important; border-color: #ffff00 !important; }
:root.a11y-contrast.a11y-contrast .a11y-launch { background-color: #000 !important; border: 3px solid #ffff00 !important; color: #ffff00 !important; }

/* Readable / dyslexia-friendly font */
:root.a11y-font body, :root.a11y-font body *:not(i):not([class*="icon"]):not([class*="fa-"]):not(.material-icons):not(svg):not(svg *) {
  font-family: 'Atkinson Hyperlegible', 'Lexend', Verdana, Tahoma, 'Trebuchet MS', Arial, sans-serif !important;
  font-style: normal;
}

/* Highlight links */
:root.a11y-links body a:not(.a11y-skip) { text-decoration: underline !important; text-underline-offset: 3px; outline: 2px solid #ffd400 !important; outline-offset: 1px; background-color: rgba(255,212,0,.18) !important; }

/* Highlight headings / readable layout */
:root.a11y-headings body :is(h1,h2,h3,h4,h5,h6):not(.a11y-panel *) { outline: 2px solid #4da3ff !important; outline-offset: 4px; background-color: rgba(77,163,255,.12) !important; border-radius: 4px; }
:root.a11y-headings body :is(p, li):not(.a11y-panel *):not(.stb-bar *) { max-width: 75ch; }

/* Text spacing (WCAG 1.4.12 values) */
:root.a11y-spacing body *:not(.a11y-panel):not(.a11y-panel *):not(.stb-bar):not(.stb-bar *) { letter-spacing: .12em !important; word-spacing: .16em !important; }
:root.a11y-spacing body :is(p, li, dd, dt, blockquote, td, th, label, span, a, div):not(.a11y-panel *):not(.stb-bar *) { line-height: 1.8 !important; }
:root.a11y-spacing body p:not(.a11y-panel *) { margin-bottom: 2em !important; }

/* Large cursor */
:root.a11y-cursor, :root.a11y-cursor body, :root.a11y-cursor body * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M6 3 L6 40 L15 31 L21 45 L28 42 L22 28 L35 28 Z' fill='%23000' stroke='%23fff' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, auto !important;
}
:root.a11y-cursor body :is(a, button, [role="button"], label, select, summary, [onclick]), :root.a11y-cursor body :is(a, button) * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M6 3 L6 40 L15 31 L21 45 L28 42 L22 28 L35 28 Z' fill='%23D4AF37' stroke='%23000' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") 6 3, pointer !important;
}

/* Reduced motion */
:root.a11y-motion *, :root.a11y-motion *::before, :root.a11y-motion *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
  transition-duration: .001ms !important; transition-delay: 0s !important; scroll-behavior: auto !important;
}
:root.a11y-motion { scroll-behavior: auto !important; }
