/* TACT Accessibility Widget */

/* Trigger button */
/* Trigger button - positioning is inline on the HTML element */
.a11y-trigger,
#a11y-trigger-btn {
  transition: transform 0.2s, background 0.2s;
}
#a11y-trigger-btn:hover { transform: scale(1.1); background: #d56a15 !important; }
.a11y-trigger svg { width: 28px; height: 28px; fill: currentColor; }

/* Panel */
.a11y-panel {
  position: fixed !important;
  bottom: 5.5rem !important;
  right: 1.5rem !important;
  z-index: 99999 !important;
  width: 320px;
  max-height: 80vh;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  border: 1px solid #d0d4e0;
  overflow: hidden;
  display: none;
  flex-direction: column;
}
.a11y-panel.open { display: flex; }

.a11y-panel-header {
  background: #ee7a23;
  color: #fff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.a11y-panel-header h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: #fff;
}
.a11y-panel-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}
.a11y-panel-close:hover { background: rgba(255,255,255,0.2); }

.a11y-panel-body {
  overflow-y: auto;
  padding: 1rem 1.25rem;
  flex: 1;
}

/* Option groups */
.a11y-group {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e8e8e8;
}
.a11y-group:last-child { border-bottom: none; margin-bottom: 0; }

.a11y-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  margin-bottom: 0.6rem;
}

/* Slider controls */
.a11y-slider-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.a11y-slider-label {
  font-size: 0.85rem;
  font-weight: 500;
  flex: 1;
  color: #1a1a2e;
}
.a11y-slider-btns {
  display: flex;
  gap: 0.25rem;
}
.a11y-slider-btns button {
  width: 32px;
  height: 32px;
  border: 1px solid #d0d4e0;
  background: #f5f6fa;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  color: #1B3A56;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.a11y-slider-btns button:hover { background: #e8eef8; }
.a11y-slider-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: #1B3A56;
  min-width: 2.5rem;
  text-align: center;
}

/* Toggle buttons */
.a11y-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.35rem;
  border: 1px solid #d0d4e0;
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
  transition: all 0.15s;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1a1a2e;
  width: 100%;
  text-align: left;
}
.a11y-toggle:hover { background: #f5f6fa; border-color: #1B3A56; }
.a11y-toggle.active {
  background: #fef3e8;
  border-color: #ee7a23;
  color: #ee7a23;
}
.a11y-toggle .a11y-toggle-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}
.a11y-toggle .a11y-toggle-label { flex: 1; margin-left: 0.5rem; }
.a11y-toggle .a11y-toggle-check {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 2px solid #d0d4e0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #fff;
  transition: all 0.15s;
}
.a11y-toggle.active .a11y-toggle-check {
  background: #ee7a23;
  border-color: #1B3A56;
}

/* Reset button */
.a11y-reset {
  width: 100%;
  padding: 0.65rem;
  background: #c62828;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 0.5rem;
}
.a11y-reset:hover { background: #b71c1c; }

/* Applied accessibility styles */
body.a11y-dyslexia-font,
body.a11y-dyslexia-font * {
  font-family: 'OpenDyslexic', 'Comic Sans MS', cursive, sans-serif !important;
}

body.a11y-high-contrast {
  filter: contrast(1.4) !important;
}
body.a11y-high-contrast * {
  border-color: #000 !important;
}

body.a11y-grayscale { filter: grayscale(1) !important; }
body.a11y-low-saturation { filter: saturate(0.3) !important; }
body.a11y-monochrome { filter: grayscale(1) contrast(1.2) !important; }

body.a11y-highlight-links a {
  background: #ffff00 !important;
  color: #000 !important;
  padding: 0.1em 0.2em !important;
  text-decoration: underline !important;
  outline: 2px solid #000 !important;
}

body.a11y-highlight-headings h1,
body.a11y-highlight-headings h2,
body.a11y-highlight-headings h3,
body.a11y-highlight-headings h4,
body.a11y-highlight-headings h5,
body.a11y-highlight-headings h6 {
  background: #1B3A56 !important;
  color: #fff !important;
  padding: 0.2em 0.4em !important;
}

body.a11y-pause-animations *,
body.a11y-pause-animations *::before,
body.a11y-pause-animations *::after {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
}

body.a11y-keyboard-nav *:focus {
  outline: 3px solid #ff8f00 !important;
  outline-offset: 3px !important;
}

/* Responsive */
@media (max-width: 480px) {
  .a11y-panel {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    bottom: 5rem;
    max-height: 75vh;
  }
  .a11y-trigger {
    bottom: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
  }
  .a11y-trigger svg { width: 24px; height: 24px; }
}
