$arrow-size: rem(14px);
$visible-portion-of-arrow: rem(5px);
$content-max-height: rem(295px);
$content-max-width: rem(400px);

.Popover {
  max-width: calc(100vw - #{2 * spacing()});
  margin: $visible-portion-of-arrow spacing(tight) spacing();
  box-shadow: shadow(deep);
  border-radius: border-radius();
  will-change: opacity, left, top;
}

.entering {
  opacity: 0;
}

.entered {
  opacity: 1;
  transition: opacity duration() easing(in);
}

.exiting {
  opacity: 1;
}

.exited {
  opacity: 0;
  transition: opacity duration() easing(out);
}

.measuring:not(.exiting) {
  opacity: 0;
}

.fullWidth {
  margin: 0;
  margin-top: $visible-portion-of-arrow;

  .Content {
    max-width: none;
  }
}

.measuring {
  .Content {
    display: block;
  }
}

.positionedAbove {
  margin: spacing() 0 $visible-portion-of-arrow spacing(tight);

  &.fullWidth {
    margin: 0 0 $visible-portion-of-arrow;
  }
}

.Wrapper {
  position: relative;
  overflow: hidden;
  background-color: color('white');
  border-radius: border-radius();
}

.Content {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: border-radius();
  max-width: $content-max-width;
  max-height: $content-max-height;

  &:focus {
    outline: none;
  }
}

.Content-fullHeight {
  max-height: none;
}

.Pane {
  flex: 1 1 0%;
  max-width: 100%;

  + .Pane {
    border-top: border();
  }
}

.Pane-fixed {
  overflow: visible;
  flex: 0 0 auto;
}

.Section {
  padding: spacing();

  + .Section {
    border-top: border();
  }
}

.FocusTracker {
  @include visually-hidden;
}
