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

Primary style

-------------------------------- */
html * {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: #d25055;
  text-decoration: none;
}

img {
  max-width: 100%;
}

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

Modules - reusable parts of our design

-------------------------------- */
.cd-container {
  /* this class is used to give a max-width to the element it is applied to, and center it horizontally when it reaches that max-width */
  width: 90%;
  max-width: 1170px;
  margin: 0 auto;
}
.cd-container::after {
  /* clearfix */
  content: '';
  display: table;
  clear: both;
}

.cd-img-replace {
  /* replace text with background images */
  display: inline-block;
  overflow: hidden;
  text-indent: 100%;
  white-space: nowrap;
}

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

Main components 

-------------------------------- */
header {
  position: relative;
  height: 200px;
  line-height: 200px;
  text-align: center;
}
header h1 {
  color: #7385ad;
  font-size: 26px;
  font-size: 1.625rem;
  font-weight: 300;
}
@media only screen and (min-width: 768px) {
  header {
    height: 250px;
    line-height: 250px;
  }
  header h1 {
    font-size: 30px;
    font-size: 1.875rem;
  }
}

#cd-gallery-items {
  margin-top: 1.5em;
}
#cd-gallery-items > li {
  position: relative;
  margin-bottom: 6em;
}
#cd-gallery-items > li img {
  width: 100%;
  display: block;
}
@media only screen and (min-width: 768px) {
  #cd-gallery-items {
    margin-top: 2em;
  }
  #cd-gallery-items > li {
    width: 48%;
    float: left;
    margin-right: 4%;
    margin-bottom: 6.5em;
  }
  #cd-gallery-items > li:nth-child(2n) {
    margin-right: 0;
  }
}
@media only screen and (min-width: 1170px) {
  #cd-gallery-items {
    margin-top: 2.5em;
  }
  #cd-gallery-items > li {
    width: 31%;
    float: left;
    margin-bottom: 7em;
    margin-right: 3.5%;
  }
  #cd-gallery-items > li:nth-child(2n) {
    margin-right: 3.5%;
  }
  #cd-gallery-items > li:nth-child(3n) {
    margin-right: 0;
  }
}

.cd-item-wrapper {
  -webkit-perspective: 500px;
  -moz-perspective: 500px;
  perspective: 500px;
  -webkit-perspective-origin: 50% -30%;
  -moz-perspective-origin: 50% -30%;
  perspective-origin: 50% -30%;
}
.cd-item-wrapper li {
  position: absolute;
  top: 0;
  left: 0;
  /* Force Hardware Acceleration in WebKit */
  -webkit-transform: translate3d(0, 0, 0);
  -moz-transform: translate3d(0, 0, 0);
  -ms-transform: translate3d(0, 0, 0);
  -o-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transition: all 0.4s;
  -moz-transition: all 0.4s;
  transition: all 0.4s;
}
.cd-item-wrapper li.cd-item-front {
  position: relative;
  z-index: 3;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
}
.cd-item-wrapper li.cd-item-middle {
  z-index: 2;
}
.active .cd-item-wrapper li.cd-item-middle {
  /* 3D effect on touch devices */
  -webkit-transform: translate3d(0, 0, -20px);
  -moz-transform: translate3d(0, 0, -20px);
  -ms-transform: translate3d(0, 0, -20px);
  -o-transform: translate3d(0, 0, -20px);
  transform: translate3d(0, 0, -20px);
  opacity: .8;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
}
.cd-item-wrapper li.cd-item-back {
  z-index: 1;
}
.active .cd-item-wrapper li.cd-item-back {
  /* 3D effect on touch devices */
  -webkit-transform: translate3d(0, 0, -40px);
  -moz-transform: translate3d(0, 0, -40px);
  -ms-transform: translate3d(0, 0, -40px);
  -o-transform: translate3d(0, 0, -40px);
  transform: translate3d(0, 0, -40px);
  opacity: .4;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
}
.cd-item-wrapper li.cd-item-out {
  /* picture not visible - use this class in case you have more than 3 pictures per item */
  z-index: 0;
  opacity: 0;
  -webkit-transform: translate3d(0, 0, -60px);
  -moz-transform: translate3d(0, 0, -60px);
  -ms-transform: translate3d(0, 0, -60px);
  -o-transform: translate3d(0, 0, -60px);
  transform: translate3d(0, 0, -60px);
}
.cd-item-wrapper li.move-right {
  -webkit-transform: translate3d(200px, 0, 0);
  -moz-transform: translate3d(200px, 0, 0);
  -ms-transform: translate3d(200px, 0, 0);
  -o-transform: translate3d(200px, 0, 0);
  transform: translate3d(200px, 0, 0);
  opacity: 0;
  z-index: 4 !important;
}
.cd-item-wrapper li.hidden {
  /* used to hide the picture once it's pushed out - to the right */
  display: none !important;
}
.no-csstransitions .cd-item-wrapper li.cd-item-middle, .no-csstransitions .cd-item-wrapper li.cd-item-back {
  /* 3D effect not visible on browsers that don't support transitions */
  display: none;
}

