/* =========================================================
   ACCESSIBILITY CENTER PRO
   Version: 2.0
   No framework / No external dependency
   ========================================================= */

:root {
  --a11y-primary: #005fcc;
  --a11y-primary-dark: #00449c;
  --a11y-bg: #ffffff;
  --a11y-text: #111111;
  --a11y-border: #c8c8c8;
  --a11y-muted: #555;
  --a11y-focus: #ff7a00;
  --a11y-panel-radius: 18px;
}

/* =========================================================
   GLOBAL ACCESSIBILITY STATES
   ========================================================= */

html.a11y-font-90 {
  font-size: 90%;
}

html.a11y-font-100 {
  font-size: 100%;
}

html.a11y-font-110 {
  font-size: 110%;
}

html.a11y-font-125 {
  font-size: 125%;
}

html.a11y-font-140 {
  font-size: 140%;
}

html.a11y-font-160 {
  font-size: 160%;
}

/* ---------- FONT FAMILY ---------- */

html.a11y-font-system body {
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif !important;
}

html.a11y-font-serif body {
  font-family:
    Georgia,
    "Times New Roman",
    serif !important;
}

html.a11y-font-mono body {
  font-family:
    "Courier New",
    Courier,
    monospace !important;
}

html.a11y-font-readable body,
html.a11y-font-readable body * {
  font-family:
    Arial,
    Helvetica,
    sans-serif !important;
}

html.a11y-font-dyslexia body,
html.a11y-font-dyslexia body * {
  font-family:
    "OpenDyslexic",
    "Atkinson Hyperlegible",
    "Lexend",
    Arial,
    sans-serif !important;
}

/* ---------- LETTER SPACING ---------- */

html.a11y-letter-normal body {
  letter-spacing: normal !important;
}

html.a11y-letter-wide body {
  letter-spacing: 0.06em !important;
}

html.a11y-letter-wider body {
  letter-spacing: 0.12em !important;
}

/* ---------- LINE HEIGHT ---------- */

html.a11y-line-normal body {
  line-height: 1.5 !important;
}

html.a11y-line-wide body {
  line-height: 1.8 !important;
}

html.a11y-line-wider body {
  line-height: 2 !important;
}

/* ---------- FONT WEIGHT ---------- */

html.a11y-weight-normal body {
  font-weight: 400 !important;
}

html.a11y-weight-bold body {
  font-weight: 600 !important;
}

html.a11y-weight-heavy body {
  font-weight: 700 !important;
}

/* ---------- TEXT SPACING ---------- */

html.a11y-text-spacing body {
  letter-spacing: 0.12em !important;
  word-spacing: 0.16em !important;
}

html.a11y-text-spacing p,
html.a11y-text-spacing li {
  line-height: 1.8 !important;
}

/* =========================================================
   CONTRAST
   ========================================================= */

html.a11y-dark {
  --a11y-bg: #121212;
  --a11y-text: #f5f5f5;
}

html.a11y-dark body {
  background: #121212 !important;
  color: #f5f5f5 !important;
}

html.a11y-dark a {
  color: #69b7ff !important;
}

html.a11y-light body {
  background: #ffffff !important;
  color: #000000 !important;
}

html.a11y-light a {
  color: #0000cc !important;
}

html.a11y-high-contrast body {
  background: #000 !important;
  color: #fff !important;
}

html.a11y-high-contrast body * {
  border-color: #fff !important;
  box-shadow: none !important;
}

html.a11y-high-contrast a {
  color: #ffff00 !important;
  text-decoration: underline !important;
}

html.a11y-high-contrast button {
  background: #000 !important;
  color: #fff !important;
  border: 2px solid #fff !important;
}

/* =========================================================
   SATURATION / MONOCHROME
   ========================================================= */

html.a11y-high-saturation body {
  filter: saturate(1.8);
}

html.a11y-low-saturation body {
  filter: saturate(0.5);
}

