/*
 * 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;
}

/* Long URLs written out in running text must wrap rather than run off the edge. */
.main-content p,
.main-content li {
  overflow-wrap: break-word;
}

/* ---- 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). */
.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
   "Work with Us" button and 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;
}

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

/* Skip-link target receives programmatic focus; it is a container, so no ring is needed. */
#ajax-content-wrap:focus {
  outline: none;
}

/* ---- 1.4.3 "Menu" label text in the slide-out widget area toggle.
   axe flags <i class="label">Menu</i> as colour-contrast serious on every page because the
   theme's transparent-header rule sets a colour that can fail depending on the header
   background state. Force it to always render as dark-on-light (21:1). */
.slide-out-widget-area-toggle a.using-label i.label,
.slide-out-widget-area-toggle a.using-label .label {
  color: #000000 !important;
}

/* Elements hidden by the theme's scroll-triggered entrance animations are revealed as soon as
   keyboard focus reaches them (2.4.11 Focus Not Obscured). */
.a11y-reveal {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !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. */
.footer-container a,
.credits a,
.gt-link,
.google_map_link,
.main-content p a:not(.link_text):not(.nectar-button):not(.full-link),
.main-content li a:not(.link_text):not(.nectar-button),
.main-content td a,
a[style*="#4DB2AD" i],
a[style*="#7cc78e" i],
a[style*="#50c4c7" i] {
  color: #1b6f6b !important;
  text-decoration: underline !important;
  text-underline-offset: 2px;
}

.footer-container a:hover,
.credits a:hover,
.gt-link:hover,
.main-content p a:not(.link_text):not(.nectar-button):not(.full-link):hover,
.main-content li a:not(.link_text):not(.nectar-button):hover,
.main-content td a:hover {
  color: #0f4744 !important;
  text-decoration-thickness: 2px !important;
}

/* Blog category tag (the theme colours it per category with high specificity) */
html body .meta-category a,
html body .masonry.material .masonry-blog-item .meta-category a {
  color: #1e7a3c !important;
}

/* Green call-to-action buttons with white text ("Read More") */
.nectar-cta[data-color="accent-color"][data-using-bg="true"] .link_wrap {
  background-color: #1e7a3c !important;
}

/* Grey secondary text: open-positions taglines/locations, culture-career photo captions */
.tagline,
.location,
.imageCaption {
  color: #595959 !important;
}

/* Header "Work with Us" button: its animated gradient (shown on hover, and always on the
   Culture & Career page where it is the current item) used the light brand teal/green, about
   2:1 behind white text. Same gradient in the darker teal/green: 5.4:1 or better. */
#header-outer .menu-item-btn-style-button-border-white-animated_extra-color-gradient > a::after {
  background-image: linear-gradient(90deg, #1b6f6b, #1e7a3c, #1b6f6b) !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.4.7 / 2.4.11 The team cards' arrow link (opens the bio) renders 0px tall, so its focus
   ring was invisible. */
.team-member .nectar-cta .link_text {
  display: inline-flex !important;
  align-items: center;
  min-width: 24px;
  min-height: 24px;
}

/* ---- 2.5.7 Dragging movements: previous/next buttons for carousels (added by a11y.js). */
.a11y-carousel-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.a11y-carousel-controls button,
.a11y-bio-close {
  min-width: 44px;
  min-height: 44px;
  padding: 6px 16px;
  font: inherit;
  font-size: 16px;
  line-height: 1.2;
  color: #ffffff;
  background: #1b6f6b;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.a11y-carousel-controls button:hover,
.a11y-bio-close:hover {
  background: #0f4744;
}

/* Close button inside the full-screen team bio (added by a11y.js). */
.a11y-bio-close {
  display: inline-block;
  margin-bottom: 20px;
}

/* ---- 4.1.2 Close button inside the menu dialog (added by a11y.js). Like the skip link it is
   hidden until it receives keyboard focus; mouse users close the menu with the header toggle. */
#slide-out-widget-area .a11y-menu-close {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100001;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 18px;
  font: inherit;
  font-size: 16px;
  line-height: 1.2;
  color: #ffffff;
  background: #1b6f6b;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

#slide-out-widget-area .a11y-menu-close:not(:focus) {
  width: 1px;
  height: 1px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ---- 1.3.1 Home page: decorative text that used to be marked up as headings (h1/h3/h5/h2) to
   get the theme's heading styles. They are plain elements now so the heading outline is
   h1 > h2 > h3; these rules restore the styles the theme applied to those tags. */
#h2span,
#h4span {
  font-family: Avenir-Medium;
  letter-spacing: normal;
  margin-bottom: 8px;
}

#h2,
#h4 {
  letter-spacing: normal;
  margin-bottom: 7px;
}

.a11y-values,
.a11y-readmore {
  font-family: Avenir-Book;
  letter-spacing: 0.05em;
  margin-bottom: 7px;
}

.a11y-values {
  font-size: 20px;
  line-height: 1.2;
}

.a11y-readmore {
  font-size: 20px;
  line-height: 30px;
}

@media only screen and (max-width: 999px) {
  .a11y-readmore {
    font-size: 18px;
    line-height: 27px;
  }
}

.a11y-counter {
  display: inline-block;
  font-family: Avenir-Medium;
  font-weight: 400;
  letter-spacing: normal;
  margin-bottom: 7px;
}

/* Blog grid "Filter" toggle (was an h4; now a button, toggled by a11y.js). Copies the theme's
   .nectar-post-grid-filters h4 styles: hidden on desktop, an expandable control on mobile. */
.nectar-post-grid-filters .a11y-filter-toggle {
  display: none;
  position: relative;
  margin: 0;
  padding: 10px 40px 10px 60px;
  font-family: Avenir-Medium;
  font-size: 16px;
  font-weight: 500;
  line-height: 25.2px;
  letter-spacing: 0;
  color: inherit;
  background: none;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  cursor: pointer;
}

.nectar-post-grid-filters .a11y-filter-toggle::before,
.nectar-post-grid-filters .a11y-filter-toggle::after {
  content: '';
  position: absolute;
  background-color: #000;
  transition: transform 0.45s cubic-bezier(0.3, 0.4, 0.2, 1);
}

.nectar-post-grid-filters .a11y-filter-toggle::before {
  top: calc(50% - 6px);
  left: 45px;
  width: 2px;
  height: 12px;
}

.nectar-post-grid-filters .a11y-filter-toggle::after {
  top: calc(50% - 1px);
  left: 40px;
  width: 12px;
  height: 2px;
}

.nectar-post-grid-filters .a11y-filter-toggle[aria-expanded="true"]::before {
  transform: rotate(90deg);
}

.nectar-post-grid-filters .a11y-filter-toggle[aria-expanded="true"]::after {
  transform: scaleY(0) rotate(90deg);
}

@media only screen and (max-width: 1000px) {
  .nectar-post-grid-filters .a11y-filter-toggle {
    display: inline-block;
  }
}

/* ---- 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;
  }

  .rellax {
    transform: none !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;
}
