
/* 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);
	--vh: 1vh; /* updated in JS for mobile browser chrome */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; }
body {
	background: var(--bg);
	color: #fff;
	font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
	position: relative;
	height: 100vh;
	width: 100vw;
	overflow: hidden;
}

.header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 60;
}

.container {
	position: absolute;
	top: var(--bar-size);
	bottom: 0;
	left: 0;
	right: 0;
	display: flex;
	width: 100%;
	height: calc(100vh - var(--bar-size));
	overflow: hidden;
}

.main {
	flex: 1;
	min-width: 0;
	min-height: 0;
	padding: 20px;
	overflow: auto;
}

/* 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 */
body {
	margin: 0;
	padding: 0;
	min-height: 100vh;
	height: 100vh;
	width: 100vw;
	overflow: hidden;
	background: var(--bg);
	color: #fff;
	font-family: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

.header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: var(--bar-size);
	background: var(--header-color);
	z-index: 60;
}

.container {
	position: absolute;
	top: var(--bar-size);
	bottom: 0;
	left: 0;
	right: 0;
	display: flex;
	width: 100%;
	height: calc(100vh - var(--bar-size));
	overflow: hidden;
	min-width: 0;
	min-height: 0;
}

.sidebar {
	position: relative;
	background: var(--sidebar-closed-color);
	width: var(--sidebar-width);
	min-width: var(--sidebar-width);
	max-width: var(--sidebar-width);
	height: 100%;
	transition: background .25s ease, width .25s ease, transform .25s ease;
	display: flex;
	align-items: flex-start;
}

body.sidebar-open .sidebar {
	background: var(--sidebar-open-color);
	width: var(--sidebar-open-width);
	min-width: var(--sidebar-open-width);
	max-width: var(--sidebar-open-width);
}

.main {
	padding: 20px;
	overflow: auto;
	min-width: 0;
	min-height: 0;
	height: 100%;
}

@media (max-width: 800px) {
	.header {
		position: fixed;
	}

	.container {
		grid-template-columns: 0 1fr;
	}

	.sidebar {
		position: fixed;
		top: var(--bar-size);
		left: 0;
		bottom: 0;
		width: var(--sidebar-open-width);
		min-width: var(--sidebar-open-width);
		max-width: var(--sidebar-open-width);
		transform: translateX(-100%);
		box-shadow: 2px 0 16px rgba(0,0,0,.6);
		z-index: 200;
	}

	body.sidebar-open .sidebar {
		transform: translateX(0);
	}

	.main {
		margin-top: 0;
		height: calc(100vh - var(--bar-size));
		overflow: auto;
	}
}

.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;
		--sidebar-width: var(--sidebar-open-width);
	}

	.header {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 60;
		padding: 0 12px;
	}

	.container {
		position: absolute;
		top: var(--bar-size);
		bottom: 0;
		left: 0;
		right: 0;
		display: flex;
		width: 100%;
		height: calc(100vh - var(--bar-size));
		overflow: hidden;
	}

	.sidebar {
		position: fixed;
		top: var(--bar-size);
		left: 0;
		bottom: 0;
		width: var(--sidebar-width);
		height: calc(100vh - var(--bar-size));
		z-index: 70;
		background: var(--sidebar-open-color);
		box-shadow: 2px 0 12px rgba(0,0,0,0.5);
	}

	body.sidebar-open .sidebar {
		transform: translateX(0);
	}

	.main {
		margin-top: 0;
		height: calc(100vh - var(--bar-size));
		overflow: auto;
	}

	.site-title,
	.header-right {
		font-size: 14px;
	}

	.sidebar-nav ul {
		padding-top: 12px;
	}
}

/* Sidebar navigation links */
.sidebar-nav li a {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	color: inherit;
	text-decoration: none;
	transition: none;
}

.sidebar-nav li a .icon {
	font-size: 20px;
	line-height: 1;
	display: inline-block;
	transform: translate(-2px, 3px);
}

.sidebar-nav li a .label {
	opacity: 0;
	transform: translate(-6px, 3px);
	transition: opacity .18s ease, transform .18s ease;
	white-space: nowrap;
}

body.sidebar-open .sidebar-nav li a .label {
	opacity: 1;
	transform: translate(0, 3px);
}

/* Active link styling */
.sidebar-nav li a.active .icon,
.sidebar-nav li a.active .label {
	color: #846de7;
}

