When the scrolled down header is in effect modify the JS to toggle a class to the sidebar and use that class in css to set the different top position for the sidebar. (Assuming you can rely on a fixed height of the header and it doesn’t change height when resized etc.)