/*
 * Quadeye Accessibility Fixes (WCAG 2.2) - CSS layer
 * Audit ref: Nishaj Infosolutions, 10 Jul 2026
 * Issues addressed here: 4 (2.4.7/2.4.11 focus visible), 6 (1.4.3 contrast)
 * All rules namespaced/additive - safe to remove.
 */

/* ---- Issue 4: visible focus indicator (2.4.7) ----
   Blue ring + white halo so it is >=3:1 on both light and dark backgrounds. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #0546d6 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 5px #ffffff, 0 0 0 7px #0546d6 !important;
  border-radius: 2px;
  transition: none !important;
}

/* OneTap widget buttons suppress outlines (its CSS loads after ours and with
   higher specificity) - win with max-specificity selectors */
html body button.onetap-toggle:focus,
html body button.onetap-toggle:focus-visible,
html body .onetap-plugin-onetap button:focus-visible,
html body .onetap-plugin-onetap a:focus-visible,
html body .onetap-plugin-onetap [tabindex]:focus-visible {
  outline: 2px solid #0546d6 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 5px #ffffff, 0 0 0 7px #0546d6 !important;
}

/* Fallback for browsers without :focus-visible (keyboard users still covered) */
a:focus,
button:focus,
[tabindex="0"]:focus {
  outline: 2px solid #0546d6;
  outline-offset: 2px;
}
/* but do not show the ring for mouse users where :focus-visible is supported */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
[tabindex="0"]:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

/* ---- Issue 4b: focused element must not hide under the sticky header (2.4.11) ---- */
a, button, input, select, textarea, [tabindex] {
  scroll-margin-top: 160px;
}

/* ---- Skip link (2.4.1 bypass blocks) ---- */
.qa11y-skip-link {
  position: absolute;
  left: -10000px;
  top: 0;
  z-index: 2147483000;
  background: #0546d6;
  color: #ffffff !important;
  padding: 12px 22px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 6px 0;
}
.qa11y-skip-link:focus {
  left: 0;
}

/* ---- Issue 6: control text contrast on hover/focus (1.4.3) ----
   Theme buttons (e.g. "Learning at Quadeye") use transparent bg + #0652FD text
   over imagery; on hover/focus force a solid dark-blue fill + white text
   (contrast 7.2:1) so the state always meets 4.5:1. */
#grve-theme-wrapper .grve-btn:hover,
#grve-theme-wrapper .grve-btn:focus,
#grve-theme-wrapper .grve-btn:focus-visible {
  background-color: #0546d6 !important;
  border-color: #0546d6 !important;
  color: #ffffff !important;
}
#grve-theme-wrapper .grve-btn:hover span,
#grve-theme-wrapper .grve-btn:focus span {
  color: #ffffff !important;
}

/* ---- Issue 1 helper: keyboard-focusable carousel buttons look interactive ---- */
.grve-carousel-prev[tabindex="0"],
.grve-carousel-next[tabindex="0"] {
  cursor: pointer;
}

/* ---- Issue 6b: careers job-board links/buttons use #6875E2 on white (4.0:1).
   Darken to #3D49B8 (~6.3:1) — same hue family, WCAG AA compliant. ---- */
a[href*="career.quadeye.com"] {
  color: #3d49b8 !important;
}
input.searchButton,
.rec-job-info.searchButton {
  background-color: #3d49b8 !important;
  color: #ffffff !important;
}

/* ---- Issue 1: submenus open on keyboard focus (matches hover behaviour) ---- */
#grve-navigation li.qa11y-submenu-open > ul.sub-menu,
#grve-navigation li.qa11y-submenu-open > .sub-menu {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
