/* iCapital language switcher — sits left of Contact in header */

:root {
  --icap-lang-fg: #1a2b3c;
  --icap-lang-muted: #5a6b7c;
  --icap-lang-border: rgba(26, 43, 60, 0.18);
  --icap-lang-bg: #ffffff;
  --icap-lang-hover: #f0f5f8;
  --icap-lang-accent: #0b3d5c;
  --icap-lang-shadow: 0 10px 28px rgba(15, 30, 45, 0.18);
  --icap-lang-z: 2147483000;
}

html[data-icapital-lang]:not([data-icapital-lang="en"]):not(.i18n-ready) body {
  opacity: 0;
}

html.i18n-ready body,
html[data-icapital-lang="en"] body {
  opacity: 1;
  transition: opacity 0.15s ease;
}

/* Host li inside #header-outer ul.buttons — left of Contact */
#header-outer .icap-lang-li,
#header-outer ul.buttons > li.icap-lang-li,
#header-outer .sf-menu > li.icap-lang-li {
  list-style: none !important;
  display: inline-flex !important;
  align-items: center;
  align-self: center;
  float: left;
  height: auto !important;
  min-height: 0 !important;
  line-height: 1 !important;
  margin: 0 10px 0 0 !important;
  padding: 0 !important;
  vertical-align: middle;
  position: relative;
  top: 0 !important;
  z-index: var(--icap-lang-z);
  background: transparent !important;
  border: 0 !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
  transform: none !important;
}

#header-outer .icap-lang-li:hover,
#header-outer .icap-lang-li.sfHover,
#header-outer ul.buttons > li.icap-lang-li:hover {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Kill Salient/Nectar menu underlines & accent bars on our host */
#header-outer .icap-lang-li::before,
#header-outer .icap-lang-li::after,
#header-outer .icap-lang-li *::before,
#header-outer .icap-lang-li *::after,
#header-outer ul.buttons > li.icap-lang-li::before,
#header-outer ul.buttons > li.icap-lang-li::after,
#header-outer .sf-menu > li.icap-lang-li > a::before,
#header-outer .sf-menu > li.icap-lang-li > a::after,
#header-outer[data-lhe="animated_underline"] .icap-lang-li > a::after,
#header-outer[data-lhe="animated_underline"] .icap-lang-li button::after {
  content: none !important;
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  max-height: 0 !important;
  border: 0 !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: none !important;
}

#header-outer .buttons .icap-lang-li {
  float: left;
}

.icap-lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: auto;
  z-index: var(--icap-lang-z);
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 13px;
  line-height: 1.2;
  color: var(--icap-lang-fg);
  -webkit-font-smoothing: antialiased;
  background: transparent !important;
  border: 0 !important;
}

.icap-lang * {
  box-sizing: border-box;
}

.icap-lang__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--icap-lang-border);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.96);
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
  font: inherit;
  letter-spacing: 0.01em;
  box-shadow: none !important;
  text-decoration: none !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.icap-lang__btn::before,
.icap-lang__btn::after {
  content: none !important;
  display: none !important;
}

.icap-lang__btn:hover,
.icap-lang__btn:focus-visible {
  background: #fff;
  border-color: rgba(11, 61, 92, 0.4);
  outline: none;
  color: var(--icap-lang-accent);
}

.icap-lang__btn[aria-expanded="true"] {
  border-color: var(--icap-lang-accent);
  color: var(--icap-lang-accent);
}

.icap-lang__label {
  font-size: 12px;
  font-weight: 400;
  color: var(--icap-lang-fg);
  max-width: 12em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icap-lang__chevron {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.65;
  transition: transform 0.15s ease;
}

.icap-lang__btn[aria-expanded="true"] .icap-lang__chevron {
  transform: rotate(180deg);
}

/* Menu portaled to body — fixed, never clipped by header */
.icap-lang__menu {
  position: fixed;
  top: 0;
  left: 0;
  min-width: 12.5rem;
  max-height: min(70vh, 320px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--icap-lang-bg);
  border: 1px solid var(--icap-lang-border);
  border-radius: 2px;
  box-shadow: var(--icap-lang-shadow);
  z-index: var(--icap-lang-z);
}

.icap-lang__menu[hidden] {
  display: none !important;
}

.icap-lang__option {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 14px;
  border: 0;
  background: transparent;
  color: var(--icap-lang-fg);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.icap-lang__option:hover,
.icap-lang__option:focus-visible {
  background: var(--icap-lang-hover);
  outline: none;
  color: var(--icap-lang-accent);
}

.icap-lang__option[aria-selected="true"] {
  font-weight: 600;
  color: var(--icap-lang-accent);
}

/* Transparent / dark header states */
#header-outer.dark .icap-lang__btn,
#header-outer[data-transparent-header="true"]:not(.scrolled-down):not(.small-nav) .icap-lang__btn {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

#header-outer.dark .icap-lang__label,
#header-outer[data-transparent-header="true"]:not(.scrolled-down):not(.small-nav) .icap-lang__label {
  color: inherit;
}

/* Fallback / mobile fixed host — always above sticky header */
.icap-lang--fixed {
  position: fixed !important;
  top: 14px;
  right: 14px;
  left: auto;
  bottom: auto;
  z-index: var(--icap-lang-z) !important;
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.icap-lang--fixed .icap-lang__btn {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 10px rgba(15, 30, 45, 0.14);
  color: var(--icap-lang-fg);
}

.icap-lang--fixed .icap-lang__label,
.icap-lang--fixed .icap-lang__code {
  color: inherit;
}

@media (max-width: 999px) {
  /* Hide empty account icon that sits under the language switcher */
  #header-outer .mobile-user-account,
  #top .mobile-user-account {
    display: none !important;
  }

  /* Mobile: sit left of hamburger, never clipped by header */
  .icap-lang--fixed.icap-lang--mobile,
  .icap-lang--mobile {
    position: fixed !important;
    top: 8px !important;
    right: 54px !important;
    z-index: var(--icap-lang-z) !important;
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  #header-outer .icap-lang-li {
    display: none !important; /* desktop host hidden while mobile fixed is used */
  }

  .icap-lang--mobile .icap-lang__btn,
  .icap-lang--fixed.icap-lang--mobile .icap-lang__btn {
    padding: 6px 4px;
    min-height: 36px;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .icap-lang--mobile .icap-lang__btn:hover,
  .icap-lang--mobile .icap-lang__btn:focus-visible,
  .icap-lang--mobile .icap-lang__btn[aria-expanded="true"] {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .icap-lang--mobile .icap-lang__label {
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .icap-lang--fixed.icap-lang--mobile,
  .icap-lang--mobile {
    top: 7px !important;
    right: 48px !important;
  }

  .icap-lang--mobile .icap-lang__label {
    font-size: 12px;
  }
}

/* HubSpot image CTAs → real text buttons (translatable) */
img.icap-hs-cta-img-hidden,
.hs-cta-node img.icap-hs-cta-img-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;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.hs-cta-node a,
span.hs-cta-node > a {
  position: relative;
  display: inline-block;
  text-decoration: none !important;
}

.icap-hs-cta {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 4px;
  background: #a9c9d8;
  color: #111 !important;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: none;
  pointer-events: none; /* clicks go to parent <a> */
}

.icap-hs-cta:hover,
a:hover > .icap-hs-cta {
  background: #98bcd0;
}

/* Revolution slider layers: keep CTA readable on dark slides */
rs-layer .icap-hs-cta,
.rev-slidebg ~ * .icap-hs-cta,
.hs-cta-wrapper .icap-hs-cta {
  background: #a9c9d8;
}
