/* general stuff */

%cell {
	overflow: visible;
}

a {
	transition: color 200ms ease-out;
}

// Steps
.wcs-steps {
	@media ($max-mobile-viewport) {
		background: #fbfbfb;
		padding-left: $wcs-steps-spacing;
	}
}
.wcs-step {
	&--marker {
		@include desktop-vertical-steps() {
			font-size: 1.2em;
		}
	}
}

div#content div.fileinfo a.remove {
	text-indent: 0;
	background: none;
	color: transparent;
}

div.fileinfo a.remove:before {
	font-family: FontAwesome;
	content: "\f057";
	color: $button-background;
}

/* layout */

html {
	background: #ece6e0;
}

body {
  overflow-x: hidden;
  background: #ece6e0 url(bg-page.png) 0 -200px repeat-x;
}

div#page {
  width: 100%;
  max-width: none;
}

div#header {
  max-width: none;
  background: white url("header-agglo.jpg") no-repeat scroll calc((100vw - 1000px) / 2) 0px;
  width: 100%;
  margin: 0 0 0 0;
  position: absolute;
  top: 0px;
  z-index: 0;
  padding: 0;
}

div#top {
  height: 456px;
  width: 100%;
  max-width: calc(1000px + 1px);
  margin: 0 auto 0 auto;
  background: url(logo.png) top left no-repeat;
}

div#top > a {
  padding-top: 30px;
  display: block;
  text-indent: -1000px;
  padding-bottom: 140px;
}


#logo h1 {
  width: 10em;
  text-align: center;
  padding-top: 3em;
  padding-left: 2em;
  margin-left: 20px;
  font-size: 120%;
  font-weight: bold;
}

#logo a {
  color: white;
  text-shadow: #6374AB 0px 0px 3px;
}

div#top a img {
    position: relative;
    z-index: 0;
    border: 0;
}

div#main-content-wrapper {
  position: relative;
  z-index: 100;
  max-width: 1000px;
  width: 100%;
  margin: 200px auto 0px auto;
}

div#main-content {
  margin: 0;
  min-height: 300px;
  clear: both;
}

div#footer {
  clear: both;
  background: white url(background_footer.png) no-repeat top right;
  padding: 0px;
  max-width: 1000px;
  width: 96%;
  width: calc(100% - 30px);
  min-height: 160px;
  margin: 10px auto 0 auto;
  position: relative;
}

p#legal {
  clear: both;
  font-size: small;
  color: #444;
  margin: 0;
  bottom: 0px;
  padding-left: 20px;
  padding-bottom: 10px;
  position: absolute;
}

#content {
  position: relative;
  margin:0;
}

div#content a:hover {
  text-decoration: underline;
}

/* for templates/combo/wcs/form_categories.html
 * and  templates/combo/wcs/current_forms.html
 */
div.wcscurrentformscell p,
div.categoriescell p {
	padding: 1ex;
}

div.categoriescell p select {
	width: 100%;
	max-width: 100%;
}

div.categoriescell h3 {
	@extend %title;
}

div#content .categoriescell h3 a {
	color: inherit;
}

div.categoriescell h3 {
	clear: both;
}

div.categoriescell ul > li {
	width: 49%;
	float: left;
	margin: 0 0.5%;
}

div.categoriescell ul > li li {
	width: auto;
	float: none;
}

/* for templates/blurps/tipi.html
 * and templates/blurps/compte_lecteur.html
 */

div.blurpcell p {
	padding: 1ex;
}

/* profile edit page */
h2.single-title {
	@extend %title;
}

/* Base templates */

body.narrow-page div.a2-block {
	padding: 0;
	margin: 0;
}

body.narrow-page #main-content form div input {
  display: block;
  margin-bottom: 2ex;
}

div#welcome {
  text-align: justify;
  margin: 0 1em;
}

div#welcome h2 {
  text-align: center;
  margin: 1ex 0;
}

span.helptext {
  color: #666;
}

body.narrow-page div.right {
  max-width: 35em;
  margin: 1ex auto;
}

body.narrow-page div.right form {
  border: 1px solid #ea5b0c;
  padding: 1em;
}

body.narrow-page div.right form div label {
  font-weight: bold;
  display: block;
}

body.narrow-page div.right form div.form-field-required label:after {
  content: "";
}

div.login-actions {
  margin: 2em 0 0 1em;
}

/* logout page */

ul.logout-list {
	position: relative;
	padding-left: 3em;
	& div {
		margin: 1ex 0;
		& img {
			position: absolute;
			left: 1ex;
		}
	}
}

/* ... */

.region-header {
  width: 100%;
  max-width: 1000px;
  position: absolute;
  top: 0px;
}

#toplinks {
	background: transparent;
	position: relative;
	float: right;
	padding: 5px 5px 5px 5px;
}

