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

FOLDED LAYOUT STYLES

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


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

Main content

-------------------------------- */
.overflow-hidden {
	overflow: hidden;
	}
.cd-main {
 	overflow-x: hidden; position: relative;
	}
/* never visible - this is used in jQuery to check the current MQ */
.cd-main::before {
 	display: none; content: 'mobile';
	}
.cd-main > * {
	-webkit-transition: -webkit-transform 0.5s 0.4s; transition: transform 0.5s 0.4s;
	}
/* on mobile - translate .cd-main content to the right when the .cd-folding-panel is open */
.cd-main.fold-is-open > * {
	-webkit-transform: translateX(100%); -ms-transform: translateX(100%); transform: translateX(100%); -webkit-transition: -webkit-transform 0.5s 0s;transition: transform 0.5s 0s;
	}
@media only screen and (min-width: 600px) {
  .cd-main.fold-is-open > * {
    -webkit-transform: translateX(600px); -ms-transform: translateX(600px); transform: translateX(600px);
  	}
}

/* CD-GALLERY */
.cd-gallery {
	position: relative; margin: 0; padding: 0; list-style: none;
	}
.cd-gallery::after {
 	clear: both; content: ""; display: table;
	}
/* this is the dark layer covering the .cd-gallery when the .cd-folding-panel is open */
.cd-gallery::before {
 	display: block; content: ''; position: absolute; z-index: 1; top: 0; left: 0; height: 100%; width: 100%; background-color: rgba(28, 23, 38, 0.6); opacity: 0; visibility: hidden; -webkit-transition: opacity 0.5s 0.4s, visibility 0s 0.9s; transition: opacity 0.5s 0.4s, visibility 0s 0.9s;
    }
.fold-is-open .cd-gallery::before {
 	visibility: visible; opacity: 1; -webkit-transition: opacity 0.5s 0s, visibility 0s 0s; transition: opacity 0.5s 0s, visibility 0s 0s;
    }
/* CD-ITEM */
.cd-item {
 	width: 100%; text-align: center; overflow: hidden; /* Force Hardware Acceleration */ -webkit-transform: translateZ(); -ms-transform: translateZ(); transform: translateZ(); -webkit-backface-visibility: hidden; backface-visibility: hidden; -webkit-transition: -webkit-transform 0.5s 0.4s; transition: transform 0.5s 0.4s; height: 50vh;
    }
.cd-item div {
 	display: table-cell; vertical-align: middle;
    }
.cd-item > a {
 	display: flex; align-items: center; justify-content: center; height: 100%; width: 100%; overflow: hidden; color: #ffffff; -webkit-font-smoothing: antialiased; position: relative;
    }
.cd-item a:hover { 
	color: #FFF; 
	}
.cd-item > a:before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
	opacity: .6; 
	background-color: #08000A;
}
.cd-item a:hover:before { 
	opacity: .8; 
	}
.cd-item i {
    font-size: 44px; z-index: 1; position: relative; margin-bottom: 12px;
	}
.cd-item h2 {
 	font-size: 1.9rem; font-weight: 700; margin-top: 0; position: relative; z-index: 1; margin-bottom: .2em;
    }
.cd-item b {
 	display: none; font-size: 10px; font-weight: 300; text-transform: uppercase; letter-spacing: 1px; padding: 10px 19px; color: rgba(255, 255, 255, 0.8); border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 16px; position: relative; z-index: 1;
    }
.cd-item p {
 	line-height: 1.2; font-size: 13px; font-weight: 300; opacity: .6; padding: 0; position: relative; z-index: 1;
    }
.cd-item { 
	background-size: cover; background-position: center;
	}
.cd-item > img {
	display: none;
	}

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

folding panel

