/* Common style */
.grid {
  max-width: 1200px;
  width: 100%;
}

.grid a {
  float: left;
  max-width: 160px;
  color: #333;
}

.grid a:nth-child(odd) {}

.grid figure {
  position: relative;
  overflow: hidden;
  margin: 1px;
  background: #333;
}

.grid figure img {
  position: relative;
  display: block;
  width: 100%;
  opacity: 0.7;
  -webkit-transition: opacity 0.3s;
  transition: opacity 0.3s;
}

.grid figcaption {
  position: absolute;
  top: 0;
  z-index: 11;
  width: 100%;
  height: 100%;
  text-align: center;
}

.grid figcaption h2 {
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 300;
  font-size: 14px;
  line-height:7px;
  -webkit-transition: -webkit-transform 0.3s;
  transition: transform 0.3s;
}

.grid figcaption p {
  color: #aaa;
  font-weight: 300;
  font-size: 14px;
  line-height:7px;
  -webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
  transition: opacity 0.3s, transform 0.3s;
}

.grid figcaption h2,
.grid figcaption p {
  -webkit-transform: translateY(75px);
  transform: translateY(75px);
}

.grid figure button {
  position: absolute;
  padding: 4px 8px;
  border: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 300;
  -webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
  transition: opacity 0.3s, transform 0.3s;
}

.grid figcaption,
.grid figcaption h2,
.grid figcaption p,
.grid figure button {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Style for SVG */
.grid svg {
  position: absolute;
  top: 0; /* fixes rendering issue in FF */
  z-index: 10;
  width: 100%;
  height: 100%;
}

.grid svg path {
  fill: rgba(25,70,186,.8);
}

/* Hover effects */
.grid a:hover figure img {
  opacity: 1;
}

.grid a:hover figcaption h2,
.grid a:hover figcaption p {
  -webkit-transform: translateY(0);
  transform: translateY(0);
}

.grid a:hover figcaption p {
  opacity: 0;
}

.demo-3 .grid figure button {
  font-size: 12px;
  font-weight: 300;
  top: 75%;
  left: 50%;
  border: 1px solid #1c8cda;
  border-radius: 4px;
  background: rgba(255,255,255,1);
  color: #1c8cda;
  opacity: 0;
  -webkit-transform: translateY(-50%) translateX(-50%) scale(0.25);
  transform: translateY(-50%) translateX(-50%) scale(0.25);
}

.demo-3 .grid a:hover figure button {
  opacity: 1;
  -webkit-transform: translateY(-50%) translateX(-50%) scale(1);
  transform: translateY(-50%) translateX(-50%) scale(1);
}

.demo-3 .grid figcaption h2,
.demo-3 .grid figcaption p {
  -webkit-transition-timing-function: cubic-bezier(0.250, 0.250, 0.115, 1); /* older webkit */
  -webkit-transition-timing-function: cubic-bezier(0.250, 0.250, 0.115, 1.445);
  timing-function: cubic-bezier(0.250, 0.250, 0.115, 1.445);
}

.demo-3 .grid a:hover figcaption p {
  -webkit-transition-delay: 0s;
  transition-delay: 0s;
  -webkit-transition-duration: 0.1s;
  transition-duration: 0.1s;
}

.demo-3 body {
  background: #dfdfdf;
}

.demo-3 .grid figcaption h2 {
  color: #fff;
}

.demo-3 .grid a:hover figcaption h2 {
  -webkit-transform: translateY(-10px);
  transform: translateY(-10px);
}


/* Hide mobile nav for tablet & desktop widths */
.mobile-nav {display: none;}

/* Hide desktop nav for mobile widths */
@media only screen
and (min-width : 321px)
and (max-width: 767px) {
.desktop-nav {display: none;}
.mobile-nav {display: table-cell;}
}


/* Media Queries */
/* Let's redefine the width of each anchor and the margins */

@media screen and (max-width: 58em) {
  .grid a {
    width: 33.333%;
  }

  .grid a:nth-child(odd) {
  }

  .grid a:nth-child(3n-1) {
  }
}

@media screen and (max-width: 45em) {
  .grid {
    max-width: 500px;
  }

  .grid a {
    width: 50%;
  }

  .grid a:nth-child(3n-1) {
  }

  .grid a:nth-child(even) {
  }


  .grid figcaption h2 {
  }

  .grid figcaption p {
    margin: 0;
    padding: 0 10px;
  }
}

@media screen and (max-width: 27em) {
  .grid {
    max-width: 250px;
  }

  .grid a {
    width: 100%;
  }

  .grid a:nth-child(even) {
  }
}