/* ═══════════════════════════════════════════════════════
   Accessibility Widget — Frontend Styles
   ═══════════════════════════════════════════════════════ */

/* ── Trigger button ── */
.qk-a11y-trigger {
  position: fixed;
  z-index: 99999;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
  transition: transform .2s ease, box-shadow .2s ease;
  color: #fff;
}
.qk-a11y-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.qk-a11y-trigger:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.qk-a11y-trigger svg { pointer-events: none; }

/* Positions */
.qk-a11y-trigger--br { bottom: 20px; right: 20px; }
.qk-a11y-trigger--bl { bottom: 20px; left: 20px; }

/* Sizes */
.qk-a11y-trigger--sm  { width: 40px; height: 40px; }
.qk-a11y-trigger--sm svg { width: 20px; height: 20px; }
.qk-a11y-trigger--md  { width: 52px; height: 52px; }
.qk-a11y-trigger--md svg { width: 26px; height: 26px; }
.qk-a11y-trigger--lg  { width: 64px; height: 64px; }
.qk-a11y-trigger--lg svg { width: 32px; height: 32px; }

/* ── Panel ── */
.qk-a11y-panel {
  position: fixed;
  z-index: 100000;
  width: 340px;
  max-height: calc(100vh - 40px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.96);
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.qk-a11y-panel--open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.qk-a11y-panel--br { bottom: 90px; right: 20px; }
.qk-a11y-panel--bl { bottom: 90px; left: 20px; }

/* Panel header */
.qk-a11y-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.qk-a11y-panel__close {
  background: rgba(255,255,255,.2);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s;
}
.qk-a11y-panel__close:hover { background: rgba(255,255,255,.35); }
.qk-a11y-panel__close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Panel body */
.qk-a11y-panel__body {
  overflow-y: auto;
  padding: 12px 16px 16px;
  flex: 1;
}

/* Tool grid */
.qk-a11y-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

/* Tool button */
.qk-a11y-tool {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  cursor: pointer;
  transition: all .15s ease;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  text-align: center;
  line-height: 1.3;
  -webkit-user-select: none;
  user-select: none;
}
.qk-a11y-tool:hover { border-color: #cbd5e1; background: #f1f5f9; }
.qk-a11y-tool:focus-visible { outline: 2px solid var(--qk-a11y-primary, #1e3a5f); outline-offset: 2px; }
.qk-a11y-tool svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.qk-a11y-tool--active {
  border-color: var(--qk-a11y-primary, #1e3a5f);
  background: color-mix(in srgb, var(--qk-a11y-primary, #1e3a5f) 8%, #fff);
  color: var(--qk-a11y-primary, #1e3a5f);
}

/* Cycle tool level badge — shown top-right when active */
.qk-a11y-tool__badge {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 7px;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--qk-a11y-primary, #1e3a5f);
  opacity: 0;
  transition: opacity .15s;
}
.qk-a11y-tool--active .qk-a11y-tool__badge { opacity: 1; }


.qk-a11y-panel__footer {
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qk-a11y-reset {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: opacity .15s;
}
.qk-a11y-reset:hover { opacity: .9; }
.qk-a11y-reset:focus-visible { outline: 2px solid var(--qk-a11y-primary, #1e3a5f); outline-offset: 2px; }

/* ── Body modifier classes applied by the widget ── */
/* contrast + saturation are managed as a combined inline filter on <html> by JS — no separate CSS rules needed */

/* bigger-text levels: must target <html> so Tailwind's rem-based sizes scale up */
html.qk-a11y--bigger-text-1 { font-size: 118% !important; }
html.qk-a11y--bigger-text-2 { font-size: 135% !important; }

body.qk-a11y--highlight-links a { outline: 2px solid #0000cc !important; outline-offset: 2px; text-decoration: underline !important; }
body.qk-a11y--text-spacing * { letter-spacing: .12em !important; word-spacing: .16em !important; }
body.qk-a11y--pause-animations *, body.qk-a11y--pause-animations *::before, body.qk-a11y--pause-animations *::after { animation-duration: 0s !important; animation-delay: 0s !important; transition-duration: 0s !important; transition-delay: 0s !important; }
body.qk-a11y--hide-images img:not(.qk-a11y-keep) { visibility: hidden !important; }
body.qk-a11y--dyslexia-friendly,
body.qk-a11y--dyslexia-friendly * {
  font-family: 'Lexend', 'Atkinson Hyperlegible', 'Segoe UI', 'Verdana', 'Arial', sans-serif !important;
}
body.qk-a11y--big-cursor, body.qk-a11y--big-cursor * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M5 2 L5 32 L13 24 L22 24 Z' fill='black' stroke='white' stroke-width='2'/%3E%3C/svg%3E") 5 2, auto !important; }
body.qk-a11y--tooltips [title] { position: relative; }
body.qk-a11y--tooltips [title]:hover::after { content: attr(title); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: #1e293b; color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 13px; white-space: nowrap; z-index: 100001; pointer-events: none; }
body.qk-a11y--line-height * { line-height: 2 !important; }
body.qk-a11y--text-align * { text-align: left !important; }

/* Responsive */
@media (max-width: 400px) {
  .qk-a11y-panel { width: calc(100vw - 24px); left: 12px !important; right: 12px !important; }
}

/* ── Minimise button (mobile only — sibling to the trigger, overlaid at its corner) ── */
.qk-a11y-minimise-btn {
  position: fixed;
  z-index: 100001;
  display: none;
  width: 18px;
  height: 18px;
  background: rgba(0,0,0,.5);
  border: 1.5px solid rgba(255,255,255,.4);
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  padding: 0;
  transition: background .15s, transform .15s;
}
.qk-a11y-minimise-btn:hover { background: rgba(0,0,0,.7); transform: scale(1.1); }
.qk-a11y-minimise-btn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
@media (max-width: 768px) {
  .qk-a11y-minimise-btn { display: flex; }
}

/* ── Minimised trigger state — tiny unobtrusive dot in the corner ── */
.qk-a11y-trigger--minimised {
  width: 20px !important;
  height: 20px !important;
  opacity: 0.45;
  box-shadow: 0 1px 4px rgba(0,0,0,.25) !important;
  transition: width .25s ease, height .25s ease, opacity .25s ease, transform .2s ease, box-shadow .2s ease !important;
}
.qk-a11y-trigger--minimised:hover {
  opacity: 0.75;
  transform: scale(1.2) !important;
}
.qk-a11y-trigger--minimised svg { display: none; }