#toplinks span,
#toplinks a {
	background-color: white;
}

#toplinks span.connected-user {
        display: inline-block;
	position: relative;
	z-index: 100;
}

#toplinks span.login,
#toplinks a.logout {
        display: inline-block;
	margin: 0;
	padding: 0;
        padding-right: 1ex;
	color: #888;
        min-width: 10em;
	background: white url(button_connexion.gif) left center no-repeat;
        padding-left: 30px;
	border: 1px solid #e9e9e9;
	line-height: 20px;
	height: 22px;
}

#toplinks a {
	color: #888;
	border: 1px solid transparent;
}

#toplinks a.logout {
        padding-left: 30px;
}

#toplinks a:hover {
	text-decoration: none;
	color: #222;
}

#toplinks a.restricted {
	color: white;
	float: right;
	padding: 0 1ex;
	border: 1px outset #888;
	background: #ea5b0c;
}

ul.newsList {
  list-style: none;
}

ul.newsList li.abonne {
  margin: 0;
  padding: 0;
}

.abonne {
  padding-left: 20px;
  background: transparent url(Validation.png) center left no-repeat;
}

.nonAbonne {
  padding-left: 20px;
  background: transparent url(Annulation.png) center left no-repeat;
}

/* forms error reporting */

.passerelle-register-plugin input + label {
  background: transparent url(Annulation.png) center left no-repeat;
}

.passerelle-register-plugin input:checked + label {
  background: transparent url(Validation.png) center left no-repeat;
}

.passerelle-register-plugin td input {
  display: none
}
.passerelle-register-plugin td label {
  padding-left: 2em;
}

div.block form, div.cell form {
  padding: 0 1ex;
}

table.announces {
  width: 100%;
  margin-bottom: 1em;
}

table.announces thead td {
  font-weight: bold;
}

table.announces thead th {
  width: 30%;
}

table.announces tbody td {
  text-align: center;
}

table.announces tbody th {
  width: 35%;
  text-align: left;
  font-weight: normal;
}

#agglolinks {
        position: absolute;
        right: 0;
        top: -140px;
}

#agglolinks > a, #agglolinks > span > a {
        width: 130px;
}

#agglolinks a, #agglolinks span {
        display: inline-block;
        margin-left: 10px;
        color: white;
        text-transform: uppercase;
        text-align: center;
        padding: 5px 5px;
        font-size: 1.231rem;
}

#agglolinks a.agglo-mon-agglo, #agglolinks a.agglo-mes-e-services {
        background: #ea5b0c;
}

#agglolinks a.agglo-connaitre {
        background: #d90024;
}

#agglolinks a.agglo-vivre {
        background: #1f4791;
}

#agglolinks a.agglo-entreprendre {
        background: #a3d117;
}

#agglolinks span.agglo-mes-e-services > a {
        background: #ea5b0c;
        width: 150px;
}

/* Main menu */
div#nav {
  font-size: 130%;
  margin-top: 0;
  text-transform: uppercase;
  ul {
    margin-top: 0;
  }
}

div#nav > ul > li {
	margin-right: 5px;
}

div#nav ul > li > a {
  font-weight: normal;
  padding: 5px 10px;
}

/* pied de page */
#footer-menu {
  display: block;
  padding: 20px 0 0 20px;
  max-width: 435px;
  width: 100%;
  width: calc(100% - 20px);
  list-style: none;
  margin: 0;
  text-align: left;
}

.footer-menu-leaf {
  display: inline;
  margin: 0;
  padding: 0;
  margin-right: 20px;
  padding-bottom: 20px;
  float: left;
}

.footer-menu-leaf-link, .footer-menu-leaf-link:hover {
  display: block;
  width: 125px;
  height: 26px;
  line-height: 26px;
  background: #6A408E;
  text-align: center;
  text-transform: uppercase;
  color: white;
  text-decoration: none;
  font-size: 1.077rem;
}

ul.show-user-feeds li {
  list-style: none;
  background: url(mediathk.png) left center no-repeat;
  min-height: 30px;
  padding-left: 30px;
  padding-bottom: 4px;
}

ul.show-user-feeds li.aquarium { background-image: url(aquarium.png); }
ul.show-user-feeds li.conservatoire { background-image: url(conservatoire.png); }
ul.show-user-feeds li.ecolothk { background-image: url(ecolothk.png); }
ul.show-user-feeds li.facebook { background-image: url(facebook.png); }
ul.show-user-feeds li.lattara { background-image: url(lattara.png); }
ul.show-user-feeds li.mediathk { background-image: url(mediathk.png); }
ul.show-user-feeds li.opendata { background-image: url(opendata.png); }
ul.show-user-feeds li.planet { background-image: url(planet.png); }

