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

@use "sass:list";

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

$banner-height: $pt-spacing * 10;

// 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;
  flex: 0 0 auto;
  justify-content: center;
  left: 0;
  min-height: $banner-height;
  padding: ($pt-spacing * 2) ($pt-spacing * 5);

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

  a {
    /* stylelint-disable-next-line declaration-no-important */
    color: $white !important;

    &:hover {
      text-decoration: none;
    }
  }

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

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

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

  .#{$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;
    }
  }
}
