scroll-margin-top is not the best choice, due to brittleness and browser issues, scroll-padding-top is much more robust. It also needs to be dynamic to account for changes in the header height. The approach at the end of this article describes the optimum approach: https://www.tpgi.com/prevent-focused-elements-from-being-obscured-by-sticky-headers/#an-alternative-approach
scroll-margin-top is not the best choice, due to brittleness and browser issues, scroll-padding-top is much more robust. It also needs to be dynamic to account for changes in the header height. The approach at the end of this article describes the optimum approach: https://www.tpgi.com/prevent-focused-elements-from-being-obscured-by-sticky-headers/#an-alternative-approach