document.addEventListener("DOMContentLoaded", function() { // Scroll to the link section first const linkSection = document.querySelector(".link"); const contentSection = document.getElementById("content-section"); if (linkSection && contentSection) { // Calculate the offset based on the height of the header const headerHeight = document.querySelector('.site-header').offsetHeight; // Get header height const offset = headerHeight + 40; // Add extra space (adjust as needed) // Scroll to the link section linkSection.scrollIntoView({ behavior: "smooth" }); // Immediately scroll to the content section window.scrollBy({ top: contentSection.offsetTop - offset, behavior: "smooth" }); } });