@import "../imports/variables";

.projects-summary {
	overflow: hidden;
	margin: 0 auto;
	max-width: 1320px;
	padding: 0 15px 60px;
}

.projects-summary-flex {
	display: flex;
	flex-wrap: wrap;
	margin: 0 -7.5px;

	> div {
		margin: 0 7.5px 15px;
		position: relative;
		width: calc(50% - 15px);
	}

	a {
		color: white;
		display: block;
		padding-bottom: 100%;
		position: relative;

		&:hover .overlay {
			opacity: 1;
		}
	}

	img {
		bottom: 0;
		display: block;
		height: 100%;
		left: 0;
		object-fit: cover;
		position: absolute;
		right: 0;
		top: 0;
		width: 100%;

		&.hide {
			display: none;
		}
	}
}

.overlay {
	align-items: center;
	background-color: rgba($bay-of-many, .75);
	bottom: 0;
	box-sizing: border-box;
	display: flex;
	justify-content: center;
	opacity: 0;
	padding: 30px;
	position: absolute;
	left: 0;
	right: 0;
	text-align: center;
	top: 0;
	transition: opacity .5s ease-in-out;
	width: 100%;
	z-index: 1;

	h2 {
		font-size: 1.222rem;
		font-weight: 700;
		padding-bottom: 7.5px;
	}
}

.projects-summary-odd > div:nth-child(2) > a,
.projects-summary-even > div:nth-child(1) > a {
	padding-bottom: calc(50% - 7.5px);

	&:first-child {
		margin-bottom: 15px;
	}
}

@media screen and (max-width: 768px) {
	.projects-summary-flex > div {
		width: calc(100% - 15px);
	}

	.projects-summary-odd > div:nth-child(2) > a,
	.projects-summary-even > div:nth-child(1) > a {
		padding-bottom: calc(100% - 7.5px);
	}
}
