/* App-wide look that MudTheme cannot express (panel tint, control sizing), loaded after MudBlazor.min.css by both
   hosts (Server App.razor, Maui index.html). Palette, fonts and typography live in Layout/AppTheme.cs.

   Control sizing: MudBlazor sizes inputs and buttons independently (padding + line height), so a dropdown next to a button only lines
   up by accident. Both are derived from the token below: change it and they resize together, without touching any
   component. Small and large buttons, default (non-dense) inputs and the small icon button override in app.css keep
   MudBlazor's own sizes. */

:root {
    --bricca-control-height: 36px;
}

/* Subtle tint for side panels: the app bar's blue, made transparent (palette AppbarBackground in AppTheme.cs). */
.bricca-tint {
    background-color: color-mix(in srgb, var(--mud-palette-appbar-background) 20%, transparent);
}

/* An empty MudChip as a small status dot: the chip's Color supplies the palette colour. */
.mud-chip.bricca-dot {
    flex: none;
    width: 0.4rem;
    min-width: 0;
    height: 0.4rem;
    margin: 0;
    padding: 0;
}

/* Dense outlined inputs: MudSelect, MudTextField, MudNumericField, MudAutocomplete and the pickers (Margin.Dense).
   The height is the text line plus vertical padding, so the padding is what remains of the control height. */
.mud-input > input.mud-input-root-outlined.mud-input-root-margin-dense,
div.mud-input-slot.mud-input-root-outlined.mud-input-root-margin-dense {
    padding-top: calc((var(--bricca-control-height) - 1lh) / 2);
    padding-bottom: calc((var(--bricca-control-height) - 1lh) / 2);
}

/* Dropdowns (MudSelect, MudAutocomplete) are borderless, also while open or focused: a light fill and the arrow at the end mark them as
   dropdowns, so they do not compete with the rest of the page. Focus is shown with a darker fill. An error border (validation)
   keeps its own !important rule from MudBlazor. */
.mud-select .mud-input.mud-input-outlined .mud-input-outlined-border,
.mud-select .mud-input.mud-input-outlined:focus-within .mud-input-outlined-border,
.mud-select .mud-input.mud-input-outlined:hover:not(.mud-disabled):not(:focus-within) .mud-input-outlined-border,
.mud-autocomplete .mud-input.mud-input-outlined .mud-input-outlined-border,
.mud-autocomplete .mud-input.mud-input-outlined:focus-within .mud-input-outlined-border,
.mud-autocomplete .mud-input.mud-input-outlined:hover:not(.mud-disabled):not(:focus-within) .mud-input-outlined-border {
    border-color: transparent;
}

.mud-select .mud-input-outlined,
.mud-autocomplete .mud-input-outlined {
    background-color: color-mix(in srgb, var(--mud-palette-action-default) 8%, transparent);
    border-radius: var(--mud-default-borderradius);
    transition: background-color 150ms ease-in-out;
}

.mud-select .mud-input-outlined:not(.mud-disabled):hover,
.mud-autocomplete .mud-input-outlined:not(.mud-disabled):hover,
.mud-select .mud-input-outlined:focus-within,
.mud-autocomplete .mud-input-outlined:focus-within {
    background-color: color-mix(in srgb, var(--mud-palette-action-default) 14%, transparent);
}

/* Microphone list in the recording bar. Device names can be very long; an unbounded list grows wider than the space right of the select
   and MudBlazor then shifts it far to the left (seen with the nav menu open on a medium screen). Cap it so long names wrap instead. */
.recording-bar-device-list {
    max-width: min(420px, calc(100vw - 32px));
}

/* Medium text buttons (the default size). The label is centred by the button itself. */
.mud-button-root.mud-button-filled-size-medium,
.mud-button-root.mud-button-outlined-size-medium,
.mud-button-root.mud-button-text-size-medium {
    height: var(--bricca-control-height);
    padding-top: 0;
    padding-bottom: 0;
}

/* Medium filled and outlined icon buttons are squares of the same size. */
.mud-icon-button.mud-button-filled-size-medium,
.mud-icon-button.mud-button-outlined-size-medium {
    width: var(--bricca-control-height);
    padding-left: 0;
    padding-right: 0;
}

/* Nav drawer toggle: the hamburger/cross icon spins a half turn while the menu opens or closes. */
.nav-toggle .mud-icon-root {
    transition: transform 0.25s ease-in-out;
}

.nav-toggle-open .mud-icon-root {
    transform: rotate(180deg);
}

/* Session list rows: a narrower right gutter than the default 16px so titles use the width they have. */
.session-list .mud-list-item-gutters {
    padding-right: 8px;
}

/* The editable session title is a real button (keyboard reachable) that looks like plain heading text. */
.session-title-button {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: start;
    cursor: pointer;
}

.session-title-button:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Scribe session tabs (Summary, Transcript, ...): slightly smaller than MudBlazor's default tab text. */
.scribe-tabs .mud-tab {
    font-size: 0.8125rem;
}
