/* VELYON Theme — Mobile App-Shell, M3 */

:root {
	/* v1.6.0/1.6.1 — TOTAL height the fixed mobile bottom tab bar occupies,
	   INCLUDING the device safe area (home-indicator inset): 0 on desktop;
	   64px + inset at <=782px. The bar is given exactly this height below, so
	   the token is exact. A plugin that pins its OWN bar to the bottom on mobile
	   sits above the theme's bar:  bottom: var(--velyon-bottom-nav-height, 0px)
	   (its own bar then needs NO safe-area padding: the nav already covers the
	   inset), z-index below 300 so the mobile drawer still covers it. */
	--velyon-bottom-nav-height: 0px;
	/* Height of a plugin's own fixed bar sitting above the nav, set by that
	   plugin on pages where it shows one (e.g. :root{--velyon-bottom-bar-height:66px}
	   at <=782px). Lets the scroll-to-top button clear it. 0 = none. */
	--velyon-bottom-bar-height: 0px;
}

/* ---------- Hamburger ---------- */
.hamburger {
	display: none;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	border: 1px solid var(--velyon-border);
	background: var(--velyon-surface);
	align-items: center;
	justify-content: center;
	color: var(--velyon-text);
	font-size: 16px;
}

@media (max-width: 782px) {
	.hamburger { display: inline-flex; }
	.primary-nav,
	.header-actions .search-trigger-btn,
	.header-actions .btn-ghost { display: none; }

	/* v1.7.0: vertical padding only (see header.css) so the container's
	   16px side padding survives; min-width:0 lets the logo group shrink. */
	.header-inner { padding-top: 14px; padding-bottom: 14px; gap: 12px; }
	.site-branding-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
	.header-actions { flex-shrink: 0; }
}

/* ---------- Drawer + overlay ---------- */
.mobile-drawer-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .5);
	z-index: 300;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
}
.mobile-drawer-overlay.is-open {
	opacity: 1;
	pointer-events: auto;
}

.mobile-drawer {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: 78%;
	max-width: 300px;
	background: var(--velyon-surface);
	z-index: 301;
	transform: translateX(-105%);
	transition: transform .28s ease;
	display: flex;
	flex-direction: column;
	box-shadow: var(--velyon-shadow);
}
.mobile-drawer.is-open {
	transform: translateX(0);
}

.drawer-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 1px solid var(--velyon-border);
	background: var(--velyon-surface-alt);
	color: var(--velyon-text-muted);
	font-size: 14px;
	line-height: 1;
}

.drawer-account-tab {
	padding: 22px 18px;
	background: var(--velyon-surface-alt);
	border-bottom: 1px solid var(--velyon-border);
	display: flex;
	gap: 12px;
	align-items: center;
}
.drawer-account-tab .avatar-static img {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: block;
}
.drawer-account-tab .who .name {
	font-family: var(--velyon-font-heading);
	font-weight: 700;
	font-size: 14.5px;
	color: var(--velyon-text);
}

/* Theme toggle — mirrors the desktop header's toggle (assets/css/
   header.css), segmented style fits the drawer's stacked-row layout
   better than a single icon button would. */
.drawer-theme-toggle {
	display: flex;
	gap: 8px;
	padding: 14px 18px;
	border-bottom: 1px solid var(--velyon-border);
}
.drawer-theme-toggle button {
	flex: 1;
	padding: 8px 0;
	border-radius: var(--velyon-radius-s);
	border: 1px solid var(--velyon-border);
	background: var(--velyon-surface-alt);
	color: var(--velyon-text-muted);
	font-size: 13px;
	font-weight: 700;
}
.drawer-theme-toggle button.is-active {
	background: var(--velyon-accent);
	border-color: var(--velyon-accent);
	color: #04170a;
}
.drawer-account-tab .who .mail {
	font-size: 12px;
	color: var(--velyon-text-muted);
}
.drawer-account-tab .auth-actions {
	display: flex;
	gap: 8px;
	width: 100%;
}
.drawer-account-tab .auth-actions .btn {
	flex: 1;
	text-align: center;
}

