/* Accessibility tools UI + applied document modes */

.a11y-tools__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-sizing: border-box;
  height: var(--site-tool-height, 2.35rem);
  min-height: var(--site-tool-height, 2.35rem);
  padding: 0 var(--site-tool-pad-x, 0.8rem);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  color: #1f2937;
  font-size: var(--site-tool-font, 0.84rem);
  font-weight: 600;
  line-height: 1;
}

.a11y-tools__toggle::after {
  margin-left: 0.15rem;
}

.a11y-tools__toggle:hover,
.a11y-tools__toggle:focus-visible {
  color: #074D2C;
}

.site-top-tools--guest .a11y-tools__toggle:hover,
.site-top-tools--guest .a11y-tools__toggle:focus-visible {
  color: #C8981E;
}

.a11y-tools__toggle i {
  font-size: var(--site-tool-icon, 1.05rem);
  line-height: 1;
}

.a11y-tools__menu {
  min-width: 220px;
  padding: 0.4rem;
  border-radius: 12px;
  border: 1px solid #edf0f5;
  z-index: 1100;
}

.a11y-tools__header {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.a11y-tools__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 8px;
  font-size: 0.85rem;
  padding: 0.45rem 0.65rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: #111827;
}

.a11y-tools__item i {
  width: 1rem;
  text-align: center;
  color: #6b7280;
}

.a11y-tools__item.is-active,
.a11y-tools__item[aria-pressed="true"] {
  background: rgba(7, 77, 44, 0.1);
  color: #074D2C;
  font-weight: 600;
}

.a11y-tools__item.is-active i,
.a11y-tools__item[aria-pressed="true"] i {
  color: #074D2C;
}

.a11y-tools__item--reset {
  color: #b45309;
}

.header-a11y .a11y-tools__toggle {
  box-shadow: none;
  background: transparent;
  border-color: transparent;
  padding: 0.35rem 0.55rem;
}

.header-a11y .a11y-tools__label {
  display: none;
}

@media (max-width: 575.98px) {
  .a11y-tools__label {
    display: none;
  }

  .site-top-tools {
    right: 0.4rem;
    top: 0.45rem;
    gap: 0.3rem;
  }
}

/* ==== Applied modes (on <html>) ==== */
html.a11y-font-scaled {
  font-size: calc(16px * var(--a11y-font-scale, 1));
}

html.a11y-grayscale body {
  filter: grayscale(1);
}

html.a11y-high-contrast body {
  background: #000 !important;
  color: #fff !important;
}

html.a11y-high-contrast a {
  color: #ffff00 !important;
}

html.a11y-high-contrast .btn,
html.a11y-high-contrast .card,
html.a11y-high-contrast .form-control,
html.a11y-high-contrast .auth-lang-bar,
html.a11y-high-contrast .a11y-tools__toggle {
  border-color: #fff !important;
}

html.a11y-negative body {
  filter: invert(1) hue-rotate(180deg);
}

html.a11y-negative img,
html.a11y-negative video,
html.a11y-negative svg {
  filter: invert(1) hue-rotate(180deg);
}

html.a11y-light-bg body {
  background: #fff !important;
  color: #111 !important;
}

html.a11y-light-bg .sectionA,
html.a11y-light-bg .auth-left,
html.a11y-light-bg .guest-footer,
html.a11y-light-bg .auth-mobile-hero {
  background: #f3f4f6 !important;
  color: #111 !important;
}

html.a11y-light-bg .text-white,
html.a11y-light-bg .sectionA-title,
html.a11y-light-bg .sectionA-subtitle,
html.a11y-light-bg .sectionA-subtitleB {
  color: #111 !important;
}

html.a11y-underline-links a {
  text-decoration: underline !important;
  text-underline-offset: 0.15em;
}

html.a11y-readable-font,
html.a11y-readable-font body,
html.a11y-readable-font button,
html.a11y-readable-font input,
html.a11y-readable-font select,
html.a11y-readable-font textarea {
  font-family: Arial, Helvetica, "Noto Sans", sans-serif !important;
  letter-spacing: 0.02em;
  word-spacing: 0.04em;
  line-height: 1.6;
}
