@use "../../colors/gray/c-gray-dark";

.tooltip-menu {
  z-index: 100;
  position: relative;
  display: flex;

  &::before {
    content: "";
    position: absolute;
    left: 80%;
    transform: translateX(-137%) translateY(100%) rotate(180deg);
    border-width: 0.2em 0.2em 0 0.2em;
    border-style: solid;
    border-color: white transparent transparent transparent;
    z-index: 100;
  }

  &::after {
    content: attr(alt);
    position: absolute;
    left: 50%;
    transform: translateX(-85%) translateY(124%);
    background: white;
    text-align: left;
    color: c-gray-dark.$d;
    font-weight: 600;
    padding: 0.5em 1em;
    width: max-content;
    max-width: 50em;
    border: none;
    pointer-events: none;
    white-space: nowrap;
    line-height: 1.5em;
    font-size: 0.4em;
  }

  &:not(hover) {
    &::before {
      opacity: 0;
      bottom: -0.3em;
      transition: all 0.1s ease-in-out;
    }

    &::after {
      opacity: 0;
      bottom: 0;
      transition: all 0.1s ease-in-out;
    }
  }

  &:hover {
    &::after, &::before {
      opacity: 1;
      bottom: -0.11em;
      transition: all 0.1s ease-in-out;
    }
  }
}
