/*
 * tokens.css — CHN brand tokens (single source of truth).
 *
 * theme.json mirrors a subset of these so the block editor + Customizer use
 * the same palette. Don't add app-specific colors here — semantic state tokens
 * live near the bottom and should stay minimal.
 */

:root {
	/* Brand */
	--chn-color-primary:     #0b3b94;
	--chn-color-primary-700: #082c6f;
	--chn-color-accent:      #f3802d;
	--chn-color-accent-700:  #d96812;

	/* Neutrals + surfaces */
	--chn-color-text:        #1d2733;
	--chn-color-muted:       #5b6772;
	--chn-color-border:      #e5e1da;
	--chn-color-surface:     #ffffff;
	--chn-color-surface-alt: #f8f9fb;
	--chn-color-paper:       #f5efe4;
	--chn-color-paper-deep:  #efe7d3;
	/* Phase B4 CHROME-4 fix: `paper-shade` alias used by the bespoke
	 * checklist + breadcrumb-strip + commerce notices. Resolves to the same
	 * tone as `paper-deep` so historic references and new code agree. */
	--chn-color-paper-shade: #efe7d3;
	--chn-color-card:        #fffdf8;
	--chn-color-card-deep:   #faf5e8;

	/* Tint colors */
	--chn-color-accent-tint: #ffd8b8;  /* light peach used on hero eyebrows over image bg */

	/* Semantic state — sparse, brand-aligned */
	--chn-state-success: var(--chn-color-primary);
	--chn-state-warning: var(--chn-color-accent);
	--chn-state-danger:  #8a1f11;
	--chn-color-focus:   var(--chn-color-accent);

	/* Typography */
	--chn-font-serif: "Fraunces", "Iowan Old Style", "Palatino", Georgia, serif;
	--chn-font-sans:  "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
	--chn-font-mono:  "JetBrains Mono", "SF Mono", "Roboto Mono", Menlo, monospace;
	--chn-line-tight:  1.15;
	--chn-line-normal: 1.55;

	/* Spacing scale — px equivalents documented for the design rules doc.
	 * Every layout decision must pick from this scale; ad-hoc px values
	 * trigger a minor in the Phase 1 audit.
	 *   --chn-space-1   4px   inline-icon gap, hairline padding
	 *   --chn-space-2   8px   chip padding, small gaps between siblings
	 *   --chn-space-3  12px   default text margins, button padding-y
	 *   --chn-space-4  16px   card gutter, list-row spacing
	 *   --chn-space-5  24px   section internal block gap
	 *   --chn-space-6  32px   section internal block gap (large)
	 *   --chn-space-7  48px   between adjacent <section> elements (REQUIRED floor)
	 *   --chn-space-8  64px   hero stack between title + sub + CTA
	 *   --chn-space-9  96px   hero vertical padding floor (above 900px)
	 */
	--chn-space-1:  4px;
	--chn-space-2:  8px;
	--chn-space-3: 12px;
	--chn-space-4: 16px;
	--chn-space-5: 24px;
	--chn-space-6: 32px;
	--chn-space-7: 48px;
	--chn-space-8: 64px;
	--chn-space-9: 96px;

	/* Typography scale — px equivalents documented. Body falls back to
	 * 16px when no scale value applies; never inline a numeric font-size
	 * outside this scale.
	 *   --chn-font-size-xs    11px   eyebrows, small-caps overlines
	 *   --chn-font-size-sm    13px   secondary copy, breadcrumbs
	 *   --chn-font-size-base  16px   body
	 *   --chn-font-size-md    17px   body lead / hero sub on light bg
	 *   --chn-font-size-lg    20px   h3
	 *   --chn-font-size-xl    28px   h2
	 *   --chn-font-size-2xl   46px   h1 (clamped between 32 and 46)
	 */
	--chn-font-size-xs:    11px;
	--chn-font-size-sm:    13px;
	--chn-font-size-base:  16px;
	--chn-font-size-md:    17px;
	--chn-font-size-lg:    20px;
	--chn-font-size-xl:    28px;
	--chn-font-size-2xl:   46px;

	/* Line-height scale */
	--chn-line-height-tight:   1.15;
	--chn-line-height-snug:    1.30;
	--chn-line-height-normal:  1.55;
	--chn-line-height-relaxed: 1.70;

	/* Component tokens */
	--chn-radius-sm: 2px;
	--chn-radius-md: 4px;
	--chn-radius-lg: 6px;
	--chn-shadow-card: 0 1px 0 rgba(0, 0, 0, .02);
	--chn-shadow-card-hover: 0 6px 24px -10px rgba(11, 59, 148, .18);
	--chn-input-height: 42px;
	--chn-button-height: 42px;

	/* Layout — Phase 0 container lock.
	 * Container max raised to 1280 (was 1240); horizontal padding clamps
	 * between 20px (mobile) and 48px (large desktop). Every shipped page
	 * must wrap content in `.chn-container` (or be a deliberate full-bleed
	 * band whose inner content uses `.chn-container`).
	 */
	--chn-container-max:  1280px;
	--chn-container-pad:  clamp(20px, 4vw, 48px);
	--chn-container:      1280px;        /* legacy alias retained */
	--chn-container-text:  880px;
}

/*
 * Compatibility aliases. Existing CHN code references --chn-color-bg etc.
 * Keep these working until all classes migrate to the new tokens.
 */
:root {
	--chn-pillar-design: var(--chn-color-primary);
	--chn-pillar-build:  var(--chn-color-primary);
	--chn-pillar-manage: var(--chn-color-primary);
	--chn-pillar-bid:    var(--chn-color-accent);
	--chn-color-bg:      var(--chn-color-surface);
	--chn-color-bg-alt:  var(--chn-color-surface-alt);
}
