/*
 * Sticky header look. Loaded only where the "Sticky compact header" style is
 * used (inc/kit/sticky-header.php). The kit script only toggles .is-cs-compact
 * and sets --cs-sticky-offset; compact here means the announcement bar slides
 * up (a transform, so nothing below moves) and the bar gets a soft shadow.
 */

.wp-block-template-part:has(> .is-style-cs-sticky-header) {
	position: sticky;
	inset-block-start: 0;
	z-index: 50;
	pointer-events: none;
}

.wp-block-template-part:has(> .is-style-cs-sticky-header) > * {
	pointer-events: auto;
}

.admin-bar .wp-block-template-part:has(> .is-style-cs-sticky-header) {
	inset-block-start: var(--wp-admin--admin-bar--height, 0px);
}

html:has(.is-style-cs-sticky-header) {
	scroll-padding-top: calc(var(--cs-sticky-offset, 0px) + 16px);
}

.is-style-cs-sticky-header.is-cs-compact .cs-announce {
	visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {

	.is-style-cs-sticky-header {
		transition: none;
	}
}
