/* =====================================================================================
   The app's own colour tokens, for surfaces in the portal that have to look like the app.

   The page builder's style preview and the block designer's canvas both render the app's
   real markup and the app's real stylesheet (hb-elements.css). That stylesheet resolves
   every colour through --color-sf-*, which in the app come from Syncfusion's Material 3
   theme. The portal runs Fluent 2, so those custom properties simply aren't there — the
   preview would fall through to nothing and paint transparent-on-transparent.

   So the values are restated here, scoped to .hb-app-surface, taken verbatim from
   Syncfusion.Blazor.Themes material3.css and material3-dark.css. They are space-separated
   RGB triples because that is how Material 3 publishes them and why every use in the app
   is wrapped in rgb() / rgba() — which is also what lets color-mix() work on them.

   The brand layer (--hb-brand-c1/c2/bg) is NOT here. It is per client, and the preview
   sets it inline from that client's own palette, exactly as setBrandPalette does in the
   app. Same for the fonts: --hb-font-heading/--hb-font-body come in from the client's
   typography settings, so "use my app's fonts" previews as the client's real fonts rather
   than the portal's.

   Pinned to 33.2.15, the version both projects are on. If the app's theme moves, these
   move with it.
   ===================================================================================== */

.hb-app-surface {
    --color-sf-primary: 103, 80, 164;
    --color-sf-on-primary: 255, 255, 255;
    --color-sf-primary-container: 234, 221, 255;
    --color-sf-on-primary-container: 33, 0, 94;
    --color-sf-secondary: 98, 91, 113;
    --color-sf-on-secondary: 255, 255, 255;
    --color-sf-secondary-container: 232, 222, 248;
    --color-sf-on-secondary-container: 30, 25, 43;
    --color-sf-surface: 255, 255, 255;
    --color-sf-surface-variant: 231, 224, 236;
    --color-sf-surface-container: 255, 255, 255;
    --color-sf-on-surface: 28, 27, 31;
    --color-sf-on-surface-variant: 73, 69, 78;
    --color-sf-outline: 121, 116, 126;
    --color-sf-outline-variant: 196, 199, 197;
    --color-sf-background: 255, 255, 255;

    /* The pinned stock accents the page-builder's DEFAULT element chain reads (see hb-elements.css).
       They are the same values as --color-sf-primary above and must stay so: in the app those two
       diverge, because the client's brand is mapped onto --color-sf-* while an unstyled element
       deliberately keeps the theme's own colour. Here nothing maps a brand onto anything, so the
       builder previews an unstyled element exactly as the app paints it. Without them the chain
       resolves to an invalid value and an unstyled button previews with no colour at all. */
    --hb-theme-primary: 103, 80, 164;
    --hb-theme-secondary: 98, 91, 113;
    --hb-theme-on-primary: 255, 255, 255;

    /* The app's body size, so a preview of a 22px label is 22px against the right baseline. */
    --bs-body-font-size: 1rem;

    color: rgb(var(--color-sf-on-surface));
    background: rgb(var(--color-sf-background));
}

.hb-app-surface.dark {
    --color-sf-primary: 208, 188, 255;
    --color-sf-on-primary: 55, 30, 115;
    --color-sf-primary-container: 79, 55, 139;
    --color-sf-on-primary-container: 234, 221, 255;
    --color-sf-secondary: 204, 194, 220;
    --color-sf-on-secondary: 51, 45, 65;
    --color-sf-secondary-container: 74, 68, 88;
    --color-sf-on-secondary-container: 232, 222, 248;
    --color-sf-surface: 28, 27, 31;
    --hb-theme-primary: 208, 188, 255;
    --hb-theme-secondary: 204, 194, 220;
    --hb-theme-on-primary: 55, 30, 115;
    --color-sf-surface-variant: 73, 69, 79;
    --color-sf-surface-container: 28, 27, 31;
    --color-sf-on-surface: 230, 225, 229;
    --color-sf-on-surface-variant: 202, 196, 208;
    --color-sf-outline: 147, 143, 153;
    --color-sf-outline-variant: 68, 71, 70;
    --color-sf-background: 28, 27, 31;
}
