Fixed sticky sidebar when resizing

1. Scroll down so that the sidebar becomes sticky
2. Resize the window
3. Scroll up, the sidebar gets static

When calculating the upper offset, the sidebar has to be static.