/**
 * High-Contrast Mode – WCAG AA/AAA Compliance
 *
 * INTENTIONAL: All colour values in this file are hardcoded by design.
 * They guarantee minimum contrast ratios required by WCAG 2.1 Level AA
 * (4.5:1 for normal text) and Level AAA (7:1) regardless of the active
 * theme or namespace tokens.  Do NOT replace these with CSS custom
 * properties—doing so would couple accessibility overrides to the
 * design-token cascade and risk breaking contrast guarantees.
 *
 * @see https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum
 */
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) {
  background-color: #ffffff !important;
  color: #000000 !important;
  font-size: 1.125em;
}
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) a {
  color: #0000ee;
  text-decoration: underline;
}
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .qr-card {
  background-color: #ffffff;
  color: #000000;
  border-color: #000000;
}
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .modern-info-card {
  border-color: #000000;
}
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .onboarding-step {
  border-color: #000000;
  box-shadow: none;
}
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .onboarding-timeline .timeline-step {
  border-color: #000000;
  color: #000000;
}
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .onboarding-timeline .timeline-step.active,
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .onboarding-timeline .timeline-step.completed {
  border-color: #000000;
  color: #000000;
}
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .onboarding-timeline .timeline-step.inactive {
  border-color: #666666;
  color: #666666;
  cursor: not-allowed;
}
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .uk-button-primary {
  background-color: #000000;
  border-color: #000000;
  color: #ffffff;
}
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .uk-button,
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .uk-button-default {
  background-color: #ffffff;
  color: #000000;
  border-color: #000000;
}
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) input,
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) textarea,
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) select {
  background-color: #ffffff;
  color: #000000;
  border-color: #000000;
}
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .sortable-list li,
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .terms li,
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .dropzone,
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .mc-option {
  background: #ffffff;
  border: 2px solid #000000;
  color: #000000;
}
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .dropzone.over {
  background: #ffffcc;
  border-color: #000000;
}

:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .question-timer {
  background-color: #ffff00;
  color: #000000;
  border: 2px solid #000000;
}

:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .question-timer--expired {
  background-color: #ff6666;
  color: #000000;
  border-color: #000000;
}

:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .question--timeout {
  opacity: 1;
  outline: 3px solid #000000;
}

:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .question-feedback--timeout {
  color: #000000;
  font-weight: 700;
}

:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .qr-handle {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: none;
  cursor: grab;
}

:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .qr-handle:focus {
  outline: 2px solid #000000;
}
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .uk-alert-success {
  background-color: #006400;
  color: #ffffff;
}
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .uk-alert-danger {
  background-color: var(--danger-500);
  color: #ffffff;
}
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .uk-alert-primary {
  background-color: #00008b;
  color: #ffffff;
}

/* High contrast styles when dark mode is also enabled */
:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) {
  background-color: #000000 !important;
  color: #ffffff !important;
}

:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) a {
  color: #ffff00;
  text-decoration: underline;
}

:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .qr-card {
  background-color: #000000;
  color: #ffffff;
  border-color: #ffffff;
}
:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .modern-info-card {
  border-color: #ffffff;
}
:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .onboarding-step {
  border-color: #ffffff;
  box-shadow: none;
}
:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .onboarding-timeline .timeline-step {
  border-color: #ffffff;
  color: #ffffff;
}
:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .onboarding-timeline .timeline-step.active,
:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .onboarding-timeline .timeline-step.completed {
  border-color: #ffffff;
  color: #ffffff;
}
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .uk-icon-button,
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .git-btn {
  border: 2px solid #000000;
  background-color: #ffffff;
}

:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .git-btn {
  color: #000000;
}

:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .uk-icon-button,
:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .git-btn {
  border: 2px solid #ffffff;
  background-color: #000000;
}

:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .git-btn {
  color: #ffffff;
}
:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .onboarding-timeline .timeline-step.inactive {
  border-color: #999999;
  color: #999999;
  cursor: not-allowed;
}

:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .uk-button-primary {
  background-color: #ffff00;
  border-color: #ffff00;
  color: #000000;
}

:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .uk-button,
:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .uk-button-default {
  background-color: #000000;
  color: #ffffff;
  border-color: #ffffff;
}

:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) input,
:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) textarea,
:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) select {
  background-color: #000000;
  color: #ffffff;
  border-color: #ffffff;
}

:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .sortable-list li,
:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .terms li,
:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .dropzone,
:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .mc-option {
  background: #000000;
  border: 2px solid #ffffff;
  color: #ffffff;
}

:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .dropzone.over {
  background: #333333;
  border-color: #ffffff;
}

:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .question-timer {
  background-color: #ffff00;
  color: #000000;
  border: 2px solid #000000;
}

:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .question-timer--expired {
  background-color: #ff6666;
  color: #000000;
  border-color: #000000;
}

:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .question-feedback--timeout {
  color: #ffff00;
}

:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .uk-alert-success {
  background-color: #008000;
  color: #ffffff;
}

:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .uk-alert-danger {
  background-color: var(--danger-500);
  color: #ffffff;
}

:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .uk-alert-primary {
  background-color: #00008b;
  color: #ffffff;
}

:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .uk-form-danger,
:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .uk-form-danger {
  border-color: var(--danger-600) !important;
}

:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .flip-card-front,
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .flip-card-back {
  background-color: #ffffff;
  color: #000000;
  border: 2px solid #000000;
}

:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .flip-card-front,
:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .flip-card-back {
  background-color: #000000;
  color: #ffffff;
  border: 2px solid #ffffff;
}

/* TipTap page editor */
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .page-editor {
  background: #ffffff;
  border: 2px solid #000000;
  color: #000000;
}

:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .page-editor .tiptap-editor {
  background: transparent;
  color: #000000;
}

:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .page-editor .tiptap-editor:focus {
  outline: 3px solid #000000;
  outline-offset: 2px;
}

:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .page-editor-toolbar .uk-button,
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .preview-link {
  background: #ffffff;
  border: 2px solid #000000;
  color: #000000;
}

:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .page-editor-toolbar .uk-button,
:where(html[data-theme="dark"] body.high-contrast, body[data-theme="dark"].high-contrast, body.dark-mode.high-contrast) .preview-link {
  background: #000000;
  color: #ffffff;
  border-color: #ffffff;
}

:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .page-editor-toolbar .uk-button:focus-visible,
:where(html[data-theme="high-contrast"], body[data-theme="high-contrast"], body.high-contrast) .preview-link:focus-visible {
  outline: 3px solid #000000;
  outline-offset: 3px;
}
