/* NCRC accessibility widget + global a11y modes */

.ncrc-a11y {
  position: fixed;
  z-index: 10050;
  inset-inline-start: 1rem;
  bottom: 1rem;
}

.ncrc-a11y__launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  background: #1b8354;
  color: #fff;
  border: 0;
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(27, 131, 84, 0.35);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.ncrc-a11y__launcher:hover,
.ncrc-a11y__launcher:focus-visible {
  background: #156b44;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.ncrc-a11y__panel {
  position: absolute;
  inset-inline-start: 0;
  bottom: calc(100% + 0.75rem);
  width: min(22rem, calc(100vw - 2rem));
  background: #fff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15);
  padding: 1rem;
}

.ncrc-a11y__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.ncrc-a11y__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.ncrc-a11y__close {
  background: transparent;
  border: 0;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem;
}

.ncrc-a11y__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.ncrc-a11y__tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.65rem 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  font-size: 0.78rem;
  cursor: pointer;
  text-align: center;
}

.ncrc-a11y__tool:hover,
.ncrc-a11y__tool:focus-visible {
  border-color: #1b8354;
  outline: none;
}

.ncrc-a11y__tool.is-active {
  background: #e8f5ee;
  border-color: #1b8354;
  color: #1b8354;
}

.ncrc-a11y__note {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  color: #6b7280;
}

/* Global accessibility modes */
html.invert-colors {
  filter: invert(1) hue-rotate(180deg);
}

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

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

body.ncrc-a11y-contrast a {
  color: #ffeb3b !important;
}

html.ncrc-a11y-links a {
  text-decoration: underline !important;
  text-underline-offset: 3px;
  background: rgba(255, 235, 59, 0.2);
}

html.ncrc-a11y-readable,
html.ncrc-a11y-readable body {
  font-family: Tahoma, Arial, sans-serif !important;
  letter-spacing: 0.02em;
  line-height: 1.7 !important;
}

html.ncrc-a11y-reduce-motion *,
html.ncrc-a11y-reduce-motion *::before,
html.ncrc-a11y-reduce-motion *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

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