/* ==========================================================================
   Queulan Documentation Header
   Light marketing-style top bar (matches the Queulan product site),
   fetched into #site-header by header.js.
   Reuses the color variables defined in css/style.css.
   ========================================================================== */

.qd-header {
	position: fixed;
	top: 2px;
	left: 0;
	right: 0;
	height: var(--qd-header-height, 72px);
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 0 32px;
	background: var(--qd-bg-sidebar, #FFFFFF);
	border-bottom: 1px light var(--qd-border, #DBE4F0);
	box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
	box-sizing: border-box;
	font-family: var(--qd-font, "Inter", sans-serif);
	z-index: 9999;
}

/* Brand
   ========================================================================== */
.qd-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
	text-decoration: none;
	margin-left: 34px;
}

.qd-logo {
	width: 48px;
	height: 48px;
	object-fit: contain;
	border-radius: 8px;
}

.qd-brand-text {
	display: flex;
	flex-direction: column;
	line-height: 1.15;
}

.qd-brand-name {
	color: var(--qd-text-main, #172033);
	font-size: 20px;
	font-weight: 700;
}

.qd-brand-sub {
	color: var(--qd-text-muted, #64748B);
	font-size: 11px;
	font-weight: 500;
}

/* Navigation
   ========================================================================== */
.qd-header-nav {
	display: flex;
	align-items: center;
	gap: 26px;
	margin: 0 auto;
}

.qd-header-nav a {
	color: var(--qd-text-secondary, #374151);
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	transition: color .15s ease;
}

.qd-header-nav a:hover {
	color: var(--qd-primary, #2563EB);
}

/* Solutions dropdown (mega menu)
   Opens on hover with a short close delay (toggled by header.js) so the
   cursor can cross the gap between the trigger and the panel without it
   snapping shut.
   ========================================================================== */
.qd-nav-dropdown {
	position: relative;
}

.qd-nav-dropdown-trigger {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.qd-nav-caret {
	width: 12px;
	height: 12px;
	transition: transform .18s ease;
}

.qd-nav-dropdown.mega-open .qd-nav-dropdown-trigger {
	color: var(--qd-primary, #2563EB);
}

.qd-nav-dropdown.mega-open .qd-nav-caret {
	transform: rotate(180deg);
}

.qd-mega-panel {
	position: absolute;
	top: calc(100% + 18px);
	left: -28px;
	width: 560px;
	max-width: calc(100vw - 48px);
	padding: 20px;
	background: var(--qd-bg-sidebar, #fff);
	border: 1px solid var(--qd-border, #DBE4F0);
	border-radius: 16px;
	box-shadow: 0 20px 45px rgba(15, 23, 42, .14);

	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(8px);
	transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}

.qd-nav-dropdown.mega-open .qd-mega-panel {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
	transition: opacity .18s ease, transform .18s ease, visibility 0s linear 0s;
}

/* Rightmost nav item ("More"): anchor the panel to its right edge instead
   of its left, so a wide panel grows back toward the header instead of
   overflowing past the viewport edge. */
.qd-nav-dropdown--right .qd-mega-panel {
	left: auto;
	right: -28px;
}

.qd-mega-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}

.qd-mega-heading {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--qd-text-muted, #64748B);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.qd-mega-heading svg {
	width: 14px;
	height: 14px;
}

.qd-mega-viewall {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--qd-primary, #2563EB);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

.qd-mega-viewall svg {
	width: 13px;
	height: 13px;
}

.qd-mega-viewall:hover {
	color: #1E3A8A;
}

.qd-mega-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2px 24px;
}

.qd-mega-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 8px;
	margin: 0 -8px;
	border-radius: 10px;
	text-decoration: none;
	transition: background .15s ease;
}

.qd-mega-item:hover {
	background: var(--qd-bg-hover, #EFF6FF);
}

.qd-mega-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 36px;
	height: 36px;
	border-radius: 9px;
	background: var(--qd-bg-hover, #EFF6FF);
	color: var(--qd-primary, #2563EB);
}

.qd-mega-icon svg {
	width: 18px;
	height: 18px;
}

.qd-mega-item-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding-top: 2px;
}

.qd-mega-item-title {
	color: var(--qd-text-main, #172033);
	font-size: 13.5px;
	font-weight: 700;
}

.qd-mega-item-desc {
	color: var(--qd-text-muted, #64748B);
	font-size: 12px;
}

/* Buttons
   ========================================================================== */
.qd-header-buttons {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-shrink: 0;
}

.qd-btn-login {
	color: var(--qd-text-secondary, #374151);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: color .15s ease;
}

.qd-btn-login:hover {
	color: var(--qd-primary, #2563EB);
}

.qd-btn-demo {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 38px;
	padding: 0 18px;
	border-radius: 8px;
	background: var(--qd-primary, #2563EB);
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: background .15s ease;
}

.qd-btn-demo:hover {
	background: #1E3A8A;
}

.qd-btn-icon {
	width: 15px;
	height: 15px;
	flex-shrink: 0;
}

/* Mobile menu toggle + panel
   ========================================================================== */
.qd-menu-toggle {
	display: none;
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	color: var(--qd-text-main, #172033);
	cursor: pointer;
	padding: 6px;
	margin-left: auto;
}

.qd-mobile-menu {
	position: fixed;
	top: var(--qd-header-height-mobile, 60px);
	left: 0;
	width: 100%;
	background: var(--qd-bg-sidebar, #FFFFFF);
	box-shadow: 0 8px 16px rgba(15, 23, 42, .08);
	display: flex;
	flex-direction: column;
	padding: 8px 24px 20px;
	gap: 4px;
	transform: translateY(-8px);
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
	z-index: 9998;
}

.qd-mobile-menu.open {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.qd-mobile-menu a {
	text-decoration: none;
	color: var(--qd-text-secondary, #374151);
	font-weight: 600;
	font-size: 14px;
	padding: 12px 0;
	border-bottom: 1px solid var(--qd-border, #DBE4F0);
}

.qd-mobile-menu .qd-btn-demo-mobile {
	background: var(--qd-primary, #2563EB);
	color: #fff;
	text-align: center;
	border-radius: 8px;
	padding: 12px;
	margin-top: 8px;
	border-bottom: none;
}

/* Responsive
   ========================================================================== */
@media (max-width: 900px) {
	.qd-header-nav,
	.qd-header-buttons {
		display: none;
	}

	.qd-menu-toggle {
		display: block;
	}

	/* The mega panel is desktop-only; the mobile menu lists Solutions as a
	   plain link instead. */
	.qd-mega-panel {
		display: none;
	}
}

@media (max-width: 768px) {
	.qd-header {
		height: var(--qd-header-height-mobile, 60px);
		padding: 0 16px;
		gap: 12px;
	}

	.qd-brand-sub {
		display: none;
	}

	.sidebar-toggle {
		top: var(--qd-header-height-mobile, 60px) !important;
		bottom: auto !important;
		left: 10px !important;
	}
}

/* ============================================================
   Layout offset so the fixed header never overlaps page content.
   Docsify renders the cover page inside <section class="cover"> (offset
   separately via the doc-hero's own top padding in index.html) and every
   other route inside <div class="markdown-section"> — bumping that, plus
   the left <aside class="sidebar">, clears the header on every page
   without touching per-page markdown.
   ============================================================ */
.sidebar {
	top: var(--qd-header-height, 72px) !important;
}

.markdown-section {
	padding-top: calc(var(--qd-header-height, 72px) + 26px) !important;
}

@media (max-width: 768px) {
	.sidebar {
		top: var(--qd-header-height-mobile, 60px) !important;
	}

	.markdown-section {
		padding-top: calc(var(--qd-header-height-mobile, 60px) + 20px) !important;
	}
}
