@import '../../sass/base/index';

@mixin takeOver {
  display: block;
  background: red;
  padding-bottom: 0;
  overflow: scroll;
  height: 100vh;
  max-height: 100%;
  background: $primary;

  .dfo-header {
    &__wrapper {
      display: block;
      background: $background;
      padding: 0;
    }

    &__menu {
      display: block;
      overflow: auto;
      border-top: 2px solid #e6e6e6;
      background: $darkbackground;
      padding: 0 $padding-medium;
    }
  }
}

.dfo-menu {
  &__item {
    display: inline;
    font-weight: 600;
    font-size: 1.6rem;
    text-decoration: none;

    @media screen and (min-width: $burgerMenuBreakpoint + 1) {
      margin: 0 1.75rem;

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

    @media screen and (max-width: $burgerMenuBreakpoint) {
      display: block;
      width: 100%;
      margin-top: 2rem;
      margin-bottom: 2rem;
      font-size: 2rem;
    }
  }
  &__item button {
    font-weight: 600;
    font-size: inherit;
    cursor: pointer;
  }
  &__item button:hover {
    color: $secondary;
  }
  &__item--active span {
    text-decoration: underline;
  }
}

.dfo-header {
  border-bottom: 2px solid $border;
  background: $background;
  display: flex;
  align-items: center;
  justify-content: space-between;

  &__logo-wrapper {
    flex-basis: 75%;
    max-width: 325px;
  }
  &__wrapper {
    display: flex;
    margin: 0 (-$padding-medium);
    align-items: center;
    flex: 1;

    &__inner {
      z-index: 0;
      min-height: 6rem;
      display: flex;
      flex: 1 0;
      justify-content: space-between;
      align-items: center;
      padding: $padding-small;

      @media screen and (min-width: $tablet) {
        padding: $padding-medium;
        min-height: 8rem;
      }
    }
  }
  &__menu {
    display: flex;
    align-items: baseline;
    padding: 0 $padding-medium;

    @media screen and (max-width: $burgerMenuBreakpoint - 1) {
      display: none;
    }
  }
  &__menu-toggle {
    display: none;
    margin-right: 0;
    font-weight: 600;
    font-size: 1.8rem;
    padding: 1rem 0;
    margin-right: 1rem;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    outline: none;

    @media screen and (max-width: $burgerMenuBreakpoint - 1) {
      display: block;
    }
    &__icon {
      margin-left: 1rem;
    }
  }

  &--menu-open {
    .menu {
      &__item {
        margin-left: 0;
      }
    }
    @media screen and (max-width: $burgerMenuBreakpoint - 1) {
      @include takeOver();
    }
  }
}

.container {
  margin: 0 $document-padding;

  &--flex {
    display: flex;
    flex-grow: 1;
    justify-content: space-between;
    align-items: center;
  }
}
