/*
 * TOOLTIP
 */

.tooltip[aria-label] {
  position: relative;

  .pic & {
    display: inline-block;
  }

  /* Hide the tooltip content by default */
  &:before,
  &:after {
    bottom: 100%;
    left: 50%;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    transition: 0.5s opacity;
    visibility: hidden;
    z-index: 100;
  }

  /* Position tooltip above the element */
  &:before {
    background-color: hsla(0, 0%, 20%, 0.95);
    border-radius: 3px;
    color: #fff;
    content: attr(aria-label);
    font-size: 14px;
    line-height: 1.2;
    margin-bottom: 5px;
    margin-left: -80px;
    padding: 7px;
    text-align: center;
    width: 160px;
  }

  /* Triangle hack to make tooltip look like a speech bubble */
  &:after {
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid hsla(0, 0%, 20%, 0.95);
    content: " ";
    font-size: 0;
    line-height: 0;
    margin-left: -5px;
    width: 0;
  }

  /* Show tooltip content on hover */
  &:hover:before,
  &:hover:after {
    opacity: 1;
    visibility: visible;
  }
}
