@media screen {
	:root {
		scroll-padding-block-start: calc(var(--ar-studio-header-height, 0px) + var(--ar-studio-toolbar-offset, 0px));
	}
	/* WordPress restores focus to the menu button while its overlay is still open. */
	:root.has-modal-open {
		scroll-padding-block-start: 0;
	}

	/* Keep the full template part sticky as the rest of the page scrolls. */
	.wp-site-blocks > :is(header, .wp-block-template-part:has(.ar-studio-header)) {
		position: sticky;
		top: var(--ar-studio-toolbar-offset, 0px);
		z-index: 100;
		background-color: var(--ar-paper);
	}
}

/* On phones the WordPress toolbar scrolls away with the page. */
@media screen and (min-width: 601px) {
	:root:has(body.admin-bar) {
		--ar-studio-toolbar-offset: var(--wp-admin--admin-bar--height, 32px);
	}
}
