/**
 * Full-bleed inside a block theme.
 *
 * `.wp-block-post-content.has-global-padding` adds the root padding (24px here).
 * `.is-layout-constrained` then caps ordinary children at the content width and
 * gives them a block-gap margin. `alignfull` is the theme's own escape: negative
 * margins equal to that padding, and no content-width cap. Do not set width to
 * 100vw — that includes the scrollbar, starts after the left padding, and the
 * extra width is clipped on the right.
 */
.has-global-padding > .gingr-navigator-breakout.alignfull,
.gingr-navigator-breakout.alignfull {
	box-sizing: border-box;
	width: auto;
	max-width: none !important;
	margin-left: calc(var(--wp--style--root--padding-left, 0px) * -1) !important;
	margin-right: calc(var(--wp--style--root--padding-right, 0px) * -1) !important;
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
}

/* The constrained layout also inserts the block gap above and below the post. */
body:has(.gingr-navigator-breakout) .wp-block-post-content,
body:has(.gingr-navigator-breakout) main {
	margin-block-end: 0;
	padding-block-end: 0;
}

body:has(.gingr-navigator-breakout) .wp-block-post-content > p:empty {
	display: none;
}

/* Block themes put the block gap on the footer, which follows the post. */
body:has(.gingr-navigator-breakout) .wp-site-blocks > * + * {
	margin-block-start: 0 !important;
}

/*
 * The tab bar uses position:sticky against the window. A block-theme group
 * with overflow other than visible (often only at desktop widths) becomes
 * the scroll container instead, so the bar scrolls away with the page.
 */
body:has(.gingr-navigator-breakout) .wp-site-blocks:has(.gingr-navigator-breakout),
body:has(.gingr-navigator-breakout) main:has(.gingr-navigator-breakout),
body:has(.gingr-navigator-breakout) .wp-block-group:has(.gingr-navigator-breakout),
body:has(.gingr-navigator-breakout) .wp-block-post-content:has(.gingr-navigator-breakout),
body:has(.gingr-navigator-breakout) .gingr-navigator-breakout {
	overflow: visible;
}

.gingr-navigator-breakout #gingr-navigator {
	--gn-sticky-offset: 0px;
}

/*
 * The mount is empty until navigator.js runs. Hold a viewport of the hero colour
 * so the theme footer stays below the fold, with a spinner in that space.
 * :empty drops out as soon as the app mounts.
 */
.gingr-navigator-breakout #gingr-navigator:empty {
	box-sizing: border-box;
	min-height: 100vh;
	min-height: 100dvh;
	background: #354560;
}

.gingr-navigator-breakout #gingr-navigator:empty::before {
	content: '';
	position: fixed;
	top: 50%;
	left: 50%;
	width: 2.5rem;
	height: 2.5rem;
	margin: -1.25rem 0 0 -1.25rem;
	border: 3px solid rgb(255 255 255 / 28%);
	border-top-color: #f5af00;
	border-radius: 50%;
	animation: gn-navigator-spin 0.7s linear infinite;
}

@keyframes gn-navigator-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.gingr-navigator-breakout #gingr-navigator:empty::before {
		animation: none;
		border-color: #f5af00;
	}
}

body.admin-bar .gingr-navigator-breakout #gingr-navigator {
	--gn-sticky-offset: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .gingr-navigator-breakout #gingr-navigator {
		--gn-sticky-offset: 46px;
	}
}

@media print {
	body * {
		visibility: hidden;
	}

	.gingr-navigator-breakout,
	.gingr-navigator-breakout * {
		visibility: visible;
	}

	.gingr-navigator-breakout {
		position: absolute;
		inset: 0;
		width: 100%;
		margin: 0;
		max-width: none;
	}

	body:has(.gingr-navigator-breakout) {
		overflow: visible;
	}

	.gingr-navigator-breakout #gingr-navigator:empty {
		min-height: 0;
		background: transparent;
	}

	.gingr-navigator-breakout #gingr-navigator:empty::before {
		content: none;
		animation: none;
	}
}