/* NUVRELL WCAG 2.2 AA polish (Wave-16 W16)
 *
 * - High-contrast focus ring (3:1+ against the gold + dark backgrounds we use)
 * - 44x44 minimum touch target enforcement on critical CTAs (WCAG 2.5.5 target size)
 * - Visible link underline restoration on hover for body links
 * - prefers-reduced-motion baked in
 * - High-contrast and forced-colors fallback
 */

:focus-visible {
  outline: 3px solid #8b6a1f !important;
  outline-offset: 2px !important;
  border-radius: 2px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  box-shadow: 0 0 0 4px rgba(196, 163, 90, 0.32);
}

/* WCAG 2.2 SC 2.5.5 (Target Size, Level AAA) — aim AAA on CTAs */
.btn,
button.btn,
[role="button"].btn {
  min-height: 44px;
  min-width: 44px;
}

/* WCAG 2.2 SC 2.5.8 (Target Size Minimum, Level AA) — the NEW 2.2 criterion.
 * Every interactive target must be ≥24×24 CSS px OR have ≥24×24 spacing
 * around it. We enforce the simpler size rule on common interactive elements. */
button, [role="button"], a.btn, input[type="checkbox"], input[type="radio"],
input[type="submit"], input[type="button"], select {
  min-height: 24px;
  min-width: 24px;
}

/* CHECKPOINT-43 W48: focus indicator size criterion (WCAG 2.2 SC 2.4.13
 * Level AAA) — keep ring AT LEAST as thick as 2px and not obscured by other
 * content. Already 3px above. Re-affirm here. */
.skip-link:focus-visible,
a.btn:focus-visible,
button:focus-visible {
  /* In addition to outline, ensure the focused element is visually distinct */
  z-index: 5;
  position: relative;
}

/* Skip-link visible on focus */
.skip-link {
  position: absolute;
  top: -64px;
  left: 0;
  padding: 12px 18px;
  background: #1a1a1a;
  color: #c4a35a;
  z-index: 10000;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: top 0.18s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 0;
}

/* prefers-reduced-motion — disable non-essential transitions */
@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;
  }
}

/* Forced-colors (Windows High Contrast) */
@media (forced-colors: active) {
  .btn,
  button.btn {
    forced-color-adjust: none;
    border: 1px solid CanvasText !important;
  }
  :focus-visible {
    outline: 3px solid CanvasText !important;
  }
}

/* Screen-reader-only utility */
.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;
}

/* Ensure interactive elements always show pointer + adequate contrast text */
a:not([class]):hover {
  text-decoration: underline;
}
a:not([class]):focus-visible {
  text-decoration: underline;
}

/* Card focus-within (keyboard navigation through product grids) */
.card:focus-within,
.product-card:focus-within {
  outline: 2px solid #8b6a1f;
  outline-offset: 2px;
}
