#site-header {
  background-color: var(--site-chrome-bgColor);
  color: var(--site-chrome-fgColor);
  font-family: var(--site-ui-fontFamily);
  position: sticky;
  top: 0;
  z-index: 1000;

  @media (min-width: 1200px) {
    box-shadow: 0 2px 4px rgba(0, 0, 0, .05);
    border-bottom: none;
  }

  .navbar {
    .navbar-brand {
      margin-right: auto;
    }

    .nav-link {
      color: var(--site-base-fgColor-alt);
      padding: 1.25rem 0;
      position: relative;
      text-decoration: none;

      @media (min-width: 768px) {
        padding: 0 1rem;
      }

      &.active {
        color: var(--site-base-fgColor);
        font-weight: 500;

        @media (min-width: 768px) {
          &:after {
            $nav-active-marker-thickness: 3px;
            background-color: var(--site-altLink-fgColor);
            content: '';
            display: block;
            height: $nav-active-marker-thickness;
            left: 0;
            position: absolute;
            top: calc(50% + (var(--site-header-height) / 2) - #{$nav-active-marker-thickness});
            width: 100%;
          }
        }
      }
    }
  }

  #mainnav {
    display: flex;
    align-items: center;
    min-height: var(--site-header-height);

    ul.navbar {
      padding: 0;
      margin: 0;
      list-style: none;

      display: none;
      flex-grow: 1;
      flex-wrap: wrap;
      justify-content: right;
      align-items: center;

      @media (min-width: 1024px) {
        display: flex;
      }

      > li {
        padding: 0 0.75rem;

        > a {
          color: var(--site-chrome-fgColor);
          display: inline-block;
          padding: 0 6px;
          font-size: 1rem;
          font-weight: 500;
          font-family: var(--site-ui-fontFamily);

          &:hover {
            color: var(--site-altLink-fgColor);
          }

          &:active {
            color: var(--site-altLink-fgColor-active);
          }
        }
      }
    }

    .navbar-contents {
      margin-left: auto;
      margin-right: 0.75rem;
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: .5rem;

      .icon-button {
        > .material-symbols {
          font-size: 1.625rem;
        }
      }

      .site-header-search {
        display: none;
        position: relative;
        align-items: center;
        vertical-align: middle;
        margin-left: 1rem;

        @media (min-width: 768px) {
          display: flex;
        }

        &::before {
          content: 'search';
          color: var(--site-base-fgColor-alt);
          font: 26px / 1 var(--site-icon-fontFamily);
          pointer-events: none;
          position: absolute;
          left: .75rem;
        }

        &:hover::before {
          color: var(--site-base-fgColor);
        }
      }

      .site-header-searchfield {
        border: 0;
        font-size: 1rem;
        height: 2.25rem;
        transition: width .35s ease-in-out;
        width: 24px;
        cursor: pointer;
        border-radius: 24px;
        padding: 0.25rem 0.5rem 0.25rem 2.5rem;
        background: none;
        color: var(--site-chrome-fgColor);

        &:focus {
          width: 14rem;
          cursor: auto;
        }

        &::-webkit-search-cancel-button {
          display: none;
        }
      }

      #fallback-search-button {
        display: none;

        @media (min-width: 320px) {
          display: flex;
        }

        @media (min-width: 768px) {
          display: none;
        }
      }
    }

    .brand {
      display: flex;
      width: 5.5rem;
      overflow: hidden;
      margin-left: 1.25rem;
      align-items: center;
    }
  }

  #menu-toggle {
    @media (min-width: 1024px) {
      display: none;
    }

    // Toggle between menu and close buttons if sidenav is open or not.
    span.material-symbols {
      &:first-child {
        display: inline;
      }

      &:last-child {
        display: none;
      }

      @at-root body.open_menu & {
        &:first-child {
          display: none;
        }

        &:last-child {
          display: inline;
        }
      }
    }
  }
}
