/* Rutito accessibility modes — mirrors Texsito passenger-web */

/*
 * Site CSS is mostly px-based, so html { font-size:% } alone does nothing.
 * Use zoom so text/UI actually scales (Chromium, Safari, modern Firefox).
 */
html.font-scale-110 { font-size: 110%; }
html.font-scale-120 { font-size: 120%; }
html.font-scale-130 { font-size: 130%; }
html.font-scale-110 body { zoom: 1.1; }
html.font-scale-120 body { zoom: 1.2; }
html.font-scale-130 body { zoom: 1.3; }

html.high-contrast body {
  filter: contrast(1.4) brightness(0.95);
}
html.high-contrast a {
  text-decoration: underline !important;
  font-weight: 700 !important;
}
html.high-contrast button,
html.high-contrast [role="button"] {
  outline: 2px solid currentColor;
}

html.grayscale-mode body {
  filter: grayscale(100%);
}

html.highlight-links a {
  text-decoration: underline !important;
  font-weight: 700 !important;
  background-color: rgba(255, 255, 0, 0.2) !important;
  color: #000000 !important;
}

html.readable-font,
html.readable-font * {
  font-family: Arial, Helvetica, sans-serif !important;
}

html.stop-animations,
html.stop-animations * {
  animation: none !important;
  transition: none !important;
}

:focus-visible {
  outline: 3px solid #e8891a !important;
  outline-offset: 2px !important;
}
html.high-contrast :focus-visible {
  outline: 3px solid #ffff00 !important;
  outline-offset: 3px !important;
}

#a11y-btn {
  position: fixed;
  bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  inset-inline-start: 1rem;
  z-index: 60;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 9999px;
  background: #0a1f44;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(7, 22, 47, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.15s;
}
#a11y-btn:hover {
  background: #14305f;
  transform: scale(1.05);
}
#a11y-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#a11y-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#a11y-overlay[hidden] {
  display: none !important;
}

#a11y-modal {
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow: auto;
  background: #fff;
  color: #142033;
  border-radius: 18px;
  border: 1px solid #e4e9f0;
  box-shadow: 0 24px 60px rgba(7, 22, 47, 0.28);
  padding: 20px;
}
#a11y-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e4e9f0;
  margin-bottom: 16px;
}
#a11y-modal-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #0a1f44;
}
#a11y-close {
  border: 0;
  background: #f3f5f8;
  color: #5c6b7e;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
#a11y-close:hover {
  background: #e4e9f0;
  color: #0a1f44;
}

.a11y-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #5c6b7e;
  margin-bottom: 8px;
}
.a11y-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.a11y-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.a11y-btn-opt {
  border: 1px solid #e4e9f0;
  background: #f7f9fc;
  color: #142033;
  border-radius: 12px;
  min-height: 44px;
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: start;
}
.a11y-btn-opt:hover {
  background: #eef2f7;
}
.a11y-btn-opt.is-active {
  border-color: #0a1f44;
  background: #0a1f44;
  color: #fff;
}
.a11y-btn-opt:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.a11y-btn-opt.span-2 {
  grid-column: 1 / -1;
}
.a11y-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.a11y-actions button,
.a11y-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid #e4e9f0;
}
.a11y-reset {
  background: #f3f5f8;
  color: #142033;
}
.a11y-statement {
  background: #e8891a;
  border-color: #e8891a;
  color: #fff !important;
}

@media (max-width: 720px) {
  #a11y-btn {
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
    inset-inline-start: 0.75rem;
  }
}
