/* =========================================================================
   Mikhael's Lexicon Architect — Cyber-Baroque tooltip
   Bespoke, vanilla CSS. No dependencies. All rules scoped to .lexicon-*.
   ========================================================================= */

.lexicon-term {
    color: inherit;
    text-decoration: underline dotted;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: rgba(168, 148, 255, 0.55);
    cursor: help;
    transition: text-decoration-color 180ms ease, color 180ms ease;
}
a.lexicon-term { text-decoration-color: rgb(0 0 0); }
a.lexicon-term:hover,
.lexicon-term:hover {
    color: #c4b5fd;
    text-decoration-color: rgba(168, 148, 255, 1);
}
.lexicon-term:focus-visible {
    outline: 2px solid rgba(168, 148, 255, 0.7);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ---------- The tooltip itself ---------- */
.lexicon-tooltip {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 9999;

    max-width: 360px;
    min-width: 220px;
    padding: 14px 16px 12px;

    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 6px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.45),
        0 0 0 1px rgba(168, 148, 255, 0.06) inset,
        0 0 16px rgba(99, 102, 241, 0.12);

    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
    font-size: 13.5px;
    line-height: 1.55;
    letter-spacing: 0.005em;

    opacity: 0;
    transform: translateY(4px);
    transition: opacity 140ms ease, transform 140ms ease;

    pointer-events: none;
}
.lexicon-tooltip.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* ---------- Internal structure ---------- */
.lexicon-tooltip__phonetic {
    display: block;
    margin: 0 0 6px 0;
    color: #94a3b8;
    font-family: "JetBrains Mono", "SFMono-Regular", Consolas, Menlo, monospace;
    font-size: 11.5px;
    letter-spacing: 0.03em;
}
.lexicon-tooltip__phonetic:empty { display: none; }

.lexicon-tooltip__body {
    color: #e2e8f0;
}

.lexicon-tooltip__link {
    display: inline-block;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    width: 100%;

    color: #a78bfa;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
}
.lexicon-tooltip__link:hover {
    color: #c4b5fd;
}
.lexicon-tooltip__link::after {
    content: " →";
    transition: margin-left 140ms ease;
}
.lexicon-tooltip__link:hover::after {
    margin-left: 3px;
}

/* ---------- Tail accents — subtle baroque flourishes ---------- */
.lexicon-tooltip::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 6px;
    pointer-events: none;
    background:
        radial-gradient(120% 60% at 10% 0%, rgba(168, 148, 255, 0.10), transparent 60%),
        radial-gradient(80% 50% at 90% 100%, rgba(56, 189, 248, 0.06), transparent 60%);
}

/* ---------- Optional category accents (used when terms have term_category) ---
   Sites can override these by targeting .lexicon-cat-{slug} in their own theme. */
.lexicon-term.lexicon-cat-acronym  { text-decoration-color: rgba(244, 114, 182, 0.55); }
.lexicon-term.lexicon-cat-acronym:hover { color: #f9a8d4; text-decoration-color: rgba(244, 114, 182, 1); }

.lexicon-term.lexicon-cat-tech     { text-decoration-color: rgba(56, 189, 248, 0.55); }
.lexicon-term.lexicon-cat-tech:hover { color: #7dd3fc; text-decoration-color: rgba(56, 189, 248, 1); }

.lexicon-term.lexicon-cat-culture  { text-decoration-color: rgba(250, 204, 21, 0.55); }
.lexicon-term.lexicon-cat-culture:hover { color: #fde047; text-decoration-color: rgba(250, 204, 21, 1); }
