:root {
  --calh-blue: #0095da;
  --calh-navy: #123259;
  --calh-text: #1c244b;
  --calh-dropdown: #f3f5f8;
  --calh-dropdown-hover: #e6e6e6;
  --calh-white: #ffffff;
}

/* The replacement remains visible while the old Elementor/Total header is hidden. */
body .elementor-location-header,
body header[data-elementor-type="header"],
body #header_pop,
body #site-header,
body #top-bar-wrap {
  display: none !important;
}

body #corealm-lightweight-header {
  display: block !important;
}

/* Webinar posts use the featured image inside their page content already. */
body.single-post.post-in-category-webinars #single-blocks > .post-media,
body.single-post.post-in-category-webinars #single-blocks > .meta.clr,
body.single-post.post-in-category-upcoming-webinars #single-blocks > .post-media,
body.single-post.post-in-category-upcoming-webinars #single-blocks > .meta.clr {
  display: none !important;
}

.calh,
.calh *,
.calh *::before,
.calh *::after {
  box-sizing: border-box;
}

.calh {
  position: sticky;
  top: 0;
  z-index: 999 !important;
  width: 100%;
  color: var(--calh-text);
  background: var(--calh-white);
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.1);
  font-family: Raleway, Arial, Helvetica, sans-serif;
}

/* Keep HubSpot's native popup unchanged; only place it above the sticky menu. */
body #hs-interactives-modal-overlay {
  z-index: 10000 !important;
}

body.admin-bar .calh {
  top: 32px;
}

.calh a {
  text-decoration: none;
}

.calh .calh-menu a,
.calh .calh-menu a:hover,
.calh .calh-menu a:focus {
  text-decoration: none !important;
}

.calh-menu a.calh__submenu-label {
  cursor: default;
}

.calh button {
  font: inherit;
}

.calh__announcement {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  color: var(--calh-white);
  background: var(--calh-blue);
}

.calh__announcement-inner {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  text-align: center;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.35;
}

