/* Audit results grid — column resize + reorder UX (#23 follow-ups Task 10).
   The base .table classes come from Bootstrap; the rules below add the
   resize-handle affordance and the drag-to-reorder drop feedback. The
   interaction itself lives in wwwroot/js/audit-grid.js — this file is purely
   the visual treatment. Internal-tool aesthetic: subtle, no flashy motion. */

/* A persisted width is delivered as the --audit-col-width custom property on
   the <th> and matching <td> cells (set inline by the component / by
   audit-grid.js during a drag). When present it pins the cell; when absent
   the column falls back to Bootstrap auto-layout. The body cells also clip
   overflowing text so a narrowed column stays tidy. */
.audit-grid-th[style*="--audit-col-width"],
.audit-grid-td[style*="--audit-col-width"] {
    width: var(--audit-col-width);
    min-width: var(--audit-col-width);
    max-width: var(--audit-col-width);
}

.audit-grid-td[style*="--audit-col-width"] {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The header cell hosts the resize handle on its right edge, so it must be a
   positioning context. Padding on the right is trimmed so the 6px handle does
   not crowd the label text. */
.audit-grid-th {
    position: relative;
    padding-right: 0.75rem;
    /* The whole header is draggable for reorder — a grab cursor signals it. */
    cursor: grab;
    user-select: none;
    white-space: nowrap;
}

.audit-grid-th:active {
    cursor: grabbing;
}

/* V — resize handle. A thin invisible hit-strip on the right edge: 6px wide
   for a comfortable grab target, transparent at rest so the header reads
   clean. On hover a hairline primary rule fades in via the inset box-shadow
   so the affordance is discoverable without being visually noisy. */
.audit-grid-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    /* Sit above the draggable header so a resize never starts a reorder. */
    z-index: 1;
    transition: box-shadow 0.08s linear, background-color 0.08s linear;
}

.audit-grid-resize-handle:hover {
    /* Hairline rule centred on the strip's right edge. */
    box-shadow: inset -2px 0 0 -1px rgba(var(--bs-primary-rgb), 0.55);
    background-color: rgba(var(--bs-primary-rgb), 0.06);
}

/* While a drag-resize is in progress the column gets a steady primary rule on
   its right edge so the user keeps a clear visual anchor. */
.audit-grid-th.resizing {
    box-shadow: inset -2px 0 0 0 var(--bs-primary);
}

.audit-grid-th.resizing .audit-grid-resize-handle {
    background-color: rgba(var(--bs-primary-rgb), 0.55);
}

/* V — reorder feedback. The dragged header dims slightly; the prospective
   drop target gets a left-edge accent rule + a faint info wash, matching the
   TreeView drop-target idiom (a quiet, unmistakable cue, not an animation). */
.audit-grid-th.dragging {
    opacity: 0.45;
}

.audit-grid-th.drop-target {
    background-color: rgba(var(--bs-info-rgb), 0.18);
    box-shadow: inset 2px 0 0 0 var(--bs-info);
}
