/* Pure-CSS tooltip for the inline "?" help hint.
 * See templates/elements/HelpHint.php for usage. */

.help-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    margin: 0 0.15em;
    border-radius: 50%;
    background: #94a3b8;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    vertical-align: middle;
    cursor: help;
    user-select: none;
    position: relative;
    line-height: 1;
}

.help-hint:hover,
.help-hint:focus {
    background: #475569;
    outline: 0;
}

.help-hint:hover::before,
.help-hint:focus::before,
.help-hint:hover::after,
.help-hint:focus::after {
    opacity: 1;
    pointer-events: none;
    visibility: visible;
}

/* Tooltip text balloon */
.help-hint::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 280px;
    padding: 8px 10px;
    background: #1f2937;
    color: #f9fafb;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.4;
    text-align: left;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 100ms ease;
    z-index: 50;
    white-space: normal;
}

/* Arrow */
.help-hint::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    visibility: hidden;
    transition: opacity 100ms ease;
    z-index: 50;
}
