/* Style du terme survolé dans le code */
code .glossaire-terme {
    border-bottom: 2.5px dashed rgb(0, 112, 187);
    background-color: #88888822;
    cursor: help;
    font-weight: 110;
    position: relative;
}

.glossaire-terme :hover {
    background-color: #AAAA8822;
}

/* Le phylactère global qui épouse les couleurs du thème mdBook */
.phylactere-tooltip {
    position: fixed;
    transform: translate(-50%, -100%);
    
    /* Utilisation des variables dynamiques de mdBook */
    background-color: var(--bg, #ffffff);
    color: var(--fg, #333333);
    border: 2px solid var(--table-border-color, #cccccc);
    
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out;
    z-index: 99999;
    max-width: 350px;
    white-space: normal;
}

/* Petite flèche en bas du phylactère alignée sur la couleur de fond de la bulle */
.phylactere-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    /* La bordure haute prend la couleur de fond du thème actuel */
    border-color: var(--bg, #ffffff) transparent transparent transparent;
}

/* Classe active pour afficher la bulle */
.phylactere-tooltip.visible {
    opacity: 1;
    transform: translate(-50%, calc(-100% - 8px));
}

/* Style des balises <code> à l'intérieur de la bulle d'explication */
.phylactere-tooltip code {
    background-color: var(--inline-code-bg, rgba(128, 128, 128, 0.1));
    color: var(--inline-code-color, inherit);
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.9em;
}