// Copyright 2017 Palantir Technologies, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0.

@import "@blueprintjs/core/src/common/variables";
@import "@blueprintjs/core/src/components/button/common";

$banner-height: $pt-grid-size * 4;

// banner along top of screen linking to v2 docs
.docs-banner {
  @include pt-flex-container(row);
  @include overflow-ellipsis();
  align-items: center;

  box-shadow: inset 0 -1px 0 $pt-divider-black;
  /* stylelint-disable declaration-no-important */
  color: $white !important;
  flex: 0 0 auto;
  justify-content: center;
  left: 0;
  min-height: $banner-height;
  padding: $pt-grid-size $pt-grid-size * 2;

  position: fixed;
  right: 0;
  text-align: center;
  top: 0;
  z-index: $pt-z-index-overlay - 1;

  @each $intent, $colors in $button-intents {
    &.#{$ns}-intent-#{$intent} {
      background: nth($colors, 1);

      &:hover {
        background: nth($colors, 2);
      }

      &:active {
        background: nth($colors, 3);
      }
    }
  }

  &:hover {
    text-decoration: none;
  }

  .#{$ns}-dark & {
    box-shadow: 0 1px 0 $pt-divider-black;
  }

  + .docs-app {
    padding-top: $banner-height;

    .docs-nav {
      height: calc(100vh - #{$banner-height});
    }

    .docs-anchor {
      // shift anchors down by $banner-height pixels
      margin-top: -$content-padding * 2 - $banner-height;
    }
  }
}
