/* ============================================================================
 * platform-actions.css — visual parity for the action primitives
 * (<save-button> / <action-link>; brief provisioning-workspace-1L-001 R4,
 * graduation-flight parity ruling 2026-06-11).
 *
 * R4's contract: a row of mixed link/submit actions reads as ONE system.
 * The consumer's btn family (.btn / .btnDefault) is element-agnostic for the
 * properties it sets, but it leaves font-size, box-sizing, vertical-align and
 * text-decoration to element-dependent rules — Bootstrap's .btn/.btn-sm
 * font-size variables and the UA/reboot differences between <a> and <button>
 * are exactly where the two primitives' heights diverged.
 *
 * The pin keys on the primitives' OWN markers (data-platform-*), never on
 * page classes — per-page CSS cannot diverge an <a> primitive from a
 * <button> primitive again. Metrics mirror the .btnDefault family literally
 * (the platform-grid.css precedent: duplicated declarations rather than a
 * dependency on consumer-side tokens). Size utilities (.btn-sm) are
 * deliberately neutralised on primitives: the primitives are one size —
 * that is the parity ruling, not a regression.
 *
 * Colors stay the consumer's (btn family) concern; this file pins BOX
 * METRICS only.
 * ========================================================================= */

a[data-platform-action-link],
button[data-platform-save-button] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-sizing: border-box;
    vertical-align: middle;
    /* Standard action-button padding (the pre-39d0e19 size). The grid-tight shrink
       is now SCOPED to .data-grid-row only (see the override at the foot of this
       file); the BASE button is standard size app-wide. Everything outside a grid
       row is standard: login, standalone form submits, page-level actions (Start a
       revision, Invite a person), and grid toolbar/header buttons (Apply, Reset).
       Re-scope ruling (Fidelis 2026-06-29) correcting the over-broad 39d0e19 global
       shrink, which had dropped padding to 0.25rem and added min-height 1.75rem on
       this base selector. No global min-height here: the standard button sizes to
       its content (about 40px). */
    padding: 0.6rem 1rem;
    border-width: 1px;
    border-style: solid;
    border-radius: 6px;
    font-size: 1rem;
    line-height: 1.2;
    text-decoration: none;
}

a[data-platform-action-link] i,
button[data-platform-save-button] i {
    font-size: 0.9rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

/* Icon-only mode (#205-A density follow-up, Fidelis 2026-06-13). The label is
   gone (it lives in aria-label + title), so the box is squared — equal padding,
   no label width — keeping the same height as the labelled siblings (parity
   holds: same border, font-size, line-height). The visual text is suppressed at
   the primitive (no <span> rendered); these are the box metrics only. */
a[data-platform-action-link][data-icon-only],
button[data-platform-save-button][data-icon-only] {
    /* Squared, standard size (the pre-39d0e19 padding). The grid-tight icon-only
       shrink is scoped to .data-grid-row at the foot of this file; the base
       icon-only button is standard size app-wide. */
    padding: 0.6rem;
}

/* ============================================================================
 * Grid-row tight override (Fidelis re-scope ruling 2026-06-29).
 *
 * The 39d0e19 grid-tight flight shrank these primitives on the BASE selectors,
 * which applied app-wide and regressed every standalone and page-level button.
 * The ruling re-scopes the shrink: TIGHT applies ONLY to an action button INSIDE
 * a data-grid ROW (.data-grid-row, the desktop <tr> emitted by DataGridRowTagHelper,
 * whose cells hold the row action cluster). The SAME primitive outside a grid row
 * keeps the standard size restored above. Grid TOOLBAR/header buttons live in
 * .data-grid-toolbar, not .data-grid-row, so they stay standard too.
 *
 * Tight metrics are the 39d0e19 values: vertical padding 0.25rem (horizontal kept
 * at 1rem), with a preserved tap-target floor of min-height 1.75rem (28px, above
 * the 24px absolute minimum). Icon-only is squared to 0.25rem with min-width/
 * min-height 1.75rem. So a row carrying a button sits a few px taller (about 37px)
 * than a plain text row (about 31px), while the button itself reads about 29px. */
.data-grid-row a[data-platform-action-link],
.data-grid-row button[data-platform-save-button] {
    padding: 0.25rem 1rem;
    min-height: 1.75rem;
}

.data-grid-row a[data-platform-action-link][data-icon-only],
.data-grid-row button[data-platform-save-button][data-icon-only] {
    padding: 0.25rem;
    min-width: 1.75rem;
    min-height: 1.75rem;
}
