@import 'bourbon'; // http://bourbon.io/

@import '../partials/variables'; // colors, fonts etc...

@import '../partials/mixins'; // custom mixins

@import '../partials/layout'; // responsive grid and media queries

/* -------------------------------- 

Primary style

-------------------------------- */

*, *::after, *::before {
	box-sizing: border-box;
}

html {
	font-size: 62.5%;
}

body {
	font: {
		size: 1.6rem;
		family: $primary-font; // variables inside partials > _variables.scss
	}
	color: $color-6;
	background-color: shade($color-1, 20%);
	@include font-smoothing;

	&::before {
		/* never visible - this is used in jQuery to check the current MQ */ 
		content: 'mobile';
		display: none;
	}

	@include MQ(L) {
		
		&::before {
			/* never visible - this is used in jQuery to check the current MQ */ 
			content: 'desktop';
		}
	}
}

a {
	color: $color-3;
	text-decoration: none;
}

/* -------------------------------- 

Main Components 

-------------------------------- */

body[data-hijacking="on"] {
	
	@include MQ(L) {
		overflow: hidden;
	}
}

.cd-section {
	height: 100vh;

	h2 {
		line-height: 100vh;
		text-align: center;
		font-size: 2.4rem;
	}

	&:first-of-type > div {
		background-color: $color-1;

		&::before {
			/* alert -> all scrolling effects are not visible on small devices */
			content: 'Effects not visible on mobile!';
			position: absolute;
			width: 100%;
			text-align: center;
			top: 20px;
			z-index: 2;	
			font-weight: bold;
			font-size: 1.3rem;
			text-transform: uppercase;
			color: tint($color-1, 30%);
		}
	}

	&:nth-of-type(2) > div {
		background-color: $color-2;
	}

	&:nth-of-type(3) > div {
		background-color: $color-3;
	}

	&:nth-of-type(4) > div {
		background-color: $color-4;
	}

	&:nth-of-type(5) > div {
		background-color: $color-5;
	}

	[data-animation="parallax"] & > div,
	[data-animation="fixed"] & > div,
	[data-animation="opacity"] & > div {
		background-position: center center;
		background-repeat: no-repeat;
		background-size: cover;
	}

	[data-animation="parallax"] &:first-of-type > div,
	[data-animation="fixed"] &:first-of-type > div,
	[data-animation="opacity"] &:first-of-type > div {
		background-image: url('../img/img-1.jpg');
	}

	[data-animation="parallax"] &:nth-of-type(2) > div,
	[data-animation="fixed"] &:nth-of-type(2) > div,
	[data-animation="opacity"] &:nth-of-type(2) > div {
		background-image: url('../img/img-2.jpg');
	}

	[data-animation="parallax"] &:nth-of-type(3) > div,
	[data-animation="fixed"] &:nth-of-type(3) > div,
	[data-animation="opacity"] &:nth-of-type(3) > div {
		background-image: url('../img/img-3.jpg');
	}

	[data-animation="parallax"] &:nth-of-type(4) > div,
	[data-animation="fixed"] &:nth-of-type(4) > div,
	[data-animation="opacity"] &:nth-of-type(4) > div {
		background-image: url('../img/img-4.jpg');
	}

	[data-animation="parallax"] &:nth-of-type(5) > div,
	[data-animation="fixed"] &:nth-of-type(5) > div,
	[data-animation="opacity"] &:nth-of-type(5) > div {
		background-image: url('../img/img-5.jpg');
	}

	@include MQ(L) {

		h2 {
			font-size: 4rem;
			font-weight: 300;
		}

		[data-hijacking="on"] & {
			opacity: 0;
			visibility: hidden;
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;

			> div {
				visibility: visible;
			}
		}

		[data-hijacking="off"] & > div {
			opacity: 0;
		}

		[data-animation="rotate"] & {
			/* enable a 3D-space for children elements */
			@include perspective(1800px);
		}

		[data-hijacking="on"][data-animation="rotate"] &:not(:first-of-type) {
			@include perspective-origin(center 0);
		}

		[data-animation="scaleDown"] & > div,
		[data-animation="gallery"] & > div,
		[data-animation="catch"] & > div {
			// box-shadow: 0 0 40px rgba(darken($color-1, 10%), .4);
			box-shadow: 0 0 0 rgba(darken($color-1, 10%), .4);
		}

		[data-animation="opacity"] &.visible > div {
			z-index: 1;
		}
	}
}

@include MQ(L) {
	.cd-section:first-of-type > div::before {
		display: none;
	}
}

.cd-section > div {

	@include MQ(L) {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		
		/* Force Hardware Acceleration */
		@include transform(translateZ(0));
		@include backface-visibility(hidden);

		[data-hijacking="on"] & {
			position: absolute;
		}

		[data-animation="rotate"] & {
			@include transform-origin(center bottom);
		}
	}
}

.cd-vertical-nav {
	/* lateral navigation */
	position: fixed;
	z-index: 1;
	right: 3%;
	@include center(y);
	display: none;

	a {
		display: block;
		height: 40px;
		width: 40px;

		/* image replace */
		overflow: hidden;
		text-indent: 100%;
		white-space: nowrap;

		background: url(../img/cd-icon-arrow.svg) no-repeat center center;

		&.cd-prev {
			@include transform(rotate(180deg));
			margin-bottom: 10px;
		}

		&.inactive {
			visibility: hidden;
			opacity: 0;
			@include transition(opacity 0.2s 0s, visibility 0s 0.2s);
		}
	}

	@include MQ(L) {
		display: block;
	}
}