#id_new_password1_help_text, #id_password1_help_text {
  font-style: italic;
  font-size: 90%;
  color: red;
}

/* saml post page */
.post-redirect {
  background: white;
}

/* django.contrib.messages */

#messages {
	position: absolute;
	left: 200px;
	top: -80px;
	@media screen and ($max-mobile-viewport) {
		position: static;
	}
	& ul {
		& li {
			color: white;
			display: inline-block;
			border: 1px solid #444;
			&.warning {
				background: #EBC90C;
				color: inherit;
			}
			&.error {
				background: #DB1F28;
			}
			&.info {
				background: white;
				color: inherit;
			}
		}
	}
}


.categories-agglo ul li:first-child, ul.demarches-agglo li:first-child {
    background: none;
    text-transform: uppercase;
    font-weight: bold;
    border-left: 5px solid #F68423;
    box-sizing: border-box;
}

.categories-agglo ul ul li:first-child, ul.demarches-agglo ul li:first-child,
.categories-agglo ul ul li, ul.demarches-agglo ul li li {
	text-transform: none;
	font-weight: normal;
	border: 0;
}

/* idp styles */

body.narrow-page #main-content form div input#id_email_1 {
    margin-left: 14em;
}

div#login-actions .actions, div#login-actions .actions form {
    display: inline;
}

div#login-actions .actions form {
    margin: 0 .5em;
}

#profile dt {
    font-weight: bold;
}

#profile dl {
    margin: 0 1em;
}

#federation-management li {
    list-style-type: none;
    margin: 5px 0;
}

#federation-management li span.name {
    float: left;
    width: 20em;
}

#federation-management li button {
    background: #ea5b0c;
    border: none;
    color: #fff;
}

/* bits of responsive design */

@media screen and (max-width: 760px) {
	body.narrow-page div.right form div input {
		width: 95%;
	}
	body.narrow-page div.right form button {
		display: none;
	}
	.column {
		width: auto;
		float: none;
	}
}


@media screen and (max-width: 990px) {
	div#toplinks {
		text-align: right;
	}
	div.region-header {
		width: 100%;
	}
	div#header {
		width: calc(100% - 30px);
		margin-left: 30px;
		z-index: 10;
	}
	div#main-content-wrapper {
		width: calc(100% - 30px);
	}
	div#menu.toggled {
		width: 15em;
		background: #eee url(logo-m3m-50p.png) no-repeat 50% 98%;
	}

	#agglolinks > a, #agglolinks > span > a {
		display: block;
		margin-right: 10px;
		margin-bottom: 3px;
	}
}

@media screen and ($max-mobile-viewport) {
	div.gru-nav .gru-nav-button + ul {
		top: -17px;
		box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.26), 0px 2px 10px 0px rgba(0, 0, 0, 0.22);
	}
	div.gru-nav .gru-nav-button + ul li {
		margin-right: 0;
	}
	div.gru-nav .gru-nav-button + ul a {
		color: white;
	}
	div.gru-nav .gru-nav-button {
		top: 0px;
		left: 0;
		box-shadow: 0 0 4px rgba(0, 0, 0, 0.76);
	}
	div.gru-nav.toggled .gru-nav-button {
		box-shadow: none;
	}
	div.gru-nav .gru-nav-button + ul {
		background: #eee url(logo-m3m-50p.png) no-repeat 50% 128%;
		transition: all 0.25s ease;
	}
	div.gru-nav.toggled .gru-nav-button + ul {
		background-position: 50% 78%;
	}
	body {
		border-left: none;
	}
}

@media screen and ($max-mobile-viewport) {
	/* limit display to those with the mobile keyword */
	div.categoriescell li,
	#services > ul > li,
	#services > ul > li li {
		&:not([data-keywords~=mobile]) {
			display: none;
		}
	}
}

div.categories-list ul ul {
	@include vendor-prefix('column-count', '1');
	border: 5px solid #97BF0D;
	border-width: 0 5px;
	margin-left: -5px;
}

div.categories-list {
	ul ul {
		position: absolute;
		left: 0;
		background: white;
		width: 100%;
		z-index: -10;
		opacity: 0;
	}
	li.on > a {
		box-shadow: 0 0 5px #777;
		background: #eee;
	}
	li.on ul {
		z-index: 10;
		opacity: 1;
		box-shadow: 0 0 5px #777;
	}
}

@media screen and ($max-mobile-viewport) {
	#content div.categories-list {
		& > ul > li {
			background: white;
			padding-top: 2px;
		}
		& > ul > li > a {
			font-size: 110%;
		}
	}
}

@media screen and (max-width: 500px) {
	div.categoriescell ul > li {
		width: auto;
		float: none;
	}
}

div#fc-button img {
	max-width: 80%;
}

