/* Hauntworks editorial theme: the palette, once.
   ---------------------------------------------------------------------
   Every colour, font and radius the dashboard uses, under one prefix so
   nothing here collides with a page's own variable names. Dark is the
   existing preview/Vox palette, value for value; light is its counterpart.

   Keyed on data-theme like dashboard.css: the head script (or
   editorial-theme-boot.js on standalone pages) resolves System / Light /
   Dark to one word on <html>, so there is no media query here.

   :root:root (and :root:root[data-theme]) wins over a page's own :root
   block regardless of load order, which standalone pages need. */

:root:root {
  color-scheme: light;

  --ed-page: #F4F2EA;
  --ed-surface: #FBFAF5;
  --ed-raised: #FFFFFF;
  --ed-border: #D3D6C8;
  --ed-strong: #A7AE98;
  --ed-grid: #E3E4D9;

  --ed-text: #101411;
  --ed-text-2: #4A5246;      /* 7.2:1 on page */
  --ed-text-3: #636B5F;      /* 4.9:1 on page — hints, labels, axis text */

  --ed-accent: #4F6A1C;      /* fill for the one committing action, selected tab */
  --ed-accent-text: #4F6A1C; /* links, eyebrows, tab underline */
  --ed-accent-ink: #FFFFFF;  /* text on --ed-accent */
  --ed-accent-soft: #E6EDCF; /* selection, hover, current row */
  --ed-focus: #4F6A1C;

  --ed-good: #2F6B3A;   --ed-good-soft: #DCEADB;
  --ed-warn: #86580A;   --ed-warn-soft: #F1E4C8;
  --ed-crit: #A8291F;   --ed-crit-soft: #F3DAD5;
  --ed-info: #335A85;   --ed-info-soft: #DEE5EE;

  /* Chart series, in the dashboard's order: wishlists, visits,
     impressions, clicks, deletes. */
  --ed-s1: #4F6A1C; --ed-s2: #B5561E; --ed-s3: #2F6188; --ed-s4: #8A4A86; --ed-s5: #1F7A70;

  /* Event ranges drawn behind charts. */
  --ed-event-red: #F2D9D2; --ed-event-yellow: #EFE6C6; --ed-event-purple: #DCE3EE;
  --ed-event-pink: #EEDCEA; --ed-event-gray: #E3E4D9; --ed-event-green: #DCE9D2;

  --ed-font-display: Georgia, "Times New Roman", serif;
  --ed-font-body: system-ui, -apple-system, "Segoe UI", sans-serif;
  --ed-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ed-display-weight: 400;
  --ed-display-tracking: -0.02em;

  --ed-radius: 6px;
  --ed-radius-card: 8px;
  --ed-radius-pill: 30px;
}

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

  --ed-page: #101411;
  --ed-surface: #1B211C;
  --ed-raised: #252E22;
  --ed-border: #394238;
  --ed-strong: #59644B;
  --ed-grid: #232A24;

  --ed-text: #EBE8DC;
  --ed-text-2: #AAB3A5;
  --ed-text-3: #8E9789;

  --ed-accent: #D9EB9B;
  --ed-accent-text: #D9EB9B;
  --ed-accent-ink: #101411;
  --ed-accent-soft: #343E2D;
  --ed-focus: #D9EB9B;

  --ed-good: #8FD39A;   --ed-good-soft: #1D3123;
  --ed-warn: #E8C270;   --ed-warn-soft: #352C18;
  --ed-crit: #F2907F;   --ed-crit-soft: #3A201C;
  --ed-info: #93B8E0;   --ed-info-soft: #1B2A3A;

  --ed-s1: #D9EB9B; --ed-s2: #F0A070; --ed-s3: #8DB6E6; --ed-s4: #D7A0D4; --ed-s5: #7ED0C2;

  --ed-event-red: #4A2A22; --ed-event-yellow: #3E3A1E; --ed-event-purple: #2E3344;
  --ed-event-pink: #402A3E; --ed-event-gray: #2A302A; --ed-event-green: #2E3C24;
}

/* Reading preferences apply to every dashboard document and embedded report.
   The extra root specificity also wins over Fog's later dark/light blocks. */
:root:root:root:root[data-contrast="more"] {
  --ed-border: var(--ed-strong);
  --ed-text-2: var(--ed-text);
  --ed-text-3: var(--ed-text);
}
:root[data-contrast="more"] :is(.ed-card,.btn,.field) { border-width: 2px; }
:root[data-reduced-motion="true"] *,
:root[data-reduced-motion="true"] *::before,
:root[data-reduced-motion="true"] *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important;
}

/* The sidebar names the page. Retain its heading for assistive navigation,
   without repeating the title or reserving a title-sized row on screen.
   Record names and section headings do not carry this marker. */
@media screen {
  :root:root body [data-page-title],
  :root:root body .ed-page-head:has(> :only-child > [data-page-title]):not(:has(> :only-child > :not([data-page-title], .ed-kicker))),
  :root:root body .card-head:has(> div:only-child > [data-page-title]:only-child),
  :root:root body .tasks-head:has(> [data-page-title]):not(:has(> :not([data-page-title]):not(:empty))) {
    position: absolute !important; width: 1px !important; height: 1px !important;
    padding: 0 !important; margin: -1px !important; overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important; clip-path: inset(50%) !important;
    white-space: nowrap !important; border: 0 !important;
  }
}