-------------------------------- */
.cd-folding-panel {
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100%;
  visibility: hidden;
  overflow: hidden;
  -webkit-transition: visibility 0s 0.9s;
  transition: visibility 0s 0.9s;
}
.cd-folding-panel .fold-left,
.cd-folding-panel .fold-right {
  /* the :after elements of .fold-left and .fold-right are the 2 fold sides */
  width: 100%;
  height: 100vh;
  overflow: hidden;
  position: relative;
  /* enable a 3D-space for children elements */
  -webkit-perspective: 2000px;
  perspective: 2000px;
}
.cd-folding-panel .fold-left::after,
.cd-folding-panel .fold-right::after {
  /* 2 fold sides */
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  /* Force Hardware Acceleration */
  -webkit-transform: translateZ(0);
  -ms-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transition: -webkit-transform 0.5s 0.4s, background-color 0.5s 0.4s;
  transition: transform 0.5s 0.4s, background-color 0.5s 0.4s;
}
.cd-folding-panel .fold-right {
  -webkit-perspective-origin: 0% 50%;
  perspective-origin: 0% 50%;
}
.cd-folding-panel .fold-right::after {
  -webkit-transform-origin: right center;
  -ms-transform-origin: right center;
  transform-origin: right center;
  -webkit-transform: translateX(-100%) rotateY(-90deg);
  -ms-transform: translateX(-100%) rotateY(-90deg);
  transform: translateX(-100%) rotateY(-90deg);
  background-color: #fff;
}
.cd-folding-panel .fold-left {
  /* on mobile only the right fold side is visible */
  display: none;
}
.cd-folding-panel .fold-left::after {
  background-color: #fff;
}
.cd-folding-panel .cd-close {
  /* 'X' close icon */
  position: absolute;
  z-index: 1;
  display: inline-block;
  top: 10px;
  right: 16px;
  height: 44px;
  width: 44px;
  /* image replacement */
  overflow: hidden;
  text-indent: 100%;
  white-space: nowrap;
  opacity: 0;
  -webkit-transition: opacity 0.2s 0s;
  transition: opacity 0.2s 0s;
}
.cd-folding-panel .cd-close::after, .cd-folding-panel .cd-close::before {
  /* lines of 'X' icon */
  content: '';
  position: absolute;
  height: 1px;
  width: 32px;
  left: 50%;
  top: 50%;
  background-color: #345;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transition: opacity 0.2s;
  transition: opacity 0.2s;
}
.cd-folding-panel .cd-close::after {
  -webkit-transform: translateX(-50%) translateY(-50%) rotate(45deg);
  -ms-transform: translateX(-50%) translateY(-50%) rotate(45deg);
  transform: translateX(-50%) translateY(-50%) rotate(45deg);
}
.cd-folding-panel .cd-close::before {
  -webkit-transform: translateX(-50%) translateY(-50%) rotate(-45deg);
  -ms-transform: translateX(-50%) translateY(-50%) rotate(-45deg);
  transform: translateX(-50%) translateY(-50%) rotate(-45deg);
}
.cd-folding-panel.is-open {
  visibility: visible;
  -webkit-transition: visibility 0s 0s;
  transition: visibility 0s 0s;
}
.cd-folding-panel.is-open .fold-right::after,
.cd-folding-panel.is-open .fold-left::after {
  -webkit-transform: translateX(0);
  -ms-transform: translateX(0);
  transform: translateX(0);
  -webkit-transition: -webkit-transform 0.5s 0s, background-color 0.5s 0s;
  transition: transform 0.5s 0s, background-color 0.5s 0s;
}
.cd-folding-panel.is-open .fold-right::after {
  background-color: #fff;
}
.cd-folding-panel.is-open .cd-close {
  opacity: 1;
  -webkit-transition: opacity 0.2s 0.5s;
  transition: opacity 0.2s 0.5s;
}

/* FOLD CONTENT */
.cd-fold-content {
 position: absolute; top: 0; left: 0; height: 100%; width: 100%; padding: 2em; visibility: hidden; -webkit-transition: visibility 0s 0.4s; transition: visibility 0s 0.4s;
    }
