/**
 * Portal chrome — document frame + global header (logo, nav, avatar).
 *
 * Scoped to .sd-portal so the active theme is never touched.
 */

/* ---------- Portal document frame ---------- */
html.sd-portal-html,
body.sd-portal {
	margin: 0;
	padding: 0;
	background: var(--sd-bg);
}

.sd-portal {
	font-family: var(--sd-font);
	min-height: 100vh;
	color: var(--sd-text-soft);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.sd-portal *,
.sd-portal *::before,
.sd-portal *::after {
	box-sizing: border-box;
}

.sd-portal__frame {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.sd-portal__body {
	flex: 1 0 auto;
}

/* Keep the sticky header clear of the WordPress admin bar for signed-in staff. */
body.admin-bar.sd-portal {
	--sd-topbar: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar.sd-portal {
		--sd-topbar: 46px;
	}
}

/* ---------- Header ---------- */
.sd-header {
	position: sticky;
	z-index: 100;
	top: var(--sd-topbar);
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: var(--sd-header-h);
	padding: 12px 48px;
	background: var(--sd-bg);
	border-bottom: 1px solid var(--sd-border-subtle);
	gap: 24px;
}

.sd-header__left {
	display: flex;
	align-items: center;
	min-width: 0;
	gap: 64px;
}

.sd-header__logo {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	justify-content: flex-start;
	gap: 12px;
}

.sd-header__logo img {
	display: block;
	width: auto;
	height: 32px;
}

.sd-header__nav {
	display: flex;
	align-items: center;
	gap: 40px;
}

.sd-header__link {
	font-size: 16px;
	font-weight: 500;
	line-height: 1.4;
	white-space: nowrap;
	text-decoration: none;
	color: var(--sd-text-dim);
}

.sd-header__link:hover {
	text-decoration: none;
	color: var(--sd-text);
}

.sd-header__link.is-active {
	color: var(--sd-text);
}

.sd-header__right {
	display: flex;
	align-items: center;
	flex: 0 0 auto;
	gap: 16px;
}

@media (max-width: 900px) {
	.sd-header {
		padding: 10px 20px;
		gap: 12px;
	}

	.sd-header__left {
		gap: 20px;
	}

	.sd-header__nav {
		gap: 20px;
		display: none;
	}
}
