
/* Common style */
.shapegrid {
	margin: 0px 0px;
	width: 100%;
}

.shapegrid a {
	float: left;
	max-width:290px;
	width: 25%;
	color: #333;
}

/*
.shapegrid a:nth-child(odd) {
	margin: 30px 0 -30px 0;
}
*/

.shapegrid figure {
	position: relative;
	overflow: hidden;
	margin: 5px;
	background: #333;
}

.shapegrid figure img {
	position: relative;
	display: block;
	width: 100%;
	opacity: 0.9;
	-webkit-transition: opacity 0.3s;
	transition: opacity 0.3s;
}

.shapegrid figcaption {
	position: absolute;
	top: 0;
	z-index: 11;
	padding: 0px 0px 0px 0px;
	width: 100%;
	height: 100%;
	text-align: center;
}

.shapegrid figcaption h2 {
	margin:0px 0px 20px 0px;
	color: #3498db;
	color:#fff!important;
	text-transform: uppercase;
	letter-spacing: 1px;
	font-weight: 300;
	font-size: 250%;
	-webkit-transition: -webkit-transform 0.3s;
	transition: transform 0.3s;
}

.shapegrid figcaption p {
	padding: 0 20px;
	color: #fff!important;
	font-weight: 300;
	-webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
	transition: opacity 0.3s, transform 0.3s;
}

.shapegrid figcaption h2,
.shapegrid figcaption p {
	-webkit-transform: translateY(30px);
	transform: translateY(30px);
}

.shapegrid figure button {
	position: absolute;
	padding: 4px 20px;
	border: none;
	text-transform: uppercase;
	letter-spacing: 1px;
	font-weight: bold;
	-webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
	transition: opacity 0.3s, transform 0.3s;
}

.shapegrid figcaption,
.shapegrid figcaption h2,
.shapegrid figcaption p,
.shapegrid figure button {
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}

/* Style for SVG */
.shapegrid svg {
	position: absolute;
	top: -1px; /* fixes rendering issue in FF */
	z-index: 10;
	width: 100%;
	height: 100%;
}

.shapegrid svg path {
	fill: #6699FF;
}

/* Hover effects */
.shapegrid a:hover figure img {
	opacity: 1;
}

.shapegrid a:hover figcaption h2,
.shapegrid a:hover figcaption p {
	-webkit-transform: translateY(0);
	transform: translateY(0);
}

.shapegrid a:hover figcaption p {
	opacity: 0;
}



.shapegrid figcaption h2 {
	color: #e74c3c;
}

.shapegrid figcaption p {
	-webkit-transition-delay: 0.05s;
	transition-delay: 0.05s;
}

.shapegrid figure button {
	bottom: 0;
	left: 0;
	padding: 20px 15px 20px 15px;
	width: 100%;
	background-color: #FFCC00;
	color: #fff;
	font-weight:bold;
	-webkit-transform: translateY(100%);
	transform: translateY(100%);
}

.shapegrid a:hover figure button {
	-webkit-transition-timing-function: ease-out;
	transition-timing-function: ease-out;
	-webkit-transform: translateY(0);
	transform: translateY(0);
}

.shapegrid figcaption h2, 
.shapegrid 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);
}

.shapegrid a:hover figcaption p{
	-webkit-transition-delay: 0s;
	transition-delay: 0s;
	-webkit-transition-duration: 0.1s;
	transition-duration: 0.1s;
}


/* Media Queries */
/* Let's redefine the width of each anchor and the margins */

@media screen and (max-width: 58em) {
	.shapegrid a {
		width: 33.333%;
	}

	.shapegrid a:nth-child(odd) {
		margin: 0;
	}

	.shapegrid a:nth-child(3n-1) {
		margin: 30px 0 -30px 0;
	}
}

@media screen and (max-width: 45em) {
	.shapegrid {
		max-width: 500px;
	}

	.shapegrid a {
		width: 50%;
	}

	.shapegrid a:nth-child(3n-1) {
		margin: 0;
	}

	.shapegrid a:nth-child(even) {
		margin: 30px 0 -30px 0;
	}


	.shapegrid figcaption h2 {
		margin-bottom: 0px;
		-webkit-transform: translateY(30px);
		transform: translateY(30px);
	}

	.shapegrid figcaption p {
		margin: 0;
		padding: 0 10px;
	}
}

@media screen and (max-width: 27em) {
	.shapegrid {
		max-width: 250px;
	}

	.shapegrid a {
		width: 100%;
	}

	.shapegrid a:nth-child(even) {
		margin: 0;
	}
}