.is-open .cd-fold-content {
 overflow-y: auto; -webkit-overflow-scrolling: touch; visibility: visible; -webkit-transition: visibility 0s 0.5s; transition: visibility 0s 0.5s;
    }

/* ANIMATED ITEMS */
.cd-fold-content .entry-header,
.cd-fold-content .entry-content > * {
  opacity: 0;
  -webkit-transform: translateY(40px);
  -ms-transform: translateY(40px);
  transform: translateY(40px);
}
.is-open .cd-fold-content .entry-header,
.is-open .cd-fold-content .entry-content > * {
  opacity: 1;
  -webkit-transform: translateY(0);
  -ms-transform: translateY(0);;
  transform: translateY(0);
}

/* animate out */
.cd-fold-content .hentry > .entry-header {
  -webkit-transition: -webkit-transform 0.2s 0.3s, opacity 0.2s 0.3s;
  transition: transform 0.2s 0.3s, opacity 0.2s 0.3s;
	}
.cd-fold-content .entry-content > *:nth-child(1) {
  -webkit-transition: -webkit-transform 0.2s 0.2s, opacity 0.2s 0.2s;
  transition: transform 0.2s 0.2s, opacity 0.2s 0.2s;
	}
.cd-fold-content .entry-content > *:nth-child(2) {
  -webkit-transition: -webkit-transform 0.2s 0.1s, opacity 0.2s 0.1s;
  transition: transform 0.2s 0.1s, opacity 0.2s 0.1s;
	}
.cd-fold-content .entry-content > *:nth-child(n+3) {
  -webkit-transition: -webkit-transform 0.2s 0s, opacity 0.2s 0s;
  transition: transform 0.2s 0s, opacity 0.2s 0s;
	}

/* animate in */
.is-open .cd-fold-content .hentry > .entry-header {
  -webkit-transition: -webkit-transform 0.2s 0.5s, opacity 0.2s 0.5s;
  transition: transform 0.2s 0.5s, opacity 0.2s 0.5s;
}
.is-open .cd-fold-content .entry-content > *:nth-child(1) {
  -webkit-transition: -webkit-transform 0.2s 0.6s, opacity 0.2s 0.6s;
  transition: transform 0.2s 0.6s, opacity 0.2s 0.6s;
}
.is-open .cd-fold-content .entry-content > *:nth-child(2) {
  -webkit-transition: -webkit-transform 0.2s 0.7s, opacity 0.2s 0.7s;
  transition: transform 0.2s 0.7s, opacity 0.2s 0.7s;
}
.is-open .cd-fold-content .entry-content > *:nth-child(n+3) {
  -webkit-transition: -webkit-transform 0.2s 0.8s, opacity 0.2s 0.8s;
  transition: transform 0.2s 0.8s, opacity 0.2s 0.8s;
}


/* TABLET AND UP */
@media only screen and (min-width: 600px) and (min-height: 500px) {
  
  .cd-folding-panel {
    width: 660px;
  	}
  .cd-fold-content {
	  padding: 2em 4em;
  	}
  .cd-item i {
	  font-size: 60px;
  	}
  .cd-item p {
	  font-size: 15px;
  	}
	.cd-item h2 {
		font-size: 3.8rem;
		}
}

