/* ============================================================================
 * Compliance — matrix item-code help wrapper + Alerts column.
 *
 * Split out of ``compliance/tooltip.css`` on 2026-10-26. That file held two
 * unrelated things: the product-wide tooltip component (now
 * ``design-system/tooltip.css``) and these framework-matrix helpers. The
 * wrappers here POSITION hosts that carry a tooltip; they do not style the
 * bubble, which has one definition in the design system.
 * ==========================================================================*/

/* ════════════════════════════════════════════════════════════════════
 * Matrix item-code "help" wrapper + Alerts column — shared across
 * compliance frameworks.  Originally authored inside CISA's static
 * folder; promoted here so AWIA / future parallel-measures matrices
 * can use the same Jinja pattern (info icon + tooltip + deep-linked
 * count pill) without duplicating styles.
 * ════════════════════════════════════════════════════════════════════ */

/* Inline-flex wrapper around an item-code <span> when the column
 * header carries a tooltip.  Keeps the code text and the trailing
 * .info-help-icon visually grouped (small gap, vertical centre).
 * ``cursor: help`` advertises that the header is hoverable.
 * ``white-space: nowrap`` on the wrapper keeps codes like "RRA-A"
 * from wrapping mid-token when the info-icon nudges them past the
 * column's preferred width — the table cell grows instead. */
.fw-matrix-item-code-help {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    cursor: help;
    white-space: nowrap;
}

/* Alerts column (rightmost in the Tenants matrix) — fixed narrow
 * width, centred header text, tabular numerals on the cells so
 * single- vs three-digit counts line up. */
.fw-matrix-alerts-col {
    width: 5.5rem;
    text-align: center;
}
.fw-matrix-cell-alerts {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Pill rendering for the deep-linked alert count.  Tone is red
 * (--danger-* tokens) because firing alerts read as alarm, not
 * success — earlier green iterations were misleading. */
.fw-matrix-alert-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 2px 8px;
    border-radius: 9999px;
    background: var(--status-danger-bg);
    color: var(--danger-deep-fg);
    border: 1px solid var(--danger-border);
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    transition:
        background 0.12s,
        border-color 0.12s,
        color 0.12s,
        transform 0.12s,
        box-shadow 0.12s;
}
.fw-matrix-alert-link:hover,
.fw-matrix-alert-link:focus-visible {
    background: var(--danger-fg);
    border-color: var(--danger-fg);
    color: var(--fg-on-dark);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 1px 4px rgba(220, 38, 38, 0.3);
}
.fw-matrix-alert-link:focus-visible {
    outline: 2px solid var(--danger-fg);
    outline-offset: 2px;
}
.fw-matrix-alert-link-glyph {
    display: inline-flex;
    align-items: center;
    color: currentColor;
    opacity: 0.65;
    transition: opacity 0.12s;
}
.fw-matrix-alert-link:hover .fw-matrix-alert-link-glyph,
.fw-matrix-alert-link:focus-visible .fw-matrix-alert-link-glyph {
    opacity: 1;
}
