@import "variables.less";
@import "mediawiki.mixins";

.background-icon(@name) {
	.background-image("icons/@{name}.svg");
}

/******
 * Header
 **/

/* Universal black PCGamingWiki header */
#pcgw-header {
	height: 40px;
	width: 100%;
	background-color: #333;
	display: -webkit-flex;
	display: flex;
	position: relative;
	z-index: 100;
	white-space: nowrap;

	/* Allows the header to scroll horizontally on mobile. */
	@media all and (max-width: 800px) {
		height: 45px;
		-webkit-flex-flow: column wrap;
		        flex-flow: column wrap;
	  -webkit-align-content: flex-start;
	          align-content: flex-start;
		position: fixed;
	}
}

#pcgw-header-sidebar-toggle {
	margin-left: 5px;
	background-size: 30px;
	background-position: 8px 8px;
	background-repeat: no-repeat;
	.background-icon("menu-icon");
	opacity: 0.75;
	transition: opacity 300ms;

	width: 45px;
	height: 45px;

	&.active {
		opacity: 1;
	}

	@media all and (min-width: 800px) {
		display: none;
	}
}

#pcgw-header-sidebar {
	@media all and (max-width: 800px) {
		display: block;
		position: fixed;
		height: ~"calc(100vh - 45px)";
		width: 75vw;
		min-width: 250px;
		max-width: 350px;
		background-color: #333;
		-webkit-transform: translateX(-100%);
		        transform: translateX(-100%);
		top: 45px;
		transition: -webkit-transform 300ms;
		transition: transform 300ms;
		box-shadow: inset 0 7px 16px -7px rgba(0,0,0,0.6);
		overflow-y: auto;

		&.active {
			-webkit-transform: translateX(0);
			        transform: translateX(0);
		}
	}
}

/* Left-aligned header item container, contains main navigational items. */
.header-item-left-container {
	position: relative;
	text-align: left;
	margin-left: 25px;
	margin-top: 0;
	list-style: none;
	padding: 13px 10px;

	@media all and (max-width: 800px) {
		margin-left: 0;
		padding: 13px 0 0;
	}
}

/* Generic header item class for the black PCGamingWiki header. */
.header-item {
	color: #aaaab2;
	font-size: 1.2rem;
	font-weight: 400;
	margin: 0 10px;
	display: inline-block;
	position: relative;
	transition: color 200ms ease-in-out;

	@media all and (max-width: 800px) {
		font-size: 1.6rem;
		display: block;
		margin: 0;
	}

	/* Links in the header are gray and become white on hover. */
	a {
		color: #aaaab2;
		font-size: 1.2rem;
		font-weight: 400;
		text-decoration: none;
		transition: color 200ms ease-in-out;

		&:hover {
			color: #fff;
		}

		@media all and (max-width: 800px) {
			font-size: 1.6rem;
			padding: 10px 18px;
			display: block;
		}
	}

	/* Emphasizes the current header item by using a thicker font weight. */
	&.current a {
		font-weight: 500;
		color: #fff;
	}

	@media all and (max-width: 800px) {
		&.no-mobile {
			display: none;	
		}
	}
	
	@media all and (min-width: 800px) {
		&.mobile-only {
			display: none;
		}
	}

	/* Pseudo-selector for the header-items that adds a "NEW" label directly above
	   when the "new" class is present. */ 
	&.new::after {
		content: 'NEW';
		position: absolute;
		top: -15px;
		font-size: 10px;
		left: -2px;
		height: 13px;
		display: inline-block;
		background-color: #e74c3c;
		padding: 0 5px;
		text-align: center;
		color: #fff;
		width: calc(100% + 8px);

		@media all and (max-width: 800px) {
			display: none;
		}
	}
}


/* Header search
	 ============================================== */
		
#header-search input[type="search"] {
	-moz-appearance: none;
	-webkit-appearance: none;
	appearance: none;
}

#pcgw-header-search-toggle {
	@media all and (max-width: 800px) {
		display: block;
		position: absolute;
		top: 0;
		right: 0;
		height: 45px;
		width: 40px;

		background-size: 21px;
		background-position: 10px;
		background-repeat: no-repeat;
		.background-icon("search-icon-hover");

		opacity: 0.75;
		transition: opacity 300ms;

		&.active {
			opacity: 1;
		}
	}

	@media all and (min-width: 800px) {
		display: none;
	}
}

