/* ***************************************
	MENUS
*************************************** */
.elgg-menu-container {
	display: flex;
	flex-direction: column;
	
	&.elgg-menu-title-container {
		> .elgg-menu-hz {
			justify-content: flex-end;
			
			> li {
				margin: 0 0.25rem;
			}
		}
	}
}

@media $(media-tablet-up) {
	.elgg-menu-container.elgg-menu-title-container {
		 flex-direction: row;
	}
}

.elgg-menu,
.elgg-child-menu {
	display: flex;
	flex-direction: column;
}

.elgg-menu > li,
.elgg-child-menu > li {
	position: relative;
}

.elgg-menu > li:last-child::after,
.elgg-child-menu > li:last-child::after {
	display: none;
}

.elgg-menu > li > a,
.elgg-child-menu > li > a {
	display: block
}

.elgg-menu.elgg-menu-hz {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	
	> li {
		margin: 0 0.25rem 0 0;
		
		> .elgg-button {
			margin-bottom: .25rem;
		}
	}
}

.elgg-module-menu .elgg-menu-hz > li {
	margin: 0 0 0 0.25rem;
}

.elgg-menu-item-has-dropdown .elgg-child-menu {
	display: none;
}

.elgg-menu-item-has-toggle > .elgg-child-menu {
	display: none;
	margin-left: 1rem;
}

.elgg-menu-item-has-toggle.elgg-state-selected > .elgg-child-menu {
	display: block;
}

.elgg-menu > li > a .elgg-icon.elgg-state-opened,
.elgg-menu > li > a .elgg-icon.elgg-state-closed {
	font-size: 9px;
	color: inherit;
	line-height: inherit;
	margin: 0 0.5rem;
}

.elgg-menu > li > .elgg-menu-opened .elgg-icon.elgg-state-opened {
	display: inline-block;
}

.elgg-menu > li > .elgg-menu-opened .elgg-icon.elgg-state-closed {
	display: none;
}

.elgg-menu > li > .elgg-menu-closed .elgg-icon.elgg-state-closed {
	display: inline-block;
}

.elgg-menu > li > .elgg-menu-closed .elgg-icon.elgg-state-opened {
	display: none;
}

.elgg-menu:not(.elgg-menu-hz) .elgg-menu-item-has-toggle {
	.elgg-menu-closed:after,
	.elgg-menu-opened:after {
		font-family: 'Font Awesome\ 5 Free';
		font-weight: 900;
		display: inline-block;
		float: right;
		font-size: 0.5rem;
		line-height: 1.5rem;
		width: 1rem;
		text-align: center;
	}

	.elgg-menu-closed:after {
		content: "\f105";
	}

	.elgg-menu-opened:after {
		content: "\f107";
	}
}

.elgg-menu.elgg-menu-hz:not(.elgg-menu-relationship):not(.elgg-menu-annotation) .elgg-menu-item-has-dropdown:not(.elgg-menu-item-title-menu-toggle),
.elgg-menu.elgg-menu-filter .elgg-menu-item-has-dropdown {
	.elgg-menu-closed:after,
	.elgg-menu-opened:after {
		font-family: 'Font Awesome\ 5 Free';
		font-weight: 900;
		display: inline-block;
		font-size: 0.5rem;
		text-align: center;
		margin-left: 0.5rem;
		vertical-align: middle;
	}

	.elgg-menu-closed:after {
		content: "\f107";
	}

	.elgg-menu-opened:after {
		content: "\f106";
	}

}

.elgg-menu .elgg-anchor-icon,
.elgg-child-menu .elgg-anchor-icon {
	color: inherit;
	font-size: inherit;
}

.elgg-menu .elgg-anchor-icon + .elgg-anchor-label,
.elgg-child-menu .elgg-anchor-icon + .elgg-anchor-label {
	margin-left: 0.5rem;
}

.elgg-menu a:hover .elgg-icon,
.elgg-child-menu a:hover .elgg-icon {
	color: inherit;
}

/* ***************************************
	ENTITY NAVIGATION
*************************************** */

.elgg-menu-entity-navigation-container {
	margin-top: 1rem;
}

.elgg-menu-entity-navigation {
	flex-direction: row;
	
	.elgg-menu-item-next {
		margin-left: auto;
	}
}

/* ***************************************
	PAGE MENU
*************************************** */
.elgg-menu-page-container .elgg-menu-section-header {
	font-size: 1.2rem;
	padding: 0.5rem;
}

.elgg-menu-page,
.elgg-menu-owner-block {
	background: #ffffff;
	border: 1px solid $(border-color-soft);
	margin-bottom: 2rem;

	li:not(:last-child) {
		border-bottom: 1px solid #f7f7f8;
	}

	.elgg-child-menu {
		border-top: #f7f7f8;
	}

	.elgg-menu-item-has-toggle > .elgg-child-menu {
		margin: 0;
		border-top: 1px solid #f7f7f8;
	}

	.elgg-menu-item-has-toggle > .elgg-child-menu > li > a {
		padding-left: 2rem;
	}

	li > a,
	li > a {
		padding: 0.5rem 1rem;
		color: $(text-color-strong);
		&:hover {
			background: $(background-color-soft);
			text-decoration: none;
			color: #333;
		}
	}

	li.elgg-state-selected > a,
	li.elgg-state-selected > a {
		color: #333;
		background-color: $(background-color-mild);
	}

	.elgg-badge {
		float: right;
		margin-top: 0;
	}

	.elgg-anchor-icon {
		width: 1rem;
		display: inline-block;
		text-align: center;
		margin-right: 0.5rem;
	}
}

