/* ---------------------------------------------------------------
   Accessibility widget — vanilla CSS, no dependencies.
   Toolbar: bottom-right floating toggle + panel.
--------------------------------------------------------------- */

#a11y-widget {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 999999;
  font-family: "Inter", -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.4;
}

#a11y-widget * {
  box-sizing: border-box;
}

.a11y-toggle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: #191813;
  color: #f2efe7;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.a11y-toggle svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.a11y-toggle:hover {
  background: #e04a17;
}

.a11y-toggle:focus-visible,
.a11y-panel button:focus-visible,
.a11y-panel-close:focus-visible {
  outline: 3px solid #e04a17;
  outline-offset: 2px;
}

.a11y-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  width: 280px;
  max-width: calc(100vw - 2.5rem);
  max-height: 70vh;
  overflow-y: auto;
  background: #ffffff;
  color: #191813;
  border: 1px solid #191813;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  padding: 1rem;
}

.a11y-panel[hidden] {
  display: none;
}

.a11y-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(25, 24, 19, 0.16);
}

.a11y-panel-header h2 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.a11y-panel-close {
  background: none;
  border: 1px solid rgba(25, 24, 19, 0.3);
  color: #191813;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.a11y-panel-close:hover {
  background: #191813;
  color: #f2efe7;
}

.a11y-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.a11y-row span {
  font-size: 0.9rem;
}

.a11y-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  background: #f2efe7;
  border: 1px solid rgba(25, 24, 19, 0.2);
  color: #191813;
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
}

.a11y-btn:hover {
  border-color: #e04a17;
}

.a11y-btn[aria-pressed="true"] {
  background: #191813;
  color: #f2efe7;
  border-color: #191813;
}

.a11y-btn-icon {
  flex: 0 0 auto;
  font-weight: 700;
  width: 1.4em;
  text-align: center;
}

.a11y-fontsize-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.a11y-fontsize-row .a11y-btn {
  margin-bottom: 0;
  justify-content: center;
  flex: 1;
}

.a11y-reset {
  width: 100%;
  background: transparent;
  border: 1px solid #e04a17;
  color: #e04a17;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  margin-top: 0.25rem;
}

.a11y-reset:hover {
  background: #e04a17;
  color: #ffffff;
}

/* ------------------------------------------------ Applied site-wide effects */

html.a11y-contrast {
  filter: contrast(1.35);
  background: #000 !important;
}

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

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

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

html.a11y-highlight-links a {
  outline: 2px solid #ffbf00 !important;
  background-color: #fff3c4 !important;
  color: #191813 !important;
  text-decoration: underline !important;
}

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, sans-serif !important;
  letter-spacing: 0.01em !important;
}

html.a11y-readable-font h1,
html.a11y-readable-font h2,
html.a11y-readable-font h3 {
  font-family: Arial, Helvetica, sans-serif !important;
}

@media (max-width: 420px) {
  #a11y-widget {
    right: 0.75rem;
    bottom: 0.75rem;
  }
}
