/* =====================================================
   ACCESSIBILITY PATCH — WCAG 2.1 AA
   TechBanta Quiz — Quiz Options & Feedback States
   ===================================================== */

/* ── 1. Focus ring for keyboard navigation on options ── */
.opt:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-color: var(--blue);
  background: var(--blue-bg);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

/* ── 2. HIGH-CONTRAST feedback: icons + border patterns
        (color alone is not sufficient — WCAG 1.4.1)     ── */

/* Correct answer: green + ✓ icon + thicker border */
.opt.correct {
  border-color: var(--green);
  border-width: 2.5px;
  border-style: solid;
}
.opt.correct::before {
  content: '✓';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: 800;
  color: var(--green);
  line-height: 1;
}
.opt.correct .opt-text {
  padding-right: 28px; /* space for ✓ icon */
}

/* Wrong answer: red + ✗ icon + dashed border */
.opt.wrong {
  border-color: var(--red);
  border-width: 2.5px;
  border-style: dashed;
}
.opt.wrong::before {
  content: '✗';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
}
.opt.wrong .opt-text {
  padding-right: 28px;
}

/* Review panel options: same pattern */
.rv-opt.correct {
  border-left: 4px solid #059669;
}
.rv-opt.chosen {
  border-left: 4px solid #4338ca;
  border-style: dashed;
}

/* ── 3. Skip button: non-color indicator for skipped dots ── */
.dot.skip {
  border: 2px dashed var(--orange);
  background: transparent;
}
.dot.current {
  border: 2px solid var(--blue);
  box-shadow: 0 0 0 2px rgba(59,130,246,0.3);
}

/* ── 4. Screen-reader-only utility class ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── 5. Result status cells: icons, not just color ── */
.rs-val.c-correct::before { content: '✓ '; font-size: 0.8em; }
.rs-val.c-wrong::before   { content: '✗ '; font-size: 0.8em; }

/* ── 6. Live region for announcements ── */
#a11y-live {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* ── 7. Reduce motion: respect prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  .opt,
  .opt-key,
  .opt.correct,
  .opt.wrong,
  .pq-ring-fill,
  .progress-fill,
  .next-rec-item,
  .review-card {
    animation: none !important;
    transition: none !important;
  }
}

/* ── 8. High-contrast mode support ── */
@media (forced-colors: active) {
  .opt.correct { border: 3px solid ButtonText; }
  .opt.wrong   { border: 3px dashed ButtonText; }
  .opt:focus-visible { outline: 3px solid Highlight; }
}
