"use client";

import { useLayoutEffect } from "react";

/**
 * Opt-in switch for the header's hide-on-scroll-down behaviour. Mount it on a
 * page (e.g. the blog) to flag the document; HeaderShell reads this flag live
 * during scroll. Renders nothing.
 */
export default function HeaderAutoHide() {
  useLayoutEffect(() => {
    const root = document.documentElement;
    root.dataset.headerAutohide = "1";
    return () => {
      delete root.dataset.headerAutohide;
    };
  }, []);

  return null;
}