.drawer-links {
	padding: 10px;
	overflow-y: auto;
	/* v1.1.4: flex:1 + min-height:0 so this scrolls WITHIN itself between
	   the fixed header (account tab/toggle/CTA) and footer (promo tiles)
	   — without this, overflow-y:auto has no bounded height to act on,
	   and a long menu (or the new promo tiles below it) can end up
	   pushed below the viewport with no way to reach it. */
	flex: 1;
	min-height: 0;
}
.drawer-links ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
.drawer-links a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 10px;
	border-radius: 10px;
	font-family: var(--velyon-font-heading);
	font-weight: 600;
	font-size: 14px;
	color: var(--velyon-text);
	flex: 1;
	min-width: 0; /* lets long labels ellipsis instead of pushing the toggle button off */
}
.drawer-links a:hover,
.drawer-links a:focus {
	background: var(--velyon-surface-alt);
}

/* v1.1.4 — icons (top-level items only), chip badges reuse
   velyon_get_menu_item_chip_html() same as the desktop mega menu. */
.drawer-icon {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	color: var(--velyon-text-muted);
}
.drawer-item-row:hover .drawer-icon,
.menu-item.is-open > .drawer-item-row .drawer-icon {
	color: var(--velyon-accent);
}
.drawer-item-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* v1.1.4 — accordion: chevron toggle + CSS-grid expand/collapse. The
   0fr/1fr grid-template-rows trick animates to/from an unknown content
   height without JS measuring scrollHeight; .drawer-submenu-inner needs
   overflow:hidden for the collapse to actually clip content at 0fr. */
.drawer-item-row {
	display: flex;
	align-items: stretch;
}
.drawer-submenu-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	flex-shrink: 0;
	background: none;
	border: none;
	color: var(--velyon-text-muted);
}
.drawer-submenu-toggle svg {
	width: 18px;
	height: 18px;
	transition: transform .2s ease;
}
.menu-item.is-open > .drawer-item-row .drawer-submenu-toggle svg {
	transform: rotate(180deg);
}

.drawer-submenu-wrap {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows .3s ease;
}
.menu-item.is-open > .drawer-submenu-wrap {
	grid-template-rows: 1fr;
}
.drawer-submenu-inner {
	overflow: hidden;
	min-height: 0;
	/* v1.2.0 bug fix: overflow:hidden alone clipped collapsed links
	   visually but left them in the tab order and screen-reader tree.
	   visibility:hidden removes them; the delayed transition keeps them
	   visible until the collapse animation finishes. */
	visibility: hidden;
	transition: visibility 0s linear .3s;
}
.menu-item.is-open > .drawer-submenu-wrap > .drawer-submenu-inner {
	visibility: visible;
	transition-delay: 0s;
}
.drawer-links .sub-menu {
	padding-left: 20px;
}
.drawer-links .sub-menu a {
	font-size: 13.5px;
	font-weight: 500;
	color: var(--velyon-text-muted);
}

/* v1.1.4 — a mega-menu item's columns become labeled sections on mobile
   (no room for a multi-column layout) — see
   inc/class-velyon-drawer-menu-walker.php for how "mega-col" /
   "mega-featured-col" map to this, same admin-authored classes as the
   desktop mega menu. */
.drawer-mega {
	padding: 4px 10px 8px;
}
.drawer-section + .drawer-section {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid var(--velyon-border);
}
.drawer-section-title {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 4px;
	font-family: var(--velyon-font-heading);
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--velyon-text-muted);
}
.drawer-section-featured .drawer-section-title {
	color: var(--velyon-accent);
}
.drawer-section-featured .drawer-section-title .drawer-icon {
	width: 13px;
	height: 13px;
	color: var(--velyon-accent);
}
.drawer-section-links {
	list-style: none;
	margin: 0;
	padding: 0;
}
.drawer-section-links a {
	padding: 9px 10px;
	font-size: 13.5px;
	font-weight: 500;
	color: var(--velyon-text);
}

