/**
 * Gold colour theme (owner decision 2026-09-27; core/ui_theme.py).
 *
 * One layout, two palettes. Gold is the approved layout of approved-style.css - Manrope, glass
 * cards, the app bar, Menu, Settings, density, the bell - drawn in the colours of the dark design
 * the app had before 2026-09-17: near-black and charcoal surfaces, the old greys for text, and gold
 * where Graphite has silver (active tab, selected segment and chip, saved heart, links, the main
 * button, focus, tags). Gold is dark as well, so the text stays light on dark.
 *
 * Mechanism. app-theme.js sets html[data-mh-theme] before the first stylesheet. This sheet loads
 * before approved-style.css, which keeps the last slot its contract reserves, and wins on
 * specificity instead: the palette block below is the approved token block with one more attribute
 * selector, (0,3,2) over (0,2,2), on the same element. Graphite is untouched because every rule
 * here requires html[data-mh-theme="gold"].
 *
 * Sources: the old dark tokens (git show f72daf4d:miniapp/styles.css, [data-theme="dark"]) and the
 * owner's screen recording of 2026-08-29. Contrast (WCAG 2.1 AA) is pinned by
 * tests/test_ci_ui_theme.py and measured on every screen by scripts/miniapp_theme_gold_visual.js.
 */

