/* Load after header.css, only when the project preview header is rendered. */
.l-header.os-has-project-preview .l-spmenu.open {
  overflow-y: auto;
  overscroll-behavior-y: contain;
}

.l-header .os-project-nav {
  position: relative;
}

.l-header .os-project-nav > .os-project-nav__trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  appearance: none;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: inherit;
  white-space: nowrap;
  cursor: pointer;
}

.l-header .os-project-nav__trigger::after {
  content: "";
  display: block;
  width: 0.375rem;
  height: 0.375rem;
  margin-top: -0.2rem;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
}

.l-header .os-project-nav__trigger[aria-expanded="true"]::after {
  margin-top: 0.2rem;
  transform: rotate(225deg);
}

.l-header .os-project-nav > .os-project-nav__menu {
  position: absolute;
  inset: calc(100% + 0.375rem) 0 auto auto;
  z-index: 30;
  display: block;
  width: 15.5rem;
  max-width: calc(100vw - 2rem);
  height: auto;
  margin: 0;
  padding: 0.375rem;
  border: 1px solid #e5e5ed;
  border-radius: 4px;
  background: #fff;
  color: #120d47;
  box-shadow: 0 8px 24px rgb(18 13 71 / 8%);
  list-style: none;
  text-align: left;
}

.l-header .os-project-nav > .os-project-nav__menu[hidden] {
  display: none !important;
}

/* Keep the pointer inside the menu while crossing its visual gap. */
.l-header .header-nav .os-project-nav > .os-project-nav__menu::before {
  content: "";
  position: absolute;
  inset: -0.375rem 0 auto;
  height: 0.375rem;
}

.l-header .os-project-nav > .os-project-nav__menu > li,
.l-header .l-spmenu .l-spmenuNav_item .l-spmenuNav_list .os-project-nav > .os-project-nav__menu > li {
  position: static;
  display: block;
  flex: none;
  float: none;
  width: auto;
  height: auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  list-style: none;
}

.l-header .os-project-nav > .os-project-nav__menu > li > a,
.l-header .l-spmenu .l-spmenuNav_item .l-spmenuNav_list .os-project-nav > .os-project-nav__menu > li > a {
  display: block;
  flex: none;
  width: 100%;
  height: auto;
  min-height: 44px;
  margin: 0;
  padding: 0.75rem 0.875rem;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  color: #120d47;
  font-family: inherit;
  font-size: 14px;
  font-weight: inherit;
  line-height: 1.5;
  letter-spacing: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.l-header .os-project-nav > .os-project-nav__menu > li > a:hover {
  background: #f5f6fb;
}

/* Keep the added menu and existing desktop labels on one line near the drawer breakpoint. */
@media (min-width: 961px) and (max-width: 1199px) {
  .l-header.os-has-project-preview .l-header__inner #header-logo {
    width: 210px;
    max-width: 210px;
    flex-shrink: 0;
  }
  .l-header.os-has-project-preview .header-nav .nav-list {
    gap: 18px;
  }
  .l-header.os-has-project-preview .header-nav .nav-list > .nav-list__Item {
    flex-shrink: 0;
  }
  .l-header.os-has-project-preview .header-nav .nav-list > .nav-list__Item > a {
    white-space: nowrap;
  }
}

.l-header .os-project-nav__trigger:focus-visible,
.l-header .os-project-nav > .os-project-nav__menu > li > a:focus-visible {
  outline: 2px solid #1978a0;
  outline-offset: 3px;
}

/* The existing drawer decides its own breakpoint; keep this submenu in flow. */
.l-header .l-spmenu .l-spmenuNav_item .l-spmenuNav_list > li.os-project-nav {
  display: block;
}

.l-header .l-spmenu .l-spmenuNav_item .l-spmenuNav_list .os-project-nav > .os-project-nav__trigger {
  width: 100%;
  font-size: 14px;
  text-align: center;
}

.l-header .l-spmenu .l-spmenuNav_item .l-spmenuNav_list .os-project-nav > .os-project-nav__menu {
  position: static;
  inset: auto;
  width: 100%;
  max-width: none;
  margin: 0.375rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.l-header .l-spmenu .l-spmenuNav_item .l-spmenuNav_list .os-project-nav > .os-project-nav__menu > li > a {
  padding: 0.75rem 0;
}