.calh__announcement a {
  color: var(--calh-white);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.calh__main {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 80px;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 15px 24px 15px 18px;
  background: var(--calh-white);
}

.calh__logo {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.calh__logo img {
  display: block;
  width: 197px;
  max-width: 100%;
  height: 48px;
  object-fit: contain;
}

.calh__nav {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-end;
}

.calh-menu,
.calh-menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.calh-menu {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.calh-menu li {
  position: relative;
  margin: 0;
}

.calh-menu > li > a {
  position: relative;
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 6px;
  padding: 8px 1.5px;
  color: var(--calh-text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.1;
  text-transform: capitalize;
  white-space: nowrap;
}

.calh-menu > li > a::before {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  content: "";
  background: #324a6d;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 170ms ease;
}

.calh-menu > li:hover > a::before,
.calh-menu > li:focus-within > a::before,
.calh-menu > li.current-menu-item > a::before,
.calh-menu > li.current-menu-ancestor > a::before {
  transform: scaleX(1);
}

.calh-menu li.menu-item-has-children > a::after {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: "";
  transform: translateY(-2px) rotate(45deg);
}

.calh-menu .sub-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 50;
  width: max-content;
  min-width: 285px;
  max-width: 340px;
  overflow: visible;
  visibility: hidden;
  border-radius: 2px;
  background: var(--calh-dropdown);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms ease;
}

.calh-menu .sub-menu::before {
  position: absolute;
  top: -10px;
  right: 0;
  left: 0;
  height: 10px;
  content: "";
}

.calh-menu li:hover > .sub-menu,
.calh-menu li:focus-within > .sub-menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.calh-menu .sub-menu .sub-menu {
  top: auto;
  bottom: 0;
  left: 100%;
  max-height: calc(100vh - 175px);
  overflow-y: auto;
}

.calh-menu > li:nth-last-child(-n + 4) .sub-menu .sub-menu {
  right: 100%;
  left: auto;
}

.calh-menu .sub-menu li + li {
  border-top: 1px solid rgba(18, 50, 89, 0.07);
}

.calh-menu .sub-menu a {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px;
  color: var(--calh-text);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  text-transform: capitalize;
  white-space: normal;
}

.calh-menu .sub-menu a:hover,
.calh-menu .sub-menu a:focus,
.calh-menu .sub-menu .current-menu-item > a {
  color: #000000;
  outline: none;
  background: var(--calh-dropdown-hover);
}

/*
 * The final top-level item is the existing Talk to an Expert CTA.
 * Reset both the menu item and its link because legacy theme CSS styles the
 * <li> itself, which otherwise creates a second dark box on hover.
 */
.calh .calh-menu > li:last-child,
.calh .calh-menu > li:last-child:hover,
.calh .calh-menu > li.talk-to-expert,
.calh .calh-menu > li.talk-to-expert:hover {
  display: flex !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
}

.calh .calh-menu > li:last-child > a,
.calh .calh-menu > li.talk-to-expert > a,
.calh .calh-menu > li:last-child > a.talk-to-expert {
  display: inline-flex !important;
  width: auto !important;
  min-width: 0 !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 14px !important;
  border: 0 !important;
  border-radius: 10px !important;
  color: var(--calh-white) !important;
  outline: 0 !important;
  background: var(--calh-blue) !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  transform: none !important;
  transition: background-color 160ms ease !important;
}

.calh .calh-menu > li:last-child > a::before,
.calh .calh-menu > li:last-child > a::after,
.calh .calh-menu > li.talk-to-expert > a::before,
.calh .calh-menu > li.talk-to-expert > a::after {
  display: none !important;
  content: none !important;
}

.calh .calh-menu > li:last-child > a:hover,
.calh .calh-menu > li:last-child > a:focus,
.calh .calh-menu > li.talk-to-expert > a:hover,
.calh .calh-menu > li.talk-to-expert > a:focus {
  color: var(--calh-white) !important;
  outline: 0 !important;
  background: #008fcf !important;
  box-shadow: none !important;
  transform: none !important;
}

.calh__mobile-toggle,
.calh__mobile-nav-head,
.calh__submenu-toggle,
.calh__overlay {
  display: none;
}

@media (min-width: 1241px) {
  .calh-menu > .calh__services-item > .calh__services-menu {
    max-height: var(--calh-services-max-height, calc(100vh - 175px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: rgba(0, 149, 218, 0.58) rgba(18, 50, 89, 0.04);
    scrollbar-width: thin;
  }

  .calh-menu > .calh__services-item > .calh__services-menu::-webkit-scrollbar,
  .calh__desktop-portal::-webkit-scrollbar {
    width: 6px;
  }

  .calh-menu > .calh__services-item > .calh__services-menu::-webkit-scrollbar-track,
  .calh__desktop-portal::-webkit-scrollbar-track {
    margin-block: 10px;
    border-radius: 999px;
    background: rgba(18, 50, 89, 0.04);
  }

  .calh-menu > .calh__services-item > .calh__services-menu::-webkit-scrollbar-thumb,
  .calh__desktop-portal::-webkit-scrollbar-thumb {
    min-height: 58px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    background: linear-gradient(180deg, #78c8e9 0%, #38a9db 100%);
    background-clip: padding-box;
  }

  .calh-menu > .calh__services-item > .calh__services-menu::-webkit-scrollbar-thumb:hover,
  .calh__desktop-portal::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #32afe4 0%, #008fcf 100%);
    background-clip: padding-box;
  }

  .calh .calh-menu .sub-menu.calh__desktop-portal {
    position: fixed !important;
    z-index: 100006;
    display: block !important;
    right: auto !important;
    bottom: auto !important;
    overflow-x: hidden;
    overflow-y: auto;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    overscroll-behavior: contain;
    scrollbar-color: rgba(0, 149, 218, 0.58) rgba(18, 50, 89, 0.04);
    scrollbar-width: thin;
  }
}

@media (max-width: 1240px) {
  .calh__main {
    min-height: 78px;
    padding: 15px 18px;
  }

  .calh__logo img {
    width: 190px;
    height: auto;
  }

  .calh__mobile-toggle {
    display: inline-flex;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--calh-navy);
    background: transparent;
    cursor: pointer;
  }

  .calh__mobile-toggle:hover,
  .calh__mobile-toggle:focus-visible {
    outline: 2px solid rgba(0, 149, 218, 0.3);
    background: #f3f5f8;
  }

  .calh__mobile-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
  }

  .calh__nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100002;
    display: block;
    width: min(90vw, 420px);
    max-width: 100%;
    overflow-y: auto;
    visibility: hidden;
    background: var(--calh-dropdown);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.22);
    opacity: 0;
    transform: translateX(104%);
    transition: transform 220ms ease, opacity 220ms ease, visibility 220ms ease;
  }

  .calh.is-menu-open .calh__nav {
    visibility: visible;
    opacity: 1;
    transform: translateX(0);
  }

  .calh__mobile-nav-head {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(18, 50, 89, 0.12);
    color: var(--calh-navy);
    background: var(--calh-white);
    font-size: 17px;
    font-weight: 700;
  }

  .calh__mobile-close {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--calh-navy);
    background: #f3f5f8;
    font-size: 34px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
  }

  .calh__overlay {
    position: fixed;
    inset: 0;
    z-index: 100001;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    visibility: hidden;
    background: rgba(8, 25, 44, 0.48);
    opacity: 0;
    cursor: pointer;
    transition: opacity 220ms ease, visibility 220ms ease;
  }

  .calh.is-menu-open .calh__overlay {
    display: block;
    visibility: visible;
    opacity: 1;
  }

  .calh-menu {
    display: block;
    padding: 8px 0 24px;
  }

  .calh-menu > li {
    border-bottom: 1px solid rgba(18, 50, 89, 0.09);
  }

  .calh-menu > li > a,
  .calh-menu .sub-menu a {
    min-height: 50px;
    padding: 12px 54px 12px 18px;
    color: #000000;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    white-space: normal;
  }

  .calh-menu > li > a::before,
  .calh-menu li.menu-item-has-children > a::after {
    display: none;
  }

  .calh .calh__nav .calh-menu li > ul.sub-menu,
  .calh .calh__nav .calh-menu li > ul.sub-menu ul.sub-menu,
  .calh .calh__nav .calh-menu > li:nth-last-child(-n + 4) ul.sub-menu ul.sub-menu {
    position: static;
    display: none;
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: none;
    overflow: visible;
    visibility: visible;
    border-radius: 0;
    background: rgba(18, 50, 89, 0.035);
    box-shadow: none;
    opacity: 1;
    transform: none;
    transition: none;
  }

  .calh .calh__nav .calh-menu li.is-submenu-open > ul.sub-menu {
    position: static !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }

  .calh-menu .sub-menu .sub-menu {
    background: rgba(18, 50, 89, 0.045);
  }

  .calh-menu .sub-menu a {
    padding-left: 32px;
  }

  .calh-menu .sub-menu .sub-menu a {
    padding-left: 46px;
  }

  .calh__submenu-toggle {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 2;
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 4px;
    color: var(--calh-navy);
    background: transparent;
    cursor: pointer;
  }

  .calh__submenu-toggle::before {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    content: "";
    transform: translateY(-2px) rotate(45deg);
    transition: transform 150ms ease;
  }

  .calh-menu li.is-submenu-open > .calh__submenu-toggle::before {
    transform: translateY(2px) rotate(225deg);
  }

  .calh .calh-menu > li:last-child,
  .calh .calh-menu > li.talk-to-expert {
    display: flex !important;
    justify-content: center !important;
    padding: 14px 18px 0 !important;
    border-bottom: 0 !important;
  }

  .calh .calh-menu > li:last-child > a,
  .calh .calh-menu > li.talk-to-expert > a {
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    padding: 0 15px !important;
  }

  body.calh-menu-open {
    overflow: hidden;
  }
}

@media (max-width: 782px) {
  body.admin-bar .calh {
    top: 46px;
  }
}

@media (max-width: 600px) {
  body.admin-bar .calh {
    top: 0;
  }

  .calh__announcement {
    min-height: 0;
    padding: 15px;
  }

  .calh__announcement-inner {
    flex-wrap: wrap;
    column-gap: 4px;
    font-size: 12px;
  }

  .calh__main {
    min-height: 72px;
    padding: 12px 15px;
  }

  .calh__logo img {
    width: 177px;
  }

}
