
/* Layout variables */

:root {
	--bg: #131722;
	--header-color: #0f0f0f;
	--sidebar-closed-color: #0f0f0f;
	--sidebar-open-color: #1f1f1f;
	--bar-size: 72px; /* slightly narrower header height and closed sidebar width */
	--sidebar-open-width: 220px; /* slightly narrower opened width */
	--sidebar-width: var(--bar-size);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
	background: var(--bg);
	color: #fff;
	font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
	display: grid;
	grid-template-rows: var(--bar-size) 1fr;
	height: 100vh;
	overflow: hidden;
}

/* Header */
.header {
	height: var(--bar-size);
	background: var(--header-color);
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 0 16px; /* nudged right a few pixels */
	position: relative;
}
.header-left { display:flex; align-items:center; gap:12px; }
.header-right {
	margin-left: auto;
	color: inherit;
	font-size: 16px;
	font-weight: 600;
	display: flex;
	gap: 12px;
	align-items: center;
	padding-right: 4px;
	transform: translateX(-6px); /* nudge left slightly */
}
/* weekday styling to match the site title */
#day {
	font-size: 16px;
	font-weight: 600;
	color: inherit;
	margin-right: 2px;
}
.site-title { font-size: 16px; font-weight: 600; }
.toggle-btn {
	background: transparent;
	color: #fff;
	border: none;
	font-size: 20px;
	cursor: pointer;
	width: 40px;
	height: 40px;
	display: inline-grid;
	place-items: center;
}

/* Main container: sidebar + main area */
.container {
	display: grid;
	grid-template-columns: var(--sidebar-width) 1fr;
	height: calc(100vh - var(--bar-size));
}

.sidebar {
	background: var(--sidebar-closed-color);
	height: 100%;
	width: 100%;
	transition: background .25s ease;
	display: flex;
	align-items: flex-start;
}

.sidebar-nav {
	width: 100%;
}

.sidebar-nav ul {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 12px 0;
	align-items: center; /* center icons when closed */
}

.sidebar-nav li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	color: #ddd;
	width: 100%;
	cursor: pointer;
}

.sidebar-nav li:hover {
	/* keep existing visual on hover — overlay will extend the highlight downward */
	transition: background .12s ease;
}

/* overlay to extend hover highlight slightly below the item without shifting layout */
.sidebar-nav li {
	position: relative;
}
.sidebar-nav li::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	background: transparent;
	border-radius: 2px;
	transition: background .12s ease, bottom .12s ease;
	z-index: 0;
}
.sidebar-nav li * {
	position: relative;
	z-index: 1;
}
.sidebar-nav li:hover::after {
	background: rgba(255,255,255,0.12);
	bottom: -6px; /* extend 6px below the item */
}

.icon { font-size: 20px; line-height: 1; }
/* nudge all sidebar emojis slightly up for better alignment */
.sidebar-nav .icon { display: inline-block; transform: translate(-2px, 3px); }
.label {
	opacity: 0;
	transform: translate(-6px, 3px);
	transition: opacity .18s ease, transform .18s ease;
	white-space: nowrap;
}

/* Main content area */
.main {
	padding: 20px;
	overflow: auto;
}

/* When sidebar is opened */
body.sidebar-open { --sidebar-width: var(--sidebar-open-width); }
body.sidebar-open .sidebar { background: var(--sidebar-open-color); }
/* nudge opened menu down a bit more */
/* slightly reduce top padding when opened to move items up a bit */
body.sidebar-open .sidebar-nav ul { align-items: flex-start; padding-left: 12px; padding-top: 12px; }
body.sidebar-open .label {
	opacity: 1;
	transform: translate(0, 3px);
}

/* When closed, keep icons centered horizontally in narrow bar with slight left nudge */
.container:not(.sidebar-open) .sidebar-nav ul { align-items: center; padding: 12px 12px 0 12px; }

/* Simple responsive tweak */
@media (max-width: 600px) {
	:root { --bar-size: 64px; }
}

/* Responsive layout: overlay sidebar on small screens */
@media (max-width: 800px) {
	:root {
		--bar-size: 56px;
		--sidebar-open-width: 220px;
	}

	/* Pin header to top so it's always visible */
	.header {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 50;
		padding: 0 12px;
	}

	/* Sidebar becomes an overlay off-canvas */
	.sidebar {
		position: fixed;
		top: var(--bar-size);
		left: 0;
		height: calc(100vh - var(--bar-size));
		width: var(--sidebar-open-width);
		transform: translateX(-100%);
		transition: transform .25s ease, background .2s ease;
		z-index: 60;
		box-shadow: 2px 0 12px rgba(0,0,0,0.5);
	}

	/* When open, slide in */
	body.sidebar-open .sidebar { transform: translateX(0); }

	/* Content should not be shifted by sidebar on mobile */
	.container { margin-left: 0; }

	/* Keep main content below the fixed header */
	.main { margin-top: var(--bar-size); }

	/* Slightly smaller header text on mobile */
	.site-title, .header-right { font-size: 14px; }

	/* Ensure nav spacing fits overlay */
	.sidebar-nav ul { padding-top: 12px; }
}