body.has-drawer-open,
body.has-search-open {
	overflow: hidden;
}

/* v1.1.4 — top CTA pill (Unstop's "+Post"). Outline style so it reads
   as a distinct action, not just another nav row. */
.drawer-cta {
	display: block;
	margin: 14px 18px 4px;
	padding: 11px 16px;
	border-radius: 999px;
	border: 1.5px solid var(--velyon-accent);
	color: var(--velyon-accent-deep);
	background: color-mix(in srgb, var(--velyon-accent) 10%, transparent);
	font-family: var(--velyon-font-heading);
	font-weight: 700;
	font-size: 14px;
	text-align: center;
}

/* v1.1.4 — bottom promo tiles (Unstop's "Post a Job" / "Become a
   Mentor" / "For Business"). Sits below the scrollable nav, inside the
   drawer's own flex column, so it's always reachable without needing to
   scroll the whole nav list first if it's short. */
.drawer-promo-tiles {
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	border-top: 1px solid var(--velyon-border);
}
.drawer-promo-tile {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border-radius: var(--velyon-radius-m);
	background: var(--velyon-surface-alt);
}
.drawer-promo-tile-icon {
	flex-shrink: 0;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--velyon-surface);
	color: var(--velyon-accent);
}
.drawer-promo-tile-icon svg {
	width: 18px;
	height: 18px;
}
.drawer-promo-tile-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.drawer-promo-tile-text .t {
	font-family: var(--velyon-font-heading);
	font-weight: 700;
	font-size: 13.5px;
	color: var(--velyon-text);
}
.drawer-promo-tile-text .s {
	font-size: 12px;
	color: var(--velyon-text-muted);
	margin-top: 2px;
}
/* The one tile that matters most (default: "For Business") — a filled
   accent background instead of the neutral surface the others use. */
.drawer-promo-tile-featured {
	background: linear-gradient(135deg, var(--velyon-accent-deep), var(--velyon-accent));
}
.drawer-promo-tile-featured .drawer-promo-tile-icon {
	background: rgba(255, 255, 255, .18);
	color: #fff;
}
.drawer-promo-tile-featured .drawer-promo-tile-text .t {
	color: var(--velyon-on-accent);
}
.drawer-promo-tile-featured .drawer-promo-tile-text .s {
	color: rgba(5, 23, 10, .7);
}

/* ---------- Bottom tab bar ---------- */
.bottom-nav {
	display: none;
}
@media (max-width: 782px) {
	:root { --velyon-bottom-nav-height: calc(64px + env(safe-area-inset-bottom, 0px)); }
	.bottom-nav {
		display: flex;
		box-sizing: border-box;
		height: var(--velyon-bottom-nav-height);
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 90;
		background: var(--velyon-surface);
		border-top: 1px solid var(--velyon-border);
		justify-content: space-around;
		padding: 9px 4px calc(10px + env(safe-area-inset-bottom, 0px));
	}
	/* Keep fixed bottom nav from covering the last bit of page content. */
	body { padding-bottom: var(--velyon-bottom-nav-height, 64px); }
}
.bottom-nav a {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	font-family: var(--velyon-font-heading);
	font-size: 10.5px;
	font-weight: 600;
	color: var(--velyon-text-muted);
}
.bottom-nav a.is-active {
	color: var(--velyon-accent-deep);
}
.bottom-nav svg {
	width: 21px;
	height: 21px;
}

/* Desktop: none of the mobile-shell elements should ever be reachable. */
@media (min-width: 783px) {
	.mobile-drawer,
	.mobile-drawer-overlay,
	.bottom-nav { display: none !important; }
}
