/* CloviHuman — Accessibility Fixes */
/* Brand: #F97316 (2.8:1 on white — FAILS AA; use #c05a0a on white or ensure dark text on brand bg) */

/* ── Skip Link ── */
.skip-link,
a[href="#main-content"].sr-only {
  position: absolute !important;
  top: -9999px !important;
  left: -9999px !important;
  z-index: 10000;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 700;
  background: #F97316;
  color: #431407 !important;
  text-decoration: none;
  white-space: nowrap;
}

.skip-link:focus,
a[href="#main-content"]:focus {
  position: fixed !important;
  top: 1rem !important;
  left: 1rem !important;
}

/* Generic sr-only */
.sr-only {
  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;
}

.sr-only:focus,
.sr-only:focus-within {
  position: static !important;
  width: auto !important;
  height: auto !important;
  padding: inherit !important;
  margin: inherit !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: inherit !important;
}

/* ── Orange/Brand buttons — dark text for contrast ── */
/* #F97316 on white = 2.8:1 (FAIL). On brand bg, use #431407 or #000 for text */
.btn-primary,
button.btn-primary,
a.btn-primary,
[class*="btn-primary"],
.nav-cta,
button.nav-cta,
[style*="background:#F97316"],
[style*="background: #F97316"],
[style*="background:#f97316"],
[style*="background: #f97316"],
[style*="background-color:#F97316"],
[style*="background-color: #F97316"],
.bg-orange-500,
.bg-orange-600 {
  color: #431407 !important;
}

/* Amber buttons — dark text */
.bg-amber-400,
.bg-amber-500,
[style*="background:#f59e0b"],
[style*="background:#fbbf24"] {
  color: #1c1917 !important;
}

/* ── Link underlines in body text ── */
p a,
li a,
td a,
.content a,
.prose a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

p a:hover,
li a:hover {
  text-decoration-thickness: 2px;
}

/* Nav links — no underline (intentional) */
nav a,
nav .nav-links a,
.footer a,
footer a {
  text-decoration: none !important;
}

/* ── Muted text contrast fixes ── */
/* #78716C on white = ~3.9:1 (marginal); bump to #57534e = 5.1:1 */
[style*="color:#78716C"],
[style*="color: #78716C"],
[style*="color:#78716c"],
.text-stone-500 {
  color: #57534e !important;
}

/* #94a3b8 on white = ~2.5:1 (FAIL) → use #64748b = 4.76:1 */
[style*="color:#94a3b8"],
[style*="color: #94a3b8"],
.text-slate-400 {
  color: #64748b !important;
}

/* #8888aa on white = ~2.7:1 (FAIL) → darken */
[style*="color:#8888aa"],
[style*="color: #8888aa"] {
  color: #5f5f88 !important;
}

/* On dark backgrounds: restore lighter muted */
[data-theme="dark"] [style*="color:#94a3b8"],
[data-theme="dark"] [style*="color: #94a3b8"],
[data-theme="dark"] .text-slate-400 {
  color: #94a3b8 !important;
}

[data-theme="dark"] [style*="color:#64748b"],
[data-theme="dark"] [style*="color: #64748b"],
[data-theme="dark"] .text-slate-500 {
  color: #94a3b8 !important;
}

/* ── Focus visible ── */
:focus-visible {
  outline: 2px solid #F97316 !important;
  outline-offset: 2px !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #F97316 !important;
  outline-offset: 2px !important;
}

/* ── Social icon links — ensure label visible ── */
a[aria-label] svg,
button[aria-label] svg {
  pointer-events: none;
}

/* ── Form labels ── */
label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

/* ── Reduce motion ── */
@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 ── */
@media (forced-colors: active) {
  .btn-primary,
  .nav-cta {
    border: 2px solid ButtonText;
  }
}
