/* Shared card primitive presentation (coding-standards §3/§4/§12). Backs the one <x-platform::card>
   component every page/section wraps itself in, so there is no per-module card styling to drift. It
   layers ON Bootstrap's `.card` (component-depth decision D-012): Bootstrap already draws the base box
   from its `--bs-card-*` variables, which bootstrap-theme.css re-points at our `--platform-*` tokens —
   so this sheet only pins the handful of properties we want to own outright (radius, border, surface,
   shadow, padding) directly to platform tokens, and adds the equal-height behaviour Bootstrap does not.
   All values are design tokens (tokens.css), so light↔dark is a token-scope switch, not per-component
   CSS. Loads AFTER bootstrap.min.css so `.platform-card` wins any overlap. Mobile-first; no inline styles. */

.platform-card {
    /* Own the box outright from our tokens (not just via the --bs-card-* remap) so a card looks right
       even outside a Bootstrap-var context and reads straight from the design language. */
    background: var(--platform-color-surface);
    border: 1px solid var(--platform-color-border);
    border-radius: var(--platform-radius-lg);
    box-shadow: var(--platform-shadow-sm);
    color: var(--platform-color-text);

    /* Equal-height friendly — the load-bearing property for the split-view editor (M-048f): as a flex or
       grid child the card stretches to fill its row's height, so two side-by-side cards stay level. Harmless
       for a stand-alone card, which has no row to fill. */
    height: 100%;
}

/* Natural-height opt-out (M-069). Where SIBLINGS stack BELOW the card in the same (stretched) column —
   e.g. the detail view's left column: details card + access panel + audit history + comments — the card
   must NOT fill the column height, or it grows to the full row height and shoves those siblings far down.
   This scopes the height back to `auto` for exactly those cards; the editor's equal-height split keeps the
   default `height: 100%` above. Declared after the base rule so it wins the (equal-specificity) overlap. */
.platform-card--natural {
    height: auto;
}

.platform-card__header {
    padding: var(--platform-space-md) var(--platform-space-lg);
    border-bottom: 1px solid var(--platform-color-border);
}

.platform-card__title {
    margin: 0;
    font-size: var(--platform-font-size-md);
    font-weight: 600;
    color: var(--platform-color-text);
    letter-spacing: var(--platform-letter-spacing);
}

.platform-card__body {
    padding: var(--platform-space-lg);
}

/* Snug padding (<x-platform::card padding="snug">) — HALF the default. For content that carries its own
   internal structure and spacing, a data grid above all: it needs to be inset from the card's edge (rows
   running into the border look like a bug, not a decision) but it must not be indented as if it were prose,
   which wastes the width a table exists to use. Expressed as a fraction of the default rather than a token of
   its own, so it stays half a card's padding by construction if the scale is ever retuned. */
.platform-card__body--snug {
    padding: calc(var(--platform-space-lg, 1.5rem) / 2);
}

/* Compact padding (<x-platform::card padding="compact">). For a card whose content is a CONTROL STRIP
   rather than prose — the grid toolbar being the case that asked for it: one row of ~2.25rem controls in
   a body padded for paragraphs reads as a bulky header. Tightened vertically first (the axis the bulk is
   on), and kept on the same tokens so it tracks the density scale (M-084) rather than inventing a size. */
.platform-card__body--compact {
    padding: var(--platform-space-sm) var(--platform-space-md);
}

.platform-card__header--compact {
    padding: var(--platform-space-sm) var(--platform-space-md);
}

/* ── Tabbed card (M-207) ──────────────────────────────────────────────────────────────────────────
   <x-platform::tabbed-card> hosts a `.platform-tabs` strip in the header region and a full-bleed body
   (typically the shared Tabulator grid) below, reading as ONE bordered surface. The strip carries its own
   bottom rule, so the tabs header drops the default header's own border + bottom padding and the strip
   drops its bottom margin — that rule becomes the single header/body divider, spanning the full card width
   (the header has no horizontal padding; the tabs' own padding insets their labels). */
.platform-card__header--tabs {
    padding: var(--platform-space-sm) 0 0;
    border-bottom: 0;
}

.platform-card__header--tabs .platform-tabs {
    margin-block-end: 0;
}

/* Flush body: a full-bleed child (e.g. the grid) spans the card with no inset. Paired with the grid's
   in-card reset (table.css), the child draws no second border/surface — exactly one box. Opt-in, so a
   normal padded body is unaffected and a card that WANTS a bordered grid inside it simply omits this. */
.platform-card__body--flush {
    padding: 0;
}

.platform-card__header--flush {
    padding: 0;
}
