/*
 * nsemm/site-chrome - fixed page furniture.
 *
 * AQL persona launcher bar + float-stack (FAB + cookie consent card) +
 * back-to-top button. Ported faithfully from home-v6 (lines ~303-519,
 * 694-761). Brand hex are NEVER hard-coded: local vars are mapped from the
 * WP preset custom properties at the top, so Brand-Sync keeps recolouring
 * this CSS. --blue-rgb carries the University-Blue channels so the frosted
 * rgba() glass can keep its own alpha while still being brand-driven.
 */
:root {
	--blue: var(--wp--preset--color--university-blue);
	--gold: var(--wp--preset--color--knowledge-gold);
	--teal: var(--wp--preset--color--discovery-teal);
	--brown: var(--wp--preset--color--foundational-brown);
	--sandy: var(--wp--preset--color--sandy-brown);
	--midnight: var(--wp--preset--color--midnight);
	--bg: var(--wp--preset--color--white);
	--gold-dark: #D4AC00; /* gold-dark is a hover shade, not in the palette */
	--blue-rgb: 28, 59, 112; /* University-Blue channels for frosted rgba() */
	--gold-rgb: 250, 205, 0; /* Knowledge-Gold channels for the focus ring + hover glow */
	--r-hdr: 20px;
	--r-btn-scrolled: 12px;
	--r-pill: 9999px;
	--r-card: 16px;
	--aql-h: 64px;
	--body: var(--wp--preset--font-family--readex-pro);
	--head: var(--wp--preset--font-family--sora);
}

/* The block wrapper itself must not interfere with the fixed children. */
.nsemm-site-chrome {
	display: contents;
}

/* ── AQL LAUNCHER ─────────────────────────────────────────────────────────
   Starts VISIBLE on page load, slides DOWN and hides as the user scrolls.
   Cookie banner starts suspended above it; descends when AQL hides. ── */
.nsemm-site-chrome .aql-bar {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 150;
	/* University Blue bar - distinct from the cookie card */
	background: var(--blue);
	box-shadow: 0 -4px 24px rgba(var(--blue-rgb), .22);
	padding: 14px 40px;
	display: flex;
	align-items: center;
	gap: 20px;
	flex-wrap: wrap;
	transform: translateY(0);
	opacity: 1;
	transition: transform .45s cubic-bezier(.4, 0, .2, 1), opacity .45s ease;
}
/* Fades and slides off-screen - partial translateY + opacity looks graceful */
.nsemm-site-chrome .aql-bar.hidden {
	transform: translateY(70%);
	opacity: 0;
}
.nsemm-site-chrome .aql-label {
	font-family: var(--head);
	font-size: 15px;
	font-weight: 700;
	color: var(--gold);
	white-space: nowrap;
	flex-shrink: 0;
}
.nsemm-site-chrome .aql-btns {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	flex: 1;
}
.nsemm-site-chrome .aql-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	border: 1.5px solid rgba(255, 255, 255, .25);
	border-radius: var(--r-pill);
	padding: 10px 18px;
	text-decoration: none;
	font-family: var(--head);
	font-size: 14px;
	font-weight: 600;
	transition: background .2s ease, border-color .2s ease, color .2s ease,
		transform .2s ease, box-shadow .2s ease, opacity .2s ease;
	opacity: .9;
}
.nsemm-site-chrome .aql-btn svg {
	width: 16px;
	height: 16px;
	stroke: currentColor;
	stroke-width: 2;
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex-shrink: 0;
}
.nsemm-site-chrome .aql-btn:hover {
	background: var(--gold);
	color: var(--brown);
	border-color: var(--gold);
	transform: translateY(-2px);
	box-shadow: 0 4px 16px rgba(var(--gold-rgb), .3);
	opacity: 1;
}

/* ── FLOAT STACK - shared wrapper owning bottom positioning for cookie + FAB ── */
.nsemm-site-chrome .float-stack {
	position: fixed;
	left: 16px;
	z-index: 400;
	bottom: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	align-items: flex-start;
	transition: bottom .9s cubic-bezier(.4, 0, .2, 1);
}
.nsemm-site-chrome .float-stack.aql-reserved {
	bottom: calc(var(--aql-h) + 20px);
}

