/* =====================================================================
   NCCL WCAG 2.2 Accessibility Shim - PHASE 2 stylesheet
   Pairs with a11y-phase2.js. Load in the theme <head> after a11y-fixes.css.
   ===================================================================== */

/* sr-only fallback (in case phase-1 CSS is not loaded) */
.a11y-sr-only, .a11y-live {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; margin: -1px !important; overflow: hidden !important;
  clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important;
}

/* ---- M15 / M16: inline validation errors ------------------------- */
.a11y-err {
  display: block;
  color: #B00020;
  font-size: 0.85em;
  line-height: 1.4;
  margin-top: 3px;
  min-height: 1em;
}
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  outline: 2px solid #B00020;
  outline-offset: 1px;
}

/* ---- MD3: honeypot field (hidden from humans, reachable by bots) -- */
.a11y-hp {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important; height: 1px !important;
  overflow: hidden !important;
}

/* ---- MN3: lightbox close button ---------------------------------- */
.a11y-close {
  position: absolute;
  top: 8px; right: 8px;
  min-width: 40px; min-height: 40px;
  font-size: 24px; line-height: 1;
  background: rgba(0,0,0,.6); color: #fff;
  border: none; border-radius: 4px;
  cursor: pointer; z-index: 10;
  display: inline-flex; align-items: center; justify-content: center;
}
.a11y-close:hover { background: rgba(0,0,0,.8); }

/* ---- M6: keyboard-opened submenus stay visible ------------------- */
/* Mirror whatever the theme uses for :hover so focus/keyboard reveals it.
   Adjust the property to match the site's actual submenu show rule. */
nav li.a11y-open > ul,
nav li.a11y-open > .dropdown-menu {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  max-height: none !important;   /* NCCL theme collapses dropdowns via max-height */
  pointer-events: auto !important;
}
