/* ==========================================================================
   a11y.css - Section 508 / WCAG 2.0 AA accessibility overrides for G2IT
   Load AFTER style.css and logo.css.
   ========================================================================== */

/* 1. Visible keyboard focus (WCAG 2.4.7)
   style.css removes all focus outlines ("*:focus { outline: none }" and
   "a:focus, button:focus { outline: none !important }"). These rules put a
   visible focus ring back for keyboard users. :focus-visible means mouse
   clicks do not show the ring, only keyboard focus does. */
html body a:focus-visible,
html body button:focus-visible,
html body input:focus-visible,
html body select:focus-visible,
html body textarea:focus-visible,
html body [tabindex]:focus-visible,
html body .btn:focus-visible,
html body .form-input:focus-visible,
html body .nav-link:focus-visible {
  outline: 3px solid #1a5fb4 !important;   /* 6.4:1 on white */
  outline-offset: 2px !important;
  box-shadow: 0 0 0 5px #ffffff !important; /* white halo so the ring shows on dark navy too */
}

/* On dark sections, use a light ring instead. */
html body .context-dark a:focus-visible,
html body .context-dark button:focus-visible,
html body .bg-madison a:focus-visible,
html body .rd-navbar-top-panel a:focus-visible,
html body .swiper-slide-caption a:focus-visible,
html body .page-footer .bg-madison a:focus-visible {
  outline-color: #ffd34d !important;        /* 11:1 on #0d2d62 navy */
  box-shadow: 0 0 0 5px #041636 !important;
}

/* Form fields: also mark focus with a visible border (inputs are wide). */
html body .form-input:focus {
  border-color: #1a5fb4 !important;
}

/* 2. Skip link (WCAG 2.4.1) - hidden until it receives keyboard focus. */
.skip-link {
  position: absolute;
  top: -200px;
  left: 8px;
  z-index: 100000;
  padding: 10px 18px;
  background: #041636;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 16px;
  border-radius: 0 0 4px 4px;
  text-decoration: underline;
}
.skip-link:focus,
.skip-link:focus-visible {
  top: 0;
  outline: 3px solid #ffd34d !important;
}

/* Main landmark target: no outline when focused programmatically by the skip link. */
#main:focus { outline: none; }

/* 3. Screen-reader-only text (used for "opens in new tab", required hints, etc.) */
.sr-only,
.visually-hidden {
  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;
}

/* 4. Desktop Capabilities dropdown: a11y.js adds the theme's own "focus" class when keyboard
   focus enters the menu item, so the submenu opens exactly as it does on hover (WCAG 2.1.1). */

/* Phone layout: the closed slide-out menu sits off-screen but its links could still take
   keyboard focus (invisible tab stops). Hide it from the keyboard once the slide-out animation
   finishes, and show it immediately when it opens. The slide animation is unchanged. */
.rd-navbar-fixed .rd-navbar-nav-wrap:not(.active) {
  visibility: hidden;
  transition-property: transform, visibility;
  transition-duration: 0.3s, 0s;
  transition-delay: 0s, 0.3s;
}
.rd-navbar-fixed .rd-navbar-nav-wrap.active {
  visibility: visible;
  transition-property: transform, visibility;
  transition-duration: 0.3s, 0s;
  transition-delay: 0s, 0s;
}

/* Mobile submenu toggle that a11y.js makes keyboard focusable */
.rd-navbar-submenu-toggle:focus-visible {
  outline: 3px solid #1a5fb4 !important;
  outline-offset: 2px;
}

