.grid {
	padding: 20px 0;
	margin: 0 auto;
	list-style: none;
	text-align: center;
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
}

.grid li {
	margin: 0;
	padding: 20px;
	float: left;
	position: relative;
	width: calc(100%/4);
}

.grid figure {
	margin: 0;
	position: relative;
	background: #fff;
}

.grid figure img {
	width: 100%;
	display: block;
	position: relative;
}

.grid figcaption {
	position: absolute;
	top: 0;
	left: 0;
	padding: 20px;
	background: #D28EFF;
	color: #7700BB;
}

.grid figcaption h3 {
	margin: 0;
	padding: 0;
	height: 78px;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;	
	color: #fff;
	font-size: 16px;
	line-height: 170%;
}

.grid figcaption span:before {
	content: 'by ';
}

.grid figcaption a {
	text-align: center;
	padding: 5px 10px;
	border-radius: 2px;
	display: inline-block;
	background: #ed4e6e;
	color: #fff;
}

.grid li h3 {
	margin: 25px 0 0;
	text-align: center;
}
.grid li >h3 {
	background: rgb(164 164 164 / 20%);
	padding: 10px 20px;
}
.grid li >h3 a{
    overflow: hidden;
    height: auto;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

/* Individual Caption Styles */

/* Caption Style 1 */
.cs-style-1 figcaption {
	height: 100%;
	width: 100%;
	opacity: 0;
	text-align: center;
	-webkit-backface-visibility: hidden;
	-moz-backface-visibility: hidden;
	backface-visibility: hidden;
	-webkit-transition: -webkit-transform 0.3s, opacity 0.3s;
	-moz-transition: -moz-transform 0.3s, opacity 0.3s;
	transition: transform 0.3s, opacity 0.3s;
	display: none;
}

.no-touch .cs-style-1 figure:hover figcaption,
.cs-style-1 figure.cs-hover figcaption {
	opacity: 1;
	-webkit-transform: translate(15px, 15px);
	-moz-transform: translate(15px, 15px);
	-ms-transform: translate(15px, 15px);
	transform: translate(15px, 15px);
}

.cs-style-1 figcaption h3 {
	margin-top: 20px;
}

.cs-style-1 figcaption span {
	display: block;
}

.cs-style-1 figcaption a {
	margin-top: 30px;
}


@media only screen and (max-width: 980px) {
	.grid li{width:50%;}
}

@media only screen and (max-width: 640px) {
	.grid li{width:50%;padding: 10px;}
}
