.elgg-nav-logo {
	left: 0;
	flex-grow: 1;
	
	.elgg-heading-site {
		font-size: 1.3rem;
		line-height: 3rem;
		font-weight: 700;
	}
	
	a {
		padding: 0.5rem 1rem 0.5rem 0;
		display: inline-block;
	}
	
	img {
		max-height: 2rem;
		vertical-align: middle;
		line-height: 2rem;
	}
}

#login-dropdown {
	order: 2;
	position: static;
	top: auto;
	right: auto;
	
	a {
		padding: 0.5rem 1rem;
		line-height: 3rem;
		display: inline-block;
		
		&:hover {
			background-color: rgba(255, 255, 255, 0.1);
		}
	}
}

#login-dropdown-box {
	border-top: 0;
	border-radius: 0;
	width: auto;
	max-width: 300px;
	position: relative;
	
	&:before {
		content: "\25b2";
		color: #ffffff;
		position: absolute;
		font-size: 1rem;
		top: -1rem;
		right: 0;
		margin-right: 1.5rem;
	}
}

@media only $(media-desktop-up) {
	.elgg-nav-logo {
		flex-grow: 0;
	}

	#login-dropdown {
		order: 5;
	}
}

.elgg-nav-collapse {
	height: auto;
	width: 100%;
	flex-grow: 4;
	order: 4;
	display: none;
}

.elgg-nav-collapsed .elgg-nav-collapse {
	display: flex;
	flex-direction: column;
}

@media only $(media-desktop-up) {
	.elgg-nav-collapse {
		position: relative;
		top: auto;
		bottom: auto;
		width: auto;
		display: flex;
		flex-direction: row;
		justify-content: flex-end;
	}
}

.elgg-nav-button {
	width: 20px;
	height: 15px;
	position: relative;
	margin: 10px 0 10px 20px;
	-moz-transform: rotate(0deg);
	-ms-transform: rotate(0deg);
	-webkit-transform: rotate(0deg);
	transform: rotate(0deg);
	-moz-transition: ease-in-out 0.5s;
	-o-transition: ease-in-out 0.5s;
	-webkit-transition: ease-in-out 0.5s;
	transition: ease-in-out 0.5s;
	cursor: pointer;
	display: block;
	order: 3;
	flex-grow: 0;
}

@media only $(media-desktop-up) {
	.elgg-nav-button {
		display: none;
	}
}

.elgg-nav-button span {
	display: block;
	position: absolute;
	height: 3px;
	width: 100%;
	background: #ffffff;
	border-radius: 2px;
	opacity: 1;
	left: 0;
	-moz-transform: rotate(0deg);
	-ms-transform: rotate(0deg);
	-webkit-transform: rotate(0deg);
	transform: rotate(0deg);
	-moz-transition: ease-in-out 0.25s;
	-o-transition: ease-in-out 0.25s;
	-webkit-transition: ease-in-out 0.25s;
	transition: ease-in-out 0.25s;
	
	&:nth-child(1) {
		top: 0;
	}
	
	&:nth-child(2) {
		top: 6px;
	}
	
	&:nth-child(3) {
		top: 12px;
	}
}

.elgg-nav-collapsed .elgg-nav-button span {
	&:nth-child(1) {
		top: 6px;
		-moz-transform: rotate(135deg);
		-ms-transform: rotate(135deg);
		-webkit-transform: rotate(135deg);
		transform: rotate(135deg);
	}
	
	&:nth-child(2) {
		opacity: 0;
		left: -60px;
	}
	
	&:nth-child(3) {
		top: 6px;
		-moz-transform: rotate(-135deg);
		-ms-transform: rotate(-135deg);
		-webkit-transform: rotate(-135deg);
		transform: rotate(-135deg);
	}
}

html.elgg-nav-collapsed {
	overflow: hidden;
	
	.elgg-page-topbar {
		height: 100vh;
		overflow-y: scroll;
	}
}