/* ── PAGE FAB - hidden by default; view.js sets display:block to reveal ── */
.nsemm-site-chrome .fab {
	display: none;
}
/* Extended pill: icon left + label right when unscrolled. Collapses to a
   circle on scroll. Re-expands on hover. */
.nsemm-site-chrome .fab-btn {
	display: inline-flex;
	align-items: center;
	height: 52px;
	padding: 0 18px 0 14px;
	background: rgba(var(--blue-rgb), .92);
	backdrop-filter: blur(18px) saturate(160%);
	-webkit-backdrop-filter: blur(18px) saturate(160%);
	border-radius: var(--r-pill);
	border: 1px solid rgba(255, 255, 255, .16);
	box-shadow: 0 8px 32px rgba(0, 0, 0, .22), 0 2px 8px rgba(0, 0, 0, .1);
	cursor: pointer;
	overflow: hidden;
	white-space: nowrap;
	transition: padding .2s cubic-bezier(.4, 0, .2, 1),
		border-radius .2s cubic-bezier(.4, 0, .2, 1),
		box-shadow .15s ease;
}
.nsemm-site-chrome .fab-btn:hover {
	box-shadow: 0 12px 36px rgba(0, 0, 0, .3);
}
.nsemm-site-chrome .fab-btn svg {
	width: 22px;
	height: 22px;
	stroke: var(--gold);
	stroke-width: 2;
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex-shrink: 0;
}
.nsemm-site-chrome .fab-text {
	color: #fff;
	font-family: var(--head);
	font-size: 14px;
	font-weight: 600;
	margin-left: 9px;
	max-width: 180px;
	opacity: 1;
	transition: max-width .2s cubic-bezier(.4, 0, .2, 1),
		opacity .15s ease, margin-left .2s cubic-bezier(.4, 0, .2, 1);
}
/* Scrolled: collapse to circle */
.nsemm-site-chrome .float-stack.stack-scrolled .fab-btn {
	padding: 15px;
	border-radius: 50%;
}
.nsemm-site-chrome .float-stack.stack-scrolled .fab-text {
	max-width: 0;
	opacity: 0;
	margin-left: 0;
}
/* Hover when scrolled: re-expand to pill */
.nsemm-site-chrome .float-stack.stack-scrolled .fab-btn:hover {
	padding: 0 18px 0 14px;
	border-radius: var(--r-pill);
}
.nsemm-site-chrome .float-stack.stack-scrolled .fab-btn:hover .fab-text {
	max-width: 180px;
	opacity: 1;
	margin-left: 9px;
}
/* Nav open: collapse FAB label same way as scrolled state */
.nsemm-site-chrome .float-stack.nav-open .fab-btn {
	padding: 15px;
	border-radius: 50%;
}
.nsemm-site-chrome .float-stack.nav-open .fab-text {
	max-width: 0;
	opacity: 0;
	margin-left: 0;
}

/* ── COOKIE BANNER - child of .float-stack; no longer self-positioned ── */
.nsemm-site-chrome .ck {
	/* University Blue frosted glass */
	background: rgba(var(--blue-rgb), .88);
	backdrop-filter: blur(18px) saturate(160%);
	-webkit-backdrop-filter: blur(18px) saturate(160%);
	border-radius: var(--r-card);
	box-shadow: 0 8px 32px rgba(0, 0, 0, .22), 0 2px 8px rgba(0, 0, 0, .1);
	border: 1px solid rgba(255, 255, 255, .14);
	max-width: 380px;
	width: calc(100vw - 32px);
	overflow: hidden;
	opacity: 1;
	transform: translateY(0) scale(1);
	transition: transform .55s cubic-bezier(.22, 1, .36, 1),
		opacity .55s cubic-bezier(.22, 1, .36, 1),
		border-radius .45s cubic-bezier(.4, 0, .2, 1);
	will-change: transform, opacity;
}
/* SMOOTH COLLAPSE - grid-template-rows 1fr->0fr tracks the actual content
   height, so the shrink reads as proportional and the FAB above glides down
   in lockstep instead of a late snap. */
