/* Shared Simpixy a11y preference effects + skip link + toolbar chrome */

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -100px;
  z-index: 10000;
  padding: 0.65rem 1rem;
  background: #111827;
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 1rem;
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}

/* Text size steps on chrome (not photo pixel content) */
html[data-a11y-text="1"] {
  font-size: 112.5%;
}
html[data-a11y-text="2"] {
  font-size: 125%;
}
html[data-a11y-text="-1"] {
  font-size: 93.75%;
}

/* High contrast: strengthen text/surfaces without filter-hacking photos */
html[data-a11y-contrast="1"] body {
  --a11y-fg: #000;
  --a11y-bg: #fff;
  --a11y-border: #000;
  color: var(--a11y-fg);
  background: var(--a11y-bg);
}

html[data-a11y-contrast="1"] a:not([class*="btn"]):not([class*="Button"]) {
  color: #0000ee;
  text-decoration: underline;
}

html[data-a11y-contrast="1"] button,
html[data-a11y-contrast="1"] .btn,
html[data-a11y-contrast="1"] [role="button"] {
  border: 2px solid #000 !important;
}

html[data-a11y-contrast="1"] input,
html[data-a11y-contrast="1"] select,
html[data-a11y-contrast="1"] textarea {
  border: 2px solid #000 !important;
  background: #fff !important;
  color: #000 !important;
}

/* Emphasize links */
html[data-a11y-links="1"] a {
  text-decoration: underline !important;
  text-underline-offset: 0.15em;
}

/* Reduce motion (toolbar override + OS) */
html[data-a11y-motion="reduce"] *,
html[data-a11y-motion="reduce"] *::before,
html[data-a11y-motion="reduce"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

@media (prefers-reduced-motion: reduce) {
  html:not([data-a11y-motion="auto"]) *,
  html:not([data-a11y-motion="auto"]) *::before,
  html:not([data-a11y-motion="auto"]) *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Toolbar */
.spx-a11y-root {
  position: fixed;
  inset-inline-end: 1rem;
  bottom: 1rem;
  z-index: 9990;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

.spx-a11y-toggle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #111827;
  background: #fff;
  color: #111827;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.spx-a11y-toggle:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
}

.spx-a11y-panel {
  position: absolute;
  inset-inline-end: 0;
  bottom: calc(48px + 0.6rem);
  width: min(280px, calc(100vw - 2rem));
  background: #fff;
  color: #111827;
  border: 2px solid #111827;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  padding: 0.85rem 1rem 1rem;
}

.spx-a11y-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
}

.spx-a11y-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.spx-a11y-row label {
  flex: 1 1 auto;
  font-weight: 500;
}

.spx-a11y-actions {
  display: inline-flex;
  gap: 0.35rem;
}

.spx-a11y-actions button,
.spx-a11y-panel > button.spx-a11y-reset,
.spx-a11y-statement {
  border: 1px solid #374151;
  background: #f9fafb;
  color: #111827;
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  font: inherit;
}

.spx-a11y-actions button[aria-pressed="true"],
.spx-a11y-row button[aria-pressed="true"] {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.spx-a11y-actions button:focus-visible,
.spx-a11y-panel button:focus-visible,
.spx-a11y-statement:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}

.spx-a11y-statement {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  margin-top: 0.35rem;
  box-sizing: border-box;
}

.spx-a11y-reset {
  width: 100%;
  margin-top: 0.25rem;
}

.visually-hidden-a11y {
  position: absolute !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;
}
