/* Common style */
.clearfix:before,
.clearfix:after {
	content: " ";
	display: table;
}
 
.clearfix:after {
	clear: both;
}
.grid {
	margin: 40px auto 120px;
	width: 100%;
}

.grid > a{
	float: left;
	width: 430px;
	color: #fff;
	margin: 0 40px;
}

.grid figure {
	position: relative;
	overflow: hidden;
	margin: 0;
	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;
	padding: 7px 10px 10px;
	width: 100%;
	height: 100%;
	text-align: center;
}
.grid figcaption h2 {
	margin: 0 0 10px 0;
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 1px;
	font-weight: 300;
	font-size: 130%;
	-webkit-transition: -webkit-transform 0.3s;
	transition: transform 0.3s;
}
.grid figcaption p {
	padding: 0 20px;
	margin-bottom: 0;
	color: #fff;
	font-weight: 300;
	-webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
	transition: opacity 0.3s, transform 0.3s;
	opacity: 0;
}
.grid figcaption button {
	position: absolute;
	bottom: 30px;
	left: 50%;
	transform: translateX(-50%);
	background: none;
	border: 2px solid #fff;
	padding: 10px 20px;
	color: #ffffff;
	text-transform: uppercase;
	-webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
	transition: opacity 0.3s, transform 0.3s;
	opacity: 0;
	cursor: pointer;
	outline: none !important;
}


.grid figcaption h2,
.grid figcaption p{
	-webkit-transform: translateY(0);
	transform: translateY(0);
}

.grid figcaption,
.grid figcaption h2,
.grid figcaption p,
.grid figcaption button{
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}

/* Style for SVG */
.grid svg:not([class*="--fa"]) {
	position: absolute;
	top: -1px; /* fixes rendering issue in FF */
	z-index: 10;
	width: 100%;
	height: 100%;
}

.grid svg:not([class*="--fa"]) path {
	fill: #0ba6c8;
}

/* Hover effects */
.grid > a:hover figure img {
	opacity: 0.2;
}

.grid > a:hover figcaption h2,
.grid > a:hover figcaption p{
	-webkit-transform: translateY(50%);
	transform: translateY(50%);
}

.grid > a:hover figcaption p,
.grid > a:hover figcaption button {
	opacity: 1;
}




/* 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) {
		margin: 0;
	}

	.grid > a:nth-child(3n-1) {
		margin: 30px 0 -30px 0;
	}
}

@media screen and (max-width: 45em) {
	.grid {
		max-width: 500px;
	}

	.grid > a {
		width: 50%;
	}

	.grid > a:nth-child(3n-1) {
		margin: 0;
	}

	.grid > a:nth-child(even) {
		margin: 30px 0 -30px 0;
	}


	.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: 250px;
	}

	.grid > a {
		width: 100%;
	}

	.grid > a:nth-child(even) {
		margin: 0;
	}
}