/* V5.2 live remediation for the four audit items that remained open. */
:root{
  --anspl-a11y-focus-yellow:#ffd400;
  --anspl-a11y-focus-blue:#052b56;
  --anspl-a11y-accessible-orange:#a23d00;
}

/* WCAG 2.4.7: focus is always visible for keyboard-operable controls. */
html body :is(a[href],area[href],button,input,select,textarea,summary,[contenteditable="true"],[role="button"],[role="link"],[tabindex]:not([tabindex="-1"])):focus-visible,
html.anspl-a11y-keyboard-user body :is(a[href],area[href],button,input,select,textarea,summary,[contenteditable="true"],[role="button"],[role="link"],[tabindex]:not([tabindex="-1"])):focus{
  outline:3px solid var(--anspl-a11y-focus-yellow)!important;
  outline-offset:3px!important;
  box-shadow:0 0 0 2px var(--anspl-a11y-focus-blue),0 0 0 5px var(--anspl-a11y-focus-yellow)!important;
  text-decoration-skip-ink:auto!important;
}

/* Keep focused items from being hidden below sticky headers. */
html.anspl-a11y-live-remediation :is(a[href],button,input,select,textarea,summary,[tabindex]):focus{
  scroll-margin-block:110px 40px!important;
}

/* Known ANSPL orange text and outlines on white failed at about 2.7:1. */
html.anspl-a11y-live-remediation [style*="#F17D3F" i],
html.anspl-a11y-live-remediation [style*="#F07330" i],
html.anspl-a11y-live-remediation [style*="rgb(241, 125, 63)" i],
html.anspl-a11y-live-remediation [style*="rgb(240, 115, 48)" i]{
  color:var(--anspl-a11y-accessible-orange)!important;
  border-color:var(--anspl-a11y-accessible-orange)!important;
}

html.anspl-a11y-live-remediation input::placeholder,
html.anspl-a11y-live-remediation textarea::placeholder{
  color:#595959!important;
  opacity:1!important;
}

/* Prevent theme rules from hiding focus on the primary and footer navigation. */
html.anspl-a11y-live-remediation :is(header,footer,nav,.navbar,.menu,.main-menu) :is(a,button,[role="button"]):focus,
html.anspl-a11y-live-remediation :is(header,footer,nav,.navbar,.menu,.main-menu) :is(a,button,[role="button"]):focus-visible{
  outline:3px solid var(--anspl-a11y-focus-yellow)!important;
  outline-offset:3px!important;
  box-shadow:0 0 0 2px var(--anspl-a11y-focus-blue),0 0 0 5px var(--anspl-a11y-focus-yellow)!important;
}

@media (forced-colors:active){
  html body :is(a[href],area[href],button,input,select,textarea,summary,[contenteditable="true"],[role="button"],[role="link"],[tabindex]:not([tabindex="-1"])):focus,
  html body :is(a[href],area[href],button,input,select,textarea,summary,[contenteditable="true"],[role="button"],[role="link"],[tabindex]:not([tabindex="-1"])):focus-visible{
    outline:3px solid Highlight!important;
    box-shadow:none!important;
  }
}

/* Footer quick links are visually identifiable as links without relying on colour alone. */
html.anspl-a11y-live-remediation footer a.anspl-a11y-purpose-link:not(.btn):not([class*="button"]){
  text-decoration:underline!important;
  text-decoration-thickness:1.5px!important;
  text-underline-offset:.18em!important;
}
