/*
 * MochaCafe design tokens: the single source of truth for colour, type, space, shape and motion.
 * Every colour pairing used for text or controls was measured against WCAG 2.2 AA (see the
 * ui-design-system skill). Change a value here and every page that uses the app shell follows.
 *
 * Layers:  brand palette (raw)  ->  semantic roles (what to use)  ->  Bootstrap bridge (framework).
 * Components (static/css/app.css) use semantic roles only, never raw palette values.
 */

/* ---- Fonts (self-hosted, variable, Latin subset; licence in static/fonts/README.md) ---- */
@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-var-latin.c154477b9aff.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
@font-face {
  font-family: "Karla";
  src: url("../fonts/karla-var-latin.5f5978e3e448.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}

:root {
  color-scheme: light; /* native controls and scrollbars stay light even on a dark OS */

  /* ---- 1. Brand palette (sampled from the logo and the existing espresso/cream identity) ---- */
  --mc-ink-900: #2b211b;      /* espresso: text, sidebar */
  --mc-ink-800: #3a2e27;
  --mc-ink-700: #4a3d35;
  --mc-ink-600: #6b5d54;      /* muted text (6.3:1 on white) */
  --mc-ink-500: #857970;      /* control borders (4.2:1 on white) */
  --mc-ink-300: #cfc5bd;
  --mc-ink-200: #e4ddd6;      /* hairlines */
  --mc-ink-100: #f1ece6;
  --mc-ink-50:  #f8f5f1;      /* page background */
  --mc-cream:   #fff8ec;      /* brand cream */

  --mc-terracotta-700: #9f3216;
  --mc-terracotta-600: #b93c1a;   /* actions: white text 5.6:1 (the logo orange #de664e is 3.4:1) */
  --mc-terracotta-500: #d54b27;   /* brand orange: large graphics only */
  --mc-terracotta-400: #de664e;   /* logo terracotta: accents on dark */
  --mc-terracotta-100: #fbe9e3;

  --mc-navy-700: #12364e;         /* logo navy: information, focus ring */
  --mc-navy-600: #1a5a85;
  --mc-navy-100: #e3edf4;

  --mc-crimson-700: #951a34;
  --mc-crimson-600: #b3203f;      /* danger, derived from the logo coral #ea4266 */
  --mc-crimson-100: #fde8ed;

  --mc-green-700: #1c6b41;
  --mc-green-100: #e2f3e9;
  --mc-amber-800: #7a4b00;
  --mc-amber-100: #fdf0cf;
  --mc-teal-700:  #0f5f57;
  --mc-teal-100:  #dcf2ef;
  --mc-slate-700: #34454f;
  --mc-slate-100: #e8edf0;

  /* ---- 2. Semantic roles (components use these) ---- */
  --color-bg: var(--mc-ink-50);
  --color-surface: #ffffff;
  --color-surface-muted: var(--mc-ink-100);
  --color-border: var(--mc-ink-200);
  --color-border-strong: var(--mc-ink-500);
  --color-text: var(--mc-ink-900);
  --color-text-muted: var(--mc-ink-600);
  --color-heading: var(--mc-ink-900);

  --color-primary: var(--mc-terracotta-600);
  --color-primary-hover: var(--mc-terracotta-700);
  --color-on-primary: #ffffff;
  --color-primary-tint: var(--mc-terracotta-100);
  --color-primary-ink: #8f2e12;       /* text on the tint */
  --color-accent: var(--mc-terracotta-400);

  --color-info: var(--mc-navy-600);
  --color-danger: var(--mc-crimson-600);
  --color-danger-hover: var(--mc-crimson-700);
  --color-danger-tint: var(--mc-crimson-100);
  --color-danger-ink: #9c1b38;
  --color-success: var(--mc-green-700);

  --color-focus: var(--mc-navy-700);   /* focus ring on light surfaces (12:1 on white) */
  --color-focus-on-dark: #ffd9a0;      /* focus ring on the espresso sidebar (11.7:1) */
  --color-tap-highlight: rgb(185 60 26 / 0.14);   /* mobile tap flash: terracotta tint */

  /* Sidebar (espresso, always dark) */
  --sidebar-bg: var(--mc-ink-900);
  --sidebar-text: #efe8e1;
  --sidebar-muted: #b8aca3;
  --sidebar-hover: rgba(255, 255, 255, 0.07);
  --sidebar-active-bg: #3d2f27;
  --sidebar-width: 17rem;

  /* Status badges: [background, text] pairs, all >= 4.5:1 */
  --status-pending-bg: var(--mc-amber-100);   --status-pending-fg: var(--mc-amber-800);
  --status-progress-bg: var(--mc-slate-100);  --status-progress-fg: var(--mc-slate-700);
  --status-printed-bg: var(--mc-navy-100);    --status-printed-fg: var(--mc-navy-700);
  --status-served-bg: var(--mc-teal-100);     --status-served-fg: var(--mc-teal-700);
  --status-completed-bg: var(--mc-green-100); --status-completed-fg: var(--mc-green-700);
  --status-primary-bg: var(--color-primary-tint); --status-primary-fg: var(--color-primary-ink);
  --status-danger-bg: var(--mc-crimson-100);  --status-danger-fg: var(--color-danger-ink);
  --status-neutral-bg: var(--mc-ink-100);     --status-neutral-fg: var(--mc-ink-700);

  /* ---- 3. Typography ---- */
  --font-display: "Montserrat", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Karla", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --text-xs: 0.75rem;     /* 12px labels, never body */
  --text-sm: 0.875rem;    /* 14px secondary */
  --text-base: 1rem;      /* 16px */
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --leading-tight: 1.25;
  --leading-body: 1.5;

  /* ---- 4. Space (4px base) ---- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  /* ---- 5. Shape, elevation, size ---- */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(43, 33, 27, 0.06);
  --shadow-md: 0 4px 14px rgba(43, 33, 27, 0.10);
  --control-height: 2.5rem;        /* 40px dense controls */
  --touch-target: 2.75rem;         /* 44px: primary actions on tablets/phones */

  /* ---- 6. Motion (functional only; disabled by prefers-reduced-motion in app.css) ---- */
  --motion-fast: 120ms;
  --motion-base: 200ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);

  /* ---- 7. Bootstrap bridge: framework components pick up the brand ---- */
  --bs-body-font-family: var(--font-body);
  --bs-body-font-size: var(--text-base);
  --bs-body-line-height: var(--leading-body);
  --bs-body-color: var(--color-text);
  --bs-body-color-rgb: 43, 33, 27;
  --bs-body-bg: var(--color-bg);
  --bs-body-bg-rgb: 248, 245, 241;
  --bs-emphasis-color: var(--color-text);
  --bs-secondary-color: var(--color-text-muted);
  --bs-secondary-bg: var(--color-surface-muted);
  --bs-tertiary-bg: var(--color-surface-muted);
  --bs-heading-color: var(--color-heading);
  --bs-border-color: var(--color-border);
  --bs-border-radius: var(--radius-md);
  --bs-border-radius-sm: var(--radius-sm);
  --bs-border-radius-lg: var(--radius-lg);
  --bs-primary: var(--color-primary);
  --bs-primary-rgb: 185, 60, 26;
  --bs-danger: var(--color-danger);
  --bs-danger-rgb: 179, 32, 63;
  --bs-link-color: var(--color-primary);
  --bs-link-color-rgb: 185, 60, 26;
  --bs-link-hover-color: var(--color-primary-hover);
  --bs-link-hover-color-rgb: 159, 50, 22;
  --bs-focus-ring-color: rgba(18, 54, 78, 0.35);
}

/*
 * Dark theme: not enabled yet. The semantic roles above are what make it a small change later:
 * add a [data-bs-theme="dark"] block here that redefines --color-bg, --color-surface, --color-text,
 * --color-border and the --status-* pairs, then re-run the contrast check. Parked for the Plan 5 review.
 */
