/* Unlayered: wins over @layer blocks and stray rules from WP / plugins.
 * Display h1 scale — shared by hero headlines, entry/CTA titles, and Core post h1. */

:is(main#main, .editor-styles-wrapper)
  :is(
    h1,
    .wp-block-heading:where(h1),
    .hero__headline,
    .primary-cta__h,
    .primary-cta__h
  ) {
  font-family: var(--serif);
  font-style: normal;
  font-weight: 400;
  font-size: var(--fs-heading-display);
  line-height: 0.95;
  letter-spacing: -0.025em;
  font-optical-sizing: auto;
  font-synthesis: none;
  color: var(--ink);
}

/* Block display titles — typographic measure; not Core post h1 (layout width comes from WP) */
:is(main#main, .editor-styles-wrapper) :is(.hero__headline, .primary-cta__h, .primary-cta__h) {
  max-width: min(22ch, 100%);
}

/* Core post h1 — keep margin-inline from constrained layout; space below the title */
:is(main#main, .editor-styles-wrapper)
  :is(.wp-block-post-content, .entry-content)
  > :is(h1.wp-block-heading, .wp-block-heading:where(h1)) {
  margin-block-start: 0;
  margin-block-end: clamp(40px, 6vh, 72px);
}

:is(main#main, .editor-styles-wrapper) :is(.hero__headline, .primary-cta__h, .primary-cta__h) {
  margin: 0;
}

:is(main#main, .editor-styles-wrapper)
  :is(
    h1,
    .wp-block-heading:where(h1),
    .hero__headline,
    .primary-cta__h,
    .primary-cta__h
  )
  em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent-em);
  font-variation-settings: normal;
}

@media (max-width: 900px) {
  :is(main#main, .editor-styles-wrapper)
    :is(
      h1,
      .wp-block-heading:where(h1),
      .hero__headline,
      .primary-cta__h,
      .primary-cta__h
    ) {
    line-height: 0.98;
  }
}
