/*
 * Louise Toolkit editor theme — BowenLabs brand system.
 *
 * Two daisyUI 5 themes (Tailwind v4 `@plugin` syntax — this file must be
 * imported from a stylesheet that Tailwind processes, after `@plugin "daisyui"`):
 *
 *   louise       — light editor chrome (default)
 *   louise-dark  — dark editor chrome (applied via prefers-color-scheme)
 *
 * Palette source: bowenlabs/branding — Brand Guidelines PDF.
 *   blue #1481ef (primary per project direction) · dark green #4f6933 ·
 *   light green #8ebe59 · yellow #f3ae29 · orange #db6327 · white
 *
 * Every `-content` color and base-content clears 4.5:1 (WCAG 1.4.3) against
 * its fill, and primary and error clear it as text on base-100 too. White on
 * the brand blue is 3.88:1 and on the brand orange 3.60:1, so the light theme
 * fills with the one-stop-darker text stops, blue #0f6ecd (5.08:1) and orange
 * #b8501f (4.99:1). No single blue clears 4.5:1 both under white text and as
 * text on a dark base, so the dark theme keeps the brand fills and puts dark
 * ink on them instead. Keep #1481ef for rings, borders, and focus outlines,
 * where 3:1 is enough. test/client/contrast.test.ts checks every pair.
 *
 * Your public site theme is separate; this file styles Louise editor surfaces
 * only (Settings, inline chrome, panels).
 */

@plugin "daisyui/theme" {
  name: "louise";
  default: true;
  prefersdark: false;
  color-scheme: light;

  --color-base-100: #ffffff;
  --color-base-200: #f5f7f9;
  --color-base-300: #e8ecf1;
  --color-base-content: #1a2430;

  --color-primary: #0f6ecd;
  --color-primary-content: #ffffff;

  /* Dark green carries enough contrast for light surfaces. */
  --color-secondary: #4f6933;
  --color-secondary-content: #ffffff;

  --color-accent: #f3ae29;
  --color-accent-content: #231903;

  --color-neutral: #1a2430;
  --color-neutral-content: #f5f7f9;

  --color-info: #0f6ecd;
  --color-info-content: #ffffff;
  --color-success: #8ebe59;
  --color-success-content: #1a2408;
  --color-warning: #f3ae29;
  --color-warning-content: #231903;
  --color-error: #b8501f;
  --color-error-content: #ffffff;

  --radius-selector: 0.5rem;
  --radius-field: 0.375rem;
  --radius-box: 0.5rem;
  --size-selector: 0.25rem;
  --size-field: 0.25rem;
  --border: 1px;
  --depth: 1;
  --noise: 0;
}

/* SCOPE: this theme colours daisyUI-classed surfaces a *site* renders (and the
   `data-theme="louise"` roots). The editor chrome (the edit bar, the on-canvas
   toolbars, and the Settings drawer) injects its own stylesheet
   (client/styles.ts) with its own role tokens, and since #603 those go dark on
   their own: they follow `prefers-color-scheme`, and a page pins a scheme with
   `data-louise-scheme="light"` or `"dark"` on the root element. The chrome's
   dark values match this theme's `louise-dark` fills, but they don't read these
   variables (ADR 0019 §3), so choosing `louise-dark` for a site doesn't switch
   the chrome by itself. */
@plugin "daisyui/theme" {
  name: "louise-dark";
  default: false;
  prefersdark: true;
  color-scheme: dark;

  --color-base-100: #131a22;
  --color-base-200: #0e141b;
  --color-base-300: #1c2530;
  --color-base-content: #e8edf3;

  /* Dark ink on the brand fills: white on #1481ef is 3.88:1, and the light
   * theme's darker #0f6ecd would fall to 3.45:1 as text on base-100. */
  --color-primary: #1481ef;
  --color-primary-content: #0e141b;

  /* Per the brand colorway rules, the light green is the green for dark
   * backgrounds (the dark green falls below contrast). */
  --color-secondary: #8ebe59;
  --color-secondary-content: #16210b;

  --color-accent: #f3ae29;
  --color-accent-content: #231903;

  --color-neutral: #26313e;
  --color-neutral-content: #e8edf3;

  --color-info: #1481ef;
  --color-info-content: #0e141b;
  --color-success: #8ebe59;
  --color-success-content: #16210b;
  --color-warning: #f3ae29;
  --color-warning-content: #231903;
  --color-error: #db6327;
  --color-error-content: #0e141b;

  --radius-selector: 0.5rem;
  --radius-field: 0.375rem;
  --radius-box: 0.5rem;
  --size-selector: 0.25rem;
  --size-field: 0.25rem;
  --border: 1px;
  --depth: 1;
  --noise: 0;
}

/*
 * Louise chrome variables — consumed by louise-toolkit/client (inline-edit
 * affordances, Settings, action bar). Defined per-theme so the chrome follows
 * the editor theme, never the site theme.
 */
[data-theme="louise"],
[data-theme="louise-dark"] {
  --louise-accent: var(--color-primary);
  --louise-accent-soft: color-mix(in oklch, var(--color-primary) 12%, transparent);
  --louise-ring: color-mix(in oklch, var(--color-primary) 40%, transparent);
  /* The font tokens live in fonts.css, the file that loads the font. */
}
