@import 'data_uris';

$header-height: 180px;
$mobile-header-height: 80px;
$logo-width: 390px;

$form-picto-keywords: adresse, aquabike, archives, asso, attestation, bibliotheque, calendrier, cantine, certificat, chantier, cni, copie, deces, dfu, ecole, espacefamille, grue, habitant, infos, inscription, justice, livret, logement, loisir, marche, mariage, naissance, nature, nom, notaire, pacs, paiement, parking, police, rectification, reference, reglement, repertoire, salle, signalement, signature, subvention, territoire, tournage, urbanisme, vote, zoo, emploi, famille, participez, pba;

%title {
	@extend %title;
	text-align: left;
	&::after {
		content: "";
		height: 3px;
		width: 45px;
		margin-top: 10px;
		background: $primary-color;
		display: block;
	}
}

.site-header {
	z-index: 200;
	background: white;
}

.site-nav {
	z-index: 250;
	pointer-events: none;
	button, ul {
		pointer-events: all;
	}
}

#header {
	height: $header-height;
	@media screen and ($max-mobile-viewport) {
		height: $mobile-header-height;
	}
	#top a {
		display: block;
		position: absolute;
		right: 0;
		top: 0;
		padding-top: 1rem;
		height: $header-height;
		width: $logo-width;
		text-align: center;
		background: $primary-color url('/assets/header:logo') bottom 1rem left 50% no-repeat;
		background-size: 150px;
		color: white;
		&::after {
			z-index: 1000;
			position: absolute;
			content: "";
			background: transparent;
			width: 0px;
			height: 0px;
			right: 60px;
			bottom: -60px;
			border: 30px solid $primary-color;
			border-color: $primary-color $primary-color transparent transparent;
		}
		@media screen and ($max-mobile-viewport) {
			padding-top: 0.5rem;
			background-size: 80px;
			background-position: bottom 0.5rem left 50%;
			font-size: 0.8rem;
			height: $mobile-header-height;
			width: 50vw;
			&::after {
				right: 24px;
				bottom: -24px;
				border-width: 12px;
			}
		}
	}
}

#toplinks {
	// reset
	padding: 0;
	border: none;
	right: auto;
	border-radius: none;
	box-shadow: none;

	background: url($data_uri_comptepersonnel) 0 5px no-repeat;
	background-size: 27px 33px;
	font-size: 0.9rem;
	position: absolute;
	top: 45px;
	left: 120px;
	text-transform: uppercase;
	font-weight: bold;
	min-height: 50px;
	padding-left: 40px;
	a {
		color: $user-info-color;
	}
	.sep, .registration, .logout {
		display: none;
	}
	@media screen and ($max-mobile-viewport) {
		padding-top: 5px;
		top: 20px;
		left: 80px;
		font-size: 0.7rem;
	}
	@media screen and (max-width: 360px) {
		left: 60px;
	}
}

.gru-nav-wrapper {
	margin-top: -50px;
}

div.gru-nav {
	.gru-nav-button .icon-bar {
		border-radius: 10px 0 0 10px;
	}
	&.toggled .gru-nav-button .icon-bar {
		border-radius: 10px;
	}
}


div.gru-nav .gru-nav-button {
	top: -90px;
	@media screen and ($max-mobile-viewport) {
		top: -15px;
	}
	@media screen and (max-width: 360px) {
		left: -10px;
	}
	+ ul {
		margin-bottom: 0;
		position: absolute;
		width: $width;
		border-top: 0;
		z-index: 1000;
	}
}

#pwa-navigation {
	ul li {
		a {
			padding-top: 35px;
			span {
				text-transform: uppercase;
				font-weight: bold;
				line-height: 110%;
			}
		}
	}
}

@media screen and ($min-desktop-viewport) {
	#pwa-navigation {
		display: block;
		max-width: $width;
		margin: auto;
		position: relative;
		height: auto;
		> div {
			width: $width - $logo-width;
			background: $nav-mobile-bottom-bar-background;
			position: absolute;
			left: 0;
			top: #{0px - $nav-mobile-bottom-bar-height};
		}
		ul li {
			max-width: 170px;
			margin: 0;
			a {
				padding-left: 15px;
				padding-right: 15px;
				background-position: 15px 50%;
				padding-top: 15px;
				span {
					line-height: 120%;
					text-align: left;
					padding-left: 35px;
					font-size: 0.75rem;
					height: 40px;
				}
				span.badge {
					padding: 0;
					height: 20px;
					width: 20px;
					text-align: center;
					left: 30px;
				}
			}
		}
	}
	.has-pwa-navigation footer {
		margin-bottom: 0;
	}
}