.nsemm-site-chrome .ck-shrink {
	display: grid;
	grid-template-rows: 1fr;
	transition: grid-template-rows .55s cubic-bezier(.22, 1, .36, 1);
}
.nsemm-site-chrome .ck-shrink-inner {
	overflow: hidden;
	min-height: 0;
}
/* Dismissed: slide off (gentle settle, slight scale-down) while the grid row
   collapses in the same breath so the two motions read as one. */
.nsemm-site-chrome .ck.dismissed {
	transform: translateY(60%) scale(.96);
	opacity: 0;
	pointer-events: none;
}
.nsemm-site-chrome .ck.dismissed .ck-shrink {
	grid-template-rows: 0fr;
}
/* Nav-minimised: strip the .ck wrapper invisible; the .ck-mini-btn inside
   takes over as a FAB-identical circle. */
.nsemm-site-chrome .ck.nav-minimised {
	width: auto;
	max-width: none;
	height: auto;
	max-height: none;
	background: transparent;
	box-shadow: none;
	border-color: transparent;
	backdrop-filter: none;
	-webkit-backdrop-filter: none;
	border-radius: 0;
	overflow: visible;
	margin: 0 0 0 14px; /* left-align with FAB; FAB's margin anchors the corner */
	transition: opacity .3s ease;
}
/* When the stack is already offset (scrolled), clear the extra margin */
.nsemm-site-chrome .float-stack.stack-scrolled .ck.nav-minimised {
	margin: 0;
}
.nsemm-site-chrome .ck.nav-minimised .ck-head,
.nsemm-site-chrome .ck.nav-minimised .ck-body,
.nsemm-site-chrome .ck.nav-minimised .ck-detail,
.nsemm-site-chrome .ck.nav-minimised .ck-actions {
	display: none;
}

/* ── COOKIE MINI BUTTON - identical to .fab-btn in its scrolled-circle state ── */
.nsemm-site-chrome .ck-mini-btn {
	display: none; /* shown only inside .nav-minimised */
	align-items: center;
	height: 52px;
	padding: 15px;
	background: rgba(var(--blue-rgb), .92);
	backdrop-filter: blur(18px) saturate(160%);
	-webkit-backdrop-filter: blur(18px) saturate(160%);
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, .16);
	box-shadow: 0 8px 32px rgba(0, 0, 0, .22), 0 2px 8px rgba(0, 0, 0, .1);
	cursor: pointer;
	overflow: hidden;
	white-space: nowrap;
	transition: padding .2s cubic-bezier(.4, 0, .2, 1),
		border-radius .2s cubic-bezier(.4, 0, .2, 1),
		box-shadow .15s ease;
}
.nsemm-site-chrome .ck-mini-btn svg {
	width: 22px;
	height: 22px;
	stroke: var(--gold);
	stroke-width: 2;
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex-shrink: 0;
}
.nsemm-site-chrome .ck-mini-text {
	color: #fff;
	font-family: var(--head);
	font-size: 14px;
	font-weight: 600;
	margin-left: 0;
	max-width: 0;
	opacity: 0;
	overflow: hidden;
	white-space: nowrap;
	transition: max-width .2s cubic-bezier(.4, 0, .2, 1),
		opacity .15s ease, margin-left .2s cubic-bezier(.4, 0, .2, 1);
}
.nsemm-site-chrome .ck.nav-minimised .ck-mini-btn {
	display: inline-flex;
}
.nsemm-site-chrome .ck.nav-minimised .ck-mini-btn:hover {
	padding: 0 18px 0 14px;
	border-radius: var(--r-pill);
	box-shadow: 0 12px 36px rgba(0, 0, 0, .3);
}
.nsemm-site-chrome .ck.nav-minimised .ck-mini-btn:hover .ck-mini-text {
	max-width: 180px;
	opacity: 1;
	margin-left: 9px;
}
/* Compact (minified): hides description + opacity slightly reduces */
.nsemm-site-chrome .ck.compact {
	opacity: .88;
}
.nsemm-site-chrome .ck.compact:hover {
	opacity: 1;
}
/* Compact body: collapse with opacity */
.nsemm-site-chrome .ck .ck-body {
	padding: 10px 18px 0;
	font-size: 14px;
	color: rgba(255, 255, 255, .78);
	line-height: 1.6;
	max-height: 80px;
	overflow: hidden;
	transition: max-height .4s ease, padding .4s ease, opacity .35s ease;
}
.nsemm-site-chrome .ck.compact .ck-body {
	max-height: 0;
	padding: 0;
	opacity: 0;
}

