/* One supported typography configuration: Manrope headings and labels with
 * subtle emphasis; Inter body text and editorial italics remain unchanged.
 * Saved legacy typography_theme values are intentionally ignored. */
body {
  --luna-typography-theme-heading-letter-spacing: var(
    --luna-primitive-tracking-subtle
  );
  --luna-typography-heading-fallback-font-weight: var(
    --luna-primitive-font-weight-700
  );
  --luna-typography-heading-emphasis-color: var(--luna-page-heading-emphasis);
  --luna-typography-heading-emphasis-font-style: var(
    --luna-primitive-font-style-normal
  );
  --luna-typography-heading-emphasis-font-weight: var(
    --luna-primitive-font-weight-700
  );
  /* Compatibility property; no generated Heading 8 italics style exists. */
  --luna-typography-heading-heading-8-italics-letter-spacing: var(
    --luna-primitive-tracking-subtle
  );
}

/* Explicit context boundaries own emphasis; saved Light means Follow page.
 * Legacy appearance attributes are presentation hints, not context resets. */
body :where([data-luna-color-context='default']) {
  --luna-typography-heading-emphasis-color: var(--luna-page-heading-emphasis);
}
body :where([data-luna-color-context='inverse']) {
  --luna-typography-heading-emphasis-color: var(
    --luna-color-context-inverse-text-heading-emphasis-subtle
  );
}

/*
 * HubSpot rich text and legacy template content can emit semantic headings
 * without a Luna component class. Keep this deliberately narrow fallback
 * scoped to em/i descendants of headings so body, quote, caption, and other
 * non-heading italics retain their existing typography.
 */
body :is(h1, h2, h3, h4, h5, h6) :is(em, i) {
  color: var(--luna-typography-heading-emphasis-color);
  font-style: var(--luna-typography-heading-emphasis-font-style);
  font-weight: var(--luna-typography-heading-emphasis-font-weight);
}
