/* Application-wide corrections to FluentUI's control *behaviour*, as opposed to its colours.
 *
 * Colours belong in orbit-theme.css beside the brand-ink override; per-component styling belongs in that
 * component's scoped .razor.css. This file is for the few rules that have to apply to every instance of a
 * FluentUI element across the whole application, which a scoped stylesheet cannot express. It exists because
 * the host's app.css must not be added to — that is leftover Blazor-template CSS whose selectors the
 * application no longer produces (see Documentation/THEMING.md, "Where colours live").
 *
 * Keep this file small. A rule here overrides a third-party component for every page at once, so each one
 * carries the reason it is justified. */

/* A button's label stays on one line.
 *
 * FluentUI v5's <fluent-button> leaves `white-space: normal` on its content part, so a button squeezed
 * narrower than its label wrapped it onto a second line and grew taller than every other control in its row.
 * That is what made the admin toolbars' "Add ..." buttons two lines tall.
 *
 * Only the wrapping is suppressed. Deliberately no `overflow`/`text-overflow` here: `overflow: hidden` on this
 * flex container would zero its automatic minimum size and let a leading icon shrink away to nothing — the same
 * trap a flex label always has. Leaving a long label room is the caller's job; see OrbitDataGrid.razor.css for
 * how the data grid toolbar does it. */
fluent-button::part(content) {
    white-space: nowrap;
}

/* A dialog field's focus ring is drawn in full.
 *
 * FluentUI draws a control's focus ring as a 2px outline outside its box. A dialog's fields fill the width of
 * <fluent-dialog-body>'s content part, which is `overflow: auto` → the ring's side edges were clipped, and the
 * top edge too on the first field.
 *
 * Growing the scroll box 4px on every side, and padding it back by the same amount, gives the ring room while
 * every field stays exactly where it was. The outset lands only in space that is already padding: the body's
 * 24px sides, and the title and action parts, which already overlap the 8px gaps above and below. */
fluent-dialog-body::part(content) {
    margin: -4px;
    padding: 4px;
}
