/*
 * Accessibility fixes shared by every page (SEBI digital accessibility audit, report BBF130).
 * Loaded after all theme styles so these rules win. Paired with a11y/a11y.js.
 */

/* Visually hidden but still read by screen readers. */
.a11y-sr-only {
  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;
}

/* ---- 1.4.10 Reflow: decorative parallax images and the theme's -15px column gutters must not
   create a horizontal scrollbar. `clip` (unlike `hidden`) does not create a scroll container. */
body,
#ajax-content-wrap {
  overflow-x: clip;
}

/* Data tables scroll inside their own focusable region (wrapper added by a11y.js) instead of
   widening the page. */
.a11y-table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

/* ---- 2.4.1 / 1.4.3 Skip link: the theme shows it in brand green (about 2:1 on its grey
   background) when focused. Force it into the viewport top-left corner with an opaque
   white background and dark accessible text (#000, contrast 21:1 on #fff). The colour also
   applies while it is hidden, because contrast checkers measure it in that state too. */
.nectar-skip-to-content {
  color: #000000 !important;
}

.nectar-skip-to-content:focus {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 999999 !important;
  display: block !important;
  width: auto !important;
  height: auto !important;
  clip: auto !important;
  clip-path: none !important;
  overflow: visible !important;
  padding: 12px 20px !important;
  color: #000000 !important;
  background: #ffffff !important;
  border: 3px solid #1b6f6b !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

/* ---- 2.4.7 / 1.4.13 Visible focus on every interactive element, including the header
   menu items whose theme styles remove the outline. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
video:focus-visible,
video:focus-within,
iframe.a11y-frame-focus,
[tabindex]:focus-visible {
  outline: 3px solid #1b6f6b !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 2px #ffffff !important;
}

.a11y-ticker-toggle:focus-visible {
  outline-color: #ffffff !important;
  box-shadow: 0 0 0 5px #1b6f6b !important;
}

/* Skip-link target (main heading, set by a11y.js): show where focus landed. */
.a11y-skip-target:focus {
  outline: 3px solid #1b6f6b !important;
  outline-offset: 4px !important;
}

/* ---- 1.4.3 Text contrast / 1.4.1 Use of colour.
   Brand teal (#4db2ad, #50c4c7) and green (#7cc78e) are below 4.5:1 as text on white, so text
   links use #1b6f6b (5.9:1 on white, 5.3:1 on #f2f2f2) and are underlined so they are not
   identified by colour alone. */
.credits a,
.gt-link {
  color: #1b6f6b !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

.credits a:hover,
.gt-link:hover {
  color: #0f4744 !important;
  text-decoration-thickness: 2px !important;
}

/* Form placeholders (e.g. open-positions Keywords / Location): the browser default #757575 is
   4.1:1 on the theme's #f3f2f2 field background; #595959 is 6.3:1. */
input::placeholder,
textarea::placeholder {
  color: #595959 !important;
  opacity: 1 !important;
}

/* ---- 2.2.2 Pause, Stop, Hide: control for the auto-scrolling TradingView ticker
   (button inserted by a11y.js). */
.a11y-ticker-toggle {
  display: inline-block;
  margin: 0 0 8px;
  padding: 6px 14px;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  color: #ffffff;
  background: #1b6f6b;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.a11y-ticker-toggle:hover {
  background: #0f4744;
}

.tradingview-widget-container.a11y-hidden {
  display: none !important;
}

/* ---- 2.2.2 / 2.3.3 Respect the operating-system "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;
  }
}

/* ---- 1.2.1 Transcripts shown under videos */
.a11y-transcript {
  margin-top: 12px;
  text-align: left;
}

.a11y-transcript summary {
  cursor: pointer;
  font-weight: 600;
  color: #1b6f6b;
  text-decoration: underline;
}

.a11y-transcript[open] summary {
  margin-bottom: 8px;
}

/* ---- Site search panel (opened by the Search button in partials/header.html; built by
   initSiteSearch in a11y.js). The button itself is styled with the header in shared.css. */
.a11y-search-toggle:focus-visible {
  outline: 3px solid #2A615E;
  outline-offset: 2px;
}

.a11y-search-panel {
  position: fixed;
  top: 90px;
  right: 16px;
  z-index: 100002;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding: 20px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  text-align: left;
}

.a11y-search-panel[hidden] {
  display: none;
}

.a11y-search-panel label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #000;
}

#a11y-search-panel input[type="search"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  color: #000;
  background: #fff;
  border: 2px solid #2A615E !important;
  border-radius: 4px;
}

#a11y-search-panel input[type="search"]:focus {
  outline: 3px solid #2A615E;
  outline-offset: 2px;
}

.a11y-search-status {
  margin: 8px 0 0;
  padding: 0;
  color: #333;
}

.a11y-search-results {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.a11y-search-results li {
  margin: 0;
  padding: 0;
  list-style: none;
}

.a11y-search-results a {
  display: block;
  padding: 8px 4px;
  color: #2A615E !important;
  text-decoration: underline;
}

.a11y-search-results a:hover,
.a11y-search-results a:focus {
  background: #eef5f4;
}