html.a11y-monochrome body {
  filter: grayscale(1);
}

/* =========================================================
   COLOR VISION MODES
   ========================================================= */

/*
   These are visual simulation/help modes.
   They should not be considered a medical color-blindness
   correction.
*/

html.a11y-color-deuteranopia body {
  filter:
    saturate(0.8)
    hue-rotate(20deg);
}

html.a11y-color-protanopia body {
  filter:
    saturate(0.75)
    hue-rotate(-20deg);
}

html.a11y-color-tritanopia body {
  filter:
    saturate(0.8)
    hue-rotate(45deg);
}

/* =========================================================
   HIGHLIGHTING
   ========================================================= */

html.a11y-highlight-headings h1,
html.a11y-highlight-headings h2,
html.a11y-highlight-headings h3,
html.a11y-highlight-headings h4,
html.a11y-highlight-headings h5,
html.a11y-highlight-headings h6 {
  background: #fff09a !important;
  color: #111 !important;
  outline: 2px solid #9c7b00 !important;
  border-radius: 5px;
  padding: 0.12em 0.3em;
}

html.a11y-highlight-links a {
  background: #fff09a !important;
  color: #111 !important;
  outline: 2px solid #9c7b00 !important;
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
}

html.a11y-underline-links a {
  text-decoration: underline !important;
  text-decoration-thickness: 2px !important;
}

/* =========================================================
   FOCUS
   ========================================================= */

html.a11y-focus :focus-visible {
  outline:
    4px solid
    var(--a11y-focus) !important;

  outline-offset: 4px !important;

  box-shadow:
    0 0 0 7px rgba(255, 122, 0, 0.22) !important;
}

/* =========================================================
   BIG CURSOR
   ========================================================= */

html.a11y-cursor-large,
html.a11y-cursor-large body,
html.a11y-cursor-large body * {
  cursor: default !important;
}

html.a11y-cursor-large a,
html.a11y-cursor-large button,
html.a11y-cursor-large input,
html.a11y-cursor-large select,
html.a11y-cursor-large textarea,
html.a11y-cursor-large [role="button"] {
  cursor: pointer !important;
}

/* =========================================================
   IMAGES
   ========================================================= */

html.a11y-hide-images img,
html.a11y-hide-images picture,
html.a11y-hide-images video,
html.a11y-hide-images svg {
  visibility: hidden !important;
}

/* =========================================================
   MOTION
   ========================================================= */

html.a11y-stop-motion *,
html.a11y-stop-motion *::before,
html.a11y-stop-motion *::after,
html.a11y-reduced-motion *,
html.a11y-reduced-motion *::before,
html.a11y-reduced-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

/* =========================================================
   READING GUIDE
   ========================================================= */

.a11y-reading-guide {
  position: fixed;
  left: 0;
  right: 0;
  top: 50vh;

  height: 4px;

  background: #ff0000;

  z-index: 2147483000;

  pointer-events: none;

  box-shadow:
    0 0 0 2px #fff,
    0 0 12px rgba(255, 0, 0, 0.7);

  transform: translateY(-50%);
}

.a11y-reading-guide::before,
.a11y-reading-guide::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 22px;
  background: rgba(255, 0, 0, 0.06);
}

.a11y-reading-guide::before {
  bottom: 100%;
}

.a11y-reading-guide::after {
  top: 100%;
}

/* =========================================================
   SKIP LINK
   ========================================================= */

.a11y-skip-link {
  position: fixed;
  top: -100px;
  left: 12px;

  z-index: 2147483647;

  background: #000;
  color: #fff;

  padding: 12px 18px;

  border-radius: 8px;

  text-decoration: none;

  font-weight: 700;
}

.a11y-skip-link:focus {
  top: 12px;
}

/* =========================================================
   ACCESSIBILITY FLOATING BUTTON
   ========================================================= */