/* 5. Pause / play controls for moving content (WCAG 2.2.2) */
.a11y-motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  color: #ffffff;
  background: rgba(4, 22, 54, 0.75);  /* navy, white text 12:1 */
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 3px;
  cursor: pointer;
  opacity: 0.85;
}
.a11y-motion-toggle:hover,
.a11y-motion-toggle:focus-visible { opacity: 1; }
.a11y-motion-toggle:hover { background: #041636; }
.a11y-motion-toggle .a11y-icon { font-size: 12px; }

/* Hero video control: bottom-right corner of the banner */
.video-background + .a11y-motion-toggle,
.a11y-video-toggle {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 20;
}

/* Logo slider control: under the slider, centered */
/* Positioned over the top-right corner of the Customers section so the layout does not move */
.a11y-slider-host { position: relative; }
.a11y-slider-toggle-wrap {
  position: absolute;
  top: 0;
  right: 15px;
  z-index: 5;
}
.a11y-slider-toggle-wrap .a11y-motion-toggle {
  color: #041636;
  background: transparent;
  border-color: #6b7a90;   /* 3:1+ against the light gray section */
}
.a11y-slider-toggle-wrap .a11y-motion-toggle:hover {
  background: #e7f1fb;
}

/* Hide the native (unusable) controls on the background video; the custom button replaces them. */
.video-background video::-webkit-media-controls { display: none !important; }

/* 6. Text over the hero video/banners: a soft shadow behind the white text keeps it
   readable on bright video frames without changing the look (WCAG 1.4.3). */
.swiper-slide-caption h1,
.swiper-slide-caption .h2,
.swiper-slide-caption .h4 {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

/* 6b. Breadcrumb current-page text was white at 40% opacity (2.97:1). 70% gives 6.9:1 on the navy band. */
html .breadcrumb-classic .list-inline > li:last-child { color: rgba(255, 255, 255, 0.7); }

/* 7. Contact form: required note and error text */
.form-required-note { font-weight: 600; }
/* When errors move focus to a field, keep it clear of the sticky header */
.rd-mailform .form-input { scroll-margin-top: 140px; }
html body .has-error .form-validation {
  color: #a82b23;
  font-weight: 600;
}

/* 8. Heading-level fixes: some headings were changed to a different tag (for example
   <h4> to <p class="h4">) so the outline is correct. These rules keep the original spacing. */

/* Banner titles: <h2> -> <h1 class="h2">. The theme sizes ".swiper-slide-caption h1"
   separately, so restore the h2 sizes, spacing and letter-spacing exactly. */
h1.h2 { letter-spacing: normal; }
html .swiper-slide-caption h1.h2,
html h1.h2 { font-size: 32px; line-height: 1.5; }
@media (min-width: 768px) {
  html .swiper-slide-caption h1.h2,
  html h1.h2 { font-size: 44px; line-height: 1.27273; }
}

/* <h4>/<h5> paragraph text -> <p class="h4"> / <p class="h5"> */
p.h4, p.h5, p.h6 { margin-bottom: 0; }
p.h4:first-child, p.h5:first-child { margin-top: 0; }
html * + p.h4, html * + p.h5 { margin-top: 19px; }
html p.h4 + * { margin-top: 19px; }
html p.h5 + * { margin-top: 11px; }

/* Headings moved to a different level but styled as before: keep the old spacing */
html * + h3.h4, html * + h3.h5, html * + h2.h6, html * + h2.h5, html * + h2.h3 { margin-top: 19px; }
html * + h2.h3 { margin-top: 21px; }
html h3.h4 + * { margin-top: 19px; }
html h3.h5 + *, html h2.h6 + *, html h2.h5 + * { margin-top: 11px; }
html h2.h3 + * { margin-top: 21px; }
.page-footer h2.h5 { margin-top: 0; }
.post-news-body h2.h6 { font-weight: 700; }

h2.h6 { margin-bottom: 0; }   /* theme: h6 { margin-bottom: 0 } */
/* theme rule "p + * { margin-bottom: 11px }" must not hit the grid row that follows an intro paragraph */
html p.h4 + .row, html p.h5 + .row { margin-bottom: 0; }

/* Theme rule ".divider + * { margin-top: 21px }" must still win after a divider */
html .divider + p.h4, html .divider + p.h5, html .divider + h3.h4, html .divider + h3.h5,
html .divider + h2.h3, html .divider + h2.h5, html .divider + h2.h6,
html .hr + p.h4, html .hr + p.h5 { margin-top: 21px; }

/* Visually hidden H1 (Careers) must not push the next section down ("html h1 + *" rule) */
html h1.sr-only + * { margin-top: 0; }

/* Footer tagline (was <h5>) */
p.tag-line { margin-top: 0; }

/* 9. Respect the operating system's "reduce motion" setting. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