@media all and (min-width: 800px) {
	#header-search {
		display: inline-block;
		margin-left: 20px;
		margin-top: 5px;
	  position: absolute;
	  left: 420px;

		input[type="search"] {
			background-color: transparent;
			width: 250px;
			height: 30px;
			border: 1px solid rgba(255,255,255,0.6);
			padding: 4px 7px 4px 24px;
			font-size: 1.2rem;
			font-weight: 300;
			color: #fff;
			background: ~"6px / 14px" no-repeat;

			.background-icon("search-icon");
			transition: border 200ms;

			&:focus {
				border: 1px solid #fff;
				outline: transparent;
				.background-icon("search-icon-hover");
			}
		}
	}
}

@media all and (max-width: 800px) {
	#header-search {
		position: fixed;
		top: 45px;
		left: 0;
		height: 36px;
		width: 100vw;
		border: 0;
		background-color: #fff;
		color: #333;
		max-height: 0;
		overflow: hidden;
		transition: max-height 300ms;

		input[type="search"] {
			background-color: transparent;
			border: 0;
			width: 100%;
			height: 100%;
			font-size: 1.4rem;
			padding: 10px 15px;
		}

		&.active {
			max-height: 36px;
			border-bottom: 1px solid #aaaab2;
		}
	}

	// Make search suggestions easier to click on mobile.
	div.suggestions-result {
		line-height: 2.5em;
		padding-left: 15px;
	}

	// Style "Log in" to match other header sidebar items.
	#p-personal {
		div#personal-bar-flyout {
			font-weight: 300;
			display: block;
			color: #aaaab2;
			opacity: 1;
			margin-top: 30px;

			> div {
				padding: 0;
				width: 100%;

				li a, a {
					color: #aaaab2;
					font-size: 1.6rem;
					display: block;
					padding: 10px 18px;
				  line-height: initial;
				}

				> a {
					text-transform: uppercase;
					font-size: 1.4rem;
					font-weight: 400;
					color: #fff;
					border-bottom: 1px solid #aaaab2;
				}

				li {
					font-size: 1.6rem;
				}
			}
		}

		#pt-login,
		#pt-createaccount {
			font-size: 1.6rem;
			display: block;
			margin: 0;
			padding: 0;
			width: 100%;

			> a {
				display: block;
				font-size: 1.6rem;
				color: #aaaab2;
				padding: 10px 18px;
			}
		}
	}
	
	// Hide personal bar item icons for mobile users.
	#p-personal {
		#personal-bar-flyout div > a,
		#pt-mycontris-flyout a,
		#pt-newmessages-flyout a,
		#pt-mytalk-flyout a,
		#pt-watchlist-flyout a,
		#pt-preferences a,
		#pt-betafeatures-flyout a {
			background: none;
		}
	}
}

#pcgw-header-logo {
	display: none;

	@media all and (max-width: 800px) {
		position: absolute;
		width: 70px;
		height: 45px;
		display: block;
		left: ~"calc(50% - 35px)";
		top: 0;

		a {
			display: block;
			padding: 2px 15px;
		}
	}
}

/* Lookash changes */

#p-personal {
  display: none;
}

#p-personal-mobile {
  margin: 0;
  list-style: none;
}

#p-personal-mobile ul {
  margin: 0;
}

#p-personal-mobile > li {
  margin: 0 0 .1em 0;
  padding: 0;
}

#p-personal-mobile > li > a {
  display: block;
  font-size: 1.6rem;
  color: #aaaab2;
  text-decoration: none;
  padding: 10px 18px;
}

#p-personal-mobile #personal-bar-flyout > div > a {
    text-transform: uppercase;
    font-size: 1.4rem;
    font-weight: 400;
    color: #fff;
    display: block;
    padding: 10px 18px;
    line-height: initial;
    border-bottom: 1px solid #aaaab2;
}

#p-personal-mobile #personal-bar-flyout > div li a {
    color: #aaaab2;
    font-size: 1.6rem;
    display: block;
    padding: 10px 18px;
    line-height: initial;
}

#p-personal-mobile #personal-bar-flyout {
  margin-top: 30px;
}

#p-personal-mobile #personal-bar-flyout > div > a {
  text-transform: uppercase;
  font-size: 1.4rem;
  font-weight: 400;
  color: #fff;
  border-bottom: 1px solid #aaaab2;
}

#p-personal-mobile #personal-bar-flyout div a {
  background: none;
}

#p-personal-mobile #personal-bar-flyout {
  list-style: none;
}

.header-item {
  cursor: pointer;
  padding: 10px 18px;
}

.page-Home .home-information-column {
  max-width: none;
}

.page-Home .home-card {
  max-width: none;
}

.dropdown-menu {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height .5s cubic-bezier(0, 1.05, 0, 1);
  -webkit-transition: max-height .5s cubic-bezier(0, 1.05, 0, 1);
}

