/* Tooltip container */
.tooltip {
  position: relative;
  display: inline-block;
}

/* Tooltip text */
.tooltip .tooltiptext {
  font-size: 0.75rem;
  visibility: hidden;
  width: 120px;
  background-color: var(--color-text);
  color: var(--color-background);
  text-align: center;
  padding: 5px 0;

  /* Position the tooltip text */
  position: absolute;
  z-index: 1;
  top: 125%;
  left: 50%;
  margin-left: -60px;

  /* Fade in tooltip */
  opacity: 0;
  transition: opacity 0.3s;
}

/* Tooltip arrow */
.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent var(--color-text) transparent;
}

/* Default: pure-CSS hover (used wherever the tooltip isn't clipped). */
.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

/* JS-driven: the tooltip_controller switches the text to `position: fixed`
   (set inline) so it escapes an ancestor's overflow-hidden, e.g. the
   calendar's collapsible rows. */
.tooltip .tooltiptext.tooltiptext--visible {
  visibility: visible;
  opacity: 1;
}