.cd-item-info {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 70px;
  line-height: 70px;
  background-color: #f2f2f2;
  padding: 0 1em;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.2);
  z-index: 5;
}
.cd-item-info:after {
  content: "";
  display: table;
  clear: both;
}
.cd-item-info b {
  float: left;
  font-weight: bold;
}
.cd-item-info b a {
  color: #323d55;
}
.cd-item-info b a:hover {
  text-decoration: underline;
}
.cd-item-info em {
  float: right;
  color: #7385ad;
}

.cd-item-navigation a {
  position: absolute;
  top: 50%;
  -webkit-transform: translateY(-50%);
  -moz-transform: translateY(-50%);
  -ms-transform: translateY(-50%);
  -o-transform: translateY(-50%);
  transform: translateY(-50%);
  width: 36px;
  height: 66px;
  background-color: rgba(216, 216, 216, 0.4);
  background-image: url("../img/cd-icon-arrow.svg");
  background-repeat: no-repeat;
  background-position: center center;
  z-index: 4;
  display: none;
  border-radius: 0.25em;
}
.no-touch .cd-item-navigation a:hover {
  background-color: rgba(216, 216, 216, 0.6);
}
.cd-item-navigation a.visible {
  display: block;
  -webkit-animation: cd-fade-in 0.4s;
  -moz-animation: cd-fade-in 0.4s;
  animation: cd-fade-in 0.4s;
}
.cd-item-navigation li:nth-child(1) a {
  left: 14px;
  -webkit-transform: translateY(-50%) rotate(180deg);
  -moz-transform: translateY(-50%) rotate(180deg);
  -ms-transform: translateY(-50%) rotate(180deg);
  -o-transform: translateY(-50%) rotate(180deg);
  transform: translateY(-50%) rotate(180deg);
}
.cd-item-navigation li:nth-child(2) a {
  right: 14px;
}
.no-csstransitions .cd-item-navigation {
  display: none;
}

@-webkit-keyframes cd-fade-in {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}
@-moz-keyframes cd-fade-in {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}
@keyframes cd-fade-in {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}
.cd-3d-trigger {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  background: url("../img/cd-icon-3d.svg") no-repeat center center;
  z-index: 4;
}
.no-touch .cd-3d-trigger {
  display: none;
}

.no-touch #cd-gallery-items > li:hover .cd-item-middle, .no-touch #cd-gallery-items > li:hover .cd-item-back {
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
}
.no-touch #cd-gallery-items > li:hover .cd-item-middle {
  /* 3D effect on no-touch devices */
  -webkit-transform: translate3d(0, 0, -20px);
  -moz-transform: translate3d(0, 0, -20px);
  -ms-transform: translate3d(0, 0, -20px);
  -o-transform: translate3d(0, 0, -20px);
  transform: translate3d(0, 0, -20px);
  opacity: .8;
}
.no-touch #cd-gallery-items > li:hover .cd-item-back {
  /* 3D effect on no-touch devices */
  -webkit-transform: translate3d(0, 0, -40px);
  -moz-transform: translate3d(0, 0, -40px);
  -ms-transform: translate3d(0, 0, -40px);
  -o-transform: translate3d(0, 0, -40px);
  transform: translate3d(0, 0, -40px);
  opacity: .4;
}