.categories-list > ul > li > a:before {
	content: " ";
	position: fixed;
	top: 0;
	left: 0;
	background: rgba(255, 255, 255, 0);
}

.categories-list > ul > li.on > a:before {
	background: rgba(255, 255, 255, 0.9);
	z-index: 1;
	width: 100%;
	height: 100%;
}

div.categoriescell ul {
	z-index: auto;
}

div.a2-block input,
div.a2-block select,
div.a2-block textarea {
	max-width: 100%;
}

div#home-page-intro {
	background: white;
	padding: 0.5ex 0;
	margin-bottom: 1ex;
}

p.chapeau {
	background: white;
	padding: 1em;
}

div.a2-block {
	max-width: none;
}

div#welcome h3 {
	text-align: center;
	font-size: 150%;
}

/* it's not possible to use :after here as it's already overloaded to be used
 * for the category>formdef overlay; so we cancel :after and use a simple
 * background image.
 */
li.required-authentication a:after {
	content: "";
}

li.required-authentication a {
	background-image: url(cle.png);
	background-repeat: no-repeat;
	background-position: 98% 50%;
}

#publik-portal-agent {
	display: none;
}

div.textbreak {
	margin-top: 30px;
	margin-bottom: 20px;
	width: 100%;
	height: 9px;
	border-bottom: 1px solid grey;
	text-align: center;

	span {
		font-size: 1.231rem;
		background-color: white;
		padding: 0 10px;
	}
}

div#registration-blocks,
div#login-blocks {
	margin: 0 auto;
	&:after {
		content: "";
		clear: both;
	}
	padding-bottom: 3em;
}

div#registration-blocks > div,
div#login-blocks > div {
	border-radius: 2px;
	box-shadow: 0 0 2px 2px #ddd;
	width: 40%;
	margin: 0;
	margin-bottom: 3em;
	padding: 2ex;
	float: left;
	&:nth-child(1) {
		margin-left: 7%;
		margin-right: 3%;
	}
	&:nth-child(2) {
		margin-left: 3%;
		margin-right: 6%;
	}
	@media screen and ($max-mobile-viewport) {
		width: 100%;
		margin: 1em 0 !important;
	}
	p {
		margin: 1ex 0;
	}
}

body.authentic-page {
	background: #ece6e0;
	div#nav {
		visibility: hidden;
	}
	div#top,
	div#header,
	div#footer {
		background: transparent;
		min-height: auto;
		height: auto;
	}
	div#header {
		position: absolute;
		z-index: 100000;
		div#top {
			position: relative;
		}
	}
	div#top > a {
		display: none;
	}
	div#page {
		display: block;
	}
	div#main-content-wrapper {
		margin-top: 10px;
		@media screen and ($max-mobile-viewport) {
			margin-top: 0;
			div#nav {
				margin-bottom: 0;
			}
		}
	}
	div#main-content {
		background: white;
		box-shadow: 0 0 2px 2px #ccc;
		padding: 1em;
	}
	.region-header {
		top: 10px;
		right: 0;
		display: inline-block;
		width: auto;
		#toplinks a.account-link {
			display: none;
		}
		@media screen and ($max-mobile-viewport) {
			top: 0;
		}
	}
	div#welcome h3 {
		padding: 0;
		margin-bottom: 2em;
	}
	div.a2-block form button,
	div.a2-block form input[type=submit] {
		min-width: 0;
	}
	div#messages {
		position: static;
	}
	div#messages ul li {
		display: block;
	}
	input[type=submit],
	button {
		background: #515151;
		&:hover {
			background: #515151;
		}
	}
	a {
		color: #515151;
		border-bottom: 1px dotted #515151;
	}
	li a {
		border-bottom: none;
	}
	div#account-management ul > li > a {
		color: #515151;
	}
	.gru-content div.a2-block h2, .gru-content div.block h2 {
		background: #515151;
	}
}

div.a2-block {
	margin: 0;
}

div.a2-block > div.a2-block,
div.a2-block > div.password-reset-form,
div.a2-block > p,
div.a2-block > form {
	max-width: 40em;
	margin: 1em auto;
}

div.realisation {
	float: left;
	padding-top: 20px;
	@media screen and ($max-mobile-viewport) {
		display: none;
	}
}

div.service-propose-par-3m {
	text-align: right;
	background: transparent url(logo-m3m-50p.png) no-repeat top right;
	min-height: 100px;
	padding-top: 20px;
	padding-right: 100px;
}

div#registration-blocks div#fc-button,
div#login-blocks div#fc-button {
	border: none;
	box-shadow: none;
	padding: 0;
	max-width: 300px;
	width: 100%;
	&:hover {
		background: inherit;
	}
	a {
		transition: all ease 0.2s;
		&:hover {
			opacity: 0.8;
		}
	}
}

p#help {
	text-align: right;
	margin-bottom: 0;
}