.nsemm-site-chrome .ck-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 18px 0;
}
.nsemm-site-chrome .ck-title {
	font-family: var(--head);
	font-size: 15px;
	font-weight: 700;
	color: #fff;
}
.nsemm-site-chrome .ck-exp {
	width: 28px;
	height: 28px;
	border-radius: 8px;
	background: rgba(255, 255, 255, .18);
	color: #fff;
	border: none;
	cursor: pointer;
	font-size: 18px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s;
	flex-shrink: 0;
	font-family: var(--head);
}
.nsemm-site-chrome .ck-exp:hover {
	background: rgba(255, 255, 255, .3);
}
.nsemm-site-chrome .ck-detail {
	overflow: hidden;
	max-height: 0;
	transition: max-height .35s ease;
}
.nsemm-site-chrome .ck-detail.open {
	max-height: 200px;
}
.nsemm-site-chrome .ck-detail-inner {
	padding: 12px 18px 0;
	font-size: 13px;
	color: rgba(255, 255, 255, .7);
	line-height: 1.6;
	border-top: 1px solid rgba(255, 255, 255, .12);
}
.nsemm-site-chrome .ck-policy-link {
	color: var(--gold);
	text-underline-offset: 3px;
}
.nsemm-site-chrome .ck-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 14px 18px;
}
/* Cookie buttons: gold accept, ghost others */
.nsemm-site-chrome .ck-accept {
	background: var(--gold);
	color: var(--brown);
	font-family: var(--head);
	font-size: 14px;
	font-weight: 600;
	padding: 11px;
	border-radius: var(--r-pill);
	border: none;
	cursor: pointer;
	transition: background .18s ease, transform .15s ease, opacity .2s ease;
	text-align: center;
	opacity: 1;
}
.nsemm-site-chrome .ck-accept:hover {
	background: var(--gold-dark);
	transform: translateY(-1px);
}
.nsemm-site-chrome .ck-row {
	display: flex;
	gap: 8px;
}
.nsemm-site-chrome .ck-custom,
.nsemm-site-chrome .ck-decline {
	flex: 1;
	font-family: var(--head);
	font-size: 13px;
	font-weight: 600;
	padding: 10px;
	border-radius: var(--r-pill);
	border: 1.5px solid rgba(255, 255, 255, .25);
	background: transparent;
	color: rgba(255, 255, 255, .85);
	cursor: pointer;
	transition: border-color .18s, background .18s, opacity .2s;
	opacity: .85;
}
.nsemm-site-chrome .ck-custom:hover,
.nsemm-site-chrome .ck-decline:hover {
	border-color: rgba(255, 255, 255, .6);
	background: rgba(255, 255, 255, .1);
	opacity: 1;
}

/* ── BACK TO TOP - bottom-right, mirrors .float-stack on the opposite corner,
   shares the same AQL-aware bottom offset so it never collides. ── */
