/* ============================================================
   HealthCompass — Accessibility layer (a11y.css)
   ------------------------------------------------------------
   PURELY ADDITIVE. Loads last so focus styles win. Does not
   alter layout, positioning, z-index, or sticky behavior.
   - Visible keyboard focus rings (focus-visible only, so mouse
     users don't see rings)
   - Skip-to-content link
   - Screen-reader-only utility
   - Reduced-motion safety net
   - Minimum tap-target comfort (without forcing layout shifts)
   ============================================================ */

/* ---- Keyboard focus rings (only for keyboard nav, not mouse clicks) ---- */
:focus-visible {
  outline: 3px solid #2da7c9 !important;
  outline-offset: 2px !important;
  border-radius: 4px;
}
/* Remove the default outline only when focus-visible is supported & not active
   (prevents double rings; mouse clicks won't show a ring) */
:focus:not(:focus-visible) {
  outline: none;
}
/* On dark backgrounds, a brighter ring reads better */
body.dark :focus-visible {
  outline-color: #5fd0ec !important;
}

/* ---- Skip to content link (hidden until focused) ---- */
.hc-skip {
  position: absolute;
  left: 8px;
  top: -48px;
  z-index: 10000;
  background: #00B4A2;
  color: #04121f;
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  text-decoration: none;
  transition: top 0.18s ease;
}
.hc-skip:focus {
  top: 8px;
}

/* ---- Screen-reader-only helper ---- */
.hc-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Reduced-motion safety net (covers any animation that slipped through) ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Tap-target comfort: ensure interactive controls aren't tiny on touch ----
   Uses min-height/min-width only; does not change display or position, so it
   cannot shift existing layouts. Applies on coarse (touch) pointers only. */
@media (pointer: coarse) {
  button, a[role="button"], .hc-tap {
    min-height: 44px;
  }
}