.elgg-page-topbar {
	background: var(--elgg-topbar-background-color);
	position: sticky;
	top: 0;
	
	> .elgg-inner {
		display: flex;
		flex-wrap: wrap;
		justify-content: flex-start;
		align-items: center;
	}
	
	a {
		color: #fff;
		text-decoration: none;
	}

	.elgg-menu-container {
		flex-direction: column;
		
		> .elgg-menu > li {
			> a.elgg-non-link {
				&:after {
					content: "\f107";
					font-family: 'Font Awesome\ 5 Free';
					font-weight: 900;
					font-size: 0.5rem;
					display: none;
					width: 1.5rem;
					text-align: center;
					float: right;
				}
			}
		}
	}
	
	.elgg-menu-topbar-container {
		order: 2;
		
		.elgg-badge {
			background-color: var(--elgg-topbar-indicator);
		}
	}
	
	.elgg-menu-site-container {
		order: 3;
	}
	
	.elgg-menu {
		width: 100%;
		
		li {
			display: block;
			width: 100%;
			
			> a {
				padding: 0.5rem 1rem;
				transition: background-color 0.5s, color 0.5s;
				border-top: 1px solid rgba(0, 0, 0, 0.05);
			}
			
			.elgg-child-menu {
				margin: 1px 0 0 1rem;
				border-left: 1px solid rgba(255, 255, 255, 0.1);
			}
		}
		
		.elgg-menu-item-account img {
			max-height: 2rem;
		}
		
		li:hover > a,
		li.elgg-state-selected > a {
			background-color: rgba(255, 255, 255, 0.1);
		}
		
		> li > a .elgg-icon {
			width: 1.5rem;
			display: inline-block;
			text-align: center;
			margin: 0;
		}
		
		.elgg-menu-item-more,
		.elgg-menu-item-account {
			> .elgg-menu-parent {
				display: none;
			}
			
			> .elgg-child-menu {
				margin-left: 0;
				border: none;
			}
		}
	}
}

*[id] {
	/* correcting for sticky topbar */
	scroll-margin-top: 4rem;
}

@media only $(media-desktop-up) {
	.elgg-nav-collapse {
		align-items: center;
		
		> .elgg-menu-container > .elgg-menu > li {
			> a.elgg-non-link {
				&:after {
					display: inline-block;
				}
			}
		}
	}

	.elgg-page-topbar {
		.elgg-menu-site-container {
			order: 1;
			margin-right: auto;
			
			.elgg-menu-site {
				.elgg-anchor-icon {
					display: none;
					& + .elgg-anchor-label {
						margin-left: 0;
					}
				}
			}
		}
		
		.elgg-nav-search {
			order: 2;
		}
				
		.elgg-menu-container {
			flex-direction: row;
			align-items: center;
		}
		
		.elgg-menu-topbar-container {
			order: 3;
			
			.elgg-menu-topbar-alt {
				order: 2;
			}
		}
		
		.elgg-menu {
			width: auto;
			flex-direction: row;
			align-items: center;
			
			&.elgg-child-menu > li {
				display: block;
				width: 100%;
				
				> a {
					border-top: 1px solid rgba(0, 0, 0, 0.05);
				}
				
				&:hover > a {
					background-color: rgba(255, 255, 255, 0.1);
				}
			}
			
			&:not(.elgg-child-menu) > li > a {
				padding: 0.5rem 1rem;
				line-height: 3rem;
				vertical-align: middle;
			}
			
			li {
				display: inline-block;
				width: auto;
				position: relative;
				
				&:focus-within,
				&:hover {
					> .elgg-child-menu {
						display: flex;
						animation: menuGrowDown 300ms ease-in-out forwards;
						transform-origin: top center;
					}
				}

				> a {
					border: none;
				}
				
				.elgg-child-menu {
					margin: 0;
					border-left: none;
				
					display: none;
					flex-direction: column;
					position: absolute;
					left: 0;
					width: 12rem;
					background: var(--elgg-topbar-background-color);
					align-items: flex-start;
					box-shadow: 1px 2px 8px rgba(0, 0, 0, 0.2);
					
					.elgg-child-menu {
						top: 0;
						left: 100%;
						margin: 0;
					}
					
					.elgg-menu-parent:after {
						content: "\f105";
						font-family: 'Font Awesome\ 5 Free';
						font-weight: 900;
						font-size: 0.5rem;
						line-height: 1.5rem;
						width: 1.5rem;
						text-align: center;
						float: right;
					}
				}
				
				&.elgg-menu-item-more,
				&.elgg-menu-item-account {
					> .elgg-menu-parent {
						display: inline-block;
						width: 100%;
					}
					
					> .elgg-child-menu {
						right: 0;
						left: unset;
					}
				}
			}
		}
				
		.elgg-menu-topbar {
			> li > a {
				.elgg-icon + .elgg-anchor-label {
					display: none;
				}
				
				.elgg-badge {
					position: absolute;
					top: 1rem;
					right: 0;
				}
			}
		}
	}
}

@keyframes menuGrowDown {
	0% {
		transform: scaleY(0);
	}
	80% {
		transform: scaleY(1.1);
	}
	100% {
		transform: scaleY(1);
	}
}
