/*
  Altar theme: every color, font and corner the dashboard's pages draw with, in one place.
  Every page links this file in <head> (templates/_theme_head.html) before its own <style>.

  CHANGING THE BRAND COLORS
    Edit the token below, in the block for the theme you mean (dark, or light), and nothing else.
    Pages never hold a color of their own: each page's <style> maps its old variable names onto
    these tokens (for example `--rust: var(--altar-accent)`), so one edit here moves every page.
    The dark block is altar.bike's own palette (Forge Black, Charcoal, Deep, Panel, Altar Rust, Rust Dark, Cream,
    Warm Cream, Mid Gray, Dim; Trail Earth and Pisgah Shadow as supporting colors), matched Oct 22 2026; the light
    block is Max's light layout (suspension/max_base.html, the approved mockups). To add a color, add a token to
    BOTH blocks.

  HOW THE THEME IS PICKED
    The server writes <html data-theme="dark|light|auto"> from the `altar_theme` cookie (default
    dark), so the right colors are there on the first paint with no flash and no script.
      dark    the :root block below
      light   the :root[data-theme="light"] block
      auto    (or no attribute at all) the dark block, unless the visitor's device asks for a light
              page (prefers-color-scheme), which turns the light block on
    The cookie is set by POST /theme, from the Light / Dark button in every page's header
    (templates/_theme_toggle.html). The pages for Max (suspension/max_base.html) start light when
    nobody has picked, as they always have; see docs/NAV-AND-THEME.md.

  TYPE
    Three faces, loaded by one link in templates/_theme_head.html: --altar-font-display (Big Shoulders Display, headings),
    --altar-font-mono (Space Mono, figures and codes) and --altar-font-reading (Public Sans, the suspension pages' body text).
    --altar-font-body is the dashboard's mono; static/altar-suspension.css points it at the reading face on suspension pages only.

  KEEP THE TWO LIGHT BLOCKS IDENTICAL
    CSS can't share one block between a selector and a media query, so the light values are written
    twice: tests/test_nav.py fails if they drift apart.

  CONTRAST (dark): Warm Cream text is 11.7:1 on Charcoal, the caption gray 5.0:1, Altar Rust 4.0:1 (held to 3.5 as
  the brand color), Cream on the rust 3.7:1 (held to 3.5: short bold labels), tests/test_nav.py checks them.
  CONTRAST (light): text #16181C on #F4F2EE is 15:1; dim text #4B5058 is 7:1; the rust #B8430E is
  4.9:1 on the page and white on it 5.5:1; the status colors are all 5:1 or better on the page.
*/

