/* ============================================
   ACCESSIBILITY BASE — WCAG 2.1 AA
   ============================================ */

/* Visually-hidden helper (sr-only) — accessible to screen readers, invisible on screen */
.sr-only,
.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link — appears on Tab focus, jumps past nav to main content */
.skip-link {
  position: absolute;
  top: -100px;
  left: 8px;
  z-index: 9999;
  padding: 12px 20px;
  background: var(--color-primary, #4A9B6E);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: top 0.15s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 8px;
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* WCAG 2.4.7 — visible focus indicator on all interactive elements
   Uses :focus-visible so mouse clicks don't trigger it (cosmetic UX) */
:focus-visible {
  outline: 2px solid var(--color-primary, #4A9B6E);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Some elements have their own focus styling — opt-in vs override.
   For elements that intentionally style :focus, we trust the original. */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-primary, #4A9B6E);
  outline-offset: 2px;
}

/* Form inputs need visible focus on dark BG too */
.site-footer input:focus-visible,
.site-footer textarea:focus-visible,
.hero input:focus-visible {
  outline-color: #fff;
}

/* WCAG 2.3.3 + vestibular safety — kill animations for users who request it */
@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;
  }
}

/* aria-live regions — must be in DOM at page load, hidden until populated */
.scandinaf-aria-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
}

/* Touch targets — WCAG 2.5.5 / 2.5.8 (24×24 minimum, 44×44 recommended).
   Apply min-size only to genuinely large interactive elements. */
.side-menu__close,
.search-toggle,
.menu-toggle {
  min-width: 44px;
  min-height: 44px;
}

/* Tiny indicators (carousel dots): keep visual size, expand hitbox via invisible ::before */
.product-card__dot {
  position: relative;
  /* visual size stays whatever style.css defines — typically 6-8px */
}
.product-card__dot::before {
  content: '';
  position: absolute;
  inset: -14px;          /* expands clickable area by 14px each side -> ~36px hitbox */
  background: transparent;
}

/* ============================================
   CONTRAST UTILITIES — WCAG AA for small text
   Use when text is <18px AND not bold, on white/light bg.
   Reasoning: --color-primary #4A9B6E gives 3.38:1 (fails AA-normal 4.5:1).
              Use --color-primary-dark #3A7D58 (~5:1) for small text contexts.
   ============================================ */
.text-contrast-aa,
small.text-primary,
.caption.text-primary {
  color: var(--color-primary-dark, #3A7D58);
}

/* Muted text: when used as small body copy, escalate to secondary (6.15:1 ✓) */
small.text-muted,
.caption {
  color: var(--color-text-secondary, #5A6270);
}
