/* Quill's editing surface, patching what blazorblueprint.css leaves out. Global because the editor is
   BbRichTextEditor's own output, which component-scoped CSS never reaches (::deep would, but the rules
   below belong to the library's markup rather than to any one step of ours).

   In the client project, alongside map.css and for the same reason: the component gallery references
   only aurora-blazor.Client, so anything left in the server's app.css is invisible there — and the
   gallery is where someone would look at this editor. One file, linked by App.razor and iframe.html.

   Quill's live DOM is not the HTML it saves. While you type, *both* list kinds are an <ol>, told apart
   only by an attribute — <ol><li data-list="bullet"> — and Quill's own core stylesheet is what turns
   that attribute into a marker. We do not ship that stylesheet (the editor runs headless with a Blazor
   toolbar), and blazorblueprint.css styles the semantic tags instead: `ol { list-style-type: decimal }`.
   The result without these rules is a bullet list rendering as a numbered one while it is being written,
   and then saving correctly, because getSemanticHTML maps "ordered" to <ol> and everything else to <ul>.
   Indentation and alignment have no styling there at all, in either view. */
[data-slot=rich-text-editor] .ql-editor ol {
    list-style: none;
    counter-reset: ql-list;
}

[data-slot=rich-text-editor] .ql-editor li[data-list] {
    /* The marker is drawn by ::before, so it needs room that list-style would otherwise have reserved. */
    position: relative;
    padding-left: 1.2em;
}

[data-slot=rich-text-editor] .ql-editor li[data-list]::before {
    position: absolute;
    left: 0;
    content: "\2022";
}

/* counter-increment only on ordered items: a bullet in the middle of a numbered list must not consume
   a number, or the items after it are numbered as though it had been one. */
[data-slot=rich-text-editor] .ql-editor li[data-list=ordered] {
    counter-increment: ql-list;
}

[data-slot=rich-text-editor] .ql-editor li[data-list=ordered]::before {
    content: counter(ql-list) ".";
}

/* Quill emits one class per level, 1-8. */
[data-slot=rich-text-editor] .ql-editor .ql-indent-1 { padding-left: 3em }
[data-slot=rich-text-editor] .ql-editor .ql-indent-2 { padding-left: 6em }
[data-slot=rich-text-editor] .ql-editor .ql-indent-3 { padding-left: 9em }
[data-slot=rich-text-editor] .ql-editor .ql-indent-4 { padding-left: 12em }
[data-slot=rich-text-editor] .ql-editor .ql-indent-5 { padding-left: 15em }
[data-slot=rich-text-editor] .ql-editor .ql-indent-6 { padding-left: 18em }
[data-slot=rich-text-editor] .ql-editor .ql-indent-7 { padding-left: 21em }
[data-slot=rich-text-editor] .ql-editor .ql-indent-8 { padding-left: 24em }

[data-slot=rich-text-editor] .ql-editor .ql-align-center { text-align: center }
[data-slot=rich-text-editor] .ql-editor .ql-align-right { text-align: right }
[data-slot=rich-text-editor] .ql-editor .ql-align-justify { text-align: justify }
