/*
Theme Name: WebshellNav
Theme URI:
Author:
Author URI:
Description: A clean, minimalist icon-based navigation theme. Icon sidebar on desktop/tablet, collapses to a footer bar on mobile. Nav items are fully managed from Appearance → Menus — no code changes needed to add, remove, or reorder items. Add a "Nav Contact" widget (e.g. a GHL chat embed) to place it at the bottom of the sidebar.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: webshellnav
*/

/* =========================================================
   Reset
   ========================================================= */
*,
*::before,
*::after {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

ul {
	list-style: none;
}

a {
	color: inherit;
	text-decoration: none;
}

img {
	max-width: 100%;
	display: block;
}

/* =========================================================
   Design tokens — swap these for your theme's palette
   ========================================================= */
:root {
	--sidebar-width: 84px;
	--mobile-nav-height: 64px;
	--admin-bar-height: 32px;

	--nav-bg: #1b1d24;
	--nav-bg-hover: #262932;
	--nav-fg: #8b8fa3;
	--nav-fg-active: #ffffff;
	--nav-accent: #6ea8ff;

	--main-bg: #f5f6f8;
	--main-fg: #1b1d24;

	--font: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
	font-family: var(--font);
	background: var(--main-bg);
	color: var(--main-fg);
	line-height: 1.5;
}

.site-shell {
	display: flex;
	min-height: 100vh;
}

/* =========================================================
   Sidebar nav — desktop & tablet
   ========================================================= */
.site-nav {
	position: fixed;
	inset: 0 auto 0 0;
	width: var(--sidebar-width);
	display: flex;
	flex-direction: column;
	background: var(--nav-bg);
	z-index: 100;
}

/* Brand / logo slot — Appearance → Customize → Site Identity */
.site-nav__brand {
	display: flex;
	align-items: center;
	justify-content: center;
	height: var(--sidebar-width);
	flex-shrink: 0;
	padding: 14px;
}

.brand-mark {
	position: relative;
	display: block;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	background: var(--nav-bg-hover);
	overflow: hidden;
	transition: background 150ms ease;
}

.brand-mark__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.brand-mark__initials {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--nav-fg-active);
	font-weight: 700;
	font-size: 14px;
	letter-spacing: .5px;
}

.brand-mark:hover {
	background: var(--nav-accent);
}

.brand-mark:hover .brand-mark__initials {
	color: var(--nav-bg);
}

/* Dynamic menu — items come from Appearance → Menus (Primary Navigation) */
.site-nav__menu {
	flex: 1;
	padding-top: 12px;
	overflow-y: auto;
}

.site-nav__menu ul {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 4px;
	padding: 0 10px;
}

.site-nav__menu a,
.site-nav__contact a {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 12px 4px;
	border-radius: 10px;
	color: var(--nav-fg);
	transition: background 150ms ease, color 150ms ease;
}

.site-nav__menu a:hover,
.site-nav__menu a:focus-visible {
	background: var(--nav-bg-hover);
	color: var(--nav-fg-active);
}

.site-nav__menu li.is-active > a {
	background: var(--nav-bg-hover);
	color: var(--nav-accent);
}

.nav-icon {
	width: 22px;
	height: 22px;
	flex-shrink: 0;
}

.nav-icon--fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--nav-bg-hover);
	font-size: 9px;
	font-weight: 700;
	letter-spacing: .3px;
}

.nav-label {
	font-size: 10.5px;
	letter-spacing: .3px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}

/* Compact "you're not done setting this up yet" pill — admins only,
   never a full sentence, so it can't blow out the 84px sidebar column. */
.nav-setup-hint {
	display: block;
	margin: 6px auto 0;
	padding: 3px 8px;
	width: fit-content;
	max-width: calc(100% - 8px);
	border: 1px dashed rgba(255, 255, 255, .25);
	border-radius: 999px;
	font-size: 9.5px;
	font-weight: 600;
	letter-spacing: .3px;
	text-align: center;
	color: var(--nav-fg);
	white-space: nowrap;
}

.nav-setup-hint:hover,
.nav-setup-hint:focus-visible {
	border-color: var(--nav-accent);
	color: var(--nav-fg-active);
}

/* Contact slot — Appearance → Widgets → "Nav Contact" */
.site-nav__contact {
	flex-shrink: 0;
	padding: 10px;
	border-top: 1px solid rgba(255, 255, 255, .06);
}

.site-nav__contact .widget {
	color: var(--nav-fg-active);
}

.site-nav__contact a {
	color: var(--nav-fg-active);
}

.site-nav__contact a:hover,
.site-nav__contact a:focus-visible {
	background: var(--nav-accent);
	color: var(--nav-bg);
}

/* =========================================================
   Mobile footer nav — hidden until the breakpoint below
   ========================================================= */
.mobile-nav {
	display: none;
	position: fixed;
	inset: auto 0 0 0;
	height: var(--mobile-nav-height);
	background: var(--nav-bg);
	z-index: 100;
	padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-nav ul {
	display: flex;
	height: 100%;
	overflow-x: auto;
}

.mobile-nav li {
	flex: 1;
	min-width: 56px;
}

.mobile-nav a {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	color: var(--nav-fg);
	transition: color 150ms ease;
}

.mobile-nav a:hover,
.mobile-nav a:focus-visible {
	color: var(--nav-fg-active);
}

.mobile-nav li.is-active a {
	color: var(--nav-accent);
}

.mobile-nav .nav-icon--fallback {
	background: var(--nav-bg-hover);
}

/* =========================================================
   Main content
   ========================================================= */
.site-main {
	flex: 1;
	margin-left: var(--sidebar-width);
	padding: 48px;
}

.site-main article + article {
	margin-top: 48px;
}

/* =========================================================
   Breakpoint — sidebar stays for desktop + tablet,
   collapses to the footer bar on phones only
   ========================================================= */
@media (max-width: 640px) {
	.site-nav {
		display: none;
	}

	.mobile-nav {
		display: block;
	}

	.site-main {
		margin-left: 0;
		padding: 24px 20px calc(var(--mobile-nav-height) + 24px);
	}
}

/* =========================================================
   Admin bar compatibility
   ========================================================= */
.admin-bar .site-nav {
	top: var(--admin-bar-height);
	height: calc(100vh - var(--admin-bar-height));
}

@media (max-width: 782px) {
	.admin-bar .mobile-nav {
		bottom: 0;
	}
}