#content-top {
	> div.cell {
		margin-left: 0;
		margin-right: 0;
	}
	width: 100%;
	margin-top: -1px;
	@media screen and ($max-mobile-viewport) {
		div.carrousel-content {
			height: 260px;
		}
	}
	div.carrousel-nav {
		top: 120px;
		left: 55px;
		text-align: left;
		label {
			box-sizing: content-box;
		}
		@media screen and ($max-mobile-viewport) {
			top: 60px;
			left: 20px;
			label {
				border-width: 2px;
				width: 5px;
				height: 5px;
				margin: 0 2px;
			}
		}
	}
	div.carrousel-content input + div div.carrousel-item div.carrousel-item-content {
		position: absolute;
		bottom: auto;
		top: 180px;
		left: 60px;
		max-width: 50%;
		line-height: 120%;
		strong {
			font-size: 2rem;
			line-height: 130%;
			text-transform: uppercase;
		}
		@media screen and ($max-mobile-viewport) {
			top: 90px;
			left: 22px;
			max-width: 80%;
			strong {
				font-size: 1.2rem;
			}
		}
	}

	div.trackingcodeinputcell {
		border-radius: 10px;
		position: relative;
		margin: -40px 50px 0 50px;
		background: white url($data_uri_codebarre) 50px 25px no-repeat;
		background-size: 60px 60px;
		@media screen and ($max-mobile-viewport) {
			margin: -40px 10px 0 10px;
			background-position: 10px 10px;
		}
		form {
			width: 30%;
			margin-left: 140px;
			float: left;
			padding-top: 15px;
			position: relative;
			@media screen and ($max-mobile-viewport) {
				width: auto;
				float: none;
				margin-left: 90px;
			}
			h2 {
				padding: 0;
				color: $primary-color;
				font-weight: bold;
				text-transform: uppercase;
				margin: 0;
				font-size: 1.2rem;
				@media screen and ($max-mobile-viewport) {
					padding-top: 5px;
				}
			}
			input {
				width: 12rem;
				border-width: 0 0 1px 0;
				border-radius: 0;
				padding: 0 0 0.7ex 0.7em;
				margin-right: 9px;
				background: white;
				@media screen and ($max-mobile-viewport) {
					width: 9rem;
				}
			}
			button {
				border-radius: 5px;
				position: absolute;
				border: 0;
				top: 25px;
				right: 5px;
				width: 60px;
				text-align: center;
				margin: 0;
				background: #1a1a1a;
				color: white;
				font-size: 1.75rem;
				&::after {
					content: "\f054";  // chevron-right
					font-family: FontAwesome;
					position: relative;
					top: 5px;
				}
				@media screen and ($max-mobile-viewport) {
					top: 15px;
					font-size: 1.25rem;
					height: 50px;
					width: 50px;
					&::after {
						top: 3px;
					}
				}
			}
		}
		p {
			width: 50%;
			float: right;
			margin-right: 50px;
			font-size: 0.9rem;
			padding-top: 10px;
			@media screen and ($max-mobile-viewport) {
				width: auto;
				float: none;
				margin: 0 1rem;
				font-size: 80%;
			}
		}
		br {
			clear: both;
		}
	}

	div.textcell {
		h2 {
			text-transform: uppercase;
			margin-bottom: 0;
			letter-spacing: 4px;
			font-size: 1.3rem;
			font-weight: 900;
		}
		h3 {
			text-transform: uppercase;
			margin-bottom: 0;
			margin-top: 0;
			font-size: 0.8rem;
			letter-spacing: 4px;
		}
		padding-bottom: 30px;
		background: url(/static/lille/img/fleches-bas.png) bottom center no-repeat;
		margin-bottom: 20px;
	}
}

#columns-wrapper {
	margin-top: 1rem;
}

.page-template-homepage {
	#columns-wrapper {
		margin-top: 0rem;
		min-height: 80vh;
		@media screen and ($max-mobile-viewport) {
			padding: 0;
			min-height: auto;
		}
	}
	.column {
		float: left;
		width: 33%;
		@media screen and ($max-mobile-viewport) {
			float: none;
			width: 100%;
			.cell {
				margin-right: 0;
				margin-left: 0;
			}
		}
	}
}

#footer {
	div.menucell {
		margin-top: -2rem;
		background: $primary-color;
		a {
			color: white;
			padding: 1rem;
			text-transform: uppercase;
			font-size: 0.7rem;
			&:hover {
				text-decoration: underline;
			}
		}
	}
}

