/* Tooltip
 **********/

[data-tooltip] {
  position: relative;

  &:focus {
    outline: 0;
  }

  &::after {
    background-color: $dark-grey;
    border-radius: 5px;
    color: $white;
    content: attr(data-tooltip);
    display: inline-block;
    font-size: 16px;
    font-weight: $weight-light;
    height: 20px;
    left: -5px;
    line-height: 13px;
    margin-top: 5px;
    max-width: 250px;
    overflow: hidden;
    overflow-wrap: break-word;
    padding-left: 6px;
    padding-right: 6px;
    padding-top: 6px;
    text-overflow: ellipsis;
    text-shadow: none;
    user-select: none;
    white-space: nowrap;
    word-wrap: break-word;
  }

  &::after,
  &::before {
    bottom: 100%;
    margin-bottom: 5px;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: auto;
  }

  &::before {
    border-color: $dark-grey transparent transparent;
    border-style: solid;
    border-width: 5px;
    content: " ";
    height: 0;
    left: 10px;
    margin-bottom: -5px;
    margin-left: 5px;
    overflow: hidden;
    width: 0;
  }

  &:focus::before,
  &:focus::after,
  &:hover::before,
  &:hover::after {
    opacity: 1;
    transform: translateZ(0);
    transition: opacity 0.15s ease-out;
    z-index: 999;
  }
}
