//
// Copyright 2018 Google Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions://
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//

@import "@material/animation/variables";
@import "@material/elevation/mixins";
@import "@material/theme/mixins";
@import "@material/rtl/mixins";
@import "./mixins";
@import "./variables";

// postcss-bem-linter: define menu-surface
.mdc-menu-surface {
  @include mdc-elevation(8);
  @include mdc-menu-surface-fill-color(surface);
  @include mdc-menu-surface-ink-color(on-surface);
  @include mdc-rtl-reflexive-property(transform-origin, top left, top right);
  @include mdc-menu-surface-corner-radius(4px);

  display: none;
  position: absolute;
  box-sizing: border-box;
  max-width: calc(100vw - #{$mdc-menu-surface-min-distance-from-edge});
  max-height: calc(100vh - #{$mdc-menu-surface-min-distance-from-edge});
  margin: 0;
  padding: 0;
  transform: scale(1);
  transform-origin: top left;
  opacity: 0;
  overflow: auto;
  will-change: transform, opacity;
  z-index: 4;

  &:focus {
    outline: none;
  }

  &--animating-open {
    display: inline-block;
    transform: scale(.8);
    transition:
      opacity $mdc-menu-surface-fade-in-duration linear,
      transform $mdc-menu-surface-scale-duration $mdc-animation-deceleration-curve-timing-function;
    opacity: 0;
  }

  &--open {
    display: inline-block;
    transform: scale(1);
    opacity: 1;
  }

  &--animating-closed {
    display: inline-block;
    transition: opacity $mdc-menu-surface-fade-out-duration linear;
    opacity: 0;
  }
}

.mdc-menu-surface--anchor {
  position: relative;
  overflow: visible;
}

.mdc-menu-surface--fixed {
  position: fixed;
}
// postcss-bem-linter: end
