// =============================================================================
// _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;
  padding: 1px;
  background-color: $popoverBackground;
  border: 1px solid #ccc;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  @include translate3d(0, 0, 0);
  @include background-clip(padding-box);
  @include box-shadow(#{0 5px 10px rgba(0, 0, 0, 0.2)});
  @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 1em;
  @include font-size(1.4);
  font-weight: normal;
  line-height: 1.3;
  background-color: $popoverTitleBackground;
  border-bottom: 1px solid darken($popoverTitleBackground, 5%);
  border-radius: 5px 5px 0 0;
}

.popover-content {
  padding: 0.563em 0.875em;
  @include font-size(1.3);
  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: $popoverArrowColor;

    &: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;
    }
  }
}