/* a11y-overrides.css — CTX-0017 (WCAG AA >=4.5:1, target >=4.6:1)
 *
 * Layered on top of nes.min.css; MUST be linked after it. All ratios below
 * were computed with WCAG 2.x relative luminance by a solver script (kept
 * out of the repo per task spec) — no colors chosen by eye.
 *
 * Approved strategy: keep every variant's original NES.css background hue;
 * adjust only lightness. For the bright variants (primary/success/error)
 * the minimal-delta fix is flipping the white label to the NES ink #212529
 * — exactly the pattern nes.min.css already uses for .is-warning — instead
 * of darkening the iconic backgrounds (which would destroy the retro
 * palette). Borders, border-images and ::after inset-shadow hexes are NOT
 * overridden, so buttons stay halo-free: every shadow hex (#006bb3,
 * #4aa52e, #8c2022, #adafbc) is still darker than the backgrounds it sits
 * on, including the two retuned hover backgrounds.
 *
 * Theme note: nes.min.css ships no body.dark-theme button rules and no
 * template overrides button colors either, so each button pair below is
 * identical in both themes. Dialogs/inputs are pinned to light chrome +
 * ink because nes.min.css sets neither background nor color on them (UA
 * default "canvas" makes class-based dark theme render them with ~#d3d3d3
 * text on white = 1.63:1).
 */

/* ---- .nes-btn default / hover: pass as shipped -------------------------
 * #212529 on #ffffff = 15.43:1 ; on #e7e7e7 (hover) = 12.47:1 */

/* ---- is-primary ---------------------------------------------------------
 * rest:  #212529 on #209cee = 5.18:1 (was #fff on #209cee = 2.98:1 FAIL)
 * hover: #212529 on #1192e7 = 4.62:1 (was #fff on #108de0 = 3.55:1 FAIL);
 *        hover bg lightened one step inside the blue family so ink clears
 *        AA while keeping the original "hover shifts darker-blue" feel.
 * focus/active only change box-shadow/border-image -> rest colors apply. */
.nes-btn.is-primary {
  color: #212529;
}
.nes-btn.is-primary:hover {
  color: #212529;
  background-color: #1192e7;
}

/* ---- is-success ---------------------------------------------------------
 * rest:  #212529 on #92cc41 = 8.03:1 (was #fff = 1.92:1 FAIL)
 * hover: #212529 on #76c442 = 7.16:1 (was #fff = 2.15:1 FAIL) */
.nes-btn.is-success,
.nes-btn.is-success:hover {
  color: #212529;
}

/* ---- is-warning: passes as shipped -------------------------------------
 * #212529 on #f7d51d = 10.64:1 ; on #f2c409 (hover) = 9.31:1 */

/* ---- is-error -----------------------------------------------------------
 * rest:  #212529 on #e76e55 = 4.97:1 (was #fff = 3.11:1 FAIL)
 * hover: #212529 on #de695f = 4.62:1. Original hover bg #ce372b is too
 *        dark for ink text (3.77:1), so hover now steps LIGHTER within the
 *        same red family; ::after shadow #8c2022 stays darker than both. */
.nes-btn.is-error {
  color: #212529;
}
.nes-btn.is-error:hover {
  color: #212529;
  background-color: #de695f;
}

/* ---- is-disabled --------------------------------------------------------
 * Vendored pair #212529/#d3d3d3 passes (12+:1) but opacity 0.6 alpha-blends
 * the label down to ~3.2:1 measured by axe/Lighthouse. 0.85 keeps a clearly
 * muted look and passes both blend models in both themes:
 *   axe-style composite (label over own bg, then over page):
 *     7.43:1 light / 5.28:1 dark
 *   naive whole-group page blend: 6.87:1 light / 7.87:1 dark
 * WCAG exempts disabled controls, but .is-disabled is applied to plain <a>
 * elements that axe/Lighthouse still audit. */
.nes-btn.is-disabled,
.nes-btn.is-disabled:focus,
.nes-btn.is-disabled:hover {
  opacity: 0.85;
}

/* ---- dialogs & form fields (both themes) --------------------------------
 * nes.min.css declares no background/color for these, so under the
 * class-based dark theme inherited --text-color (#d3d3d3) lands on the UA
 * light canvas = 1.63:1 FAIL. Pin light chrome + ink everywhere; this also
 * matches the buttons, which stay light-surfaced in dark theme. */
.nes-dialog {
  background-color: #fff;
  color: #212529;
}
.nes-input,
.nes-select select,
.nes-textarea {
  background-color: #fff;
  color: #212529;
}
