.wp-block-heading {
  sup {
    font-size: clamp(12px, 0.25em, 0.25em);
    letter-spacing: -0.06em;
    vertical-align: super;
  }

  a {
    text-decoration: none !important;
    color: inherit !important;
  }
}

h1.wp-block-heading :is(strong, em) {
  font-size: inherit;
  line-height: inherit;
  font-style: normal;
  font-weight: 300;
}

/*
 * Case study titles end in a green period. Fade-letters titles get a real
 * .kbd-page-hero__heading-accent span from JS (ensurePageHeroAccentPeriod);
 * ::after covers static titles and the editor.
 */
.single-case-study .wp-block-post-content h1 .kbd-page-hero__heading-accent,
.single-case-study .wp-block-post-content h1 .kbd-page-hero__heading-accent .char {
  color: var(--wp--preset--color--accent, #49d31b);
}

.single-case-study .wp-block-post-content h1:not(.is-style-fade-letters-in):not(:has(.kbd-page-hero__heading-accent))::after,
.post-type-case-study h1.wp-block-heading::after {
  content: '.';
  color: var(--wp--preset--color--accent, #49d31b);
}

h4.wp-block-heading {
  margin-block-end: 0;
}


/*
 * Case study headings (frontend and the case study editor canvas).
 */
:where(.single-case-study .wp-block-post-content, .post-type-case-study.editor-styles-wrapper) {
  & h2.wp-block-heading {
    font-size: var(--wp--custom--font-size--article-heading);
    font-weight: var(--wp--custom--font-weight--medium);
    letter-spacing: -0.02em;
    line-height: 1;
  }

  & h3.wp-block-heading {
    font-size: var(--wp--custom--font-size--article-body);
    font-weight: var(--wp--custom--font-weight--medium);
    letter-spacing: 0;
    line-height: calc(29 / 22);
  }
}

/*
 * Post subheads (frontend and the post editor): the Figma has one subhead
 * style, 22px on 29px at weight 550, for every heading level in the body.
 */
:where(.single-post, .post-type-post.editor-styles-wrapper) .wp-block-post-content :is(h2, h3, h4).wp-block-heading {
  font-size: var(--wp--custom--font-size--article-body);
  font-weight: var(--wp--custom--font-weight--medium);
  letter-spacing: 0;
  line-height: calc(29 / 22);
  margin-block-end: 0;
}