.dropdown-menu a {
  padding: 10px 18px;
  color: #aaaab2;
  text-decoration: none;
  font-size: 1.6rem;
  display: block;
}

.dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.5em;
  vertical-align: 0.155em;
  content: "";
  border-top: 0.3em solid;
  border-right: 0.3em solid transparent;
  border-bottom: 0;
  border-left: 0.3em solid transparent;
}

.display-block {
  max-height: 600px;
  transition: max-height .5s linear;
  -webkit-transition: max-height .5s linear;
}

@media (min-width: 801px) {
  #p-personal-mobile {
    display: none;
  }

  #pcgw-header-logo {
    display: block;
    height: 40px;
    width: 200px;
    margin: 0;
    flex-shrink: 0;
  }

  #pcgw-logo {
    margin: 0;
    width: auto;
  }

  #pcgw-header-sidebar .dropdown-menu {
    display: none;
  }

  #pcgw-logo img {
    width: auto;
    margin: 5px 5px 0 0;
  }

  #pcgw-header-sidebar {
    display: flex;
    align-items: center;
  }

  #pcgw-header-sidebar li {
    margin: 0;
  }

  .dropdown-toggle {
    margin: 0;
    display: block;
    padding: 11.5px 10px;
    cursor: pointer;
  }

  .dropdown-toggle:hover {
    color: white;
    background-color: #1a1a1a;
  }

  #pcgw-header-sidebar .dropdown-toggle:hover + .dropdown-menu,
  #pcgw-header-sidebar .dropdown-menu:hover {
    display: block;
    position: absolute;
    background: #333;
    top: 45px;
    list-style: none;
    min-width: 100px;
    margin: 0;
  }

  #pcgw-header-sidebar .dropdown-menu a {
    display: block;
    color: #aaaab2;
    padding: 7px 10px;
    font-size: 1.2rem;
    transition: color 200ms ease-in-out, background 200ms ease-in-out;
    -webkit-transition: color 200ms ease-in-out, background 200ms ease-in-out;
  }

  #pcgw-header-sidebar .dropdown-menu a:hover {
    background-color: #1a1a1a;
    color: white;
    text-decoration: none;
  }

  #pcgw-header-logo a {
    display: block;
  }

  #pcgw-header-logo img {
    width: 200px;
    height: 40px;
  }

  #pcgw-header {
    background-color: #333;
    z-index: 100;
    height: 45px;
    justify-content: center;
  }

  .header-item-left-container {
    margin: 0 5px;
    padding: 0;
    display: flex;
  }

  #header-search {
    display: block;
    margin: 0 5px;
    position: static;
  }

  #header-search input[type="search"] {
    width: 130px;
  }

  .header-item-left-container {
    margin: 0;
  }

  .header-item-left-container li span {
    padding: 14px 3px;
  }

  .pcgw-header_limit {
    max-width: 1630px;
    width: 100%;
    display: flex;
    align-items: center;
    margin: 0 5px 0 0;
  }

  #p-personal {
    position: static;
    display: block;
  }

  #p-personal #p-personal-logged-in li {
    display: none;
  }

  #p-personal #personal-bar-flyout > div {
    position: relative;
  }

  #p-personal #personal-bar-flyout > div ul {
    position: absolute;
    background-color: white;
    left: 0;
    right: 0;
  }

  #p-personal-logged-in {
    margin-top: 0;
    display: flex;
    align-items: center;
  }

  #p-personal #personal-bar-flyout {
    min-width: 150px;
    margin-top: 0;
  }

  .rightside-wrap {
    display: flex;
    align-items: center;
  }
}

@media (min-width: 1024px) {
  #header-search input[type="search"] {
    width: 200px;
  }

  .header-item-left-container li span {
    padding: 14px 5px;
  }
}

@media (min-width: 1280px) {
  #p-personal li {
    display: inline-block;
  }

  #p-personal #personal-bar-flyout {
    min-width: 200px;
  }

  #header-search input[type="search"] {
    width: 250px;
  }

  .header-item-left-container {
    margin: 0 5px;
  }

  .header-item-left-container li span {
    padding: 14px 10px;
  }

  .pcgw-header_limit {
    margin: 0 10px;
  }

  #p-personal #personal-bar-flyout {
    min-width: 150px;
    margin-top: 0;
  }
}

#pt-anonuserpage > a,
#pt-anontalk > a,
#pt-anoncontribs > a,
#pt-login > a,
#pt-createaccount > a {
  font-weight: 400;
}

.white-text {
  color: white;
  background-color: #1a1a1a;
}
