/* Infobulles désactivées via toggle-infobulles */
body.infobulles-desactivees .lexique-term {
    text-decoration: none;
    cursor: text;
    pointer-events: none;
    color: inherit;
}
body.infobulles-desactivees #lexique-tooltip {
    display: none !important;
}

/* ============================================================
   lexique-infobulles.css
   Styles pour les termes annotés et l'infobulle du lexique.
   À inclure sur toutes les pages h2 après style-h2.css.
   ============================================================ */

/* Terme survolable — couleur violette */
.lexique-term {
    cursor: default;
    color: var(--violet-officiel);
    text-decoration: none;
}

/* Effet survol */
.lexique-term:hover {
    color: var(--violet-officiel-survol);
}

/* Dans les labels : survol — couleur fixe la plus sombre de l'irisé3 */
.bloc-label span:hover,
.bloc-label .lexique-term:hover {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: var(--brun-officiel);
    animation: none;
}
#lexique-tooltip {
    display: none;
    position: fixed;
    z-index: 9000;    width: 380px;
    background: white;
    border: 1px solid var(--gris-3);
    border-radius: 9px;
    box-shadow: none;
    padding: 14px 16px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: var(--font-size-1);
    line-height: 1.6;
    color: var(--gris-6);
    text-align: justify;
    pointer-events: auto;
}

/* --- Flèches — carré pivoté 45° --- */
#lexique-tooltip::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    border: 1px solid var(--gris-3);
    transform: rotate(45deg);
    z-index: -1;
}

/* Flèche en haut (infobulle en dessous du terme) */
#lexique-tooltip.fleche-haut::before {
    top: -7px;
    left: var(--fleche-offset, 20px);
    border-bottom: none;
    border-right: none;
}

/* Flèche en bas (infobulle au-dessus du terme) */
#lexique-tooltip.fleche-bas::before {
    bottom: -7px;
    left: var(--fleche-offset, 20px);
    border-top: none;
    border-left: none;
}

/* Flèche à gauche (infobulle à droite du terme) */
#lexique-tooltip.fleche-gauche::before {
    left: -7px;
    top: var(--fleche-offset, 20px);
    border-bottom: none;
    border-right: none;
    transform: rotate(-45deg);
}

/* Flèche à droite (infobulle à gauche du terme) */
#lexique-tooltip.fleche-droite::before {
    right: -7px;
    top: var(--fleche-offset, 20px);
    border-top: none;
    border-left: none;
    transform: rotate(-45deg);
}

#lexique-tooltip.avec-image {
    display: block;
    padding: 0;
}

#lexique-tooltip.avec-image .tooltip-image-conteneur {
    background: white;
    border-radius: 8px 8px 0 0;
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid var(--gris-4);
}

#lexique-tooltip.avec-image .tooltip-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

#lexique-tooltip.avec-image .tooltip-texte {
    padding: 14px 16px;
    text-align: justify;
}

/* --- Infobulle label : disposition image à gauche, pas de flèche --- */
#lexique-tooltip.label-infobulle {
    width: 540px;
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

#lexique-tooltip.label-infobulle::before {
    display: none;
}

#lexique-tooltip.label-infobulle .tooltip-image-label {
    width: 90px;
    height: 90px;
    flex-shrink: 0;
    object-fit: contain;
    background: white;
    display: block;
    margin: auto;
}

#lexique-tooltip.label-infobulle .tooltip-image-wrap {
    width: 120px;
    flex-shrink: 0;
    background: white;
    border-radius: 9px 0 0 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

#lexique-tooltip.label-infobulle .tooltip-separateur {
    width: 1px;
    background: var(--gris-2);
    flex-shrink: 0;
    margin: 14px 0;
}

#lexique-tooltip.label-infobulle .tooltip-texte {
    flex: 1;
    padding: 14px 16px;
}

body.aide-active #lexique-tooltip {
    filter: brightness(0.85);
}
