// ┌────────────────┐
// │ Calcite Navbar │
// └────────────────┘
//
// Styling for brand, title, subtitle and dropdown menu

.calcite-navbar {
  height: $navbar_height;
  border: 0;
  // Flex
  display: -ms-flexbox;
  display: -moz-flex;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-flow: row nowrap;
  flex-flow: row nowrap;
  justify-content: flex-start;
  align-content: stretch;
  direction: ltr;

  // Header

  .navbar-header {
    order: 0;
    flex-shrink: 0;
  }

  // Brand

  .navbar-brand {
    padding: $navbar_brand_padding;
    font-size: $navbar_brand_font_size;
    cursor: pointer;
  }

  .navbar-brand img {
    width: 40px;
  }

  // Nav

  .navbar-nav {
    display: flex;
    order: 2;
    flex-shrink: 0;
    margin: 0;
  }

  // Nav items

  .navbar-nav > li > a {
    padding: $navbar_nav_li_a_padding;
    font-size: $navbar_nav_font_size;
  }

}

// Title

.calcite-title {
  order: 1;
  flex-grow: 1;
  margin: 0;
  line-height: 1.5; 
  display: flex;
  align-items: center;
}

.calcite-title-main {
  flex-shrink: 0;
  margin: $navbar_title_margin;
  padding: $navbar_title_padding;
  overflow: hidden;  
  font-size: $navbar_title_font_size;
  font-weight: $navbar_title_font_weight;
}

.calcite-title-divider {
  position: relative;
  top: 0;
  left: 0;
  height: $navbar_height * 2;
  margin: $navbar_title_divider_margin;
  transform: scale(.7, .3);
  transform-origin: left;
  border-left: 1px solid;
}

.calcite-title-sub {
  display: inline-block;
  margin: $navbar_subtitle_margin;
  padding: $navbar_subtitle_padding;
  overflow: hidden;
  font-size: $navbar_subtitle_font_size;
  font-weight: $navbar_subtitle_font_weight;
}

.calcite-overflow-hidden {
  white-space: nowrap;
  overflow: hidden;
}

// Nav

.calcite-nav {
}

// Search widget

.calcite-navbar-search {
  margin: 9px 9px;
}

// Nav menu animated

.calcite-dropdown-toggle {
  display: block;
  width: $navbar_dropdown_toggle_icon_bar_width;
  height: $navbar_dropdown_toggle_icon_bar_height;
  position: relative;
  margin: 0;
  -webkit-transform: rotate(0deg);
  -moz-transform: rotate(0deg);
  -o-transform: rotate(0deg);
  transform: rotate(0deg);
  -webkit-transition: .15s ease-in-out;
  -moz-transition: .15s ease-in-out;
  -o-transition: .15s ease-in-out;
  transition: .15s ease-in-out;
  cursor: pointer;
}

.calcite-dropdown-toggle span {
  display: block;
  position: absolute;
  height: 2px;
  width: 100%;
  margin: 0;
  padding: 0;
  background: #fff;  // default overidden by theme
  border-radius: 5px;
  opacity: 1;
  left: 0;
  -webkit-transform: rotate(0deg);
  -moz-transform: rotate(0deg);
  -o-transform: rotate(0deg);
  transform: rotate(0deg);
  -webkit-transition: .1s ease-in-out;
  -moz-transition: .1s ease-in-out;
  -o-transition: .1s ease-in-out;
  transition: .1s ease-in-out;
}

/* closed */

.calcite-dropdown-toggle span:nth-child(2) {
  top: 0px;
}

.calcite-dropdown-toggle span:nth-child(3),
.calcite-dropdown-toggle span:nth-child(4) {
  top: 6px;
}

.calcite-dropdown-toggle span:nth-child(5) {
  top: 12px;
}

/* open */

.calcite-dropdown-toggle.open span:nth-child(2) {
  top: 6px;
  width: 0%;
  left: 50%;
}

.calcite-dropdown-toggle.open span:nth-child(3) {
  -webkit-transform: rotate(45deg);
  -moz-transform: rotate(45deg);
  -o-transform: rotate(45deg);
  transform: rotate(45deg);
}

.calcite-dropdown-toggle.open span:nth-child(4) {
  -webkit-transform: rotate(-45deg);
  -moz-transform: rotate(-45deg);
  -o-transform: rotate(-45deg);
  transform: rotate(-45deg);
}

.calcite-dropdown-toggle.open span:nth-child(5) {
  top: 6px;
  width: 0%;
  left: 50%;
}

// Navbar - Hide

.calcite-nav-hidden {
  .calcite-navbar {
    background-color: transparent !important;
    right: auto;
    .calcite-title,
    .calcite-nav {
      display: none;
    }
  }
}

// Mobile screens

@media (max-width: $navbar_breakpoint_width_mobile) {
  .calcite-title-main {
    font-size: $navbar_title_font_size_mobile;
    flex-shrink: 1;
  }
  .calcite-title-sub {
    font-size: $navbar_subtitle_font_size_mobile;
  }
}