/* ═══════════════════════════════════════════════════════════════
   accessibility.css — Tolleration high-contrast / WCAG AA mode
   Activated by: <html data-access="high">
   ═══════════════════════════════════════════════════════════════ */

/* ── REDUCED MOTION — always active, no toggle needed ──────── */
@media (prefers-reduced-motion: reduce) {
  .draw, .draw-dot, .draw-text, .arc-dots, .fade-g {
    animation: none !important;
    opacity: 1 !important;
    stroke-dashoffset: 0 !important;
  }
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── HIGH CONTRAST MODE ────────────────────────────────────── */
[data-access="high"] {
  --cream:      #ffffff;
  --cream-dark: #f0f0f0;
  --ox:         #6b0000;
  --ox-faint:   rgba(107,0,0,0.3);
  --ox-ghost:   rgba(107,0,0,0.08);
  --ink:        #000000;
  --ink-mid:    #111111;
  --ink-soft:   #222222;
  --gold:       #5a3e00;
}

/* White background, black text throughout */
[data-access="high"] body {
  background: #ffffff;
  color: #000000;
  font-family: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.9;
}
[data-access="high"] body::before { display: none; } /* remove texture */

/* Topbar */
[data-access="high"] .topbar {
  background: #ffffff;
  border-bottom: 2px solid #000000;
  height: 46px !important;
  padding: 0 32px !important;
}
[data-access="high"] .topbar-name {
  color: #000000;
  font-family: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing:0.22em;
}
[data-access="high"] .topbar-login {
  color: #333333;
  opacity: 1;
  border-color: #333333;
  font-family: system-ui, sans-serif;
  font-size: 12px;
}
[data-access="high"] .topbar-submit {
  background: #6b0000;
  color: #ffffff;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  border: 2px solid #6b0000;
  letter-spacing: 0.05em;
}
[data-access="high"] .topbar-submit:hover {
  background: #ffffff;
  color: #6b0000;
}

/* Sitenav */
[data-access="high"] .sitenav {
  background: #ffffff;
  border-top: 2px solid #000000;
  border-bottom: 2px solid #000000;
  height: 44px !important;
}
[data-access="high"] .sitenav a {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #000000;
  letter-spacing: 0.08em;
  border-right: 1px solid #cccccc;
  border-top: none;
  border-left: none;
  border-bottom: none;
  padding:11px 12px;
  line-height:1;
}
[data-access="high"] .sitenav a:hover {
  color: #6b0000;
  background: #fff0f0;
}
[data-access="high"] .sitenav a.active {
  color: #6b0000;
  background: #fff0f0;
  border-bottom: 3px solid #6b0000;
}

/* About dropdown */
[data-access="high"] .nav-dropdown {
  background: #ffffff;
  border: 2px solid #000000;
  border-top: 3px solid #6b0000;
}
[data-access="high"] .nav-dropdown a {
  color: #000000;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  border-bottom-color: #dddddd;
}
[data-access="high"] .nav-dropdown a:hover {
  background: #fff0f0;
  color: #6b0000;
}

/* Headings */
[data-access="high"] h1,
[data-access="high"] h2.section-title,
[data-access="high"] .page-title {
  font-family: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-weight: 700;
  color: #000000;
  font-size: clamp(20px, 3vw, 30px);
}

/* Body text */
[data-access="high"] p,
[data-access="high"] .pathology-body,
[data-access="high"] .topic-note,
[data-access="high"] .page-sub,
[data-access="high"] .advisory-note,
[data-access="high"] .form-note,
[data-access="high"] .param-val {
  font-family: system-ui, sans-serif;
  font-size: 16px;
  color: #000000;
  opacity: 1;
  line-height: 1.85;
}

/* Section labels */
[data-access="high"] .role-label,
[data-access="high"] .pathology-num,
[data-access="high"] .aporia-label,
[data-access="high"] .section-rule,
[data-access="high"] .soon-glyph,
[data-access="high"] .footer-dots {
  font-family: system-ui, sans-serif;
  color: #5a3e00;
  opacity: 1;
  font-weight: 700;
}

/* Cards */
[data-access="high"] .pathology-card,
[data-access="high"] .topic-card {
  background: #ffffff;
  border: 1px solid #aaaaaa;
}
[data-access="high"] .pathology-title,
[data-access="high"] .topic-label {
  font-family: system-ui, sans-serif;
  font-weight: 700;
  color: #000000;
  font-size: 16px;
}
[data-access="high"] .pathology-response {
  color: #6b0000;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  border-top-color: #aaaaaa;
}
[data-access="high"] .pathology-grid,
[data-access="high"] .topics-grid {
  background: #aaaaaa;
  border-color: #aaaaaa;
}

/* Param table */
[data-access="high"] .param-list { border-color: #aaaaaa; }
[data-access="high"] .param-row { border-color: #cccccc; }
[data-access="high"] .param-key {
  font-family: system-ui, sans-serif;
  font-weight: 700;
  color: #000000;
  border-right-color: #cccccc;
  font-size: 15px;
}

/* Form */
[data-access="high"] .form-field label {
  font-family: system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #000000;
  opacity: 1;
  letter-spacing: 0.05em;
}
[data-access="high"] .form-field input,
[data-access="high"] .form-field textarea,
[data-access="high"] .form-field select {
  font-family: system-ui, sans-serif;
  font-size: 16px;
  color: #000000;
  background: #ffffff;
  border: 2px solid #000000;
}
[data-access="high"] .form-field input::placeholder,
[data-access="high"] .form-field textarea::placeholder {
  color: #555555;
}
[data-access="high"] .form-field input:focus,
[data-access="high"] .form-field textarea:focus,
[data-access="high"] .form-field select:focus {
  border-color: #6b0000;
  outline: 3px solid #6b0000;
  outline-offset: 2px;
}
[data-access="high"] .role-chip {
  font-family: system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  border: 2px solid #555555;
}
[data-access="high"] .role-chip.selected {
  background: #6b0000;
  color: #ffffff;
  border-color: #6b0000;
}
[data-access="high"] .btn-submit {
  font-family: system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: #6b0000;
  color: #ffffff;
  border: 2px solid #6b0000;
}
[data-access="high"] .btn-submit:hover {
  background: #ffffff;
  color: #6b0000;
}

/* Buttons */
[data-access="high"] .btn-primary {
  font-family: system-ui, sans-serif;
  font-weight: 700;
  font-size: 13px;
  background: #6b0000;
  border: 2px solid #6b0000;
  letter-spacing: 0.05em;
}
[data-access="high"] .btn-secondary {
  font-family: system-ui, sans-serif;
  font-weight: 600;
  color: #000000;
  border: 2px solid #000000;
}
[data-access="high"] .btn-replay {
  font-family: system-ui, sans-serif;
  color: #000000;
  border: 2px solid #555555;
}

/* Footer */
[data-access="high"] footer {
  background: #f0f0f0;
  border-top: 2px solid #000000;
}
[data-access="high"] .footer-name {
  font-family: system-ui, sans-serif;
  font-weight: 700;
  color: #000000;
  font-size: 16px;
}
[data-access="high"] .footer-sub {
  font-family: system-ui, sans-serif;
  color: #222222;
  font-size: 14px;
}
[data-access="high"] .footer-meta {
  font-family: system-ui, sans-serif;
  font-size: 14px;
  color: #000000;
}
[data-access="high"] .footer-meta a { color: #6b0000; border-bottom-color: #6b0000; }
[data-access="high"] .footer-sister {
  background: #1a1a1a;
}
[data-access="high"] .footer-sister .sister-label {
  font-family: system-ui, sans-serif;
  font-weight: 700;
  color: #ffffff;
  opacity: 1;
  font-size: 12px;
}
[data-access="high"] .footer-sister .sister-links {
  font-family: system-ui, sans-serif;
  font-size: 14px;
}
[data-access="high"] .footer-sister .sister-links a {
  color: #ffcc88;
  border-bottom-color: rgba(255,204,136,0.4);
}

/* ── ENHANCED FOCUS RINGS ───────────────────────────────── */
[data-access="high"] a:focus-visible,
[data-access="high"] button:focus-visible,
[data-access="high"] input:focus-visible,
[data-access="high"] textarea:focus-visible,
[data-access="high"] select:focus-visible {
  outline: 3px solid #6b0000;
  outline-offset: 3px;
}

/* ── DARK + HIGH CONTRAST ───────────────────────────────── */
[data-theme="dark"][data-access="high"] body {
  background: #000000;
  color: #ffffff;
  font-family: system-ui, sans-serif;
}
[data-theme="dark"][data-access="high"] .topbar,
[data-theme="dark"][data-access="high"] .sitenav {
  background: #000000;
  border-color: #ffffff;
}
[data-theme="dark"][data-access="high"] .topbar-name,
[data-theme="dark"][data-access="high"] .sitenav a {
  color: #ffffff;
}
[data-theme="dark"][data-access="high"] h1,
[data-theme="dark"][data-access="high"] h2,
[data-theme="dark"][data-access="high"] p { color: #ffffff; }
[data-theme="dark"][data-access="high"] .pathology-card,
[data-theme="dark"][data-access="high"] .topic-card { background: #111111; border-color: #555555; }
[data-theme="dark"][data-access="high"] footer { background: #111111; border-color: #ffffff; }
[data-theme="dark"][data-access="high"] .footer-name,
[data-theme="dark"][data-access="high"] .footer-meta { color: #ffffff; }

/* About button and subbar in high contrast */
[data-access="high"] .about-btn {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #000000 !important;
  letter-spacing: 0.12em;
  padding: 11px 20px;
  line-height: 1;
  height: 100%;
  background: #ffffff !important;
  border: none !important;
  border-right: 1px solid #cccccc !important;
}
[data-access="high"] .about-btn:hover { color:#6b0000; background:#fff0f0; }
[data-access="high"] .about-subbar {
  background: #6b0000;
  border-bottom: 2px solid #000000;
}
[data-access="high"] .about-subbar a {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.12em;
  padding: 11px 20px;
  border-right: 1px solid rgba(255,255,255,0.3);
}
[data-access="high"] .about-subbar a:hover { background:rgba(0,0,0,0.2); }
/* Dark + access: subbar */
[data-theme="dark"][data-access="high"] .about-subbar { background:#e8b800; border-bottom:2px solid #000; }
[data-theme="dark"][data-access="high"] .about-subbar a { color:#000000; border-right-color:rgba(0,0,0,0.2); }

/* nav-subbar (PHP pages) high contrast */
[data-access="high"] .nav-subbar {
  background: #6b0000 !important;
  border-bottom: 2px solid #000000;
}
[data-access="high"] .nav-subbar a {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #ffffff !important;
  letter-spacing: 0.12em;
  padding: 11px 20px;
  border-right: 1px solid rgba(255,255,255,0.3);
}
[data-access="high"] .nav-subbar a:hover { background: rgba(0,0,0,0.2); }
[data-theme="dark"][data-access="high"] .nav-subbar { background: #e8b800 !important; border-bottom-color: #000; }
[data-theme="dark"][data-access="high"] .nav-subbar a { color: #000000 !important; border-right-color: rgba(0,0,0,0.2); }

/* Dark + high contrast — about-btn */
[data-theme="dark"][data-access="high"] .about-btn {
  color: #ffffff !important;
  background: #000000 !important;
  border-right-color: #555555 !important;
}
[data-theme="dark"][data-access="high"] .about-btn:hover {
  background: #1a1a1a !important;
  color: #ffffff !important;
}

/* nav-about trigger (PHP pages) high contrast alignment */
[data-access="high"] .nav-about > a {
  font-family: system-ui, sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #000000 !important;
  letter-spacing: 0.12em;
  padding: 11px 20px;
  line-height: 1;
  background: #ffffff !important;
}
[data-access="high"] .nav-about > a:hover { color:#6b0000 !important; background:#fff0f0 !important; }
[data-theme="dark"][data-access="high"] .nav-about > a {
  color: #ffffff !important;
  background: #000000 !important;
}
[data-theme="dark"][data-access="high"] .nav-about > a:hover {
  background: #1a1a1a !important;
}
