How to hide header when filter does not show that side scroll category on page

Hello,

I am trying to figure out if there is a way to hide the title of the category (in my case language arts or mathematics) once category does not show results after filtering through the search or through the tags on the left side bar. What is happening now is that when searching or filtering by clicking on the tags on the left side and no results are shown for say “language arts” the header title stays there and stacks on top of the bottom category header.

Here is my read-only link: https://preview.webflow.com/preview/peaceful-works?utm_medium=preview_link&utm_source=dashboard&utm_content=peaceful-works&preview=11330001858995ec2edfa03d097a0889&mode=preview