.nsemm-site-chrome .bt2t {
	position: fixed;
	right: 16px;
	z-index: 400;
	bottom: 20px;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: rgba(var(--blue-rgb), .92);
	backdrop-filter: blur(18px) saturate(160%);
	-webkit-backdrop-filter: blur(18px) saturate(160%);
	border: 1px solid rgba(255, 255, 255, .16);
	box-shadow: 0 8px 32px rgba(0, 0, 0, .22), 0 2px 8px rgba(0, 0, 0, .1);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	opacity: 0;
	transform: translateY(12px);
	pointer-events: none;
	transition: bottom .9s cubic-bezier(.4, 0, .2, 1),
		opacity .3s ease, transform .3s ease, box-shadow .15s ease;
}
.nsemm-site-chrome .bt2t.visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: all;
}
.nsemm-site-chrome .bt2t.aql-reserved {
	bottom: calc(var(--aql-h) + 20px);
}
.nsemm-site-chrome .bt2t:hover {
	box-shadow: 0 12px 36px rgba(0, 0, 0, .3);
	transform: translateY(-2px);
}
.nsemm-site-chrome .bt2t svg {
	width: 20px;
	height: 20px;
	stroke: var(--gold);
	stroke-width: 2;
	fill: none;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
	.nsemm-site-chrome .aql-bar {
		display: none;
	}
	/* Unscrolled on mobile: cookie + FAB mirror the flat full-width header */
	.nsemm-site-chrome .float-stack {
		left: 0;
		bottom: 0;
		width: 100%;
		transition: left .45s cubic-bezier(.4, 0, .2, 1),
			bottom .9s cubic-bezier(.4, 0, .2, 1),
			width .45s cubic-bezier(.4, 0, .2, 1);
	}
	.nsemm-site-chrome .float-stack.aql-reserved {
		bottom: 0;
	}
	/* FAB pill gets breathing room from the corner even though cookie is edge-to-edge */
	.nsemm-site-chrome .fab {
		margin: 0 0 10px 14px;
	}
	.nsemm-site-chrome .ck {
		width: 100%;
		max-width: none;
		border-radius: var(--r-card) var(--r-card) 0 0;
	}
	/* Scrolled: morphs to small card matching pill header margins (left:12px) */
	.nsemm-site-chrome .float-stack.stack-scrolled {
		left: 12px;
		bottom: 16px;
		width: calc(100vw - 24px);
	}
	.nsemm-site-chrome .float-stack.stack-scrolled.aql-reserved {
		bottom: 16px;
	}
	/* Once scrolled the stack itself is offset - clear the FAB margin */
	.nsemm-site-chrome .float-stack.stack-scrolled .fab {
		margin: 0;
	}
	.nsemm-site-chrome .float-stack.stack-scrolled .ck {
		border-radius: var(--r-card);
		width: 100%;
		max-width: none;
	}
	.nsemm-site-chrome .bt2t {
		right: 14px;
		bottom: 0;
	}
	.nsemm-site-chrome .bt2t.aql-reserved {
		bottom: 16px;
	}
}

/* ── FOCUS RING - on-brand gold ring, not the browser default. ── */
.nsemm-site-chrome a:focus-visible,
.nsemm-site-chrome button:focus-visible,
.nsemm-site-chrome [tabindex]:focus-visible {
	outline: 3px solid var(--gold);
	outline-offset: 3px;
	border-radius: 8px;
	box-shadow: 0 0 0 6px rgba(var(--gold-rgb), .35);
	transition: outline-offset .15s ease, box-shadow .15s ease;
}

/* ── REDUCED MOTION - instant state changes, no slides/morphs. ── */
@media (prefers-reduced-motion: reduce) {
	.nsemm-site-chrome .aql-bar,
	.nsemm-site-chrome .float-stack,
	.nsemm-site-chrome .fab-btn,
	.nsemm-site-chrome .fab-text,
	.nsemm-site-chrome .ck,
	.nsemm-site-chrome .ck-shrink,
	.nsemm-site-chrome .ck-body,
	.nsemm-site-chrome .ck-detail,
	.nsemm-site-chrome .ck-mini-btn,
	.nsemm-site-chrome .ck-mini-text,
	.nsemm-site-chrome .ck-accept,
	.nsemm-site-chrome .bt2t,
	.nsemm-site-chrome .aql-btn {
		transition: none !important;
	}
}
