/* Site header. Colors are fixed values, change them here only. */
:root {
	--yt-bg: #fff6d9;
	--yt-text: #3a2412;
	--yt-accent: #d9782d;
	--yt-accent-strong: #c2631f;
	--yt-accent-hover: #9e4e15;
	--yt-muted: #8a6e58;
	--yt-burger: #8a4a1c;
	--yt-soft: rgba(58, 36, 18, 0.12);
	--yt-overlay: rgba(40, 24, 12, 0.55);
	--yt-shadow: rgba(58, 36, 18, 0.25);
	--yt-admin-bar: 0px;
}

.admin-bar {
	--yt-admin-bar: 32px;
}

/* Leave display unset here so the "hide header" option keeps working. */
header#masthead.yt-header {
	background: var(--yt-bg);
	color: var(--yt-text);
	position: sticky;
	top: var(--yt-admin-bar);
	width: 100%;
	z-index: 1000;
}

header#masthead.yt-header .yt-header-bar {
	align-items: center;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	height: 60px;
	padding: 0 16px;
	position: relative;
}

header#masthead.yt-header .yt-header-left,
header#masthead.yt-header .yt-header-right {
	align-items: center;
	display: flex;
	gap: 12px;
}

header#masthead.yt-header .yt-header-right {
	justify-content: flex-end;
}

/* Burger */
header#masthead.yt-header .yt-menu-burger,
header#masthead.yt-header .yt-menu-burger:hover,
header#masthead.yt-header .yt-menu-burger:focus,
header#masthead.yt-header .yt-menu-burger:active {
	align-items: center;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	cursor: pointer;
	display: flex;
	flex-direction: column;
	gap: 5px;
	height: 40px;
	justify-content: center;
	outline: 0;
	padding: 0;
	width: 40px;
}

header#masthead.yt-header .yt-burger-line {
	background: var(--yt-burger);
	display: block;
	height: 2px;
	width: 20px;
}

header#masthead.yt-header .yt-menu-burger:hover .yt-burger-line,
header#masthead.yt-header .yt-menu-burger:focus .yt-burger-line {
	background: #000;
}

/* Logo */
header#masthead.yt-header .yt-logo,
header#masthead.yt-header .yt-logo:visited {
	color: var(--yt-text);
	display: block;
	font-weight: 700;
	text-decoration: none;
	width: 100px;
}

header#masthead.yt-header .yt-logo img {
	display: block;
	height: auto;
	width: 100px;
}

/* Page tabs */
header#masthead.yt-header .yt-header-nav {
	display: flex;
	justify-content: center;
}

header#masthead.yt-header .yt-header-tab,
header#masthead.yt-header .yt-header-tab:visited {
	align-items: center;
	color: var(--yt-muted);
	display: flex;
	height: 60px;
	justify-content: center;
	position: relative;
	width: 64px;
}

header#masthead.yt-header .yt-header-tab svg {
	height: 26px;
	width: 26px;
}

header#masthead.yt-header .yt-header-tab:hover,
header#masthead.yt-header .yt-header-tab:focus,
header#masthead.yt-header .yt-header-tab.is-active {
	color: var(--yt-accent-strong);
}

header#masthead.yt-header .yt-header-tab.is-active::after {
	background: var(--yt-accent-strong);
	border-radius: 3px 3px 0 0;
	bottom: 4px;
	content: "";
	height: 3px;
	left: 8px;
	position: absolute;
	right: 8px;
}

/* Sign in */
header#masthead.yt-header .yt-header-cta,
header#masthead.yt-header .yt-header-cta:visited {
	align-items: center;
	background: var(--yt-accent-strong);
	border-radius: 50%;
	color: #fff;
	display: flex;
	height: 36px;
	justify-content: center;
	width: 36px;
}

header#masthead.yt-header .yt-header-cta:hover,
header#masthead.yt-header .yt-header-cta:focus {
	background: var(--yt-accent-hover);
	color: #fff;
}

header#masthead.yt-header .yt-header-cta svg {
	height: 18px;
	width: 18px;
}

/* Signed-in user */
header#masthead.yt-header .yt-user {
	align-items: center;
	display: flex;
	gap: 12px;
}

header#masthead.yt-header .yt-user-name,
header#masthead.yt-header .yt-user-name:visited {
	color: var(--yt-text);
	font-size: 1.15rem;
	font-weight: 700;
	max-width: 220px;
	overflow: hidden;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}

header#masthead.yt-header .yt-user-name:hover {
	color: var(--yt-accent-hover);
}

header#masthead.yt-header .yt-user-avatar {
	cursor: pointer;
	height: 36px;
	position: relative;
	width: 36px;
}

header#masthead.yt-header .yt-user-avatar img {
	border-radius: 50%;
	display: block;
	height: 36px;
	width: 36px;
}

