/* -----------------------------------------
	Header
----------------------------------------- */

/* Generic header styling
========================================= */
.header {
	display: flex;
	flex-direction: column;
	position: relative;
	z-index: 30;
}

.header-fullwidth {
	@include media-breakpoint-up(xl) {
		.container {
			width: 100%;
		}
	}
}

.header-fixed {
	position: absolute;
	width: 100%;
	top: 0;
	left: 0;
}

/* Site branding
========================================= */
.site-branding {
	max-width: 250px;
	margin-left: $head-item-spacing;
	margin-right: $head-item-spacing;
	flex: none;
}

.site-logo {
	font-size: 26px;
	font-weight: 700;
	margin: 0;
	line-height: 1.2;
	letter-spacing: $letter-spacing-default;
}

.site-tagline {
	font-size: 12px;
	margin: 0;
}

/* Header content slots
========================================= */
.head-content-slot {
	display: flex;
	align-items: center;

	.head-intro & {
		margin-left: -$head-item-spacing;
		margin-right: -$head-item-spacing;
	}

	@include media-breakpoint-down(sm) {
		.head-intro & {
			justify-content: center;
			margin: 3px 0;
		}
	}
}

.head-content-slot-end {
	justify-content: flex-end;
	text-align: right;

	@include media-breakpoint-down(sm) {
		text-align: center;
	}
}

.head-content-slot-center {
	justify-content: center;
	text-align: center;
}

.head-content-slot-item {
	margin: 0 $head-item-spacing;
	flex: none;
}

.head-menu-slot {
	display: flex;
	margin-left: $head-item-spacing;
	margin-right: $head-item-spacing;

	.head-mast {
		flex: auto;
	}
}

/* Top header bar (head intro)
========================================= */
.head-intro {
	font-size: 13px;
	padding: $head-item-spacing 0;
	background-color: $accent-color;
	color: $white;
	line-height: normal;
	border-bottom: 3px solid $accent-color-alt;

	a {
		color: inherit;

		&:hover {
			color: inherit;
		}
	}

	.container,
	.row {
		height: 100%;
	}
}

/* Main header (head mast)
========================================= */
.head-mast {
	padding: 30px 0;
	background-color: $white;
	color: $text-color-light;
	transition: all .25s ease;
	transition: background-color .25s ease;

	.header-sticky & {
		will-change: transform;
	}

	a {
		color: inherit;
	}

	.head-content-slot {
		color: inherit;
	}
}

.head-mast-inner {
	display: flex;
	align-items: center;
	margin-left: -$head-item-spacing;
	margin-right: -$head-item-spacing;
}

/* Header variations
========================================= */

/* Menu right */
.header-full-nav-right {
	.head-menu-slot {
		flex: auto;
		justify-content: flex-end;
	}
}

/* Menu next to logo */
.header-full-nav-left {
	.head-menu-slot {
		flex: auto;
	}
}

/* Menu centered */
.header-full-nav-center {
	.site-branding,
	.head-mast .head-content-slot {
		width: 20%;
		flex: none;
		max-width: 100%;
	}

	.head-menu-slot {
		flex: auto;
		justify-content: center;
	}
}

/* Branding center / Split Menu */
.header-nav-split {
	.site-branding {
		text-align: center;
	}

	.head-menu-slot {
		flex: auto;
		width: 35%;

		&:last-of-type {
			justify-content: flex-end;
		}
	}
}

/* Branding when menu is in navbar */
.header-navbar {
	.head-mast-inner {
		justify-content: center;
	}

	.site-branding {
		text-align: center;
	}
}

.header-navbar-h-reverse {
	.head-outro-inner {
		flex-direction: row-reverse;
	}
}

.header-navbar-v-reverse {
	.head-mast {
		order: 2;
	}
}

.header-navbar-h-center {
	.head-outro-inner {
		justify-content: center;
	}
}

.header-navbar-stretch {
	.head-menu-slot {
		flex: auto;
	}

	.nav {
		width: 100%;
	}

	.navigation-main {
		display: flex;
		justify-content: space-between;
	}
}

/* Head outro
========================================= */
.head-outro {
	padding: $head-item-spacing 0;
	background-color: $grey;
	color: $text-color-light;
	transition: all .25s ease;

	.header-sticky & {
		will-change: transform;
	}

	a {
		color: inherit;
	}
}

.head-outro-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-left: -$head-item-spacing;
	margin-right: -$head-item-spacing;
}

/* Sticky header
========================================= */
.header-sticky-wrapper {
	z-index: 150;

	@media (max-width: 1024px) {
		height: auto !important;
	}
}

.header-sticky-fixed {
	height: auto !important;
}

.header-sticky-mobile-disabled {
	.header-sticky-wrapper {
		@media (max-width: 1024px) {
			height: auto !important;
		}
	}

	.head-stuck {
		@media (max-width: 1024px) {
			.head-outro,
			.head-mast {
				position: static !important;
				width: auto !important;
				box-shadow: none;
			}
		}
	}
}

/* -----------------------------------------
	03b. Slot Items
----------------------------------------- */

/* Global search form / trigger
========================================= */
.global-search-form {
	position: fixed;
	top: 0;
	left: 0;
	max-width: 100%;
	width: 100%;
	transform: translateY(-100%);
	transition: transform .25s ease;
	padding: 20px;
	background-color: rgba($white, .9);
	box-shadow: 0 2px 6px rgba($black, .02);
	z-index: 200;
}

.global-search-form-expanded {
	max-width: 100%;
	transform: translateY(0);
}

.global-search-input {
	height: 56px;
	font-size: 16px;
}

.global-search-form-dismiss {
	@include button-reset;
	position: absolute;
	width: 50px;
	height: 56px;
	top: calc(50% - 2px);
	right: 20px;
	transform: translateY(-50%);
	font-size: 26px;
	padding: 0;
	line-height: 0;
	opacity: .5;
}

/* Social icons
========================================= */
.social-icon-inset {
	margin: 0 2px;
}

/* Menu shortcode
========================================= */
.head-content-slot,
.footer-content-slot {
	.menu {
		margin: 0;
		padding: 0;
		list-style: none;
		display: flex;

		li {
			margin: 0 5px;

			&:first-child {
				margin-left: 0;
			}

			&:last-child {
				margin-right: 0;
			}
		}
	}
}

/* Header Mobile Styles
========================================= */
@include media-breakpoint-down(md) {
	#mobilemenu {
		display: block;
	}

	.mobile-nav-trigger {
		display: inline-block;
	}

	.nav {
		display: none;
	}

	.header-full-nav-right,
	.header-full-nav-left,
	.header-full-nav-center,
	.header-nav-split {
		.site-branding {
			max-width: 70%;
			width: auto;
			text-align: left;
		}

		.head-menu-slot {
			width: auto;

			&:first-of-type {
				display: none;
			}
		}

		.head-mast-inner {
			flex-wrap: wrap;

			.head-content-slot {
				order: -1;
				width: 100%;
				justify-content: center;
				margin-bottom: 5px;
			}
		}

		.mobile-nav-trigger {
			margin-left: auto;
		}
	}

	.head-mast-inner {
		.head-content-slot-end {
			display: none;
		}
	}
}
