/* ============================================================
 * DS Design System — Utility classes for complex Telerik components
 * ============================================================
 * For components too complex to wrap (deep sub-component trees),
 * apply these classes via the Telerik `Class` parameter:
 *
 *   <TelerikGrid Data="@data" Class="ds-c-grid" ...>
 *
 * These are NOT scoped — they must be loaded globally (after
 * kendo-bridge.css) to override Kendo/Telerik defaults.
 * ============================================================ */


/* ── Grid / Table ── */

.ds-c-grid .k-grid-header,
.ds-c-grid .k-grid-header-wrap {
    background-color: var(--ds-table-headerContainer);
}

.ds-c-grid .k-header,
.ds-c-grid th.k-header {
    background-color: var(--ds-table-headerContainer);
    color: var(--ds-table-headerText);
    padding: var(--ds-table-cellPaddingY) var(--ds-table-cellPaddingX);
    border-color: var(--ds-table-border);
    border-width: var(--ds-table-borderWidth);
    font-family: var(--ds-table-headerTypography-font-family);
    font-size: var(--ds-table-headerTypography-font-size);
    font-weight: var(--ds-table-headerTypography-font-weight);
    line-height: var(--ds-table-headerTypography-line-height);
}

.ds-c-grid td,
.ds-c-grid .k-table-td {
    padding: var(--ds-table-cellPaddingY) var(--ds-table-cellPaddingX);
    border-color: var(--ds-table-border);
    border-width: var(--ds-table-borderWidth);
    font-family: var(--ds-table-cellTypography-font-family);
    font-size: var(--ds-table-cellTypography-font-size);
    font-weight: var(--ds-table-cellTypography-font-weight);
    line-height: var(--ds-table-cellTypography-line-height);
}

.ds-c-grid .k-alt,
.ds-c-grid .k-table-alt-row {
    background-color: var(--ds-table-rowAlt);
}

.ds-c-grid .k-grid-content tr:hover,
.ds-c-grid .k-table-row:hover {
    background-color: var(--ds-table-rowHover);
}

.ds-c-grid .k-selected,
.ds-c-grid .k-table-row.k-selected {
    background-color: var(--ds-table-rowSelected);
}

.ds-c-grid {
    border-color: var(--ds-table-border);
    border-width: var(--ds-table-borderWidth);
}


/* ── Tabular numerals (BF-18) ──
 * Fixed-width, baseline-aligned figures for columns of numbers, amount /
 * currency fields, and any data that must line up vertically. Apply the helper
 * to a cell/element, or scope it to a grid's numeric columns:
 *
 *   <span class="ds-u-tabular-nums">1.234,56 kr.</span>
 *   <TelerikGrid Class="ds-c-grid ds-c-grid--tabular" ...>  (all body cells)
 *
 * React (CSS modules) references the same token directly:
 *   fontFeatureSettings: 'var(--ds-typography-featureSettings-tabular)'
 *
 * GH-450: the token was renamed from --ds-typography-numeric-tabular because
 * that name read like a font-variant-numeric keyword while holding
 * font-feature-settings syntax; the old name is kept as a deprecated
 * backward-compat alias only. The progressive-enhancement line below is now
 * bound to its own correctly-typed keyword sibling instead of a hardcoded
 * literal.
 */
.ds-u-tabular-nums,
.ds-c-grid--tabular td,
.ds-c-grid--tabular .k-table-td {
    font-feature-settings: var(--ds-typography-featureSettings-tabular);
    /* progressive enhancement — the standardized property where supported */
    font-variant-numeric: var(--ds-typography-variantNumeric-tabular);
}


/* ── DsAppShell floating-slot inline clearance (GH-2607) ──
 * DsAppShell reserves BLOCK-END clearance under its floating slot (the FAB)
 * automatically — --ds-appShell-floatingClearance, GH-599/GH-1309 — but never
 * INLINE-END clearance: not every row reaches the shell's trailing edge, so
 * paying for it on every row would waste space on the ones that do not. Apply
 * this to a region that DOES reach the trailing edge — a full-width card
 * grid, a row of trailing controls — so it clears the FAB AT REST, not just
 * mid-scroll:
 *
 *   <div class="dir__grid ds-u-clear-floating-inline"> ... </div>
 *
 * Reads --ds-appShell-floatingClearanceInline, which DsAppShell publishes on
 * its root ONLY while floatingSlot is filled (0 — inert — on a shell with no
 * FAB, tokens/components/appShell.json). Not scoped — must be loaded
 * globally, like the rest of this file.
 */
.ds-u-clear-floating-inline {
    padding-inline-end: var(--ds-appShell-floatingClearanceInline, 0px);
}
