/* CSS-only hover/focus tooltip on an inline info icon. Built by ApplicationHelper#info_tooltip.
   Bulma 1.0.4 ships without the bulma-tooltip extension, hence the hand-rolled version; the
   `info-` prefix keeps these names clear of that extension's `.tooltip`/`has-tooltip-*`. */
.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  /* Relative to the heading it sits in, so one helper suits a .title.is-5 and a small label alike. */
  font-size: 0.75em;
  color: var(--bulma-text-weak);
  cursor: help;
}

.info-tooltip-text {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: max-content;
  max-width: 16rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background-color: #363636;
  color: #fff;
  /* Explicit, because Bulma's `.title span` inherits the heading weight and callers like
     .demand-headline-label uppercase their descendants. */
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  text-align: left;
  text-transform: none;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 120ms ease;
}

/* Arrow pointing down at the icon. */
.info-tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #363636;
}

.info-tooltip:hover .info-tooltip-text,
.info-tooltip:focus-visible .info-tooltip-text {
  opacity: 1;
  visibility: visible;
}

/* Placement modifiers, set by ApplicationHelper#info_tooltip's `position:`. A 16rem panel
   centered above its icon overhangs the window near an edge, so the caller sends it the other
   way -- the same "which side it opens to lives on the element" split as .dropdown.is-right.
   Each variant moves the panel and its arrow together, since both hardcode the top placement's
   centering; and each clears border-top-color, or the base arrow's triangle would still paint
   alongside the new one. Scoped to .info-tooltip so these never collide with Bulma's own is-*. */
.info-tooltip.is-bottom .info-tooltip-text {
  top: calc(100% + 0.5rem);
  bottom: auto;
}

.info-tooltip.is-bottom .info-tooltip-text::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: #363636;
}

.info-tooltip.is-left .info-tooltip-text {
  top: 50%;
  right: calc(100% + 0.5rem);
  bottom: auto;
  left: auto;
  transform: translateY(-50%);
}

.info-tooltip.is-left .info-tooltip-text::after {
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-left-color: #363636;
}

.info-tooltip.is-right .info-tooltip-text {
  top: 50%;
  right: auto;
  bottom: auto;
  left: calc(100% + 0.5rem);
  transform: translateY(-50%);
}

.info-tooltip.is-right .info-tooltip-text::after {
  top: 50%;
  right: 100%;
  left: auto;
  transform: translateY(-50%);
  border-top-color: transparent;
  border-right-color: #363636;
}