div#content div.wcsformsofcategorycell {
	position: relative;
	margin-bottom: 25px;
	@media screen and ($max-mobile-viewport) {
		margin: 0px;
		border-bottom: 3px solid white;
	}
	h2 {
		position: relative;
		z-index: 10;
		background: transparent;
		color: white;
		font-weight: bold;
		text-transform: uppercase;
		padding-top: 40px;
		height: 130px;
		&::after {
			content: "";
			height: 3px;
			width: 45px;
			left: 1rem;
			margin-top: 10px;
			background: white;
			display: block;
		}
	}
	&.foldable {
		@media screen and ($max-mobile-viewport) {
			h2 {
				padding-right: 50px;  // for folding arrow
			}
		}
		h2::before {
			// folding moved to ::before as ::after is used for
			// underline dash.
			font-family: FontAwesome;
			content: "\f106";  // angle-up
			font-size: 1.5rem;
			position: absolute;
			right: 1em;
			cursor: pointer;
		}
		&.folded h2::before {
			content: "\f107";  // angle-down
		}
	}
	&.folded picture,
	picture {
		display: block;
		position: absolute;
		top: 0;
		width: 100%;
		height: 130px;
		overflow: hidden;
		img {
			padding: 0;
		}
	}
	div.intro, div.description {
		display: none;
	}
	ul > li {
		a {
			background-position: 10px 50%;
			background-repeat: no-repeat;
			background-size: 48px 48px;
		}
		@each $form-picto-keyword in $form-picto-keywords {
			&.keyword-#{$form-picto-keyword} a {
				background-image: url(/assets/picto:#{$form-picto-keyword});
			}
		}
	}
	ul > li a {
		padding-left: 70px;
		text-transform: uppercase;
		color: #454545;
		font-size: 0.7rem;
		font-weight: bold;
	}
	ul > .add-more-items a {
		padding-left: 0;
	}
	background: transparent;
	border: none;
	& > div > div {
		position: relative;
		margin: -10px 1rem 0 1rem;
		li {
			border-radius: 10px;
			background: white;
			margin-bottom: 10px;
			a {
				border-radius: 10px;
				border: none;
			}
		}
	}
}

div#page div#main-content-wrapper {
	padding-bottom: 50px;
}

footer {
	position: relative;
	z-index: 100;
}

.page-template-homepage div.cell#filtre-profil {
	border: none;
	background: transparent;
	@media screen and ($max-mobile-viewport) {
		margin: 1rem;
	}
	label {
		display: block;
		font-weight: bold;
		font-size: 80%;
	}
	select {
		border-color: $primary-color;
		width: 100%;
		border-radius: 5px;
		background-color: inherit;
		color: #666;
		font-style: italic;
		background-image: url($data_uri_arrow-down-colour);
		font-weight: bold;
		&.selected {
			color: $primary-color;
			text-transform: uppercase;
			font-style: normal;
		}
	}
}

div#title-section {
	h1 {
		margin-bottom: 1rem;
		text-transform: uppercase;
		@media screen and ($max-mobile-viewport) {
			font-size: 1.4rem;
		}
		&::after {
			content: "";
			height: 3px;
			width: 55px;
			margin-top: 10px;
			background: $primary-color;
			display: block;
		}

	}
}

div#rub_service div#tracking-code {
	background: url($data_uri_codebarre) 0px 0px no-repeat;
	background-size: 40px 40px;
	h3, a {
		background: transparent;
		display: inline-block;
		font-size: $font-size;
		border: none;
		text-transform: uppercase;
		padding-top: 5px;
	}
	h3 {
		padding-left: 50px;
		padding-right: 10px;
		&::after {
			content: none;
		}
	}
}

#steps {
	ol {
		margin: 0;
		padding: 0;
		list-style: none;
		position: relative;
		overflow: hidden;
		text-align: left;
		display: flex;
		li {
			position: relative;
			&.step-before {
				flex: 0;
			}
			white-space: nowrap;
			border-radius: 0;
			border: none;
			padding: 0;
			height: 48px;
			background: $steps-background;
			&.step-after {
				background: darken($steps-background, 10%);
			}
			flex: 1;
			text-align: left;
			.marker {
				text-align: center;
				display: inline-block;
				padding: 0;
				width: 48px;
				height: 48px;
				line-height: 48px;
				color: white;
				border: none;
				background: transparent;
				z-index: 100;
				position: relative;
				font-weight: bold;
				font-size: 1.2rem;
				border-right: 2px solid white;
				border-radius: none;
				&::after {
					content: "";
					width: 0px;
					height: 0px;
					display: block;
					background: transparent;
					position: absolute;
					right: -20px;
					top: 14px;
					border: 10px solid white;
					border-color: transparent transparent transparent white;
				}
			}
			.total {
				display: none;
			}
			&.current {
				padding-left: 10px;
				background: $steps-background;
				.marker {
					background: white;
					color: black;
				}
				.label {
					font-weight: normal;
				}
			}
			.label {
				text-transform: uppercase;
				font-weight: normal;
				padding-top: 10px;
				display: inline-block;
				font-weight: normal;
				color: white;
				padding-left: 20px;
				padding-right: 1rem;
			}
		}
		&::before {
			content: '';
			display: block;
			position: absolute;
			top: 26px;
			width: 100%;
			height: 3px;
			background: #4d4d55;
		}
	}
	&.steps-10, &.steps-11, &.steps-12, &.steps-13, &.steps-14, &.steps-15,
	&.steps-16, &.steps-17, &.steps-18, &.steps-19, &.steps-20, &.steps-21 {
		ol {
			li {
				.label {
					display: none;
				}
				&.current {
					.label {
						display: inline-block;
					}
				}
			}
		}
	}
	@media screen and ($max-mobile-viewport) {
		margin: 0 -1ex;
		width: auto;
		ol {
			.step-before, .step-after {
				display: none;
			}
			.current {
				.marker {
					border-radius: 0;
					background: transparent;
					color: white;
					width: auto;
					min-width: 2rem;
				}
				.total {
					padding-left: 16px;
					display: inline-block;
					color: black;
					font-size: 1.2rem;
				}
				.label {
					font-size: 1.2rem;
				}
			}
		}
	}
}