html[data-mh-theme="gold"].mh-approved.mh-approved body {
  /* ground, surfaces and lines: near-black and charcoal, neutral to warm */
  --ap-bg: #0c0d0f;
  --ap-card: linear-gradient(135deg, #1f1f22f0, #141518f0);
  --ap-card-border: #ffffff21;
  --ap-card-edge: inset 0 1px #ffffff12;
  --ap-control-bg: #1e1f23;
  --ap-input-bg: #191b1f;
  --ap-input-border: #ffffff2e;
  --ap-line: #3a3833;
  --ap-divider: #3d3a33;
  --ap-notice-bg: #16161a;
  --ap-notice-border: #3d392f;
  --ap-sheet-bg: #1b1c20;
  --ap-sheet-border: #45413a;
  --ap-header-bg: #121316e6;
  --ap-header-line: #ffffff17;
  --ap-nav-bg: #121316;
  --ap-glass: linear-gradient(135deg, #fff5e21a, #fff5e205);
  --ap-glass-border: #f3e6cc33;
  --ap-glass-edge: inset 0 1px #ffffff1f;
  --ap-rail: linear-gradient(135deg, #fff5e217, #fff5e205);
  --ap-rail-border: #f3e6cc29;
  --ap-media-empty: linear-gradient(135deg, #25231f, #141518);
  --ap-hub-top: #252421;
  --ap-hub-bottom: #151619;
  --ap-hub-edge: #ffffff29;
  --ap-hub-shadow: rgba(0, 0, 0, 0.5);
  --ap-hub-tile: #181b21;
  --ap-back-pill: rgba(12, 13, 15, 0.78);
  --ap-back-pill-pressed: rgba(12, 13, 15, 0.92);
  /* The directories' tiles and heroes read --mh-id-bg and fall back to a blue-grey #1c2b36. A
     centre that has its own identity colour still sets it on the element itself (that wins); the
     ones without take Gold's charcoal instead of Graphite's. */
  --mh-id-bg: #23211d;
  --ap-hero-scrim: linear-gradient(180deg, rgba(12, 13, 15, 0.22) 0%, rgba(12, 13, 15, 0.58) 42%, rgba(12, 13, 15, 0.9) 100%);

  /* text: the old dark greys */
  --ap-text: #f4f4f2;
  --ap-text-2: #c8cbd0;
  --ap-muted: #a8adb5;
  --ap-meta: #b3b7be;
  --ap-subtitle: #b3b7be;
  --ap-reading: #c1c4c9;
  --ap-row-ink: #bcbfc5;
  --ap-label-ink: #a8adb5;
  --ap-control-ink: #f4f4f2;
  --ap-input-ink: #f4f4f2;
  --ap-save-ink: #c8cbd0;
  --ap-notice-ink: #c4c6ca;
  --ap-notice-strong: #f4f4f2;
  --ap-salary-ink: #f4f4f2;
  --ap-segment-ink: #a8adb5;
  --ap-nav-ink: #9a9ea6;

  /* gold: #c6a66a main, #d8be88 light (text and marks on dark), #a8894f / #7e663c dark */
  --ap-accent: #d8be88;
  --ap-accent-ink: #0c0d0f;
  --ap-metal: linear-gradient(155deg, #e6cf9c, #c6a66a 58%, #dcc38e);
  --ap-depth: #7e663c;
  --ap-selected: #2f2820;
  --ap-focus: #e2c992;
  --ap-glint: #f2dcaa4d;
  --ap-logo-ring: #d8be8847;
  --ap-tag-bg: #16171b;
  --ap-tag-border: #c6a66a61;
  --ap-chip-bg: #36302a;
  --ap-chip-border: #c6a66a4d;
  --ap-chip-ink: #e2d0a8;
  --ap-tile-bg: #c6a66a1a;
  --ap-tile-border: #c6a66a4d;
  --ap-tile-ink: #e2d0a8;
  --ap-seg-indicator: #c6a66a29;
  --ap-seg-indicator-edge: inset 0 0 0 1px #c6a66a59;
  --ap-link-underline: #d8be8866;

  /* app tokens approved-style.css writes as literals; #181b21 is the old design's card slab, which
     the older sheets still paint under the approved cards */
  --mh-surface: #181b21;
  --mh-surface-elevated: #1f2024;
  --mh-surface-muted: #1c1d21;
  --mh-surface-standard: #181b21;
  --mh-surface-raised: #1f2024;
  --mh-surface-inset: #1c1d21;
  --mh-surface-sticky: #0c0d0ff2;
  --mh-surface-nav: #121316;
  --mh-surface-diag: #1c1d21cc;
  --mh-card-surface: #181b21;
  --mh-navy-dark: #f7f6f2;
  --mh-border: #ffffff26;
  --mh-border-subtle: #ffffff1a;
  --mh-border-standard: #ffffff26;
  --mh-border-strong: #ffffff40;
  --mh-accent-hover: #e2d0a8;
  --mh-accent-soft: #c6a66a1f;
  --mh-input-text: #f4f4f2;
  --mh-nav-bg: #121316;
  --mh-nav-inactive: #9a9ea6;
  --mh-gold-bright: #e2d0a8;
  --mh-depth-1-highlight: inset 0 1px #ffffff12;
  --mh-salary-fg: #f4f4f2;
  --jobs-primary-dark: #a8894f;
  --jobs-primary-light: #e2d0a8;
  --jobs-white: #181b21;
  --jobs-gray-50: #0c0d0f;
  --jobs-gray-100: #181b21;
  --jobs-gray-200: #1f2024;
  --jobs-gray-500: #a8adb5;
  --jobs-gray-600: #c8cbd0;
  --jobs-gray-900: #f7f6f2;
  --jobs-salary-text: #f4f4f2;
  --mh-btn-secondary-fg: #f4f4f2;
  --mh-btn-disabled-bg: #1c1d21;
}

/* Over the Training photos Graphite lays navy shades (training-directory.css, which keeps its own
   cache key, so it is overridden here rather than edited): Gold uses its near-black at the same
   alphas. */
html[data-mh-theme="gold"] #view-training-detail .mh-training-detail__hero-shade {
  background:
    linear-gradient(90deg, rgba(12, 13, 15, 0.5) 0%, rgba(12, 13, 15, 0.18) 45%, transparent 75%),
    linear-gradient(180deg, transparent 30%, rgba(12, 13, 15, 0.7) 100%);
}

html[data-mh-theme="gold"] #view-training-detail .mh-training-detail__hero-badge {
  background: rgba(12, 13, 15, 0.7);
}

html[data-mh-theme="gold"] #view-training .mh-training-card__flag {
  background: rgba(12, 13, 15, 0.62);
}

/* The CV preview's empty line sits on the paper sheet, so it takes paper ink instead of the page's
   grey (8.2:1); !important because recruiter-ref-ui.css gives every .muted its grey that way in the
   dark scheme. Graphite paints the same line #c4cede on #f7f5f1, 1.46:1: an older defect, left as
   it is there because this change does not touch Graphite. */
html[data-mh-theme="gold"].mh-approved.mh-approved #view-cv-builder .mh-cv-preview-placeholder {
  color: #4b4d52 !important;
}
