
/*---------------------------------------------------------------------------*/

nav
{
	flex: 0 0 auto; /* grow shrink base */
	display: flex;
	flex-direction: row;
	justify-content: center;
	padding: 0 6em; /* ver hor */
}

nav.Main
{
	background-color: var(--nav_background);
	color: var(--nav_color);
	font-weight: bold;
}

nav.App
{
	border-bottom: solid 1px var(--nav_background);
}

nav a
{
	font-weight: normal;
	text-decoration-color: currentcolor;
}

/*---------------------------------------------------------------------------*/
/* menu elements */

nav>*
{
	overflow: hidden;
	min-width: 34px; /* preserves at least the icon to be visible */
}

nav>*.Active
{
	overflow: visible; /* otherwise sub menus will be cut! */
	min-width: unset;
}

nav>*.Active a
{
	text-decoration: none; /* makes the underline disappear for opened sub menus */
}

nav.Main .Button:hover,
nav.Main .Button.Active
{
	background-color: var(--article_background);
	color: var(--article_color);
}

nav.App>*:hover,
nav.App>*.Active
{
	background-color: var(--submenu_background);
	color: var(--submenu_color);
}

/*---------------------------------------------------------------------------*/

.Button
{
	position: relative; /* to make it an anchestor for sub menu positioning */
	cursor: pointer;
	overflow: hidden;
	white-space: nowrap; /* to prevent text wrapping into a new line */
	/* text-overflow: ellipsis; */
	text-align: left;
	margin-left: 1px;
	margin-right: 1px;
}

nav.Main .Button
{
	padding: 0.5em 1.0em;
}

nav.App .Button
{
	padding: 0.5em 0.5em;
}

.Button img
{
	/*margin-left: 5px;*/
	margin-right: 0.25em;
	vertical-align: bottom;
}

.Button:hover
{
	transition: var(--transition);
}

.Button.Disabled
{
	cursor: auto;
}

.Button.Disabled img
{
	filter: saturate(0) contrast(0.5) brightness(1.5);
}

/*---------------------------------------------------------------------------*/

.SubMenu /* this is placed as an achor for the sub menu */
{
	position: relative;
	display: none;

	&>* /* this is the actual sub menu window */
	{
		position: absolute;
		top: 0px; left: 0px;
		width: auto;
		z-index: 1; /* required to be on top of other buttons */
		padding-left: 1em;
		padding-right: 1em;
		border: solid 1px var(--nav_background);
		border-top: none;
		color: var(--submenu_color);
		background-color: var(--submenu_background);
		white-space: nowrap; /* wrap must be explicit with <br> tags */
		max-height: 80vh;
		overflow: hidden auto; /* x y */
	}

	section
	{
		margin: 0.7em 0; /* ver hor */
	}

	.Heading
	{
		text-decoration: underline;
	}

	select,
	input[type=submit],
	input[type=text],
	input[type=password],
	.CheckSelect
	{
		width: 12em;
	}
	select.Slim
	{
		width: 7em;
	}

	input[type=number]
	{
		width: 4em;
	}

	input[type=color]
	{
		width: 2em;
		height: 1.5em; /* no effect on Forefox, which keeps a min height of 20px content */
	}

	.CheckSelect
	{
		border: solid 1px grey;
	}

	select,
	input[type=number],
	input[type=color],
	.CheckSelect
	{
		margin-top: 1px;
		margin-bottom: 1px;
	}

	.CheckSelect
	{
		max-height: 7.5em;
		overflow-y: auto;
		background-color: white;
		padding: 3px;
		white-space: nowrap;
		overflow-x: hidden;
		text-overflow: ellipsis;
		
		hr
		{
			margin-block-start: 2px;
			margin-block-end: 1px;
		}		
		
		select
		{
			width: 4em;
			margin-right: 3px;
			/* text-overflow: ellipsis; */
		}
	}

	label
	{
		white-space: nowrap;
	}

	.Indent
	{
		margin-left: 0.25em;
		padding: 0.25em;
		border-left: solid 1px grey;
	}

	input[type=submit]
	{
		margin: 2px 0;
		text-align: left;
	}

	.Info
	{
		white-space: normal;
	}

	header /* used in shared forms when displayed as .Dialog */
	{
		display: none;
	}
	
	/* specialized layout for 'user' menu */
	
	.SportSettings
	{
		input.Speed { width: 3.5em; }
		input.Climb { width: 3.5em; }
		span.Unit { font-size: smaller; }
	}
}

/*---------------------------------------------------------------------------*/


