.acc-glossary-term {
    --acc-glossary-bg: #fff;
    --acc-glossary-border: #ccc;
    --acc-glossary-text: #333;
    --acc-glossary-shadow: rgba(0, 0, 0, 0.12);

    position: relative;
    display: inline;
    text-decoration-line: underline;
    text-decoration-style: dotted;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    cursor: help;
}

.acc-glossary-icon {
    margin-left: 0.15em;
    font-size: 0.65em;
    vertical-align: super;
    cursor: help;
}

/* Tooltip card */
.acc-glossary-popup {
    display: block;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;

    background: var(--acc-glossary-bg);
    color: var(--acc-glossary-text);
    border: 1px solid var(--acc-glossary-border);
    border-radius: 4px;
    box-shadow: 0 2px 8px var(--acc-glossary-shadow);
    padding: 0.6em 0.8em;
    max-width: 300px;
    width: max-content;

    font-size: 0.9em;
    line-height: 1.4;
    font-style: normal;
    font-weight: normal;
    text-align: left;
    text-decoration: none;
    white-space: normal;
    word-break: break-word;

    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
}

/* Downward arrow */
.acc-glossary-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--acc-glossary-border);
}

/* Show on hover or keyboard focus; :focus-within keeps popup live while
   a link inside it is being clicked or tabbed to. */
.acc-glossary-term:hover .acc-glossary-popup,
.acc-glossary-term:focus .acc-glossary-popup,
.acc-glossary-term:focus-within .acc-glossary-popup {
    opacity: 1;
    pointer-events: auto;
}

.acc-glossary-popup a {
    color: inherit;
}
