/* P40 — Entity resolution badges for Oraclea brief renderer
 *
 * Applied to party / company / institution mentions in the brief body.
 * Deliberately understated — native annotation feel, not UI chrome.
 *
 * Usage:
 *   <span class="vc-resolved-entity" data-entity-canonical="Müller Holding AG"
 *         data-entity-type="company" data-entity-jurisdiction="ZH">
 *     Müller AG
 *     <span class="vc-resolved-entity-badge">→ Müller Holding AG (ZH, company)</span>
 *     <span class="vc-resolved-entity-tooltip">…</span>
 *   </span>
 */

/* ── Mention wrapper ──────────────────────────────────────────────────────── */
.vc-resolved-entity {
    position: relative;
    display: inline;
    border-bottom: 1px dotted var(--vc-t4, #5A5673);
    cursor: default;
}

/* ── Inline badge ─────────────────────────────────────────────────────────── */
.vc-resolved-entity-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 0 5px;
    border-radius: 3px;
    font-size: 10px;
    font-variant: small-caps;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--vc-t4, #5A5673);
    background: rgba(150, 145, 175, 0.07);
    border: 1px solid rgba(150, 145, 175, 0.12);
    vertical-align: middle;
    white-space: nowrap;
    transition: background 0.12s, color 0.12s;
    user-select: none;
}

.vc-resolved-entity:hover .vc-resolved-entity-badge {
    color: var(--vc-t2, #B3AECB);
    background: rgba(150, 145, 175, 0.14);
}

/* ── Hover tooltip ────────────────────────────────────────────────────────── */
.vc-resolved-entity-tooltip {
    position: absolute;
    left: 0;
    top: calc(100% + 4px);
    background: var(--vc-bg-surface, #161922);
    border: 1px solid var(--vc-border, rgba(150, 145, 175, 0.1));
    border-radius: 7px;
    padding: 8px 12px;
    font-size: 11px;
    color: var(--vc-t2, #B3AECB);
    z-index: 120;
    min-width: 180px;
    max-width: 300px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    display: none;
    white-space: normal;
    line-height: 1.5;
    text-align: left;
}

.vc-resolved-entity:hover .vc-resolved-entity-tooltip {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.vc-resolved-entity-tooltip-canon {
    font-weight: 600;
    color: var(--vc-t1, #E8E5F0);
}

.vc-resolved-entity-tooltip-meta {
    font-size: 10px;
    color: var(--vc-t4, #5A5673);
}

.vc-resolved-entity-tooltip-aliases {
    font-size: 10px;
    color: var(--vc-t4, #5A5673);
    font-style: italic;
    border-top: 1px solid rgba(150, 145, 175, 0.08);
    padding-top: 3px;
    margin-top: 2px;
}

/* ── Entity type color accent on badge (subtle) ───────────────────────────── */
.vc-resolved-entity[data-entity-type="court"] .vc-resolved-entity-badge {
    color: #7C6FEE;
    border-color: rgba(124, 111, 238, 0.18);
    background: rgba(124, 111, 238, 0.06);
}

.vc-resolved-entity[data-entity-type="government"] .vc-resolved-entity-badge {
    color: #6B8EBD;
    border-color: rgba(107, 142, 189, 0.18);
    background: rgba(107, 142, 189, 0.06);
}

.vc-resolved-entity[data-entity-type="company"] .vc-resolved-entity-badge {
    color: var(--vc-t3, #8B849E);
}

/* ── Mode overrides ───────────────────────────────────────────────────────── */
/* Preview mode: hide annotations, leave text bare */
.vc-brief.mode-preview .vc-resolved-entity-badge {
    display: none;
}

.vc-brief.mode-preview .vc-resolved-entity {
    border-bottom: none;
    cursor: text;
}

/* Print: hide badges */
@media print {
    .vc-resolved-entity-badge,
    .vc-resolved-entity-tooltip {
        display: none !important;
    }

    .vc-resolved-entity {
        border-bottom: none;
    }
}
