@import '../../_global/styles/mixins';
@import '../../_global/styles/vars';

.page-header.dummy nav {
  z-index: 0;
  visibility: visible;
  transform: translate3d(-100%, 0, 0);
  --header-height: 0px;
}

.page-header nav {
  position: fixed;
  display: flex;
  flex-direction: column;
  top: var(--header-height);
  left: 100%;
  width: 420px;
  max-width: 100%;
  transform: translate3d(1px, 0, 0);
  height: calc(var(--viewport-height, 1vh) * 100 - var(--header-height));
  background-color: white;
  transition: transform 0.25s $easeOutQuad, visibility 0s linear 0.25s;
  box-shadow: -1px 0 0 var(--theme-grey-light);
  z-index: -1;
  visibility: hidden;

  @media(min-width: 1199px) {
    --header-height: 100px;
  }

  .overlay-holder {
    content: "";
    position: absolute;
    right: 100%;
    width: 100vw;
    top: -100px;
    bottom: 0;
    z-index: -1;
    background-color: var(--theme-color-primary-dimmed-04);
    border-right: 1px solid rgba(var(--theme-color-primary-rgb), 0.4);
    @include hide;
  }

  .primary {
    position: relative;
    flex-grow: 1;

    img {
      max-height: 44px;
      margin-top: -3px;
      margin-bottom: -3px;
    }

    ul {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      padding: 0;
      margin: 0;
      list-style: none;
      text-align: left;
      overflow-y: hidden;
      overflow-x: hidden;
      background-color: white;
      z-index: 0;
      transition: transform 0.3s $easeOutCubic, z-index 0s linear 0.3s;
      box-shadow: 0 50vh 0 0 white;
      pointer-events: none;

      &:before {
        content: "";
        @include full-size;
        background-color: var(--theme-color-white);
        z-index: 2;
        @include hide;
        background-image: url("../../assets/img/preload.svg");
        background-size: 100px;
        background-position: center 50px;
        background-repeat: no-repeat;
      }

      &:after {
        content: "";
        @include full-size;
        background-color: var(--theme-color-primary);
        opacity: 0.1;
        transition: 0.3s $easeInOutSine;
      }

      &.loading:before {
        @include show;
      }

      &.current {
        transform: translate3d(0, 0, 0);
        transition: transform 0.3s $easeOutCubic, z-index 0s linear 0s;
        overflow-y: auto;
        pointer-events: all;

        &:after {
          opacity: 0;
          pointer-events: none;
        }

        ul {
          transform: translate3d(100%, 0, 0);

          &:after {
            opacity: 0;
          }
        }
      }
    }

    li {
      &.open > ul {
        transform: translate3d(0, 0, 0);
        z-index: 1;
      }

      &.back {
        position: sticky;
        text-align: left;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1;

        a {
          background-color: var(--theme-color-primary-dimmed-04);
          padding-left: 60px;
          padding-right: 20px;
          overflow: hidden;
          text-overflow: ellipsis;
          justify-content: flex-start;
          @include focus-visible(true);

          &:before {
            left: 18px;
            transform: rotate(180deg);
          }

          @media(max-width: 359px) {
            padding-left: 50px;

            &:before {
              left: 12px;
            }
          }
        }
      }
      &.magazine-nav {
        position: relative;

        &:before {
          content: "";
          @include full-size;
          background: linear-gradient(90deg, var(--theme-color-gradient-01) 20%, var(--theme-color-gradient-02) 70%, var(--theme-color-gradient-03) 100%);
          transition: 0.3s ease;
          width: 100%;
        }

        &:hover {
          &:before {
            width: 120%;
          }
          a {
            background-color: transparent;
          }
        }

        a {
          color: white !important;
          background-color: transparent !important;

          &:before {
            content: '\e8c8' !important;
          }
        }
      }
      &.link, &.overview, &.miscellaneous {
        a {
          color: var(--theme-color-secondary-intensed);
        }
      }
      &.link a:before, &.miscellaneous a:before {
        @include icon-content;
        margin-top: -14px;
      }
      &.overview a:before {
        @include icon-liste;
        margin-top: -14px;
      }
      &.back:hover {
        text-decoration: none;
      }
      &.link.extranet a:before, &.miscellaneous.extranet a:before {
        @include icon-content-stern;
      }
      &.link.intranet a:before, &.miscellaneous.intranet a:before {
        @include icon-content-schloss;
      }
      &.link.download a:before, &.miscellaneous.download a:before {
        @include icon-download;
      }
      &.overview.extranet a:before {
        @include icon-liste-stern;
        margin-top: -14px;
      }
      &.overview.intranet a:before {
        @include icon-liste-schloss;
        margin-top: -14px;
      }
      &.deep.extranet a:before {
        @include icon-pfeil-rechts-stern;
      }
      &.deep.intranet a:before {
        @include icon-pfeil-rechts-schloss;
      }
      &.miscellaneous.external a:before {
        @include icon-link-external;
      }
    }

    a {
      position: relative;
      display: flex;
      justify-content: flex-start;
      align-items: center;
      font-family: 'Korb', sans-serif;
      font-size: var(--font-size-copy);
      line-height: 1.2;
      padding: 12px 60px 12px 20px;
      min-height: 61px;
      text-decoration: none;
      transition: 0.3s $easeOutSine;
      border-bottom: 1px solid rgba(var(--theme-color-primary-rgb), 0.1);
      @include focus-visible(true);

      &.active {
        background-color: var(--theme-grey-light);
        padding-left: 12px;
        border-left: var(--border-width) solid var(--theme-color-secondary-intensed);
      }

      &:before {
        @include icon-pfeil-rechts;
        position: absolute;
        width: 30px;
        height: 30px;
        font-family: 'Icons', sans-serif;
        font-size: var(--icon-size);
        line-height: 1;
        right: 18px;
        top: 50%;
        margin-top: calc(var(--icon-size) / -2);
        text-align: center;
      }

      @media(max-width: 359px), (max-width: 767px) and (orientation: landscape) {
        min-height: 43px;
        padding: 10px 50px 10px 20px;

        &:before {
          right: 12px;
        }
      }

      &:hover {
        text-decoration: none;
        background-color: rgba(var(--theme-color-primary-rgb), 0.06);
      }
    }
  }

  .secondary {
    position: relative;
    z-index: 1;
    background-color: var(--theme-color-primary-dimmed-04);
    text-align: left;

    ul {
      padding: 15px 14px;
      list-style: none;
      margin: 0;
      font-size: 18px;
      line-height: 20px;

      @media(max-width: 359px) {
        font-size: 16px;
        line-height: 20px;
        padding: 10px;
      }
    }

    li {
      display: inline-block;
    }

    @media (max-width: 767px) and (orientation: landscape) {
      position: absolute;
      right: 100%;
      top: 0;
      width: calc(100vw - 420px);
      min-width: 35vw;

      li {
        display: block;
      }
    }

    a {
      position: relative;
      display: block;
      padding: 5px 6px;
      transition: 0.3s $easeOutQuad;
      text-decoration: underline;
      text-decoration-color: transparent;
      text-decoration-thickness: 2px;
      text-underline-offset: 2px;
      @include focus-visible;

      @media(max-width: 359px) {
        padding: 5px;
      }
    }
  }

  .meta {
    position: relative;
    z-index: 1;
    padding: 0 12px;

    > ul {
      display: flex;
      justify-content: flex-start;
      list-style: none;
      padding: 0;
      margin: 0;
    }

    ul {
      display: flex;
      list-style: none;
      padding: 0;
      margin: 0;

      li {
        padding: 0;
      }
    }

    .icons {
      margin-left: auto;

      .login {
        a {
          &:before {
            @include icon-login-flyout;
            font-family: 'Icons', sans-serif;
            font-size: var(--icon-size-small);
            line-height: 30px;
            float: right;
            margin-left: 5px;
          }

          &:hover {
            text-decoration-color: transparent;
          }
        }

      }

      li:not(.login) a {
        font-size: 0;
        line-height: 0;
        text-decoration: none;

        &:before {
          font-family: 'Icons', sans-serif;
          font-size: var(--icon-size-small);
          line-height: 30px;
        }

        &:hover {
          text-decoration-color: transparent;
        }
      }

      .sign-language a::before {
        @include icon-small-gebaerdensprache;
      }

      .simple-language a::before {
        @include icon-small-leichte-sprache;
      }
    }

    a {
      display: block;
      font-size: var(--font-size-small);
      line-height: 30px;
      margin: 10px 0;
      padding: 5px 8px;
      text-decoration: none;
      /*
      text-decoration: underline;
      text-decoration-color: transparent;
      text-decoration-thickness: 2px;
      text-underline-offset: 2px;
      */
      transition: 0.3s ease;
      text-align: center;
      border: 0;
      background-color: transparent;
      cursor: pointer;
      @include focus-visible;

      @media(max-width: 359px) {
        padding: 5px;
      }

      &:hover {
        text-decoration-color: var(--theme-color-primary);
      }
    }
  }

  .secondary, .meta {
    a {
      border-radius: var(--border-radius-xs);
    }
  }
}