/* Carbon styling modifications */
.bx--header__nav::before {
  // This is hacky and weird, but Carbon INSISTS on creating a
  // vertical bar before the start of its headers, and will only
  // concede to let it fade if we override literally all the
  // style settings that make it display
  display: none !important;
  background-color: none !important;
  width: 0rem !important;
  height: 0rem !important;
  content: none !important;
}

.bx--text-truncate--end {
  font-weight: bold !important;
}

.bx--header__menu-title {
  font-weight: bold !important;
  padding: 0 0.5rem !important;
}

.bx--header__menu-item {
  color: rgb(113, 118, 122) !important;

  &:focus {
    color: rgb(113, 118, 122) !important;
  }

  &:hover {
    background-color: midnightblue !important;
    color: white !important;
  }
}

.bx--header__menu {
  background-color: midnightblue !important;
  color: white !important;
  margin-left: .125rem;

  .bx--text-truncate--end {
    font-weight: normal !important;
    color: white !important;
    padding-top: .85rem !important;
  }
}

.bx--header__menu-arrow {
  vertical-align: top;
}

.bx--header__menu-bar {
  li {
    height: 3.5rem;
  }
}

.modal-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  flex-wrap: nowrap;
}

.active-page::after {
  background-color: #61366f;
  border-radius: 0;
  content: "";
  display: block;
  position: absolute;
  height: .25rem;
  left: 1rem;
  right: 1rem;
  bottom: 0;
  top: 3rem;
}

/* USWDS Extensions */
.usa-header {
  &--extended {
    .usa-logo {
      @include at-media($theme-navigation-width) {
        margin: units(1.5) 0 units(1);
      }
    }

    .usa-nav {
      @include at-media($theme-navigation-width) {
        border-bottom: units(1px) solid color('base-lighter');
      }
    }
  }
  a:focus .usa-logo__text {
    @extend [href], :focus;
  }

  &--oec-default {
    .primary-title {
      margin: 0;
      font-size: 0.5em;
      font-weight: normal;

      &--only {
        font-size: inherit;
      }
    }

    .secondary-title {
      margin: 0;
      font-size: 0.6em;
    }
  }

  .with-dropdown,
  .with-dropdown:hover {
    text-decoration: none !important;

    .display-inline-block {
      > a {
        padding-bottom: 0.5rem;
      }
    }
  }

  .dropdown {
    position: absolute;
    z-index: 1;
    width: max-content;

    ul {
      list-style-type: none;
    }
  }

  .option {
    display: block;

    width: 100%;
    padding: 1em;
    height: fit-content;

    border: solid color($theme-color-base) 1px;
    background-color: #ffffff;

    text-decoration: none;
    color: color('ink');

    &:not(:last-child) {
      border-bottom: none;
    }
  }

  .option:hover {
    background-color: #e7e7e7;
  }
}

.usa-nav__secondary {
  &--extended {
    bottom: calc(100% - (-4ch / 2));
  }
}

.usa-nav__secondary-links {
  button {
    @extend a;
    border: none;
    padding-left: 0;
    padding-right: 0;
  }
}

.usa-nav__secondary-links .usa-nav__secondary-item + .usa-nav__secondary-item {
  &::before {
    color: #71767a;
  }
}

.usa-logo__text {
  $logo-size-mobile: 4;
  $logo-size-desktop: 9;

  &::before {
    @include u-square($logo-size-mobile);
    content: '';
    background-image: url('../../assets/images/logo.svg');
    background-repeat: no-repeat;
    background-size: 100% auto;
    display: inline-block;
    margin-left: units(-2px);
    margin-right: units(1);
    position: relative;
    top: units(-1px);
    vertical-align: middle;

    @include at-media('desktop') {
      @include u-square($logo-size-desktop);
      margin-right: units(2);
    }
  }
}

/* OEC Specific Rules */
.oec-logged-in-user {
  display: block;

  width: 100%;
  padding-top: 1.5rem;

  font-weight: 700;

  @include at-media($theme-navigation-width) {
    float: right;
    height: units(5);
    text-align: right;
    padding-top: 0.35rem;
  }

  a {
    color: color('base-dark');
    text-decoration: none;

    &:hover {
      color: color('primary');
      text-decoration: underline;
    }
  }
}
