Keep announcement above navbar on scroll


I am trying to create an announcement bar that will stay above the navbar on scroll. The issue is that some pages does not include the navbar, which creates a blank space above the navbar. I have succeeded in removing that blank space but then the announcement bar disappears on scroll or gets hidden behind the navbar.

Any ideas how I can have the announcement bar sticky to the top and the navbar sticky to the announcement bar?