// Copyright 2016 Palantir Technologies, Inc. All rights reserved.
// Licensed under the BSD-3 License as modified (the “License”); you may obtain a copy
// of the license at https://github.com/palantir/blueprint/blob/master/LICENSE
// and https://github.com/palantir/blueprint/blob/master/PATENTS

@import "../../common/variables";
@import "../../common/icons";
@import "./common";

.pt-submenu {
  > .pt-popover-target {
    display: inherit;

    > .pt-menu-item {
      padding-right: $pt-icon-size-standard + $pt-grid-size;

      &::after {
        @include pt-icon();
        position: absolute;
        right: $half-grid-size;
        content: $pt-icon-caret-right;

        .pt-large & {
          line-height: $pt-icon-size-large;
        }
      }
    }
  }

  > .pt-popover-open > .pt-menu-item {
    // keep a trail of hovered items as submenus are opened
    // stylelint-disable-next-line scss/at-extend-no-missing-placeholder
    @extend .pt-menu-item:hover;
  }

  // minor adjustments to popover position so top submenu item lines up with submenu trigger item
  .pt-popover {
    position: relative;
    top: -$half-grid-size;
    left: $half-grid-size;

    &.pt-align-left {
      right: $half-grid-size;
      left: auto;
    }
  }
}
