.grid-wrap {
	clear: both;
	margin: 0 auto;
	padding: 0;
	max-width: 100%;
}

.grid, .grid2 {
	margin: 0px auto;
	padding: 0;
	list-style: none;
}

.js .grid{
  background: url(../loading.gif) no-repeat 50% 100px;
}

.js .grid.loaded, .js .grid2.loaded {
	background: none;
}

.grid li, .grid2 li {
	display: inline-block;
	overflow: hidden;
	text-align: left;
	vertical-align: top;
}

.grid li{
  width: 265px;
  margin:1.8em;
}

.grid2 li{
  width: 115px;
  margin:1em;
}

.js .grid li, .j2 .grid2 li {
	display: none;
	float: left;
}

.js .grid.loaded li, .js .grid2.loaded li {
	display: block;
}

/* Title box */
.title-box h2, 
.title-box-divider h2{
	display: block;
	width: 250px;
  margin-left:7px;
  margin-bottom:7px;
	padding: 20px;
	background: #333333;
	color: #D3EEE2;
  box-shadow: 2px 2px 5px rgba(51,51,51,0.64);
	text-transform: uppercase;
	letter-spacing: 1px;
	font-weight: 300;
  border-radius:5px;
}

.title-box h2 a,
.title-box-divider h2 a {
	display: block;
	font-weight: 900;
}

/* Anchor and image */
.grid li > a,
.grid li img,
.grid2 li > a,
.grid2 li img {
	display: block;
	outline: none;
	border: none;
}

.grid li img,
.grid2 li img {
  margin:auto;
  margin-bottom:10px;
  border-radius:5px;
  box-shadow: 2px 2px 5px rgba(51,51,51,0.64);
}

.grid li > a,
.grid2 li > a {
	position: relative;
	overflow: hidden;
	margin:0px;
  border-radius:5px;
}


/* Curtain element */
.grid .curtain,
.grid2 .curtain {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 100;
	width: 100%;
	height: 100%;
	background: #333333;
}

.grid.swipe-right .curtain,
.grid2.swipe-right .curtain {
	-webkit-transform: translate3d(-100%,0,0);
	transform: translate3d(-100%,0,0);
}


/* Shadow */
.grid .curtain::after,
.grid2 .curtain::after {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,1);
	content: '';
}

.grid.swipe-right .curtain::after,
.grid2.swipe-right .curtain::after {
	left: -100%;
}

/* Title */
.grid li h3,
.grid2 li h3 {
	position: absolute;
	bottom: 0;
	margin: 0;
	background: #333333;
	color: #f0f0f0;
	text-align: right;
	font-size: 1em;
  box-shadow: 2px 2px 5px rgba(51,51,51,0.64);
  border-radius:5px;
	-webkit-transition: -webkit-transform 0.6s, color 0.6s, background 0.6s;
	transition: transform 0.6s, color 0.6s, background 0.6s;
}

.grid li h3{
	width: 100%;
}

.grid2 li h3{
	width: 100%;
}

.grid li h3 {
	text-transform: uppercase;
	letter-spacing: 1px;
	font-weight: 800;
	padding: 20px;
}

.grid2 li h3 {
	text-transform: none;
	letter-spacing: 0px;
	font-weight: 200;
  padding: 10px;
}

/* Pseudo element for hover effect */
.grid li > a::before,
.grid2 li > a::before {
	position: absolute;
	top: 0;
	left: 0;
	width: 100.5%;
	height: 100.5%;
	border: 0px solid transparent;
	background: rgba(0,0,0,0);
	content: '';
	-webkit-transition: border-width 0.9s, border-color 0.9s;
	transition: border-width 0.9s, border-color 0.9s;
}

/* Hover effects */
.grid li.shown:hover h3,
.grid2 li.shown:hover h3 {
	color: rgba(255,255,255,0);
  box-shadow:0px 0px 0px rgba(51,51,51,0);
  border-radius:5px;
  background-color: rgba(51,51,51,0);
	-webkit-transform: translate3d(0,-30px,0);
	transform: translate3d(0,-30px,0);
}

.grid li.shown:hover > a::before,
.grid2 li.shown:hover > a::before {
  border-width: 0px;
  border-color: #333333;
}
/* Animations */

/* Swipe right */
.grid.swipe-right li.animate .curtain,
.grid2.swipe-right li.animate .curtain {
  border-radius:5px;
	-webkit-animation: swipeRight 1.5s cubic-bezier(0.6,0,0.4,1) forwards;
	animation: swipeRight 1.5s cubic-bezier(0.6,0,0.4,1) forwards;
}

@-webkit-keyframes swipeRight {
	0% {} /* fixes Chrome 35.0.1916.114 issue (easing breaks) */
	50%, 60% { -webkit-transform: translate3d(0,0,0); }
	100% { -webkit-transform: translate3d(100%,0,0); }
}

@keyframes swipeRight {
	0% {}
	50%, 60% { -webkit-transform: translate3d(0,0,0); transform: translate(0); }
	100% { -webkit-transform: translate3d(100%,0,0); transform: translate3d(100%,0,0); }
} 



/* Shadow */
.grid li.animate .curtain::after,
.grid2 li.animate .curtain::after {
	border-radius:5px;
	-webkit-animation: fadeOut 1.5s ease forwards;
	animation: fadeOut 1.5s ease forwards;
	-webkit-animation-delay: inherit;
	animation-delay: inherit;
}

@-webkit-keyframes fadeOut {
	0% {} /* fixes Chrome 35.0.1916.114 issue (easing breaks) */
	50%, 60% { opacity: 1; }
	100% { opacity: 0; }
}

@keyframes fadeOut {
	0% {}
	50%, 60% { opacity: 1; }
	100% { opacity: 0; }
}

/* Hide image and title and show at half time */
.js .grid li img,
.js .grid li h3,
.js .grid2 li img,
.js .grid2 li h3 {
	visibility: hidden;
}

.grid li.animate img,
.grid li.animate h3,
.grid2 li.animate img,
.grid2 li.animate h3 {
	-webkit-animation: showMe 1.5s step-end forwards;
	animation: showMe 1.5s step-end forwards;
}

@-webkit-keyframes showMe {
	from { visibility: hidden; }
	60%, 100% { visibility: visible; }
}

@keyframes showMe {
	from { visibility: hidden; }
	60%, 100% { visibility: visible; }
}

.grid li.shown img,
.grid li.shown h3,
.grid2 li.shown img,
.grid2 li.shown h3 {
	visibility: visible;
}