header.global {
  border-bottom: 1px solid $m-gray;
  @include box-shadow(0 1px 5px 0 rgba(0,0,0, 0.1));
  background: $white;
  height: 76px;
  position: relative;
  width: 100%;
  z-index: 10;

  nav {
    @include clearfix;
    height: 40px;
    margin: 0 auto;
    padding: 18px 10px 0px;
    max-width: grid-width(12);
    min-width: 760px;
    width: flex-grid(12);
  }

  h1.logo {
    float: left;
    margin: -2px 39px 0px 0px;
    position: relative;

    a {
      display: block;
    }
  }

  ol {
    &.left {
      float: left;
    }

    &.guest {
      float: right;
    }

    > li {
      @include inline-block;
      margin-right: 20px;
      position: relative;
      vertical-align: middle;

      &:last-child {
        margin-right: 0px;
      }

      a {
        letter-spacing: 1px;
        vertical-align: middle;
      }
    }

    li.secondary {
      > a {
        color: $link-color;
        display: block;
        font-family: $sans-serif;
        @include inline-block;
        margin: 0px 30px 0px 0px;
        text-decoration: none;
        text-transform: uppercase;
        text-shadow: 0 1px rgba(255,255,255, 0.6);

        &:last-child {
          margin-right: 0px;
        }

        &:hover {
          color: $base-font-color;
        }
      }
    }

    li.primary {
      margin-right: 5px;

      > a {
        @include background-image($button-bg-image);
        background-color: $button-bg-color;
        border: 1px solid $border-color-2;
        @include border-radius(3px);
        @include box-sizing(border-box);
        @include box-shadow(0 1px 0 0 rgba(255,255,255, 0.6));
        color: $base-font-color;
        display: inline-block;
        font-family: $sans-serif;
        @include inline-block;
        line-height: 1em;
        margin: 1px 5px;
        padding: 10px 12px;
        text-decoration: none;
        text-transform: uppercase;
        text-shadow: 0 1px rgba(255,255,255, 0.6);
        vertical-align: middle;

        &:last-child {
          margin-right: 0px;
        }

        &:hover, &.active {
          background: $button-bg-hover-color;
        }
      }
    }

    &.user {
      float: right;
      margin-top: 4px;

      > li.primary {
        display: block;
        float: left;
        margin: 0px;

        > a {
          margin: 0px;
          @include border-right-radius(0px);
        }

        &:last-child {
          > a {
            @include border-radius(0 4px 4px 0);
            border-left: none;
            padding: 5px 8px 7px 8px;
          }
        }
      }

      a.user-link {
        padding: 6px 12px 8px 35px;
        position: relative;
        text-transform: none;
        font-size: 14px;
        font-weight: bold;
        letter-spacing: 0;

        .avatar {
          @include background-image(url('../images/small-header-home-icon.png'));
          background-repeat: no-repeat;
          height: 26px;
          @include inline-block;
          left: 8px;
          opacity: 0.5;
          overflow: hidden;
          position: absolute;
          top: 4px;
          @include transition(all, 0.15s, linear);
          width: 26px;
        }

        &:hover {
          .avatar {
            opacity: 0.8;
          }
        }
      }

      ul.dropdown-menu {
        background: $border-color-4;
        @include border-radius(4px);
        @include box-shadow(0 2px 24px 0 rgba(0,0,0, 0.3));
        border: 1px solid $border-color-3;
        display: none;
        padding: 5px 10px;
        position: absolute;
        right: 0px;
        top: 34px;
        width: 170px;
        z-index: 3;

        &.expanded {
          display: block;
        }

        &::before {
          background: transparent;
          border: {
            top: 6px solid $border-color-4;
            right: 6px solid $border-color-4;
            bottom: 6px solid transparent;
            left: 6px solid transparent;
          }
          @include box-shadow(1px 0 0 0 $border-color-3, 0 -1px 0 0 $border-color-3);
          content: "";
          display: block;
          height: 0px;
          position: absolute;
          @include transform(rotate(-45deg));
          right: 12px;
          top: -6px;
          width: 0px;
        }

        li {
          display: block;
          border-top: 1px dotted $border-color-2;
          @include box-shadow(inset 0 1px 0 0 rgba(255,255,255, 0.05));

          &:first-child {
            border: none;
            @include box-shadow(none);
          }

          > a {
            border: 1px solid transparent;
            @include border-radius(3px);
            @include box-sizing(border-box);
            color: $link-color;
            cursor: pointer;
            display: block;
            margin: 5px 0px;
            overflow: hidden;
            padding: 3px 5px 4px;
            text-overflow: ellipsis;
            @include transition(padding, 0.15s, linear);
            white-space: nowrap;
            width: 100%;

            &:hover {
              color: $base-font-color;
              text-decoration: none;
            }
          }
        }
      }
    }
  }

  .nav-global {
    margin-top: ($baseline/2);
    list-style: none;

    li {
      display: inline-block;
      margin: 0 $baseline+1 0 0;
      font-size: em(14);
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0 !important;

      &:last-child {
        margin-right: 0;
      }

      a {
        display:block;
        padding: ($baseline/4);
        color: $m-gray-d1;
        font-weight: 600;

        &:hover, &:active {
          text-decoration: none;
          color: $m-blue-s1;
        }
      }

      &.active {

        a {
          text-decoration: none;
          color: $m-blue-s1;
        }
      }
    }

    // logged in
    &.authenticated {

    }
  }

  .nav-courseware {
    float: right;
    margin-top: ($baseline/4);
    list-style: none;

    li {
      display: inline-block;

      a {
        @include border-radius(0);
        @include linear-gradient($m-blue-s1 5%, $m-blue-d1 95%);
        display: inline-block;
        padding: $baseline/2 $baseline*2.5;
        text-transform: lowercase;
        color: $white;
        letter-spacing: 0.1rem;
        font-weight: 300;
        cursor: pointer;
        text-align: center;
        border: none !important;
        text-shadow: none;
        letter-spacing: 0.1rem;
        font-size: 14px;
        box-shadow: none !important;

        &:hover {
          text-decoration: none;
        }
      }
    }

    // logged in
    &.authenticated {

    }
  }
}

// marketing site design syncing
.view-register, .view-login {

  header.global nav {
    width: 960px;
  }
}

// page-based nav states
.view-howitworks .nav-global-01, 
.view-courses .nav-global-02, 
.view-schools .nav-global-03, 
.view-register .nav-global-04 {

  a {
    text-decoration: none;
    color: $m-blue-s1 !important;
  } 
}
