/* ***************************************
	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;
	
	> li {
		position: relative;
		
		&:last-child::after {
			display: none;
		}
		
		> 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-state-closed {
			display: none;
		}
	}
	
	> .elgg-menu-closed .elgg-icon {
		&.elgg-state-opened {
			display: none;
		}
		&.elgg-state-closed {
			display: inline-block;
		}
	}
}

.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-child-menu {
	a:hover .elgg-icon {
		color: inherit;
	}
	
	.elgg-anchor-icon {
		color: inherit;
		font-size: inherit;
		
		+ .elgg-anchor-label {
			margin-left: 0.5rem;
		}
	}
}

/* ***************************************
	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;
	font-weight: 500;
	padding: 0.5rem;
}

.elgg-menu-page,
.elgg-menu-owner-block {
	background: #ffffff;
	border: 1px solid var(--elgg-border-color-soft);

	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: var(--elgg-text-color-strong);
		&:hover {
			background: var(--elgg-background-color-soft);
			text-decoration: none;
			color: #333;
		}
	}

	li.elgg-state-selected > a,
	li.elgg-state-selected > a {
		color: #333;
		background-color: var(--elgg-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: 0 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,
.elgg-menu-hover-actions,
.elgg-menu-hover-admin {
	li:not(:last-child) {
		border-bottom: 1px solid var(--elgg-border-color-soft);
	}
	
	li > a {
		color: var(--elgg-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;
		
		&:hover {
			background: var(--elgg-background-color-soft);
			color: #333;
		}
	}
}

.elgg-menu-hover {
	.elgg-child-menu {
		border: 1px solid var(--elgg-border-color-soft);
		border-width: 1px 0;
		margin: 0 0 -1px;
		
		&:before {
			content: "\25b2";
			color: #fff;
			font-size: 0.5rem;
			text-shadow: 0 -2px var(--elgg-border-color-mild);
			top: -0.5rem;
			left: 1.5rem;
			position: relative;
			margin-bottom: -0.75rem;
		}
	}
	
	.elgg-anchor-icon {
		width: 1.5rem;
		text-align: center;
		display: inline-block;
	}
	
	.elgg-menu {
		flex: 1 1 auto;
		max-width: 20rem;
		
		&.elgg-menu-hover-actions {
			border-top: 1px solid var(--elgg-border-color-soft);
		}
	}
	
	.elgg-menu-hover-admin a {
		color: #d33f49;
	}
}

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

/* ***************************************
	GENERAL MENU
*************************************** */
.elgg-menu-general > li,
.elgg-menu-general > li > a {
	display: inline-block;
	color: var(--elgg-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-entity-trash,
.elgg-menu-social,
.elgg-menu-annotation,
.elgg-menu-widget {
	font-size: 0.9rem;
	color: var(--elgg-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: var(--elgg-text-color-highlight);
				text-decoration: none;
			}
		}
	}
}

.elgg-menu-entity-default,
.elgg-menu-entity-trash-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;
}

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

.elgg-menu-login > li {
	width: 100%;
	
	> a {
		padding: 0.5rem 1rem;
		font-size: 0.9rem;
		color: #646464;
		display: block;
		
		&:hover {
			background: var(--elgg-background-color-soft);
			text-decoration: none;
		}
	}
}
