/*
Shared sidebar layout for the personal sites (kaiyamenning.com,
myliemenning.com): a fixed sidebar menu, a top bar with a hamburger, and a
content area. It reproduces the design both sites used on IONOS, where the
content was an <iframe>; here it is real pages.

Each site sets the variables below in its own assets/css/site.css, which is
loaded after this file, and adds its content styles there.
*/

:root{
	--sb-body-bg: #ffffff;       /* page background */
	--sb-top: #555555;           /* top bar */
	--sb-side: #777777;          /* sidebar */
	--sb-sub: #999999;           /* second-level menu items */
	--sb-accent: #777777;        /* text/icon colour of the active or hovered menu item */
	--sb-burger-hover: #dddddd;  /* hamburger hover */
	--sb-content-bg: #f1f1f1;    /* content area */
	--sb-focus: #58e7f1;         /* keyboard focus ring */
	--sb-side-pad-top: 10px;     /* space above the profile picture */
	--sb-profile-h: 100px;       /* profile picture height (width is 100px) */
	--sb-bar-pad-right: 0px;     /* top bar right padding */
	--sb-hidden-pad: 255px;      /* top bar left padding while the menu is hidden */
}

*{
	list-style: none;
	text-decoration: none;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: 'Roboto', 'Open Sans', sans-serif;
}

body{
	background: var(--sb-body-bg);
}

/* keyboard users: skip straight past the menu */
.skip{
	position: absolute;
	left: -9999px;
}
.skip:focus{
	left: 10px;
	top: 10px;
	z-index: 10;
	background: #ffffff;
	color: var(--sb-top);
	padding: 8px 12px;
}

a:focus-visible,
button:focus-visible{
	outline: 3px solid var(--sb-focus);
	outline-offset: 2px;
}

.wrapper .section{
	width: calc(100% - 225px);
	margin-left: 225px;
	transition: all 0.8s ease;
}

.wrapper .section .top_navbar{
	background: var(--sb-top);
	height: 80px;
	display: flex;
	align-items: center;
	padding-left: 30px;
	padding-right: var(--sb-bar-pad-right);
	transition: all 0.8s ease;
}

.wrapper .section .top_navbar .hamburger button{
	font-size: 28px;
	color: #FFFFFF;
	background: none;
	border: 0;
	cursor: pointer;
}

.wrapper .section .top_navbar .hamburger button:hover{
	color: var(--sb-burger-hover);
}

.wrapper .section .top_navbar .site-title{
	padding: 10px;
	text-align: center;
	font-size: 140%;
	font-weight: bold;
	color: #FFFFFF;
}

.wrapper .sidebar{
	background: var(--sb-side);
	position: fixed;
	top: 0;
	left: 0;
	width: 225px;
	height: 100vh;
	overflow-y: auto;
	padding-top: var(--sb-side-pad-top);
	transition: all 0.8s ease;
	z-index: 5;
}

.wrapper .sidebar .profile{
	margin-bottom: 30px;
	text-align: center;
}

.wrapper .sidebar .profile img{
	display: block;
	width: 100px;
	height: var(--sb-profile-h);
	object-fit: cover;
	border-radius: 50%;
	margin: 0 auto;
}

.wrapper .sidebar .profile h3{
	color: #ffffff;
	margin: 10px 0 5px;
}

.wrapper .sidebar .profile p{
	color: #ffffff;
	font-size: 14px;
}

.wrapper .sidebar ul li a{
	display: block;
	padding: 13px 30px;
	border-bottom: 1px solid #FFFFFF;
	color: #FFFFFF;
	font-size: 16px;
	position: relative;
}

.wrapper .sidebar ul li a .icon{
	color: #FFFFFF;
	width: 30px;
	display: inline-block;
}

.wrapper .sidebar ul li a:hover,
.wrapper .sidebar ul li a.active{
	color: var(--sb-accent);
	background: #FFFFFF;
	border-right: 2px solid #FFFFFF;
}

.wrapper .sidebar ul li a:hover .icon,
.wrapper .sidebar ul li a.active .icon{
	color: var(--sb-accent);
}

/* second level menu items ------------------- start */

.wrapper .sidebar ul li ul{
	margin-left: 20px;
	margin-top: -6px;
	display: none;
}

.wrapper .sidebar ul li a:hover + ul,
.wrapper .sidebar ul li a.active + ul,
.wrapper .sidebar ul li a:focus + ul{
	display: block;
}

.wrapper .sidebar ul li ul:hover,
.wrapper .sidebar ul li ul:focus-within,
.wrapper .sidebar ul li ul:has(li a.active){
	display: block;
}

.wrapper .sidebar ul li ul li a{
	display: block;
	padding: 8px 20px;
	color: #FFFFFF;
	font-size: 16px;
	position: relative;
	background: var(--sb-sub);
	border-bottom: 1px solid #FFFFFF;
}

.wrapper .sidebar ul li ul li a .icon{
	color: #FFFFFF;
	width: 26px;
	display: inline-block;
}

.wrapper .sidebar ul li ul li a:hover,
.wrapper .sidebar ul li ul li a.active{
	color: var(--sb-accent);
	background: #FFFFFF;
	border-right: 2px solid #FFFFFF;
}

.wrapper .sidebar ul li ul li a:hover .icon,
.wrapper .sidebar ul li ul li a.active .icon{
	color: var(--sb-accent);
}

/* second level menu items ------------------- end */

/* The content area: where the <iframe> used to be. */
.content{
	margin-left: 225px;
	min-height: calc(100vh - 80px);
	background: var(--sb-content-bg);
	overflow-x: auto;
	transition: all 0.8s ease;
}

/* menu hidden (hamburger) */
body.active .wrapper .section .top_navbar{
	padding-left: var(--sb-hidden-pad);
}

body.active .wrapper .sidebar{
	left: -225px;
}

body.active .wrapper .section{
	margin-left: 0;
	width: 100%;
}

body.active .content{
	margin-left: 0;
}

/* Phones: the menu starts hidden and slides over the page from the hamburger. */
@media (max-width: 700px){
	.wrapper .sidebar{
		left: -225px;
	}
	.wrapper .section{
		margin-left: 0;
		width: 100%;
	}
	.content{
		margin-left: 0;
	}
	.wrapper .section .top_navbar{
		padding-left: 20px;
	}
	.wrapper .section .top_navbar .site-title{
		font-size: 120%;
	}
	body.active .wrapper .sidebar{
		left: 0;
	}
	body.active .wrapper .section .top_navbar{
		padding-left: 245px;
	}
}
