/**
 * DLV Access Control — custom top bar.
 *
 * Everything is scoped under the .dlv-ac-bar namespace so nothing here relies
 * on (or leaks into) WordPress admin-bar styling. Background and text colours
 * are NOT set here: they are dynamic settings and are applied inline on the
 * element by the PHP render method. Placement and fixed/static behaviour are
 * driven by the modifier classes the PHP adds:
 *
 *   .dlv-ac-bar--top      placed against the top edge
 *   .dlv-ac-bar--bottom   placed against the bottom edge
 *   .dlv-ac-bar--sticky   position: fixed (pinned); absence = static, in flow
 */

.dlv-ac-bar {
	box-sizing: border-box;
	width: 100%;
	left: 0;
	right: 0;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 13px;
	line-height: 1.4;
}

.dlv-ac-bar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px 16px;
	padding: 6px 16px;
	max-width: 100%;
}

/* --- Branding (left): site title + nav menu ----------------------------- */

.dlv-ac-bar__brand {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 16px;
	min-width: 0;
}

.dlv-ac-bar__site-title {
	color: inherit;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.dlv-ac-bar__nav {
	min-width: 0;
}

.dlv-ac-bar__menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dlv-ac-bar__menu a {
	color: inherit;
	text-decoration: none;
}

.dlv-ac-bar__menu a:hover,
.dlv-ac-bar__menu a:focus {
	text-decoration: underline;
}

/* --- Session (right): identity / logout, or the logged-out login link --- */

.dlv-ac-bar__session {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-left: auto;
}

.dlv-ac-bar__name {
	font-weight: 600;
}

.dlv-ac-bar__status {
	opacity: 0.85;
}

/* Pushes the logout link to the far end of the bar (legacy layout hook). */
.dlv-ac-bar__spacer {
	margin-left: auto;
}

.dlv-ac-bar__logout,
.dlv-ac-bar__login {
	color: inherit;
	text-decoration: underline;
	white-space: nowrap;
}

.dlv-ac-bar__logout:hover,
.dlv-ac-bar__logout:focus,
.dlv-ac-bar__login:hover,
.dlv-ac-bar__login:focus {
	text-decoration: none;
}

/* --- Placement ---------------------------------------------------------- */

.dlv-ac-bar--top {
	top: 0;
}

.dlv-ac-bar--bottom {
	bottom: 0;
}

/* --- Fixed vs static ---------------------------------------------------- */

.dlv-ac-bar--sticky {
	position: fixed;
}

/* Non-sticky bars sit in the normal document flow. */
.dlv-ac-bar:not(.dlv-ac-bar--sticky) {
	position: static;
}

/* --- Sticky-bar content offset ------------------------------------------ */
/*
 * When the bar is fixed it leaves the flow and would cover page content. The
 * bar's JS measures its real height into the --dlv-ac-bar-height custom
 * property and adds the matching body modifier class below. Kept as a single
 * low-specificity rule so a theme can override the offset if it conflicts.
 */
body.dlv-ac-body--offset-top {
	padding-top: var(--dlv-ac-bar-height, 0px);
}

body.dlv-ac-body--offset-bottom {
	padding-bottom: var(--dlv-ac-bar-height, 0px);
}
