/*
 * base.css — shared component utilities (CSS refactor Stage 1c, feature 919).
 *
 * Linked right after tokens.css. Rules sit in the base, layout and utilities layers declared in
 * tokens.css; no tokens live here.
 *
 * Utilities:
 *   .u-mono-label         — monospace font-family only. Sites keep their own font-size /
 *                           letter-spacing / font-weight (those vary ~50/50 across call sites).
 *   .u-mono-label--upper  — adds text-transform: uppercase (compose with .u-mono-label).
 */

/* Utilities land AFTER components (feature 921). FR4/OQ1 sole-declarant invariant
   verified: at every .u-mono-label* adopting site the only directly-matching
   component font-family/text-transform rules set the SAME value (mono / uppercase),
   and inherited (ancestor) font-family is not a cascade conflict — so moving these
   past components flips nothing. */
/* Zero-specificity vertical stack (consolidation 2026-08-23) — the column counterpart
   of dashboard.css's :where(.cluster). Lives here (not dashboard.css) because auth,
   portal, and gift pages link base.css but not dashboard.css. Adopting rules keep
   their own gap; :where() keeps this at (0,0,0) so any component rule wins. */
@layer base {
:where(.stack) {
    display: flex;
    flex-direction: column;
}
}

@layer layout {
.sidebar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--sidebar-gap, var(--space-5));
}

.sidebar > * {
    flex-grow: 1;
    flex-basis: var(--sidebar-w, 20rem);
}

.sidebar > .sidebar__main {
    flex-basis: 0;
    flex-grow: 999;
    min-inline-size: var(--sidebar-main-min, 55%);
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(var(--grid-min, 16rem), 100%), 1fr));
    gap: var(--grid-gap, var(--space-4));
}
}

@layer utilities {
/* Canonical screen-reader-only recipe (consolidation 2026-08-23) — replaces four
   per-component copies (file inputs under styled labels, AT-only labels/text). */
.u-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Truncating row-body column (consolidation 2026-08-23) — the flexible middle column
   of a list/result row: fills the row, clamps children so titles can ellipsize.
   Was .search-result__main / .page-list__main (byte-identical). */
.u-row-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* One-line row title (consolidation 2026-08-23) — meta-size, semibold, ellipsized.
   Was .profile-edit__pin-title / .wz-stop__title / .wz-shortlist__title (byte-identical). */
.u-row-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--font-size-meta);
    font-weight: 600;
    color: var(--color-fg);
}

/* Muted body-text recipes (consolidation 2026-08-23) — the three margin-0 caption/hint
   text styles repeated across ~20 component rules. Compose with the site's semantic class. */
.u-text-caption-muted {
    margin: 0;
    color: var(--color-fg-muted);
    font-size: var(--font-size-caption);
}

.u-text-caption-dim {
    margin: 0;
    color: var(--color-fg-dim);
    font-size: var(--font-size-caption);
}

.u-text-eyebrow-dim {
    margin: 0;
    color: var(--color-fg-dim);
    font-size: var(--font-size-eyebrow);
}

.u-text-meta-muted {
    margin: 0;
    color: var(--color-fg-muted);
    font-size: var(--font-size-meta);
}

.u-mono-label {
    font-family: var(--font-family-mono);
}

.u-mono-label--upper {
    text-transform: uppercase;
}
}

