/* Lirio — Kindle-style inline word glosses (ported from mdBook theme) */
.reading { font-size: 1.08rem; line-height: 1.8; }
.reading img { max-width: 100%; height: auto; }

.gloss {
    border-bottom: 2px dotted #5f83b6;
    cursor: help;
    position: relative;
    display: inline;
}
.gloss:hover,
.gloss.active { border-bottom-style: solid; }

/* Paragraph label badge (A, B, C…) for paragraph_match exercises */
.para-label {
    display: inline-block;
    font-family: system-ui, sans-serif;
    font-size: 0.72em;
    font-weight: 700;
    color: #5b6a86;
    border: 1px solid #c9d7ee;
    border-radius: 5px;
    padding: 0 0.4em;
    margin-right: 0.55em;
    vertical-align: 0.12em;
    user-select: none;
}

/* Gloss hidden by the word-level filter: plain text, no tooltip */
.gloss.gloss-off { border-bottom: none; cursor: inherit; }
.gloss.gloss-off::before,
.gloss.gloss-off::after { display: none; }

[data-bs-theme="dark"] .gloss { border-bottom-color: #9db8e0; }

/* Definition bubble */
.gloss::before {
    content: attr(data-def);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1a1f2e;
    color: #c5cfe8;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.78em;
    font-style: italic;
    line-height: 1.4;
    white-space: normal;
    width: max-content;
    max-width: 220px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 9999;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}
.gloss::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 3px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1a1f2e;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
    z-index: 9999;
}
.gloss:hover::before, .gloss:hover::after,
.gloss.active::before, .gloss.active::after { opacity: 1; }
