.gallery {
	display: grid;
	margin: 0 auto;
	grid-auto-flow: row;
	grid-template-columns: repeat(4, 1fr);
	grid-row-gap: 15px;
	grid-column-gap: 15px;
}

.gallery_item {
	background-color: #000;
	color: #fff !important;
	display: inline-block;
	margin: 8px;
	overflow: hidden;
	position: relative;
	text-align: center;
	width: 100%;
}

.gallery_item * {
	box-sizing: border-box;
  	transition: all 0.45s ease;
}

.gallery_item::before,
.gallery_item::after {
	background-color: rgba(0, 0, 0, 0.2);
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	content: '';
	transition: all 0.3s ease;
	z-index: 1;
	opacity: 0;
	transform: scaleY(2);
}

	.gallery_item img {
		width: 100%;
		height: 100%;
		vertical-align: top;
  		backface-visibility: hidden;
		object-fit: cover;
	}

	.gallery_item figcaption {
		position: absolute;
		top: 0;
		bottom: 0;
		left: 0;
		right: 0;
		align-items: center;
		z-index: 1;
		display: flex;
		flex-direction: column;
		justify-content: center;
		line-height: 1.1em;
		opacity: 0;
		z-index: 2;
		transition-delay: 0.1s;
		font-size: 24px !important;
		font-family: "Open Sans", Helvetica, sans-serif;
		font-weight: 400;
		letter-spacing: 1px;
		text-transform: uppercase;
	}

	.gallery_item figcaption h3 {
		color: #fff !important;
	}

	.gallery_item:hover::before,
	.gallery_item:hover::after {
		transform: scale(1);
		opacity: 1;
	}

	.gallery_item:hover figcaption {
		opacity: 1;
	}

@media only screen and (min-width: 1280px) {	
	.gallery_item:nth-child(6n+1) {
		grid-column: span 2;
		grid-row: span 2;
	}

	.gallery_item:nth-child(6n+2) {
		grid-column: span 1;
		grid-row: span 1;
	}

	.gallery_item:nth-child(6n+3) {
		grid-column: span 1;
		grid-row: span 1;
	}
	
	.gallery_item:nth-child(6n+4) {
		grid-column: span 2;
		grid-row: span 2;
	}

	.gallery_item:nth-child(6n+5) {
		grid-column: span 1;
		grid-row: span 1;
	}

	.gallery_item:nth-child(6n) {
		grid-column: span 1;
		grid-row: span 1;
	}

	.gallery_item:nth-child(6n+2) figcaption, 
	.gallery_item:nth-child(6n+3) figcaption,
	.gallery_item:nth-child(6n+5) figcaption,
	.gallery_item:nth-child(6n+6) figcaption {
		font-size: 18px !important;
	}
}

@media only screen and (max-width: 1280px) {
	.gallery {
		grid-template-columns: repeat(3, 1fr);
		grid-auto-rows: 20vh;
	}
	
	.gallery_item:nth-child(6n+1) {
		grid-column: span 1;
		grid-row: span 2;
	}

	.gallery_item:nth-child(6n+2) {
		grid-column: span 2;
		grid-row: span 1;
	}

	.gallery_item:nth-child(6n+3) {
		grid-column: span 2;
		grid-row: span 1;
	}
	
	.gallery_item:nth-child(6n+4) {
		grid-column: span 2;
		grid-row: span 1;
	}

	.gallery_item:nth-child(6n+5) {
		grid-column: span 1;
		grid-row: span 2;
	}

	.gallery_item:nth-child(6n) {
		grid-column: span 2;
		grid-row: span 1;
	}
}

@media only screen and (max-width: 980px) {
	.gallery {
		grid-template-columns: repeat(2, 1fr);
		grid-auto-rows: 20vh;
	}

	.gallery_item:nth-child(n) {
		grid-column: span 1;
		grid-row: span 1;
	}

	.gallery_item figcaption {
		font-size: 18px !important;
	}
}

@media screen and (max-width: 768px) {
	.gallery {
		grid-template-columns: 100%;
		grid-auto-rows: 30vh;
	}

	.gallery_item figcaption {
		font-size: 22px !important;
	}
}