
.section-nav {
  background-color: var(--parent-color);
}


.section-metanav {
  @extend .section-nav;
}


.section-pagetitle {
  @extend .section-nav;
  // Höhe: Rest vom .section-hero - .navbar-main - .section-top - .section-subnav
  height: calc(33vh - 3em - 8vh - 40px);
  //
  min-height: 4em;
  max-height: 12em;

  @include media-breakpoint-up(xxl) {
    height: calc(33vh - #{$font-size-lg * 3} - 8vh - 40px);
    min-height: #{$font-size-lg * 3 + 1};
  }

  .container {
    height: 100%;
    display: flex;
    align-items: center;
  }
}


.section-subnav {
  overflow: hidden;
  position: relative;
  z-index: 1;
  @include media-breakpoint-down(sm) {
    visibility: hidden;
  }

}


.navbar-sub {
  @extend .navbar-light;
  @extend .navbar-expand;

  padding: 0;

  .navbar-nav {
    @include media-breakpoint-down(sm) {
      max-width: 100%;
      overflow: scroll;
    }
    position: relative;

    .nav-link {
      padding-left: 1.5em;
      padding-right: 1.5em;
      text-transform: uppercase;
      font-weight: $font-weight-light;
      letter-spacing: .05em;
      white-space: nowrap;
      color: rgba(255, 255, 255, .8);
      background-color: var(--parent-color-light);

      &:hover, &:focus {
        background-color: var(--parent-color-light-trans);
        color: #fff;
      }
    }

    .active .nav-link, .current .nav-link {
      background-color: var(--parent-color-light-trans);
      color: #fff;
    }

    &:before, &:after {
      position: absolute;
      content: '';
      width: 100vw;
      height: 100%;
      background-color: var(--parent-color-light);
    }

    &:before {
      right: 100%;
    }

    &:after {
      left: 100%;
    }
  }

}


.navbar-main {
  @extend .navbar-dark;
  @extend .navbar-expand;

  background-color: transparent;
  padding: 0;
  @include media-breakpoint-up(xxl) {
    font-size: $font-size-lg;
  }

  .navbar-nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .nav-item {
    flex: 0 1 16.6666%;
    overflow: hidden;
    @include media-breakpoint-up(sm) {
      flex: 1 1 auto;
    }
    text-align: center;
  }

  .nav-item > .nav-link {
    position: relative;
    overflow: hidden;
    font-weight: $font-weight-bold;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1em;
    font-size: 9px;
    padding: 3.5em .5em .5em .5em;
    @include media-breakpoint-up(sm) {
      font-size: 1em;
      padding: 1em 2.1em 1em .5em;
    }
    @include media-breakpoint-up(xl) {
      padding: 1em 3.1em 1em .7em;
    }
    @include media-breakpoint-up(xxl) {
      padding: 1em 3.5em 1em 1.5em;
    }

    &::after {
      position: absolute;
      top: 0;
      left: 50%;
      margin-left: -1.5em;
      height: 3em;
      width: 3em;
      @include media-breakpoint-up(sm) {
        left: inherit;
        margin-left: inherit;
        right: -0.5em;
        top: 0;
        height: 3em;
        width: 3em;
        display: block;
        opacity: .9;
      }
      @include media-breakpoint-up(xl) {
        right: 0;
      }
    }

    &:hover {
      &::after {
        opacity: 1;
      }
    }
  }

  @each $color, $value in $colors {
    .nav-item--#{$color} {
      @if $color == home {
        flex: 1 1 100%;

        &::after {
        }
        @media (min-width: 769px) {
          flex: 0 1 auto;
        }
        > .nav-link.nav-logo {
          display: block;
          padding: 1.5em 1.5em;
          background-color: darken($white, 0%);
          @include media-breakpoint-up(sm) {
            padding: .7em 1.5em .9em;
          }

          img {
            height: 2em;
            @include media-breakpoint-up(sm) {
              height: 1.4em;
            }
            display: inline-block;
          }

          &:hover {
            background-color: darken($white, 0%);
          }

          &::after {
            content: none;
          }
        }
      }

      > .nav-link {

        background-color: #{$value};
        color: scale_color($value, $lightness: 95%);

        display: none;
        @include media-breakpoint-up(sm) {
          display: inherit;
        }

        &::after {
          content: url(../Images/Icons/icon-#{$color}.svg);
        }

        &:hover {
          color: scale_color($value, $lightness: 100%);
          background-color: scale_color($value, $lightness: -15%);
        }

      }

      > .nav-link.nav-toggler {
        display: inherit;
        @include media-breakpoint-up(sm) {
          display: none;
        }
      }

      .sub-nav-panel {
        background-color: scale_color($value, $lightness: -15%);
      }
    }
  }
}


.sub-nav-panel {
  position: absolute;
  z-index: $zindex-dropdown;
  left: 0;
  width: 100%;
}


.sub-nav {
  list-style: none;
  padding-left: 0;

  .sub-item .nav-link {
    color: rgba(255, 255, 255, .8);
    border-bottom: 1px solid rgba(255, 255, 255, .1);
  }

}


.navbar-meta {
  @extend .navbar-dark;
  @extend .navbar-expand;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 0;

  @include media-breakpoint-up(sm) {
    height: 4.5rem;
  }

  .navbar-nav {
    .nav-link {
      color: $white;
      font-size: .8em;
      line-height: 1;
      padding: 14px 0 13px 14px;
    }
  }
}


.navbar-footer {

  @extend .navbar-light;
  @extend .navbar-expand;
  padding-left: 0;
  padding-right: 0;

  .navbar-nav .nav-link {
    padding-left: 1.5em;
    padding-right: 1.5em;
    white-space: nowrap;

    &:first-child {
      padding-left: 0;
    }
  }

  .navbar-nav {
    overflow: auto;
  }
}



.navbar-section {
  padding: 0;
  background-color: $gray-100;
  margin-top: $grid-gutter-width * 1;
  margin-bottom: $grid-gutter-width * 1.5;



  .nav-header {
    background-color: $gray-300;
    font-weight: bold;
    padding: $nav-link-padding-y $nav-link-padding-x;
    width: 100%;
    @include media-breakpoint-up(sm) {
      pointer-events: none;
    }

    .toggler {
      display: inline-block;
      float: right;
      @include media-breakpoint-up(sm) {
        display: none;
      }
    }

    .toggler.is-shown {
      display: none;
    }

    &.collapsed {
      .toggler.is-shown {
        display: inline-block;

      }

      .toggler.is-collapsed {
        display: none;
      }
    }
  }

  .nav {
    flex-direction: column;
    flex-wrap: nowrap;
    width: 100%;
  }

  .nav-item {

    + .nav-item {
      border-top: 1px solid $gray-300
    }
  }

  .nav-link {

    &.active {
      font-weight: bold;
      //background-color: $gray-200;
    }
  }

  .sidebar-wrapper & {
    position: sticky;
    top: $grid-gutter-width*1.5;
    z-index: $zindex-sticky;
  }
}


.nav-scrolltop {

  .row > & {
    @include make-col-ready;
  }

  @include make-col(12);
  justify-content: flex-end;

  //margin-top: $grid-gutter-width/2;

  &:after {
    content: '';
    height: 1px;
    width: 100%;
    background-color: $gray-200;
  }

}


.link-top {
  @include button-size($btn-padding-y-sm, $btn-padding-x-sm, .75em, $btn-line-height-sm, $btn-border-radius-sm);
  background-color: $gray-200;
  color: var(--parent-color);
  display: inline-block;
}
