/* base.less
*
* Notes:
*	- Thank you to The Less Core Team for the use of Less.js.
*/

/***** imports */
@import "fonts";
@import "constants";
@import "colours";

/** css **/
body {
	font-family: Roboto;
	font-size: @l-text;
	line-height: @line-height;

	background-color: @background-colour;
	color: @secondary-colour;
}

header {
	padding: @double-margin 0 @double-margin 0;	
	font-size: @m-text;
	color: @tertiary-colour;

	h1 {
		font-style: normal;
		font-size: @xxxxxxl-text;
		font-weight: @bold;
		padding: 0;
		margin: 0;
		line-height: 1.1;
		color: @primary-colour;
	}

	h2 {
		padding: 0 0 0 @quarter-margin;
		margin: 0;
		font-size: @xxl-text;
		color: @secondary-colour;
		
		span {
			margin-left: @half-margin;
			font-size: @m-text;
		}
	}

	img {
		max-width: 100%;
		max-height: 170px;
	}
}

nav {
	text-align: center;
	padding: @margin 0;	
	background-color: @background-colour;

	ul {
		display: inline-table;
		li {
			display: inline;
			text-align: center;		
			min-width: 120px;		
		}
	}

	.nav-link {	
		text-transform: uppercase;
		color: @primary-colour !important;
		border: none;
		margin: @half-margin;

		&:focus {
			color: @secondary-colour !important;
		}

		&:hover {
			color: @secondary-colour !important;
		}	

		&-selected {
			color: @tertiary-colour !important;
		}
		
	}	
}

section {
	padding: @quadruple-margin 0;

	a {
		text-decoration: underline;
		text-decoration-style: dotted;
		color: @primary-colour
	}

	a:hover {
		text-decoration: underline;
		text-decoration-style: solid;
		cursor: pointer;
	}

	h1 {
		font-size: @xxxl-text;
		font-weight: @bold;
		margin: @margin 0;
		color: @primary-colour;
	}

	h2 {
		font-size: @xxl-text;
		font-weight: @bold;
		margin: @margin 0 @half-margin 0;
		color: @primary-colour;

		span {
			margin-right: @margin;
			color: @tertiary-colour;
		}
	}

	h3 {
		font-size: @xl-text;
		font-weight: @bold;
		margin: @double-margin 0 @half-margin 0;
		color: @primary-colour;

		span {
			color: @tertiary-colour;

			&:nth-child(1) {
				margin-right: @margin;
			}

			&:nth-child(2) {
				margin-left: @margin;
			}
		}
	}


	h4 {
		font-size: @l-text;
		font-weight: @bold;
		margin: @margin 0 @half-margin 0;
	}

	h5 {
		font-size: @l-text;
		font-weight: @bold;
		margin: @margin 0 @half-margin 0;
		vertical-align: middle;

		&::before {
			content: "||";
			font-size: @s-text;
			margin-right: @margin;
			color: @tertiary-colour;
		}
	}

	ul {
		list-style: greater;
		list-style-position: outside;

		li {
			margin-left: @one-half-margin;
			margin-bottom: @half-margin;	
			color: @secondary-colour;	

			&::marker {
				color: @tertiary-colour;	
				font-size: @s-text;
				padding-right: @margin;
			}
		}
	}	

	@counter-style greater {
		system: cyclic;
		symbols: "\003e";
		suffix: " ";
		pad: "" 0;
	}

	.subsection {
		margin: @triple-margin 0;
		img {		
			max-width: 300px;
			margin-bottom: @half-margin;
		}

		p {
			font-size: @s-text;		
		}

		.full-width {
			max-width: 100%; 
		}
	}
	
	.image-row {
		padding: 0;
		margin-left: auto;
		margin-right: auto;
		
		img {
  			vertical-align: middle;
		}
	}

	.image-row + p {
		font-size: @s-text;
	}
}

.overlay {
	display: flex;
	visibility: hidden;
	z-index: 1051;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	outline: 0;
	background: @background-w-alpha-colour;

    .overlay-container {
        border: none;
        -moz-border-radius: @border-radius;
        -webkit-border-radius: @border-radius;
        border-radius: @border-radius;
        -khtml-border-radius: @border-radius;
        z-index: 1052;
        background-color: @background-colour;
		margin: @double-margin 0;

        .overlay-content {
        	img {
        		max-width:100%;
        	}
        	
			header {
				padding: 0;
				margin-top: @triple-margin;				
			}
        }
		
		section {
			h1 {
				text-align: center;
			}
		}

        .modal-footer {
            background: @background-dark-colour;
            padding: 0 @margin;
        }
    }
}

/**
    .has-scrollable-child:
    Forms can surround a scrollable AND a button bar. This is so the button in button bar can be the submit button without extra Javascript.
    'flex: 1' is used to fill the space in 'main'. If I remove this, this still works in Firefox but not Chrome, so I have left it in.
    '.has-scrollable-child' needs to be its own flex container and allow '.scrollable' child to fill the space with its 'flex: 1'.
    'min-height: 0px' is here for the same reason as 'main'
*/
.has-scrollable-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0px;
    margin-bottom: 0px;
}

