/**
 * Shared accessibility utilities — see design.md §8.
 * Load after css/typography.css on every prototype page.
 */

[hidden] {
  display: none !important;
}

[x-cloak] {
  display: none !important;
}

/* Visually hidden, available to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link — first focusable element in document order */
.skip-link {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--shell);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-160%);
  transition: transform 0.15s;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--focus, var(--primary));
  outline-offset: 2px;
}

:focus-visible {
  outline: 2px solid var(--focus, var(--primary));
  outline-offset: 2px;
}

/* Programmatic focus targets (skip-link target <main tabindex="-1">) — never show a ring around the page */
[tabindex="-1"]:focus,
[tabindex="-1"]:focus-visible {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .skip-link {
    transition: none;
  }
}
