/* MBX theme.

   The look MBX opens with is "Storm", a preset from Blazor Blueprint
   (blazorblueprintui.com/docs/theming). The sun/moon button in the top bar
   switches between light and dark by adding or removing the "dark" class on
   <html>.

   The paintbrush button beside it is the theme chooser. It lets each person
   pick a base tone (Zinc, Slate, Gray, Neutral, Stone) and an accent colour,
   remembered in their browser. It works by putting data-base-color and
   data-primary-color on <html>; the colours for those come from the
   library's own themes.css, which is loaded after this file.

   Storm takes the place of "Slate" in the chooser: Slate is MBX's default
   base tone, and while it is chosen the Storm colours below apply. The three
   accent values (primary, its text colour, and the focus ring) are kept in
   their own rules, so that picking an accent colour replaces only those. */

/* ---- always: how tightly things are packed, and how round the corners are ---- */

:root {
  /* Density: Blazor Blueprint multiplies every padding, gap and row height by
     this. 0.25rem is its standard, 0.21875rem compact, 0.1875rem dense.
     MBX uses dense, whatever theme is chosen. */
  --bb-spacing: 0.1875rem;
  --radius: 0.5rem;
}

/* ---- Storm, light ---- */

:root,
:root[data-base-color="slate"] {
  --background: oklch(1 0 0);
  --foreground: oklch(0.129 0.042 264.695);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.129 0.042 264.695);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.129 0.042 264.695);
  --secondary: oklch(0.968 0.007 247.896);
  --secondary-foreground: oklch(0.208 0.042 265.755);
  --muted: oklch(0.968 0.007 247.896);
  --muted-foreground: oklch(0.554 0.046 257.417);
  --accent: oklch(0.968 0.007 247.896);
  --accent-foreground: oklch(0.208 0.042 265.755);
  --destructive: oklch(0.577 0.245 27.325);
  --destructive-foreground: oklch(1 0 0);
  --border: oklch(0.929 0.013 255.508);
  --input: oklch(0.929 0.013 255.508);
  --chart-1: oklch(0.704 0.04 256.788);
  --chart-2: oklch(0.554 0.046 257.417);
  --chart-3: oklch(0.446 0.043 257.281);
  --chart-4: oklch(0.391 0.039 257.287);
  --chart-5: oklch(0.293 0.032 260.166);
  --sidebar: oklch(0.985 0.002 247.839);
  --sidebar-background: oklch(0.985 0.002 247.839);
  --sidebar-foreground: oklch(0.129 0.042 264.695);
  --sidebar-primary: oklch(0.554 0.046 257.417);
  --sidebar-primary-foreground: oklch(0.985 0.002 247.839);
  --sidebar-accent: oklch(0.968 0.007 247.896);
  --sidebar-accent-foreground: oklch(0.208 0.042 265.755);
  --sidebar-border: oklch(0.929 0.013 255.508);
  --sidebar-ring: oklch(0.554 0.046 257.417);
}

/* Storm's accent, light. Used until someone picks an accent colour. */
:root,
:root[data-base-color="slate"]:not([data-primary-color]) {
  --primary: oklch(0.554 0.046 257.417);
  --primary-foreground: oklch(0.985 0.002 247.839);
  --ring: oklch(0.554 0.046 257.417);
}

/* ---- Storm, dark ---- */

.dark,
:root.dark[data-base-color="slate"] {
  --background: oklch(0.129 0.042 264.695);
  --foreground: oklch(0.985 0.002 247.839);
  --card: oklch(0.208 0.042 265.755);
  --card-foreground: oklch(0.985 0.002 247.839);
  --popover: oklch(0.208 0.042 265.755);
  --popover-foreground: oklch(0.985 0.002 247.839);
  --secondary: oklch(0.279 0.041 260.031);
  --secondary-foreground: oklch(0.985 0.002 247.839);
  --muted: oklch(0.279 0.041 260.031);
  --muted-foreground: oklch(0.704 0.04 256.788);
  --accent: oklch(0.279 0.041 260.031);
  --accent-foreground: oklch(0.985 0.002 247.839);
  --destructive: oklch(0.704 0.191 22.216);
  --destructive-foreground: oklch(0.985 0.002 247.839);
  --border: oklch(1 0 0 / 10%);
  --input: oklch(1 0 0 / 15%);
  --chart-1: oklch(0.704 0.04 256.788);
  --chart-2: oklch(0.554 0.046 257.417);
  --chart-3: oklch(0.446 0.043 257.281);
  --chart-4: oklch(0.391 0.039 257.287);
  --chart-5: oklch(0.293 0.032 260.166);
  --sidebar: oklch(0.208 0.042 265.755);
  --sidebar-background: oklch(0.208 0.042 265.755);
  --sidebar-foreground: oklch(0.985 0.002 247.839);
  --sidebar-primary: oklch(0.704 0.04 256.788);
  --sidebar-primary-foreground: oklch(0.129 0.042 264.695);
  --sidebar-accent: oklch(0.279 0.041 260.031);
  --sidebar-accent-foreground: oklch(0.985 0.002 247.839);
  --sidebar-border: oklch(1 0 0 / 10%);
  --sidebar-ring: oklch(0.554 0.046 257.417);
}

/* Storm's accent, dark. */
.dark,
:root.dark[data-base-color="slate"]:not([data-primary-color]) {
  --primary: oklch(0.704 0.04 256.788);
  --primary-foreground: oklch(0.129 0.042 264.695);
  --ring: oklch(0.704 0.04 256.788);
}

/* The library's other base tones set the side menu's colour under the name
   "sidebar" only. This keeps the older name in step for them. */
:root[data-base-color]:not([data-base-color="slate"]) {
  --sidebar-background: var(--sidebar);
}
