// Nav tabs
//
// Needs a description.
//
// Weight: 2
//
// Style guide: molecules.navigation.nav-tabs


@import "settings";

// Give the tabs something to sit on
.nav-tabs {

  > li {
    float: left;
    // Make the list-items overlay the bottom border
    margin-bottom: -1px;

    // Actual tabs (as links)
    > a {
      margin-right: 2px;
      line-height: $line-height-base;
      border: 1px solid transparent;
      transition: all 0.3s;
      font-weight: 500;
      position: relative;
      user-select: none;
      -webkit-touch-callout: none;
      -webkit-tap-highlight-color: rgba(0, 0, 0, 0);

      &:hover,
      &:focus {
        outline: none;
      }

      @include for-tablet-portrait-up {
        border-bottom: 2px solid transparent;
        margin-right: 5px;
      }

    }

    // Active state, and its :hover to override normal :hover
    &.active > a {
      &,
      &:hover,
      &:focus {
        border-bottom-color: transparent;
        cursor: default;
      }
    }
  }

  @include for-tablet-portrait-up {
    border-bottom-width: 1px;
    border-bottom-style: solid;
  }

  .card-underline .card-head & {
    border-bottom: none;
  }

  &.card-head {
    padding: 0;
    overflow: hidden;
  }

}

// Tabbable tabs
// -------------------------

// Hide tabbable panes to start, show them when `.active`
.tab-content {
  > .tab-pane {
    display: none;
  }
  > .active {
    display: block;
  }
}

.tabs-center {
  text-align: center;

  @include for-tablet-portrait-up {

    li {
      float: none;
      display: inline-block;
    }

  }

  .card-underline .card-head & {
    margin-top: -1px;
  }

}

@include for-tablet-portrait-up {
  .nav-tabs--xl {
    font-size: 1.125em;

    a {
      padding: 1em 1.5em;
    }
  }
}


// Tabs Left, Right
// -------------------------

.tabs-right > .nav-tabs,
.tabs-left > .nav-tabs {
	border: none;
}


// Tab left/right
.tabs-left,
.tabs-right {
  display: flex;

  .nav-tabs {
    flex: 1 1 auto;
  }

  > .tab-content {
    flex: 1 1 75%;
    overflow: auto;
  }

}

.tabs-left > .nav-tabs,
.tabs-right > .nav-tabs {
	padding-left: 0;
	padding-right: 0;
}

.tabs-left > .nav-tabs > li,
.tabs-right > .nav-tabs > li {
	float: none;
}

.tabs-left > .nav-tabs > li > a,
.tabs-right > .nav-tabs > li > a {
	min-width: 74px;
	margin-right: 0;
  line-height: 1.5;
  padding-top: 10px;
  padding-bottom: 10px;
}

// Tab left only
.tabs-left > .nav-tabs {
	float: left;
  border-right: 1px solid $gray-lighter;
  overflow: hidden;
}

.tabs-left > .nav-tabs > li > a {
	border-bottom: none;
	border-right: 2px solid transparent;
}

.tabs-left > .nav-tabs > li > a:hover,
.tabs-left > .nav-tabs > li > a:focus {
	border-color: transparent;
	border-right-color: rgba(0,0,0,0.1);
}

.tabs-left > .nav-tabs .active > a {
	&, &:hover, &:focus {
		border-bottom: none;
	}
}

// Tab right only
.tabs-right > .nav-tabs {
	float: right;
	border-left: 1px solid #ddd;
  border-radius: 0 10px 10px 0;
}

.tabs-right > .nav-tabs > li > a {
	border-bottom: none;
	border-left: 2px solid transparent;
}

.tabs-right > .nav-tabs > li > a:hover,
.tabs-right > .nav-tabs > li > a:focus {
	border-color: transparent;
	border-left-color: rgba(0,0,0,0.1);
}

.tabs-right > .nav-tabs .active > a {
	&, &:hover, &:focus {
		border-bottom: none;
	}
}

.vertical-tabs-list {
  background-color: $gray-lightest;
}