/* ***************************************
	HOVER MENU
*************************************** */
.elgg-menu-hover {
	display: none;
	position: absolute;
	overflow: hidden;
	background-color: #ffffff;
	box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.4);
	min-width: 10rem;
}

.elgg-menu-hover-card-container {
	display: flex;
	flex-direction: column;
}

.elgg-menu-hover-card {
	padding: 1rem;
	max-width: 20rem;
	flex: 2;
}

.elgg-menu-hover li:not(:last-child),
.elgg-menu-hover-actions li:not(:last-child),
.elgg-menu-hover-admin li:not(:last-child) {
	border-bottom: 1px solid $(border-color-soft);
}

.elgg-menu-hover .elgg-child-menu {
	border: 1px solid $(border-color-soft);
	border-width: 1px 0;
	margin: 0 0 -1px;
}

.elgg-menu-hover .elgg-child-menu:before {
	content: "\25b2";
	color: #fff;
	font-size: 0.5rem;
	text-shadow: 0 -2px $(border-color-mild);
	top: -0.5rem;
	left: 1.5rem;
	position: relative;
	margin-bottom: -0.75rem;
}

.elgg-menu-hover li > a,
.elgg-menu-hover-actions li > a,
.elgg-menu-hover-admin li > a {
	color: $(text-color-strong);
	font-size: 0.9rem;
	transition: background-color 0.5s;
	text-decoration: none;
	padding: 0.5rem 1rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.elgg-menu-hover li > a:hover,
.elgg-menu-hover-actions li > a:hover,
.elgg-menu-hover-admin li > a:hover {
	background: $(background-color-soft);
	color: #333;
}

.elgg-menu-hover .elgg-anchor-icon {
	width: 1.5rem;
	text-align: center;
	display: inline-block;
}

.elgg-menu-hover .elgg-menu {
	flex: 1 1 auto;
	max-width: 20rem;
	
	&.elgg-menu-hover-actions {
		border-top: 1px solid $(border-color-soft);
	}
}

.elgg-menu.elgg-menu-hover-admin {
	border-top: 1px solid $(border-color-soft);
	max-width: unset;
}

.elgg-menu-hover .elgg-menu-hover-admin a {
	color: #d33f49;
}

/* ***************************************
	GENERAL MENU
*************************************** */
.elgg-menu-general > li,
.elgg-menu-general > li > a {
	display: inline-block;
	color: $(text-color-soft);
}

.elgg-menu-general > li:after {
	content: "\007C";
	padding: 0 6px;
}

/* ***************************************
	ENTITY, SOCIAL, RIVER AND ANNOTATION
*************************************** */
.elgg-listing-summary-metadata > .elgg-menu-container,
.elgg-river-metadata > .elgg-menu-container,
.elgg-menu-annotation-container {
	float: right;
	margin-left: 1rem;
	display: flex;
	flex-direction: row;
	
	> .elgg-menu + .elgg-menu {
		margin-left: 1rem;
	}
}

.elgg-menu-river,
.elgg-menu-relationship,
.elgg-menu-entity,
.elgg-menu-social,
.elgg-menu-annotation,
.elgg-menu-widget {
	font-size: 0.9rem;
	color: $(text-color-mild);
	height: auto;
	vertical-align: middle;

	> li:not(:first-child) {
		margin-left: 0.75rem;
	}

	> li {
	
		> a:not(.elgg-button) {
			&:not(.elgg-state-active) {
				color: inherit;
			}
			
			&:hover {
				color: #0078ac;
				text-decoration: none;
			}
		}
	}
}

.elgg-menu-entity-default,
.elgg-menu-relationship-default,
.elgg-menu-river-default {
	.elgg-menu-item-has-dropdown {
		font-size: 100%;
	}
}

.elgg-menu-social .elgg-anchor > span:not(:first-child).elgg-anchor-label {
	display: none;
}

/* ***************************************
	LONGTEXT
*************************************** */
.elgg-menu-longtext-container {
	float: right;
}

/* ***************************************
	LOGIN MENU
*************************************** */
.elgg-menu-login-container {
	margin-top: 1rem;
	border-top: 1px solid $(border-color-soft);
}

.elgg-menu-login > li {
	width: 100%;
}

.elgg-menu-login > li > a {
	padding: 0.5rem 1rem;
	font-size: 0.9rem;
	color: #646464;
	display: block;
}

.elgg-menu-login > li > a:hover {
	background: $(background-color-soft);
	text-decoration: none;
}
