/* =================================================================== */
/*  Person + Entity Dashboards — shared layout                           */
/* =================================================================== */
/*                                                                       */
/*  The entity dashboard (Lieux/Organisations/Sujets/Événements) reuses  */
/*  the same panel modules as the person dashboard with a no-op facet,   */
/*  so the two share the same body / stats / grid structure under        */
/*  different BEM prefixes. This stylesheet is enqueued by both the      */
/*  person and entity resource-page templates.                           */
/*                                                                       */
/*  Block-specific additions on top of core:                             */
/*    - Body / stats / facet wrappers                                    */
/*    - Sentiment panel (polarité / centralité / subjectivité)           */
/*    - Associated-entities network (graph host + toolbar)               */
/*    - Subject co-occurrence chord host                                 */
/*                                                                       */
/*  Depends on iwac-core.css + iwac-maplibre.css (for the locations     */
/*  map panel).                                                          */
/* =================================================================== */

.iwac-vis-person,
.iwac-vis-entity {
    display: block;
}

.iwac-vis-person__body,
.iwac-vis-entity__body {
    display: flex;
    flex-direction: column;
    gap: var(--space-4, 1rem);
}

.iwac-vis-person__stats,
.iwac-vis-entity__stats {
    margin-bottom: var(--space-3, 0.75rem);
}

.iwac-vis-person__facet {
    margin-bottom: var(--space-3, 0.75rem);
}


/* =================================================================== */
/*  Sentiment panel — model picker + stacked bars                        */
/* =================================================================== */

/*  The polarité chart uses --iwac-vis-sent-* tokens, the centralité
 *  chart uses --iwac-vis-cent-* tokens (both defined in iwac-core.css).
 *  The JS reads them via getComputedStyle — never hex literals. */

.iwac-vis-sentiment {
    display: flex;
    flex-direction: column;
    gap: var(--space-3, 0.75rem);
}

.iwac-vis-sentiment__picker {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2, 0.5rem);
}

.iwac-vis-sentiment__caption {
    font-size: var(--text-sm, 0.9rem);
    color: var(--muted, #6e7a82);
    font-variant-numeric: tabular-nums;
}

.iwac-vis-sentiment__chart {
    width: 100%;
    min-height: 110px;
}

.iwac-vis-sentiment__chart--cen,
.iwac-vis-sentiment__chart--sub {
    margin-top: var(--space-2, 0.5rem);
}


/* =================================================================== */
/*  Associated entities — force-layout network panel                     */
/* =================================================================== */

/*  Buttons inherit color, border, focus-visible, and transition from
 *  `.iwac-vis-btn` (the network panel composes both classes), so this
 *  file only overrides the icon-button geometry. The graph host gets
 *  a taller min-height than the default chart to accommodate the
 *  force-layout bbox (typically 460px square for a 50-node graph).
 *
 *  The graph host opts out of the shared panel toolbar via the
 *  `.iwac-vis-graph-host` marker class — it ships its own toolbar
 *  with zoom + legend + fullscreen + download buttons. */

.iwac-vis-graph-host {
    position: relative;
    min-height: 640px;
}

/*  Co-occurrence chord panel needs the same breathing room as the
 *  associated-entities graph so labels on the ring don't clip. */
.iwac-vis-chord-host {
    position: relative;
    min-height: 640px;
}

@media (max-width: 640px) { /* sm */
    .iwac-vis-graph-host,
    .iwac-vis-chord-host {
        min-height: 520px;
    }
}

.iwac-vis-graph-toolbar {
    position: absolute;
    top: var(--space-2, 0.5rem);
    right: var(--space-2, 0.5rem);
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: var(--space-1, 0.25rem);
}

.iwac-vis-graph-toolbar__btn {
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: var(--text-lg, 1.125rem);
    line-height: 1;
    box-shadow: var(--shadow-xs, 0 1px 2px 0 var(--iwac-vis-shadow-subtle));
}

.iwac-vis-graph-toolbar__btn--pressed {
    background: color-mix(in srgb, var(--primary, #e67a14) 18%, var(--surface, #fdfdfc));
    border-color: color-mix(in srgb, var(--primary, #e67a14) 60%, var(--border, #dcd7ce));
    color: var(--primary, #e67a14);
}
