/* =============================================================================
   Glossary.css — inline glossary terms + hover/focus popover (WikiGlossary.js).
   ============================================================================= */

/* The decorated term inside running text: a subtle dotted underline that reads
   as "there's more here" without shouting. */
.wiki-glossary {
    border-bottom: 1px dotted var(--behnke-design, #0066cc);
    cursor: help;
    text-underline-offset: 2px;
}

.wiki-glossary:hover,
.wiki-glossary:focus-visible {
    color: var(--behnke-design, #0066cc);
    border-bottom-style: solid;
    outline: none;
}

.wiki-glossary:focus-visible {
    border-radius: 2px;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--behnke-design, #0066cc) 35%, transparent);
}

/* ── Popover ──────────────────────────────────────────────────────────────── */

.wiki-glossary-pop {
    position: fixed;
    z-index: 4600;                  /* above the step-mode overlay (4000) + confetti (4500) */
    max-width: min(340px, 92vw);
    padding: calc(0.8 * var(--behnke-basic)) var(--behnke-basic);
    background: var(--behnke-white, #fff);
    border: 1px solid var(--behnke-light-gray, #e5e7eb);
    border-radius: calc(0.6 * var(--behnke-basic));
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
    color: var(--behnke-black, #1f2937);
    font-size: var(--behnke-normal-font-size, 0.95rem);
    line-height: 1.55;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: auto;
}

.wiki-glossary-pop.is-above { transform: translateY(-4px); }

.wiki-glossary-pop.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.wiki-glossary-pop__term {
    font-weight: 700;
    color: var(--behnke-design, #0066cc);
    margin-bottom: calc(0.3 * var(--behnke-basic));
}

.wiki-glossary-pop__body { color: var(--behnke-medium-black, #4b5563); }

/* Definitions are authored content — keep their spacing compact in the card. */
.wiki-glossary-pop__body :first-child { margin-top: 0; }
.wiki-glossary-pop__body :last-child { margin-bottom: 0; }
.wiki-glossary-pop__body p { margin: 0 0 calc(0.4 * var(--behnke-basic)); }
.wiki-glossary-pop__body img { max-width: 100%; height: auto; border-radius: 4px; }

.wiki-glossary-pop__more {
    display: inline-block;
    margin-top: calc(0.5 * var(--behnke-basic));
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--behnke-design, #0066cc);
    text-decoration: none;
}
.wiki-glossary-pop__more:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
    .wiki-glossary-pop { transition: none; transform: none; }
    .wiki-glossary-pop.is-above { transform: none; }
}

/* In print the popover is irrelevant; keep the term readable as plain text. */
@media print {
    .wiki-glossary-pop { display: none !important; }
    .wiki-glossary { border-bottom: none; }
}
