/* Common style */
.grid {
	margin: 10px auto 30px;
	width: 100%;
}

.grid a {
	float: left;
	width: 22%;
	margin: 1% 1% 1% 1%;
	color: #333;
	display:block;


}



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

.grid figcaption h2 {
	margin: 0 0 20px 0;
	letter-spacing: 1px;
	font-size: 130%;
	text-transform: uppercase;
	-webkit-transition: -webkit-transform 0.3s;
	transition: transform 0.3s;
}

.grid figcaption p {
	padding: 0 20px;
	color: #aaa;
	font-weight: 300;
	-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(50px);
	transform: translateY(50px);
}

.grid 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;
}

.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: -1px; /* fixes rendering issue in FF */
	z-index: 10;
	width: 100%;
	height: 100%;
}

.grid svg path {
	fill: rgba(87,87,87,0.9);
}

/* 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;
}

/* Individual styles */
.demo-1 body {
	background: #FFFFFF;
}

.demo-1 .grid figure button {
	top: 50%;
	left: 50%;
	border: 3px solid #fff;
	background: transparent;
	color: #fff;
	opacity: 0;
	-webkit-transform: translateY(-50%) translateX(-50%) scale(0.25);
	transform: translateY(-50%) translateX(-50%) scale(0.25);
}

.demo-1 .grid a:hover figure button {
	opacity: 1;
	-webkit-transform: translateY(-50%) translateX(-50%) scale(1);
	transform: translateY(-50%) translateX(-50%) scale(1);
}





/* Media Queries */
/* Let's redefine the width of each anchor and the margins */
@media screen and (max-width: 65em) and (orientation: portrait) {
	.grid a {
		width: 25%;
		margin-left: 2%;
	}


}
@media screen and (max-width: 80em) and (orientation: landscape) {
	.grid a {
		width: 27%;
	}



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

	.grid a {
		width: 50%;




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

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

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

	.grid a {
		width: 100%;
	}

	
}