/* DESKTOPS */
@media only screen and (min-width: 992px) {
	
  /* never visible - this is used in jQuery to check the current MQ */
  .cd-main::before {
    content: 'desktop';
  	}
  /* reset style - on bigger devices we translate the gallery items */
  .cd-main.fold-is-open > * {
    -webkit-transform: translateX(0); -ms-transform: translateX(0); transform: translateX(0); 
	}
	
  	.cd-item {
		 width: 50%; float: left; -webkit-transition: -webkit-transform 0.5s 0.4s; transition: transform 0.5s 0.4s;
		}
	.cd-item:last-child:nth-child(odd) {
	 	width: 100%
		}
	.cd-item h2,
	.cd-item p,
	.cd-item i {
	 	-webkit-transform: translateY(30px); -ms-transform: translateY(30px); transform: translateY(30px); -webkit-transition: -webkit-transform 0.3s 0.1s; transition: transform 0.3s 0.1s;
		}
	.cd-item p {
	 	font-size: 16px; margin-bottom: 2em; opacity: .5;
		}
	.cd-item b {
	 	opacity: 0; display: inline-block;  -webkit-transform: translateY(20px); -ms-transform: translateY(20px); transform: translateY(20px); -webkit-transition: opacity 0.3s 0s, -webkit-transform 0.3s 0s; transition: opacity 0.3s 0s, transform 0.3s 0s;
		}
	.no-touchevents .cd-item a:hover h2,
	.no-touchevents .cd-item a:hover p, 
	.no-touchevents .cd-item a:hover i {
	 	-webkit-transform: translateY(0); -ms-transform: translateY(0); transform: translateY(0); -webkit-transition: -webkit-transform 0.3s 0s; transition: transform 0.3s 0s;
		}
	.no-touchevents .cd-item a:hover b {
	 	opacity: 1; -webkit-transform: translateY(0); -ms-transform: translateY(0); transform: translateY(0); -webkit-transition: opacity 0.3s 0.1s, -webkit-transform 0.3s 0.1s; transition: opacity 0.3s 0.1s, transform 0.3s 0.1s;
		}
	.fold-is-open .cd-item {
	 	-webkit-transition: -webkit-transform 0.5s 0s; transition: transform 0.5s 0s; -webkit-transform: translateX(-400px); -ms-transform: translateX(-400px); transform: translateX(-400px);
		}
	.fold-is-open .cd-item:last-child:nth-child(odd) {
	 	-webkit-transform: translateX(0px); -ms-transform: translateX(0px); transform: translateX(0px);
		}
	.fold-is-open .cd-item:nth-of-type(2n) {
	 	-webkit-transform: translateX(400px); -ms-transform: translateX(400px); transform: translateX(400px);
		}
  .cd-folding-panel {
    left: 50%;
    right: auto;
    -webkit-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    transform: translateX(-50%);
    width: 800px;
  }
  .cd-folding-panel .fold-left,
  .cd-folding-panel .fold-right {
    width: 50%;
    float: left;
    height: 100%;
  }
  .cd-folding-panel .fold-right {
    /* change perspective-origin so that the 2 fold sides have the same vanishing point */
    -webkit-perspective-origin: 0% 50%;
    perspective-origin: 0% 50%;
  }
  .cd-folding-panel .fold-right::after {
    -webkit-transform-origin: right center;
    -ms-transform-origin: right center;
    transform-origin: right center;
    -webkit-transform: translateX(-100%) rotateY(-90deg);
    -ms-transform: translateX(-100%) rotateY(-90deg);
    transform: translateX(-100%) rotateY(-90deg);
  }
  .cd-folding-panel .fold-left {
    display: block;
    /* change perspective-origin so that the 2 fold sides have the same vanishing point */
    -webkit-perspective-origin: 100% 50%;
    perspective-origin: 100% 50%;
  }
  .cd-folding-panel .fold-left::after {
    -webkit-transform-origin: left center;
    -ms-transform-origin: left center;
    transform-origin: left center;
    -webkit-transform: translateX(100%) rotateY(90deg);
    -ms-transform: translateX(100%) rotateY(90deg);
    transform: translateX(100%) rotateY(90deg);
  }
}

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

Javascript disabled

-------------------------------- */
.no-js .cd-fold-content.single-page {
  position: static;
  visibility: visible;
  height: auto;
  background-color: #dadcdc;
}
.no-js .cd-fold-content.single-page > * {
  opacity: 1;
  -webkit-transform: translateY(0);
  -ms-transform: translateY(0);
  transform: translateY(0);
}