input, input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="tel"], input[type="number"], input[type="search"], input[type="file"], input[type="date"], input[type="datetime-local"], input[type="month"], input[type="time"], input[type="week"], textarea, select {
	padding-top: 1.2ex;
	padding-bottom: 1.2ex;
}

form.quixote div.buttons div.previous-button {
	float: left;
}

form.quixote div.buttons div.cancel-button {
	float: right;
	margin-right: 0;
	button {
		border: 2px solid #b4b4b4;
		background: transparent;
		color: #b4b4b4;
		box-shadow: none;
	}
}

#messages li,
div.warningnotice,
div.errornotice {
	&::before {
		color: $primary-color;
	}
}

#messages li.success,
#messages li.info,
div.infonotice,
div.successnotice {
	&::before {
		color: #464646;
	}
}

ul#evolutions,
div.gru-content #disclose-dataview,
div#receipt-intro {
	margin: 1em 0;
}

div#rub_service div.dataview, div#rub_service dl#evolutions, div#rub_service form {
	padding: 0;
}

div#rub_service div.dataview {
	margin-top: 1rem;
	font-size: 90%;
}

.form-content--title,
div#rub_service h2 {
	padding-left: 0;
}

div.gru-content div#rub_service h3,
div#rub_service h3 {
	@extend %title;
	padding-left: 0;
	text-transform: uppercase;
}

div.datetimepicker {
	font-size: 0.8rem;
}

form.quixote {
	div.error {
		padding-left: 0;
		background-image: none;
		font-weight: normal;
		&::before {
			content: "\f06a";
			font-family: FontAwesome;
			padding-right: 1ex;
		}
	}
}

div.textcell h1 {
	@extend %title;
	font-size: 2rem;
	padding-left: 0;
}

body.authentic-page {
	$neutral-color: #5a5a5a;
	header {
		background: transparent;
	}
	#nav button {
		background: transparent;
		display: none;
	}
	div.gru-nav .gru-nav-button + ul li.selected > a, div.gru-nav .gru-nav-button + ul li:hover > a {
		background: #464646;
	}
	#header #top a {
		pointer-events: none;
		background: #464646;
		padding-top: 60px;
		&::after {
			border-color: #464646 #464646 transparent transparent;
		}
	}
	#lille-user-info {
		display: none;
	}
	#pwa-navigation {
		& > div {
			background: #464646;
			margin-top: 55px;
			height: 5px;
		}
		@media screen and ($max-mobile-viewport) {
			display: none;
		}
	}
	#pwa-navigation ul {
		visibility: hidden;
	}
	.gru-content {
		button {
			border-color: $neutral-color;
			background: $neutral-color;
			&:hover {
				background: $neutral-color;
			}
		}
		a {
			color: $neutral-color;
			border-bottom: 1px dotted $neutral-color;
		}
		div#account-management ul > li > a {
			color: $neutral-color;
		}
		div.a2-block h2, div.block h2 {
			&::after {
				background: $neutral-color;
			}
		}
	}
	#footer div.menucell {
		background: #464646;
	}
}

footer {
	.grid-footer-1-5 {
		width: calc(20% - 1rem);
		padding-right: 0;
		padding-left: 1rem;
		text-align: center;
		img {
			max-width: 90%;
		}
		@media screen and ($max-mobile-viewport) {
			width: 50%;
		}
		@media screen and (max-width: $very-small-limit) {
			width: 100%;
			padding-left: 0;
		}
	}
}
