/* First stylesheet on the page: the @layer statement here fixes the cascade-layer order for the whole
   document, so it must stay ahead of every other <link>. Lowest to highest priority:

     properties, theme, base     BlazorBlueprint's Tailwind output; base is the preflight reset
     mud-compat                  rolls the preflight back outside .bb-scope (below)
     mudblazor                   MudBlazor, flatpickr and app.css, imported in their original order so
                                 nothing between them changes
     components, utilities, bb   BlazorBlueprint component styles and utilities

   Unlayered rules (theme.css, anything linked after this) beat every layer, so keep new global CSS
   scoped: Mud-era overrides go in app.css, Blueprint overrides target .bb-scope or a data-* attribute.
   Ordering MudBlazor below Blueprint's component/utility layers is what lets Blueprint's classes beat
   Mud's element-level defaults (button, input, a, select) inside a Blueprint subtree; ordering it above
   base keeps the preflight from touching anything Mud styles itself. Mud's own !important utility
   classes (.absolute, .rounded, .justify-end, ...) still beat everything; see docs/ui-migration.md. */
@layer properties, theme, base, mud-compat, mudblazor, components, utilities, bb;

@import url("/_content/MudBlazor/MudBlazor.min.css") layer(mudblazor);
@import url("https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css") layer(mudblazor);
@import url("/css/app.css") layer(mudblazor);

/* The preflight resets elements MudBlazor never styles (raw headings, lists, links, images, native
   form controls), which is why the Blueprint stylesheet used to be attached per page. Outside a
   .bb-scope subtree every element the preflight names is returned to the browser default with
   `all: revert`. A revert only wins where no higher layer has its own declaration, so MudBlazor's
   reset and app.css stay in force; inside .bb-scope the preflight applies as Blueprint expects.
   The selector list mirrors the element selectors of Tailwind v4's preflight as shipped in
   blazorblueprint.css 3.15.0 (@layer base); re-check it when that package is upgraded. */
@layer mud-compat {
    h1:where(:not(.bb-scope *)),
    h2:where(:not(.bb-scope *)),
    h3:where(:not(.bb-scope *)),
    h4:where(:not(.bb-scope *)),
    h5:where(:not(.bb-scope *)),
    h6:where(:not(.bb-scope *)),
    a:where(:not(.bb-scope *)),
    abbr:where(:not(.bb-scope *)),
    b:where(:not(.bb-scope *)),
    strong:where(:not(.bb-scope *)),
    code:where(:not(.bb-scope *)),
    kbd:where(:not(.bb-scope *)),
    samp:where(:not(.bb-scope *)),
    pre:where(:not(.bb-scope *)),
    small:where(:not(.bb-scope *)),
    sub:where(:not(.bb-scope *)),
    sup:where(:not(.bb-scope *)),
    hr:where(:not(.bb-scope *)),
    table:where(:not(.bb-scope *)),
    summary:where(:not(.bb-scope *)),
    progress:where(:not(.bb-scope *)),
    ol:where(:not(.bb-scope *)),
    ul:where(:not(.bb-scope *)),
    menu:where(:not(.bb-scope *)),
    img:where(:not(.bb-scope *)),
    svg:where(:not(.bb-scope *)),
    video:where(:not(.bb-scope *)),
    canvas:where(:not(.bb-scope *)),
    audio:where(:not(.bb-scope *)),
    iframe:where(:not(.bb-scope *)),
    embed:where(:not(.bb-scope *)),
    object:where(:not(.bb-scope *)),
    button:where(:not(.bb-scope *)),
    input:where(:not(.bb-scope *)),
    select:where(:not(.bb-scope *)),
    optgroup:where(:not(.bb-scope *)),
    textarea:where(:not(.bb-scope *)),
    input:where(:not(.bb-scope *))::placeholder,
    textarea:where(:not(.bb-scope *))::placeholder,
    input:where(:not(.bb-scope *))::file-selector-button {
        all: revert;
    }
}
