/* Canonical source: Kunida-Design-System/patterns/kunida-front-end-baseline.css.
   Copy unchanged into a site and load it before site styles. It fixes the
   defects the rendered critic finds on most sites, through --kd-* roles
   (patterns/SITE-TOKEN-CONTRACT.md). Every selector uses :where() so any
   site rule wins without a specificity fight. */

:where(body) {
  font-size: max(1rem, var(--kd-text-base, 1rem));
  line-height: var(--kd-leading-body, 1.55);
}

/* Links inside running text carry a non-colour cue (WCAG 1.4.1). Classed
   links (buttons, cards, menus) keep their own treatment. */
:where(p, li, dd, td, blockquote) :where(a:not([class])) {
  text-decoration-line: underline;
  text-decoration-thickness: from-font;
  text-underline-offset: 0.18em;
}

/* A visible keyboard focus ring everywhere (WCAG 2.4.7). */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--kd-color-focus, #1d4ed8);
  outline-offset: 2px;
}

/* Touch targets of at least 44px on touch devices. */
@media (pointer: coarse) {
  :where(button, [role="button"], input:not([type="hidden"], [type="checkbox"], [type="radio"]), select, summary) {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :where(*, ::before, ::after) {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
