/* .sv-mapbar from the design system's bundle.css.
 * No theme.json here, so token values are literal. */
/* stylelint-disable color-no-hex, function-disallowed-list */

@font-face {
	font-family: "Source Sans 3";
	font-style: normal;
	font-weight: 600;
	font-display: swap;
	src: url(/wp-content/themes/sovereignty/src/fonts/SourceSans3-Semibold.woff2) format("woff2");
}

.sv-has-mapbar {
	--sv-mapbar-height: 56px;
}

/* Selectors carry .sv-has-mapbar to beat Josh's global nav and a rules */
.sv-has-mapbar .sv-mapbar {
	position: sticky;
	top: 0;
	z-index: 999; /* above the maps' panels, under the Place Names welcome dialog (1000) */
	display: flex;
	align-items: center;
	gap: 16px; /* space-4 */
	box-sizing: border-box;
	height: var(--sv-mapbar-height);
	margin: 0;
	padding: 0 16px; /* space-4 */
	background: #00587c; /* surface-inverse */
	color: #fff; /* ink-inverse */
	font-family: "Source Sans 3", "Gill Sans Nova", "Gill Sans MT", "Gill Sans", "Noto Sans", system-ui, sans-serif; /* font-sans */
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
}

/* The site header's laptop nav hover. A transparent underline can fade in */
.sv-has-mapbar .sv-mapbar a {
	display: inline-flex;
	align-items: center;
	min-height: 44px; /* target-min */
	color: #fff; /* ink-inverse */
	text-decoration: underline 2px transparent;
	text-underline-offset: 3px;
	transition: text-decoration-color 150ms ease;
}

.sv-has-mapbar .sv-mapbar__links a {
	padding: 0 12px;
	white-space: nowrap;
}

.sv-has-mapbar .sv-mapbar a:hover {
	text-decoration-color: currentcolor;
}

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

	.sv-has-mapbar .sv-mapbar a {
		transition: none;
	}
}

.sv-has-mapbar .sv-mapbar a:focus-visible {
	outline: 3px solid #fff; /* focus-width, focus-ring-inverse */
	outline-offset: 2px;
	border-radius: 4px; /* radius-sm */
}

.sv-mapbar__mark {
	flex-shrink: 0;
}

.sv-mapbar__mark img {
	display: block;
	width: auto;
	height: 28px;

	/* The theme's basket is teal, which disappears on Dark Blue */
	filter: brightness(0) invert(1);
}

/* Ellipsis, not wrapping, keeps the bar one height for the map offsets */
.sv-mapbar__title {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	padding-left: 16px; /* space-4 */
	border-left: 1px solid #c9ebf9; /* ink-inverse-muted */
	font-size: 17px;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.sv-mapbar__links {
	display: flex;
	flex-shrink: 0;
	gap: 4px; /* space-1 */
}

/* Phone sizes from the 3b board's inline overrides */
@media (max-width: 599px) {

	.sv-has-mapbar {
		--sv-mapbar-height: 48px;
	}

	.sv-has-mapbar .sv-mapbar {
		gap: 10px;
		padding: 0 12px;
	}

	.sv-mapbar__mark img {
		height: 24px;
	}

	.sv-mapbar__title {
		padding-left: 10px;
		font-size: 15px;
	}

	.sv-has-mapbar .sv-mapbar__links a {
		padding: 0 8px;
		font-size: 14px;
	}

	.sv-has-mapbar .sv-mapbar .sv-mapbar__other {
		display: none;
	}
}

/* Move Josh's top-anchored UI below the bar */
.sv-has-mapbar #map {
	top: var(--sv-mapbar-height);
	height: calc(100dvh - var(--sv-mapbar-height));
}

/* Sovereignty's sticky chapter nav */
.sv-has-mapbar nav[aria-label="Page Navigation"] {
	top: var(--sv-mapbar-height);
}

.sv-has-mapbar #panel {
	top: calc(var(--sv-mapbar-height) + 1em);
	max-height: calc(100dvh - var(--sv-mapbar-height) - 2em);
}
