@mixin Topbar {
  z-index: $topbar-zindex;
  position: absolute;
  right: 0;
  left: 0;
  top: 0;
}

@mixin TopbarPrimary {
  background-color: $topbar-background-color;
  height: $topbar-height;
  padding-right: 4vw;
  padding-left: 4vw;
  display: grid;

  grid-template-columns: auto 1fr auto;

  /**
   * Apply a sidebar column width if we have a sidebar.
   * This aligns the search bar with the content area.
   * Just one of those things that an OCD user will appreciate.
   */
  @include breakpoint(md) {
    grid-template-columns: $sidebar-width 1fr auto;
  }
}

@mixin TopbarLogo {
  padding-right: $gutter;
  justify-items: center;
  align-items: center;
  display: flex;
}

@mixin TopbarLogoWordmark {
  transform: translateY(2px);
}

@mixin TopbarLogoSeparator {
  margin-right: $gutter * 0.375;
  margin-left: $gutter * 0.625;
  color: $gray-400;
}

@mixin TopbarApplicationWordmark {
  font-weight: $font-weight-medium;
  color: $gray-400;
}

@mixin TopbarSearch {
  padding-right: $gutter;
  align-items: center;
  display: flex;

  .#{$form-class + $group-class} {
    width: 100%;
    margin: 0;
  }

  .#{$form-class + $control-class} {
    max-width: $form-control-max-width;
    width: 100%;
  }
}

@mixin TopbarNavigation {
  justify-items: center;
  align-items: center;
  display: flex;
}

@mixin TopbarNavigationLink {
  font-weight: $font-weight-medium;
  color: $black;

  align-items: center;
  position: relative;
  display: flex;
  height: 100%;

  padding-right: $gutter;
  padding-left: $gutter;

  cursor: pointer;

  &:last-child {
    padding-right: 0;
  }

  @include hover {
    color: transparentize($black, 0.5);
  }
}

@mixin TopbarSpacer {
  background: linear-gradient(to bottom, $body-bg, transparentize($body-bg, 1));
  box-shadow: 0 -1px 0 0 $border-color;
  pointer-events: none;
  position: absolute;
  bottom: -$gutter;
  height: $gutter;
  right: 0;
  left: 0;
}
