
"use strict";
(() => {
  var navbar = document.getElementById("sidebar");
  
  // Only run if sidebar exists (for old layout compatibility)
  if (!navbar) {
    return;
  }
  
  var sticky = navbar.offsetTop;
  
  function stickyFn() {
    if (!navbar) {
      return;
    }
    
    if (window.scrollY >= 75) {
      navbar.classList.add("sticky-pin");
    } else {
      navbar.classList.remove("sticky-pin");
    }
  }
  
  window.addEventListener('scroll', stickyFn);
  window.addEventListener('DOMContentLoaded', stickyFn);
})();

