.tooltip,
[data-tooltip] {
  position: relative;

  &:hover,
  &:focus {
    cursor: help;

    &::before {
      width: auto;
      position: absolute;
      z-index: 200;
      left: 0rem;
      bottom: 2rem;
      padding: @distance-2;
      overflow: hidden;
      content: attr(data-tooltip);
    }

    &:after {
      display: inline-block;
      z-index: 200;
      position: absolute;
      content: '';
      left: 0.5rem;
      bottom: 1.55rem;
      width: 0;
      height: 0;
    }
  }

  &.tooltip-right {
    &:hover,
    &:focus {
      &::before {
        left: initial;
        right: 0;
        bottom: 2rem;
      }
      &::after {
        left: initial;
        right: 0.5rem;
        bottom: 1.55rem;
      }
    }
  }

  &.tooltip-bottom {
    &:hover,
    &:focus {
      &::before {
        width: auto;
        position: absolute;
        z-index: 200;
        left: 0rem;
        bottom: -4.4rem;
        padding: @distance-2;
        overflow: hidden;
      }

      &:after {
        display: inline-block;
        z-index: 200;
        position: absolute;
        content: '';
        left: 0.5rem;
        top: 2rem;
        width: 0;
        height: 0;
      }
    }

    &.tooltip-right {
      &:hover,
      &:focus {
        &::before {
          left: initial;
          right: 0;
          bottom: -4rem;
          z-index: 200;
          white-space: nowrap;
        }
        &::after {
          left: initial;
          top: 1.55rem;
        }
      }
    }
  }
}