:root {
  color-scheme: dark;

  /* ---- surfaces and text: altar.bike's palette (Matt, Oct 22 2026: "update the dashboard with these colors to match
     the website"). The names after each value are the website's. ---- */
  --altar-bg: #0c0c0c;              /* Forge Black: the page */
  --altar-surface: #141414;         /* Charcoal: cards, input fields, panels, the menu's second row */
  --altar-surface-2: #1a1a1a;       /* Deep: the subtle shifts (a panel inside a panel, hover rows, chips) */
  --altar-panel: #1e1e1e;           /* Panel: pop-ups and dialogs that sit over the page */
  --altar-bg-sunken: #080808;       /* below the page: weekend cells, empty lanes. Not a website color: the page is
                                       already the website's darkest, so this is the one step under it */
  --altar-border: #383838;          /* Dim: borders, dividers */
  --altar-border-strong: #707070;   /* Mid Gray: a line that must show (input edges, the old suspension pages' rules):
                                       3.7:1 on Charcoal, over the 3:1 a control's edge needs */
  --altar-text: #d4cdc0;            /* Warm Cream: body text */
  --altar-text-strong: #eee8dc;     /* Cream: headings, names, the menu */
  --altar-text-dim: #858585;        /* captions and secondary figures. The website's Mid Gray (#707070) reads 3.4-4.0:1 on
                                       these backgrounds, under the 4.5:1 small text needs on a shop PC at arm's length;
                                       #858585 is the nearest gray that clears 4.5 on all four (4.5 on Panel, 5.3 on
                                       Forge Black). Mid Gray itself is --altar-border-strong. */

  /* ---- brand ---- */
  --altar-accent: #b85c2a;          /* Altar Rust: buttons, the active tab, links, the menu's hover */
  --altar-accent-hover: #d9733d;    /* rust brightened for TEXT on the dark page (links on hover, due dates, focus rings):
                                       the website's Rust Dark is 2.8:1 there. Pages alias it as --rust-bright */
  --altar-accent-press: #8c4420;    /* Rust Dark: a rust button's face on hover, as the website does it */
  --altar-accent-tint: #2a1a10;     /* a row that needs a look (overdue, the "needs Max" tag): darker than the old #3a2416
                                       so the caption gray reads 4.5:1 on it and the text rust 5.2:1 */
  --altar-on-accent: #eee8dc;       /* Cream: text written on the rust (the website's button text). 3.7:1, held to 3.5
                                       like the rust itself: labels on it are short, bold and uppercase */
  --altar-on-fill: #0c0c0c;         /* text on a BRIGHT fill that isn't the rust: the amber, red or green buttons and
                                       marks, the bright-rust "late" tag. Cream reads 2.5-3:1 on those, Forge Black 5-9:1 */

  /* ---- roles whose pick differs in kind between the two themes. Each light value is exactly what Max's light layout
     draws today, so a page that moves onto one of these doesn't move in light; the dark value is the website's role.
     A page never makes this pick with its own theme selectors. ---- */
  --altar-link: #d9733d;            /* a link: the website's rust, in its text weight (Altar Rust is 4.0:1 behind small
                                       text on Charcoal; this is 5.7:1). Light: the light rust */
  --altar-menu: #eee8dc;            /* the menu at rest: Cream, as the website's. Light: the dim gray */
  --altar-menu-hover: #d9733d;      /* the menu under the pointer: the website's rust, in its text weight. Light: the text */
  --altar-accent-solid: #8c4420;    /* a rust face under LONGER text (the chat's own bubble, Max's checked chips, the bench's
                                       work-order button): Rust Dark, so Cream reads 5.8:1. Short bold labels stay on
                                       --altar-accent. Light: the light rust */
  --altar-field: #141414;           /* an input field's face: Charcoal, as the website's. Light: the page */
  --altar-control-edge: #707070;    /* a control's edge (inputs, segmented buttons): Mid Gray, 3.7:1 on Charcoal, over the
                                       3:1 a control's boundary needs. Light: Trail Earth's light shade */
  --altar-earth-rule: #383838;      /* a card or ticket edge Max's light layout draws in Trail Earth: Dim, like every
                                       border on the website */
  --altar-firm-rule: #383838;       /* a card or row edge Max's light layout draws in its strong gray: Dim */
  --altar-disabled: #1a1a1a;        /* a locked button's face: Deep, with the caption gray on it at 4.7:1 */
  --altar-toast: #1e1e1e;           /* a toast's face: Panel. Light: Trail Earth's light shade */
  --altar-accent-text: #d9733d;     /* the rust as TEXT that isn't a link (bold names in Ask AI's answers, a pressed
                                       toggle's label, a tag): the text weight, 5.4:1 on Deep. Light: the light rust */
  --altar-control-edge-quiet: #707070; /* the dashboard's own controls (range buttons, selects, the Ask AI box): Mid Gray
                                       (Dim is 1.5:1 there). Light: the border gray they draw */
  --altar-tooltip: #1e1e1e;         /* a chart's hover box: Panel, with Cream title and Warm Cream text and a Dim edge.
                                       Light: Chart.js's own black box with white text, as before */
  --altar-tooltip-title: #eee8dc;
  --altar-tooltip-text: #d4cdc0;
  --altar-tooltip-edge: #383838;
  --altar-panel-hover: #383838;     /* a hovered row inside a pop-up (the New fit dialog's results): one step over Panel */
  --altar-drawing-line: #707070;    /* a line in a drawing (the fit sheet's bike ground line): Mid Gray on Charcoal */
  --altar-placeholder: #858585;     /* placeholder text in a field: the caption gray (the website's Mid Gray reads 3.7:1 on
                                       Charcoal). Light: the browser's own placeholder gray */
  --altar-max-link: #d9733d;        /* a link on Max's layout: the website's rust in dark. Light: the info blue Max's
                                       approved light mockups use */
  --altar-plain-link: #d9733d;      /* a link on the manager suspension pages: the website's rust in dark. Light: the text */
  --altar-earth: #4a3728;           /* Trail Earth: selected buttons, card rules */
  --altar-earth-deep: #2f221a;      /* a button's face */
  --altar-pisgah: #2c4a5a;          /* Pisgah Shadow */
  --altar-on-pisgah: #d4cdc0;       /* text on Pisgah, which is dark in both themes (the status chips on the cards) */
  --altar-tan: #c9a27e;             /* the coffee tag and its links */
  --altar-tan-line: #7a5a3c;

  /* ---- status colors: reserved for good / warning / bad / information ---- */
  --altar-green: #6fa06a;
  --altar-green-bg: #1d2a1f;
  --altar-green-ink: #9fd4a3;
  --altar-green-line: #3f6b4f;
  --altar-amber: #d9a441;
  --altar-amber-bg: #2e2412;
  --altar-amber-ink: #e8bd6a;
  --altar-amber-line: #5a4521;
  --altar-red: #d0674a;
  --altar-red-bg: #2b1812;          /* a step darker than #2e1a14, so the red itself reads 4.5:1 on it (a red badge) */
  --altar-red-ink: #f0a58c;
  --altar-red-line: #5e3326;
  --altar-info: #3a8ccb;
  --altar-info-bg: #15222e;
  --altar-info-ink: #9fc3ea;
  --altar-info-line: #2b4560;

  /* ---- chart series (validated on this background): rust, river blue, ochre, and a quiet slate ---- */
  --altar-series-1: #d06a36;
  --altar-series-2: #3a8ccb;
  --altar-series-3: #a88a22;
  --altar-cyan: #9fb6c2;

  /* ---- the dashboard's black header: Max's pages keep it black in both themes. Forge Black, a Dim edge, Warm Cream
     and Cream text, as the website's header (the same four values in all three blocks) ---- */
  --altar-header: #0c0c0c;
  --altar-header-2: #383838;
  --altar-header-soft: #d4cdc0;
  --altar-header-text: #eee8dc;
  --altar-header-warn: #ffd9a0;     /* a warning written on that header (the Board's stale-sync note): amber-ink is
                                       for the page, and the light one is unreadable on black */

  /* ---- type and corners ---- */
  --altar-font-display: 'Big Shoulders Display', Impact, 'Arial Narrow', sans-serif;
  --altar-font-mono: 'Space Mono', ui-monospace, Consolas, monospace;
  --altar-font-body: var(--altar-font-mono);   /* the dashboard's own pages read in mono; a page whose text isn't mono sets its own font */
  --altar-font-reading: 'Public Sans', system-ui, sans-serif;   /* the readable face for text read at arm's length: the suspension pages'
                                       body text. static/altar-suspension.css points --altar-font-body at it on those pages only (the fit
                                       booking and parts pages read --altar-font-body too and stay as they are). */
  --altar-radius: 2px;
}

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

  --altar-bg: #f4f2ee;
  --altar-surface: #ffffff;
  --altar-surface-2: #efece6;
  --altar-panel: #ffffff;
  --altar-bg-sunken: #e9e5de;
  --altar-border: #ddd8cf;
  --altar-border-strong: #c9c3b8;
  --altar-text: #16181c;
  --altar-text-strong: #16181c;
  --altar-text-dim: #4b5058;

  --altar-accent: #b8430e;
  --altar-accent-hover: #8a3208;
  --altar-accent-press: #8a3208;
  --altar-accent-tint: #f6dfd0;
  --altar-on-accent: #ffffff;
  --altar-on-fill: #ffffff;
  --altar-link: #b8430e;
  --altar-menu: #4b5058;
  --altar-menu-hover: #16181c;
  --altar-accent-solid: #b8430e;
  --altar-field: #f4f2ee;
  --altar-control-edge: #6b5440;
  --altar-earth-rule: #6b5440;
  --altar-firm-rule: #c9c3b8;
  --altar-disabled: #c9c3b8;
  --altar-toast: #6b5440;
  --altar-accent-text: #b8430e;
  --altar-control-edge-quiet: #ddd8cf;
  --altar-tooltip: rgba(0, 0, 0, 0.8);
  --altar-tooltip-title: #ffffff;
  --altar-tooltip-text: #ffffff;
  --altar-tooltip-edge: rgba(0, 0, 0, 0);
  --altar-panel-hover: #efece6;
  --altar-drawing-line: #2e2620;
  --altar-placeholder: #757575;
  --altar-max-link: #1e4fa3;
  --altar-plain-link: #16181c;
  --altar-earth: #6b5440;
  --altar-earth-deep: #efece6;
  --altar-pisgah: #2c4a5a;
  --altar-on-pisgah: #cccccc;
  --altar-tan: #7a5230;
  --altar-tan-line: #b08a62;

  --altar-green: #1f6b3a;
  --altar-green-bg: #e6f4ea;
  --altar-green-ink: #1f5a33;
  --altar-green-line: #b5ddc1;
  --altar-amber: #8a5a00;
  --altar-amber-bg: #fff4d6;
  --altar-amber-ink: #6b4200;
  --altar-amber-line: #f0d58a;
  --altar-red: #b3321f;
  --altar-red-bg: #fdecea;
  --altar-red-ink: #8a1c12;
  --altar-red-line: #f3b8b0;
  --altar-info: #1e4fa3;
  --altar-info-bg: #e8eef9;
  --altar-info-ink: #163a7a;
  --altar-info-line: #b9c9e8;

  --altar-series-1: #b8430e;
  --altar-series-2: #1e4fa3;
  --altar-series-3: #8c7010;
  --altar-cyan: #4a6a7a;

  /* ---- the dashboard's black header: Max's pages keep it black in both themes ---- */
  --altar-header: #0c0c0c;
  --altar-header-2: #383838;
  --altar-header-soft: #d4cdc0;
  --altar-header-text: #eee8dc;
  --altar-header-warn: #ffd9a0;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="light"]) {
    color-scheme: light;

    --altar-bg: #f4f2ee;
    --altar-surface: #ffffff;
    --altar-surface-2: #efece6;
    --altar-panel: #ffffff;
    --altar-bg-sunken: #e9e5de;
    --altar-border: #ddd8cf;
    --altar-border-strong: #c9c3b8;
    --altar-text: #16181c;
    --altar-text-strong: #16181c;
    --altar-text-dim: #4b5058;

    --altar-accent: #b8430e;
    --altar-accent-hover: #8a3208;
    --altar-accent-press: #8a3208;
    --altar-accent-tint: #f6dfd0;
    --altar-on-accent: #ffffff;
    --altar-on-fill: #ffffff;
    --altar-link: #b8430e;
    --altar-menu: #4b5058;
    --altar-menu-hover: #16181c;
    --altar-accent-solid: #b8430e;
    --altar-field: #f4f2ee;
    --altar-control-edge: #6b5440;
    --altar-earth-rule: #6b5440;
    --altar-firm-rule: #c9c3b8;
    --altar-disabled: #c9c3b8;
    --altar-toast: #6b5440;
    --altar-accent-text: #b8430e;
    --altar-control-edge-quiet: #ddd8cf;
    --altar-tooltip: rgba(0, 0, 0, 0.8);
    --altar-tooltip-title: #ffffff;
    --altar-tooltip-text: #ffffff;
    --altar-tooltip-edge: rgba(0, 0, 0, 0);
    --altar-panel-hover: #efece6;
    --altar-drawing-line: #2e2620;
    --altar-placeholder: #757575;
    --altar-max-link: #1e4fa3;
    --altar-plain-link: #16181c;
    --altar-earth: #6b5440;
    --altar-earth-deep: #efece6;
    --altar-pisgah: #2c4a5a;
    --altar-on-pisgah: #cccccc;
    --altar-tan: #7a5230;
    --altar-tan-line: #b08a62;

    --altar-green: #1f6b3a;
    --altar-green-bg: #e6f4ea;
    --altar-green-ink: #1f5a33;
    --altar-green-line: #b5ddc1;
    --altar-amber: #8a5a00;
    --altar-amber-bg: #fff4d6;
    --altar-amber-ink: #6b4200;
    --altar-amber-line: #f0d58a;
    --altar-red: #b3321f;
    --altar-red-bg: #fdecea;
    --altar-red-ink: #8a1c12;
    --altar-red-line: #f3b8b0;
    --altar-info: #1e4fa3;
    --altar-info-bg: #e8eef9;
    --altar-info-ink: #163a7a;
    --altar-info-line: #b9c9e8;

    --altar-series-1: #b8430e;
    --altar-series-2: #1e4fa3;
    --altar-series-3: #8c7010;
    --altar-cyan: #4a6a7a;

    /* ---- the dashboard's black header: Max's pages keep it black in both themes ---- */
    --altar-header: #0c0c0c;
    --altar-header-2: #383838;
    --altar-header-soft: #d4cdc0;
    --altar-header-text: #eee8dc;
    --altar-header-warn: #ffd9a0;
  }
}
