In order to stop the Active Heading Content from nesting inside Headers, you will need to add a margin before the active heading content.

In order to accomplish this,

  1. Go to the settings of TOP Table of contents
  2. Next, click on Headings
  3. Set the Offset from top to the number of pixels you wish to add before headings.
  4. It’s done now