// =============================================================================
// _NAVS.SCSS
// -----------------------------------------------------------------------------
// Site styles.
// =============================================================================

// =============================================================================
// TABLE OF CONTENTS
// -----------------------------------------------------------------------------
//   01. Base Class
//   02. Tabs
//   03. Tabbable
//   04. Article Navigation
// =============================================================================

// Base Class
// =============================================================================

.x-nav {
  margin-left: 0;
  margin-bottom: $baseMargin;
  list-style: none;
}


//
// Make links block level.
//

.x-nav > li > a {
  display: block;
}

.x-nav > li > a:hover {
  text-decoration: none;
  background-color: transparent;
}


//
// Redeclare float classes because of specifity.
//

.x-nav > .right {
  float: right;
}



// Tabs
// =============================================================================

//
// Give the tabs something to sit on.
//

.x-nav-tabs {
  position: relative;
  top: 1px;
  margin-bottom: 1px;
  border: 1px solid $shortcodeBorderColor;
  border-bottom: 0;
  z-index: 10;
  // box-shadow: $shortcodeBoxShadow;
  @include cf();

  > li {
    float: left;
    border-right: 1px solid $shortcodeBorderColor;
    border-bottom: 1px solid $shortcodeBorderColor;
    text-align: center;
    @include transition(#{border-color 0.3s ease});
    @include break(cubs) {
      border-right: 0;
    }

    > a {
      padding: 0.75em;
      font-size: 14px;
      line-height: 1.3;
      color: rgba(0, 0, 0, 0.325);
      background-color: $baseModBackground;

      &:hover {
        color: $headingsColor;
        background-color: $baseModBackground;
      }
    }
  }

  &.left,
  &.right {
    width: 24%;
    max-width: 200px;
    @include break(cubs) {
      float: none;
      width: 100%;
      max-width: none;
    }

    > .x-nav-tabs-item {
      float: none;
      width: 100%;
      border-left: 0;
      border-right: 0;
      border-bottom: 1px solid $shortcodeBorderColor;
    }
  }

  &.left {
    border-right: 0;
    @include break(cubs) {
      border-right: 1px solid $shortcodeBorderColor;
    }
  }

  &.right {
    border-left: 0;
    @include break(cubs) {
      border-left: 1px solid $shortcodeBorderColor;
    }
  }
}


//
// Active state, and it's :hover to override normal :hover.
//

.x-nav-tabs > .active {
  // border-bottom-color: transparent;

  > a,
  > a:hover {
    color: $headingsColor;
    background-color: $baseModBackground;
    cursor: default;
  }
}


//
// Tab sizes.
//

.x-nav-tabs {
  &.one-up   > li { width: 100%;      &:nth-child(1n) { border-right: 0; } }
  &.two-up   > li { width: 50%;       &:nth-child(2n) { border-right: 0; } }
  &.three-up > li { width: 33.33333%; &:nth-child(3n) { border-right: 0; } }
  &.four-up  > li { width: 25%;       &:nth-child(4n) { border-right: 0; } }
  &.five-up  > li { width: 20%;       &:nth-child(5n) { border-right: 0; } }

  &.two-up,
  &.three-up,
  &.four-up,
  &.five-up {
    > li {
      @include break(cubs) {
        float: none;
        width: 100%;
      }
    }
  }
}



// Tabbable
// =============================================================================

//
// Common styles.
// 1. Prevent content from running below tabs.
//

.tabbable {
  @include cf();
}

.x-tab-content {
  overflow: auto;
  position: relative;
  margin-bottom: $baseMargin;
  border: 1px solid $shortcodeBorderColor;
  border-top: 0;
  background-color: $baseModBackground;
  z-index: 15;
  // box-shadow: $shortcodeBoxShadow;

  img,
  .x-btn {
    @include transform(#{translate3d(0, 0, 0)});
  }

  .x-tab-pane {
    padding: 4%;
  }
}

.x-nav-tabs {
  &.left,
  &.right {
    + .x-tab-content {
      border-top: 1px solid $navbarBackground;
      @include break(cubs) {
        border-top: 0;
      }
    }
  }
}


//
// Show/hide tabbable areas.
//

.x-tab-content > .x-tab-pane {
  display: none;
}

.x-tab-content > .active {
  display: block;
}



// Article Navigation
// =============================================================================

.x-nav-articles {
  float: right;
  width: 82px;
  margin-left: $layoutSpacing;
  @include cf();

  a {
    position: relative;
    @include btn_simple();
  }

  .prev {
    float: left;
    right: -1px;
  }

  .next {
    float: right;
  }
}