/* mes-theme.css — Light theme for the Foundry 4.0 MES dashboard (theme-3)
 *
 * Each page's own :root block IS the dark theme and stays untouched.
 * This file only overrides those same tokens when mes-theme.js sets <html data-scheme="light">.
 * Uses data-scheme (pages already use data-theme for the AIG/Azure brand). html:root[data-scheme] is (0,2,1), so it beats both the pages' :root and :root[data-theme="azure"].
 *
 * Status colours are darkened for light backgrounds; text-bearing colours are >= 4.5:1 on --panel (#fff):
 *   molten #c94a12 4.7 | steel-cyan #0d7f76 4.8 | alert #b45309 5.0 | critical #c62828 5.6 | good #13824f 4.8
 */

/* Chart.js tokens, read by mes-theme.js (resolve per theme) */
:root { --chart-text: var(--text-secondary); --chart-grid: var(--border); }

html:root[data-scheme="light"] {
  color-scheme: light;

  /* surfaces */
  --bg:            #eef1f4;
  --bg-deep:       #e2e6eb;
  --panel:         #ffffff;
  --panel-raised:  #f4f6f9;
  --border:        #d3dae2;

  /* text */
  --text-primary:   #18202b;
  --text-secondary: #3a4350;
  --ink:            #18202b;
  --ink-dim:        rgba(24, 32, 43, 0.62);
  --hair:           rgba(15, 23, 32, 0.18);
  --ghost:          rgba(15, 23, 32, 0.05);

  /* brand + status */
  --molten:          #c94a12;
  --hot:             #c94a12;
  --molten-dim:      #f6d8c8;
  --steel-cyan:      #0d7f76;
  --steel-cyan-dim:  #cfe9e6;
  --alert:           #b45309;
  --critical:        #c62828;
  --good:            #13824f;

  --chart-grid: rgba(15, 23, 32, 0.12);
}

/* Azure brand, light: keeps the Microsoft blue instead of AIG orange (>= 4.5:1 on white) */
html:root[data-scheme="light"][data-theme="azure"] {
  --bg:             #eef2f7;
  --bg-deep:        #e1e8f1;
  --panel-raised:   #f3f6fa;
  --border:         #d0dae6;
  --text-secondary: #3a4560;
}
/* Shop Floor's Azure keeps its orange/ink accents, so only the other pages switch to blue */
html:root[data-scheme="light"][data-theme="azure"]:not([data-page^="shopfloor"]) {
  --molten:         #0067b8;
  --molten-dim:     #d6e8f7;
  --steel-cyan:     #00708a;
  --steel-cyan-dim: #d3edf3;
}

/* Shop Floor uses --steel-cyan as its ink colour (#e9edf2), not as cyan. Must stay after the Azure block. */
html:root[data-scheme="light"][data-page^="shopfloor"] { --steel-cyan: #18202b; }

/* theme-3: Shop Floor labels (station names, panel captions, subtitles, side list) near-black in Light.
   Lines and arrows keep the lighter --ink-dim so the drawing stays uncluttered. ~11:1 on the light background. */
html:root[data-scheme="light"] #floorplan .t-xs,
html:root[data-scheme="light"] #floorplan .t-dim,
html:root[data-scheme="light"] #floorplan .hz-low { fill: #2a323d; }
html:root[data-scheme="light"] .tree-item,
html:root[data-scheme="light"] .canvas-legend,
html:root[data-scheme="light"] .fs-count-normal,
html:root[data-scheme="light"] select.theme-toggle-btn { color: #2a323d; }

html:root[data-scheme="dark"] { color-scheme: dark; }

body { transition: background-color .2s ease, color .2s ease; }
@media (prefers-reduced-motion: reduce) { body { transition: none; } }
