/* ──────────────────────────────────────────────────────────────────────────
 * site-fixes.css — global accessibility + UX/UI hardening
 * Loaded by every Omniscient HTML page (landing, agents, sales, try, etc.)
 * Addresses SiteVitals audit issues:
 *   - Critical UX/UI: no visible keyboard focus styles on nav links
 *   - High UX/UI: no visible search in header on desktop
 *   - Accessibility: focus indicators (WCAG 2.4.7)
 *   - Code quality: shared utility layer reduces per-page inline styles
 * ────────────────────────────────────────────────────────────────────────── */

/* WCAG 2.4.7 — Focus Visible. Applies a high-contrast outline to every
 * keyboard-focused interactive element across every page. Mouse users see
 * nothing extra (because of :focus-visible), so visual design is unaffected. */
:focus-visible {
  outline: 2px solid #c4aaff !important;
  outline-offset: 2px !important;
  border-radius: 4px;
}
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  box-shadow: 0 0 0 4px rgba(196, 170, 255, 0.35) !important;
}

/* Fallback for older browsers without :focus-visible — only header nav */
header a:focus,
header button:focus,
nav a:focus,
nav button:focus {
  outline: 2px solid #c4aaff;
  outline-offset: 2px;
}

/* Skip-to-content link for screen-reader / keyboard users.
 * Hidden until focused, then jumps into the top-left corner. */
.ov-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100000;
  background: #4B0082;
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
.ov-skip-link:focus {
  left: 0;
}

/* Header site-search — visible on desktop ≥ 760px, collapsed to icon on mobile.
 * Wires to /search?q=… (handled by existing search route). */
.ov-header-search {
  display: none;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(196, 170, 255, 0.3);
  border-radius: 999px;
  padding: 4px 10px;
  margin-left: auto;
}
.ov-header-search input {
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  font-size: 13px;
  width: 180px;
  outline: none;
}
.ov-header-search input::placeholder { color: rgba(255, 255, 255, 0.55); }
.ov-header-search button {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 2px 6px;
  font-size: 14px;
  line-height: 1;
}
@media (min-width: 760px) {
  .ov-header-search { display: inline-flex; }
}

/* Reduced-motion respect for any animated elements that don't honor it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High-contrast mode (Windows) — keep focus indicators visible */
@media (forced-colors: active) {
  :focus-visible { outline: 3px solid CanvasText !important; }
}
