/*
    CorpMate rich-text box (Pages/CorpMate/Components/OnRichTextEditor.razor): Radzen's HtmlEditor re-pointed at
    MudBlazor's palette so it follows the app's light / dark theme. A plain stylesheet loaded right after Radzen's theme
    (Server.UI doesn't load Blazor's scoped-CSS bundle). Radzen colours the editor through --rz-editor-* variables; the
    toolbar buttons use its generic button classes, hence the explicit rules below.
*/
.on-rich-text {
    --rz-editor-border: 1px solid var(--mud-palette-lines-inputs);
    --rz-editor-border-radius: var(--mud-default-borderradius);
    --rz-editor-content-background-color: var(--mud-palette-surface);
    --rz-editor-toolbar-background-color: var(--mud-palette-background-gray);
    --rz-editor-focus-outline: none;
    --rz-text-color: var(--mud-palette-text-primary);
}

.on-rich-text .rz-html-editor {
    color: var(--mud-palette-text-primary);
}

.on-rich-text .rz-html-editor:focus-within {
    border-color: var(--mud-palette-primary);
}

.on-rich-text.on-rich-text--error .rz-html-editor {
    border-color: var(--mud-palette-error);
}

.on-rich-text .rz-html-editor-toolbar {
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.on-rich-text .rz-html-editor-toolbar .rz-button {
    color: var(--mud-palette-text-primary) !important;
    background-color: transparent !important;
}

.on-rich-text .rz-html-editor-toolbar .rz-button:hover:not(.rz-state-disabled) {
    background-color: var(--mud-palette-action-default-hover) !important;
}

.on-rich-text .rz-html-editor-toolbar .rz-button.rz-state-active {
    color: var(--mud-palette-primary) !important;
    background-color: var(--mud-palette-action-default-hover) !important;
}

.on-rich-text .rz-html-editor-toolbar .rz-button.rz-state-disabled {
    color: var(--mud-palette-text-disabled) !important;
}

.on-rich-text .rz-html-editor-content {
    color: var(--mud-palette-text-primary);
    font-family: var(--mud-typography-body1-family);
    font-size: var(--mud-typography-body1-size);
}

/* MudBlazor's reset zeroes list padding, which pushes the numbers / bullets outside the box. Also for the read-only
   rendering of stored rich text (.on-rich-text-view, e.g. the 5351E pre-defined / template blocks). */
.on-rich-text .rz-html-editor-content ol,
.on-rich-text .rz-html-editor-content ul,
.on-rich-text-view ol,
.on-rich-text-view ul {
    padding-left: 2em;
    margin: 0 0 0.5em 0;
}

.on-rich-text-view p {
    margin: 0 0 0.5em 0;
}

/* Table cells get a faint guide while editing (the portal prints tables without borders). */
.on-rich-text .rz-html-editor-content table td,
.on-rich-text .rz-html-editor-content table th {
    border: 1px dashed var(--mud-palette-lines-default);
    padding: 2px 6px;
}