/**
    .scrollable:
    Fills up available space - requires 'display: flex' and 'flex-direction: column' by parent.
    Becomes scrollable when filled with content .
*/
.scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.bg-dark {
	background: @background-dark-colour !important;
}

.shadowed {
	box-shadow: 0 0px 25px -16px @background-shadow-colour;
	transition: box-shadow 0.2s ease-in;
	&-lite {
		box-shadow: 0 0px 22px -16px @background-shadow-colour;	
	}
}

.unshadowed {
	box-shadow: none;
	transition: box-shadow 0.2s ease-in;
}

.sticky-top {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.clearfix::after { 
   content: " ";
   display: block; 
   height: 0; 
   clear: both;
}

.hidden {
    opacity: 0;
    transition: opacity 0.2s ease-in;
}

.visible {
    opacity: 1;
	transition: opacity 0.2s ease-in;
}

.button {
	font-weight: @bold;
	font-size: @s-text;
	cursor: pointer;
	padding: @half-margin @half-margin;
	margin: @margin @half-margin;
	text-decoration: none;	
	text-align: center;
	border: none;
	color: @primary-colour;

	&:focus {
		text-decoration: none;
		color: @secondary-colour;
	}

	&:hover {
		text-decoration: none;
		color: @secondary-colour;
	}

	&:-selected {
	}

	&-img {	
		margin: 0;
		padding: 0;
		text-decoration: none;	

		img {
			-moz-border-radius: @border-radius;
	        -webkit-border-radius: @border-radius;
        	border-radius: @border-radius;
        	-khtml-border-radius: @border-radius;
			padding: @quarter-margin;
			max-width: 175px;
		}	

		&:hover {
			img {
				opacity: 0.9;
			}
		}
	}

	&-img:hover {
		text-decoration: none;
	}

	&-large {
		font-size: @xl-text;
	}

	&-white {
		background: white;
	}

	&-circular {
		border-radius: 50%;
		padding: 0.5em;
		width: 55px;
		height: 55px;
  		line-height: 0em;
	}

	&-close {
		display: inline-block;
		content: "\00d7"; /* This will render the 'X' */
	}

	&-equal-margin {
		margin: @double-margin;
	}
}

.floating-right {
	position: fixed;
	top: 0px;
	right: 0px;
	z-index: 2000;
}

button:hover {
	cursor: pointer;
}

.circle-image {
	-moz-border-radius: @circle-border-radius;
    -webkit-border-radius: @circle-border-radius;
    border-radius: @circle-border-radius;
    -khtml-border-radius: @circle-border-radius;
}

.bordered {
	border-width: @circle-image-border-size;
	border-style: solid;
	border-color: @primary-colour;
}

strong {
	font-weight: @bold;
}

em, i {
	font-style: italic;
}

p {
	margin-bottom: @margin;
}

.fullscreen-container {
	margin: 0 @margin;
}

.center {
	text-align: center;
}

.side {
	display: inline-block;
	float: left;
	width: 50%;
	margin: 0;
	padding: 0;
}

.right-align {
	float: right;
}

.no-top-margin {
	margin-top: 0;
}

.left-overlay {
	position: fixed;
}

.b-background-alpha {
	background: @background-w-alpha-colour;
}

/** 
 * responsive breakpoints (copied from bootstrap.css) 
 * This is at the bottom so it takes priority.
 * Ordering is key especially when using 'max-width'; 
 * if biggest 'UP TO' statement is at bottom, that will erroneously override smaller widths.
**/
/** UP TO 'lg' **/
@media (max-width: 991px) {
	header {
		h1 {
			font-size: @xxxxxl-text;
		}
	}
}

/** UP TO 'md' **/
@media (max-width: 767px) {
	header {
		img {
			margin-top: @double-margin;
		}
	}

	.overlay {
		.overlay-container {
    		margin: @margin;
		}
	}
}

/** UP TO 'sm' ('sm' breakpoint at 576px) **/
@media (max-width: 575px) {
	nav { 
		padding-top: @half-margin;
		padding-bottom: @half-margin;
		ul li {
			display: block;
			margin: @half-margin 0;
		}
	}

	header {		
		h1 {
			font-size: @xxxxl-text;
		}
		h2 {
			font-size: @xl-text;
		}
	}	
}

/** UP TO midway between 'xs' and 'sm' ('sm' breakpoint at 576px) **/
@media (max-width: 406px) {
	header {
		h1 {
			font-size: @xxxl-text;
		}
		h2 {
			font-size: @l-text;
		}
	}
}


/** FROM 'md' UPWARDS **/
@media (min-width: 768px) {
	header {
		padding-top: 140px;
	}
	#modal {
		.overlay-container {
			max-width: 750px;
			
			.overlay-content {
				.container {
        			max-width: 600px;
        		}
			}
		}
	}
}