/*
 * Accessibility repairs on top of live's theme (KMG-85, Enterstellarsoftwares/IDM-architecture#1249).
 * The theme-*.css files are live's own stylesheets, regenerated by tools/parity/theme-css.mjs and
 * never hand-edited; this file is not a theme-*.css, so a regeneration keeps it. Every rule here
 * fixes a WCAG 2.2 AA failure live has too, and changes nothing a mouse or touch user sees:
 * docs/kamagra/accessibility.md lists the findings and what was left as live.
 */

/*
 * 1.4.3 Contrast: live's greys #777777 (`--wd-text-color`, body text) and #777
 * (`--color-gray-500`, breadcrumbs, review link, price filter) on white are 4.48:1, under AA's
 * 4.5:1. #767676 is the nearest grey that passes (4.54:1); it differs by one step per channel.
 * Set on the same selectors the theme sets them on, light colour schemes left alone.
 */
:root,
.color-scheme-dark,
.color-scheme-hover-dark:hover,
.wd-header-text [class*="wcml-dropdown"] {
  --wd-text-color: #767676;
}
:root,
.color-scheme-dark {
  --color-gray-500: #767676;
}

/*
 * 2.4.7 Focus visible: live's theme removes the outline from links and buttons
 * (`a:focus{outline:none}`, `.btn,.button,button{outline:none}`), so Tab moves through the page
 * with no sign of where it is. :focus-visible is keyboard focus only (a mouse click on a link or
 * button does not match it). Text fields and selects keep live's own focus border.
 */
:is(a, button, summary, [tabindex]:not([tabindex="-1"]), input[type="radio"], input[type="checkbox"], input[type="submit"], input[type="button"]):focus-visible {
  outline: 2px solid #005fcc;
  outline: 2px auto -webkit-focus-ring-color;
  outline-offset: 2px;
}

/*
 * The pack table's radio buttons are transparent (live's snippet #27 draws SELECT / SELECTED
 * beside them), so their own ring cannot show: the label next to the focused one shows it.
 */
.prod_table input[name="check_quantity"]:focus-visible + .variation_text {
  outline: 2px solid #005fcc;
  outline: 2px auto -webkit-focus-ring-color;
  outline-offset: 2px;
}
