/* AI with Megan — accessibility layer (WCAG 2.2 AA)
   Loaded LAST on every page. Keep brand colors in brand.css / index.html;
   this file only adds focus, motion, skip-link and link-affordance rules. */

:root {
  /* Terracotta darkened just enough for text/buttons on cream (5.3:1).
     The original --terracotta (#C97A63) stays for decoration only. */
  --terracotta-aa: #9C543D;
  --terracotta-aa-hover: #7F4330;
  /* Terracotta lightened for text on forest green (6:1). */
  --terracotta-on-dark: #E3A892;
}

/* ---- Skip link ------------------------------------------------ */
.skip-link, .skip {
  position: absolute;
  left: 12px;
  top: -64px;
  z-index: 10000;
  padding: 10px 16px;
  background: #2F4036;
  color: #FAF8F3;
  border-radius: 6px;
  font: 600 14px/1.2 system-ui, sans-serif;
  text-decoration: none;
}
.skip-link:focus, .skip:focus {
  top: 12px;
  left: 12px;
  display: inline-block;
  outline: 3px solid #E3A892;
  outline-offset: 2px;
}

/* ---- Visible keyboard focus ----------------------------------- */
:focus-visible {
  outline: 3px solid #9C543D;
  outline-offset: 3px;
  border-radius: 3px;
}
/* On dark (forest) blocks use the light ring */
.upsell :focus-visible, .signup :focus-visible, .opt.win :focus-visible,
.privacy-band:focus-visible, .banner :focus-visible, .site-head.banner :focus-visible,
.site-foot :focus-visible, .final-cta :focus-visible, .closing :focus-visible {
  outline-color: #F4D9CF;
}
/* Form fields: keep the brand glow AND a real outline */
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible,
.signup input[type=email]:focus-visible {
  outline: 3px solid #9C543D;
  outline-offset: 1px;
}
summary:focus-visible { outline-offset: 4px; }

/* ---- Links must not rely on color alone ----------------------- */
p a:not(.btn):not(.download):not(.made-link),
li a:not(.btn),
.lede a, details a, .fine a, small a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

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

/* ---- Respect "reduce motion" ---------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .card:hover { transform: none !important; }
}

/* ---- Touch targets (WCAG 2.2: 24px min; we aim higher) -------- */
.kit-close { min-width: 44px; min-height: 44px; }

/* ---- Forced-colors / high-contrast mode ----------------------- */
@media (forced-colors: active) {
  .btn, .card, .tile, .opt { border: 1px solid CanvasText; }
  :focus-visible { outline-color: Highlight; }
}