header#masthead.yt-header .yt-user-menu {
	background: var(--yt-bg);
	border-radius: 6px;
	box-shadow: 0 2px 8px var(--yt-shadow);
	display: none;
	padding: 6px 0;
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	white-space: nowrap;
	z-index: 10;
}

/* Transparent bridge between the avatar and the box. */
header#masthead.yt-header .yt-user-menu::before {
	content: "";
	height: 8px;
	left: 0;
	position: absolute;
	right: 0;
	top: -8px;
}

header#masthead.yt-header .yt-user-avatar:hover .yt-user-menu,
header#masthead.yt-header .yt-user-avatar:focus-within .yt-user-menu {
	display: block;
}

header#masthead.yt-header .yt-user-menu a,
header#masthead.yt-header .yt-user-menu a:visited {
	color: var(--yt-text);
	display: block;
	padding: 4px 14px;
	text-decoration: none;
}

header#masthead.yt-header .yt-user-menu a:hover,
header#masthead.yt-header .yt-user-menu a:focus {
	color: var(--yt-accent-hover);
}

header#masthead.yt-header .yt-user-profile {
	display: none;
}

/* Scroll progress */
header#masthead.yt-header .yt-scroll-progress {
	background: var(--yt-soft);
	bottom: 0;
	height: 4px;
	left: 0;
	position: absolute;
	width: 100%;
}

header#masthead.yt-header .yt-scroll-progress-bar {
	background: var(--yt-accent);
	height: 100%;
	width: 0;
}

/* Overlay and side menu */
header#masthead.yt-header .yt-side-menu-overlay {
	background: var(--yt-overlay);
	bottom: 0;
	left: 0;
	opacity: 0;
	position: fixed;
	right: 0;
	top: 0;
	transition: opacity 0.3s, visibility 0.3s;
	visibility: hidden;
	z-index: 1001;
}

header#masthead.yt-header .yt-side-menu {
	background: var(--yt-bg);
	bottom: 0;
	box-shadow: 2px 0 12px var(--yt-shadow);
	left: 0;
	max-width: 85vw;
	overflow-y: auto;
	padding-top: 56px;
	position: fixed;
	top: var(--yt-admin-bar);
	transform: translateX(-100%);
	transition: transform 0.3s, visibility 0.3s;
	visibility: hidden;
	width: 320px;
	z-index: 1002;
}

html.side-menu-open,
html.side-menu-open body {
	overflow: hidden;
}

html.side-menu-open header#masthead.yt-header .yt-side-menu-overlay {
	opacity: 1;
	visibility: visible;
}

html.side-menu-open header#masthead.yt-header .yt-side-menu {
	transform: translateX(0);
	visibility: visible;
}

header#masthead.yt-header .yt-side-menu-close,
header#masthead.yt-header .yt-side-menu-close:hover,
header#masthead.yt-header .yt-side-menu-close:focus,
header#masthead.yt-header .yt-side-menu-close:active {
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: var(--yt-text);
	cursor: pointer;
	font-size: 28px;
	line-height: 1;
	outline: 0;
	padding: 8px 12px;
	position: absolute;
	right: 8px;
	top: 8px;
}

header#masthead.yt-header .yt-side-menu-close:hover,
header#masthead.yt-header .yt-side-menu-close:focus {
	color: var(--yt-accent-strong);
}

header#masthead.yt-header .yt-side-menu-list,
header#masthead.yt-header .yt-side-menu-list ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

header#masthead.yt-header .yt-side-menu-list a,
header#masthead.yt-header .yt-side-menu-list a:visited {
	color: var(--yt-text);
	display: block;
	padding: 12px 24px;
	text-decoration: none;
}

header#masthead.yt-header .yt-side-menu-list a:hover,
header#masthead.yt-header .yt-side-menu-list a:focus {
	background: var(--yt-soft);
	color: var(--yt-accent-hover);
}

@media screen and (min-width: 600px) {

	header#masthead.yt-header .yt-header-bar {
		padding: 0 24px;
	}
}

@media screen and (max-width: 782px) {

	.admin-bar {
		--yt-admin-bar: 46px;
	}
}

@media screen and (max-width: 639px) {

	header#masthead.yt-header .yt-header-nav,
	header#masthead.yt-header .yt-user-name {
		display: none;
	}

	header#masthead.yt-header .yt-header-bar {
		grid-template-columns: 1fr 1fr;
	}

	header#masthead.yt-header .yt-logo {
		left: 50%;
		position: absolute;
		top: 50%;
		transform: translate(-50%, -50%);
	}

	header#masthead.yt-header .yt-user-menu a.yt-user-profile {
		display: block;
	}
}

@media (prefers-reduced-motion: reduce) {

	header#masthead.yt-header .yt-side-menu,
	header#masthead.yt-header .yt-side-menu-overlay {
		transition: none;
	}
}
