// =============================================================================
// _POPOVERS.SCSS
// -----------------------------------------------------------------------------
// Site styles.
// =============================================================================

// =============================================================================
// TABLE OF CONTENTS
// -----------------------------------------------------------------------------
//   01. Base Styles
//   02. Arrows
// =============================================================================

// Base Styles
// =============================================================================

.popover {
  position: absolute;
  top: 0;
  left: 0;
  z-index: $zindexPopover;
  display: none;
  width: 236px;
  background-color: $popoverBackground;
  border: 1px solid rgba(0, 0, 0, 0.2);
  text-align: center;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
  @include transform(#{translate3d(0, 0, 0)});
  @include background-clip(padding-box);
  @include transition(#{opacity 0.3s ease});


  //
  // Offset the popover to account for the popover arrow.
  //

  &.top    { margin-top:  -0.825em; }
  &.right  { margin-left:  0.825em; }
  &.bottom { margin-top:   0.825em; }
  &.left   { margin-left: -0.825em; }
}


//
// 1. Reset heading 'margin'.
//

.popover-title {
  margin: 0; // 1
  padding: 0.571em 0.75em;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.3;
  background-color: $popoverTitleBackground;
}

.popover-content {
  border-top: 1px solid rgba(0, 0, 0, 0.2);
  padding: 0.563em 0.875em;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;

  p,
  ul,
  ol {
    margin-bottom: 0;
  }

  ul,
  ol {
    margin-left: 1.286em;
  }
}



// Arrows
// =============================================================================

.popover .arrow,
.popover .arrow:after {
  position: absolute;
  display: inline-block;
  width: 0;
  height: 0;
  border-color: transparent;
  border-style: solid;
}

.popover .arrow:after {
  content: "";
  z-index: -1;
}

.popover {
  &.top .arrow {
    bottom: -$popoverArrowWidth;
    left: 50%;
    margin-left: -$popoverArrowWidth;
    border-width: $popoverArrowWidth $popoverArrowWidth 0;
    border-top-color: $popoverArrowColor;

    &:after {
      border-width: $popoverArrowOuterWidth $popoverArrowOuterWidth 0;
      border-top-color: $popoverArrowOuterColor;
      bottom: -1px;
      left: -$popoverArrowOuterWidth;
    }
  }

  &.right .arrow {
    top: 50%;
    left: -$popoverArrowWidth;
    margin-top: -$popoverArrowWidth;
    border-width: $popoverArrowWidth $popoverArrowWidth $popoverArrowWidth 0;
    border-right-color: $popoverArrowColor;

    &:after {
      border-width: $popoverArrowOuterWidth $popoverArrowOuterWidth $popoverArrowOuterWidth 0;
      border-right-color: $popoverArrowOuterColor;
      bottom: -$popoverArrowOuterWidth;
      left: -1px;
    }
  }

  &.bottom .arrow {
    top: -$popoverArrowWidth;
    left: 50%;
    margin-left: -$popoverArrowWidth;
    border-width: 0 $popoverArrowWidth $popoverArrowWidth;
    border-bottom-color: $popoverTitleBackground;

    &:after {
      border-width: 0 $popoverArrowOuterWidth $popoverArrowOuterWidth;
      border-bottom-color: $popoverArrowOuterColor;
      top: -1px;
      left: -$popoverArrowOuterWidth;
    }
  }

  &.left .arrow {
    top: 50%;
    right: -$popoverArrowWidth;
    margin-top: -$popoverArrowWidth;
    border-width: $popoverArrowWidth 0 $popoverArrowWidth $popoverArrowWidth;
    border-left-color: $popoverArrowColor;
    
    &:after {
      border-width: $popoverArrowOuterWidth 0 $popoverArrowOuterWidth $popoverArrowOuterWidth;
      border-left-color: $popoverArrowOuterColor;
      bottom: -$popoverArrowOuterWidth;
      right: -1px;
    }
  }
}