.a11y-launcher {
  position: fixed;

  right: 20px;
  bottom: 20px;

  width: 58px;
  height: 58px;

  z-index: 2147483000;

  border: 3px solid #fff;
  border-radius: 50%;

  background:
    var(--a11y-primary);

  color: #fff;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 27px;
  line-height: 1;

  cursor: pointer;

  box-shadow:
    0 6px 24px rgba(0, 0, 0, 0.28);

  transition:
    transform 0.15s ease,
    background 0.15s ease;
}

.a11y-launcher:hover {
  transform: scale(1.06);
  background: var(--a11y-primary-dark);
}

.a11y-launcher:focus-visible {
  outline: 4px solid #ff7a00;
  outline-offset: 4px;
}

/* =========================================================
   OVERLAY
   ========================================================= */

.a11y-overlay {
  position: fixed;

  inset: 0;

  z-index: 2147483001;

  background:
    rgba(0, 0, 0, 0.52);

  opacity: 0;
  visibility: hidden;

  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.a11y-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* =========================================================
   PANEL
   ========================================================= */

.a11y-panel {
  position: fixed;

  top: 0;
  right: 0;

  width: min(430px, 100vw);
  height: 100vh;

  z-index: 2147483002;

  background: #fff;
  color: #111;

  display: flex;
  flex-direction: column;

  transform: translateX(105%);

  transition:
    transform 0.25s ease;

  box-shadow:
    -10px 0 40px rgba(0, 0, 0, 0.22);

  border-left: 1px solid #ddd;
}

.a11y-panel.is-open {
  transform: translateX(0);
}

.a11y-panel-header {
  flex: 0 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 12px;

  padding: 18px;

  border-bottom: 1px solid #ddd;

  background: #fff;
}

.a11y-panel-title {
  margin: 0;

  font-size: 1.25rem;
  line-height: 1.3;

  font-weight: 750;
}

.a11y-panel-subtitle {
  margin: 4px 0 0;

  color: #555;

  font-size: 0.85rem;
}

.a11y-panel-close {
  width: 42px;
  height: 42px;

  border: 2px solid #555;
  border-radius: 9px;

  background: #fff;
  color: #111;

  font-size: 24px;

  cursor: pointer;
}

.a11y-panel-body {
  flex: 1 1 auto;

  overflow-y: auto;

  padding: 14px 16px 24px;
}

/* =========================================================
   SECTIONS
   ========================================================= */

.a11y-section {
  margin-bottom: 14px;

  border: 1px solid #ddd;
  border-radius: 13px;

  overflow: hidden;

  background: #fff;
}

.a11y-section-title {
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 10px;

  padding: 14px;

  border: 0;

  background: #f7f7f7;
  color: #111;

  font: inherit;
  font-weight: 750;

  cursor: pointer;

  text-align: left;
}

.a11y-section-title:hover {
  background: #ededed;
}

.a11y-section-content {
  padding: 12px;
}

.a11y-section-content[hidden] {
  display: none;
}

/* =========================================================
   CONTROLS
   ========================================================= */

.a11y-grid {
  display: grid;

  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 8px;
}

.a11y-control {
  min-height: 52px;

  padding: 9px;

  border: 2px solid #bdbdbd;
  border-radius: 10px;

  background: #fff;
  color: #111;

  cursor: pointer;

  font: inherit;
  font-size: 0.9rem;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  text-align: center;

  gap: 4px;

  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.a11y-control:hover {
  background: #f2f6fb;
  border-color: #005fcc;
}

.a11y-control[aria-pressed="true"],
.a11y-control.is-selected {
  background: #005fcc;
  color: #fff;
  border-color: #005fcc;
}

.a11y-control-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.a11y-control-label {
  line-height: 1.2;
}

/* =========================================================
   SELECT
   ========================================================= */

.a11y-select {
  width: 100%;

  min-height: 48px;

  padding: 8px 10px;

  border: 2px solid #aaa;
  border-radius: 9px;

  background: #fff;
  color: #111;

  font: inherit;
}

/* =========================================================
   RANGE
   ========================================================= */

.a11y-range-row {
  display: grid;

  grid-template-columns:
    1fr auto;

  gap: 10px;

  align-items: center;

  margin-bottom: 10px;
}

.a11y-range-label {
  font-weight: 650;
}

.a11y-range-value {
  min-width: 55px;
  text-align: right;
  font-weight: 700;
}

.a11y-range {
  width: 100%;
}

/* =========================================================
   FOOTER
   ========================================================= */

.a11y-panel-footer {
  flex: 0 0 auto;

  display: grid;

  grid-template-columns:
    1fr 1fr;

  gap: 8px;

  padding: 12px 16px;

  border-top: 1px solid #ddd;

  background: #fff;
}

.a11y-reset {
  min-height: 46px;

  border: 2px solid #b00020;
  border-radius: 9px;

  background: #fff;
  color: #b00020;

  font: inherit;
  font-weight: 700;

  cursor: pointer;
}

.a11y-reset:hover {
  background: #b00020;
  color: #fff;
}

/* =========================================================
   LANGUAGE BUTTON
   ========================================================= */

.a11y-language {
  min-height: 46px;

  border: 2px solid #555;
  border-radius: 9px;

  background: #fff;
  color: #111;

  font: inherit;
  font-weight: 700;

  cursor: pointer;
}

/* =========================================================
   STATUS
   ========================================================= */

.a11y-status {
  position: fixed !important;

  width: 1px !important;
  height: 1px !important;

  padding: 0 !important;
  margin: -1px !important;

  overflow: hidden !important;

  clip: rect(0, 0, 0, 0) !important;

  white-space: nowrap !important;

  border: 0 !important;
}

/* =========================================================
   TOOLTIP
   ========================================================= */

.a11y-tooltip {
  position: fixed;

  z-index: 2147483646;

  max-width: 250px;

  padding: 7px 10px;

  border-radius: 7px;

  background: #111;
  color: #fff;

  font-size: 12px;
  line-height: 1.3;

  pointer-events: none;

  opacity: 0;

  transition: opacity 0.1s ease;
}

.a11y-tooltip.visible {
  opacity: 1;
}

/* =========================================================
   SHORTCUTS
   ========================================================= */

.a11y-shortcut {
  display: inline-flex;

  padding: 2px 6px;

  border: 1px solid #aaa;
  border-bottom-width: 2px;

  border-radius: 5px;

  background: #f5f5f5;

  font-size: 0.78rem;
}

/* =========================================================
   PRINT
   ========================================================= */

@media print {
  .a11y-launcher,
  .a11y-overlay,
  .a11y-panel,
  .a11y-reading-guide,
  .a11y-skip-link,
  .a11y-status {
    display: none !important;
  }

  html,
  body {
    background: #fff !important;
    color: #000 !important;

    filter: none !important;

    font-size: 100% !important;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    box-shadow: none !important;
  }

  a {
    color: #000 !important;
    text-decoration: underline !important;
  }
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {
  .a11y-launcher {
    right: 14px;
    bottom: 14px;

    width: 54px;
    height: 54px;
  }

  .a11y-overlay {
    background: rgba(0, 0, 0, 0.35);
  }

  .a11y-panel {
    top: auto;
    bottom: 0;
    right: 0;

    width: 100%;
    height: min(92vh, 760px);

    border-left: 0;
    border-top: 1px solid #ddd;

    border-radius:
      20px 20px 0 0;

    transform: translateY(105%);
  }

  .a11y-panel.is-open {
    transform: translateY(0);
  }

  .a11y-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* =========================================================
   VERY SMALL SCREENS
   ========================================================= */

@media (max-width: 360px) {
  .a11y-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================
   SYSTEM REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
