/**
 * Post grid styles
 * Loads on front end and back end
 */

.lsx-block-post-grid {
	margin: 0 0 1.2em 0;
	position: relative;
	word-break: break-all;
	.gutenberg-compatible-template.using-gutenberg.page-template-default & {
		&.alignwide {
			width: initial;
			max-width: initial;
		}
	}

	@media (min-width: 900px) {
		padding: 4rem;
	}
	.is-grid {
		display: grid;
		grid-template-columns: 1fr 1fr;
		grid-template-rows: 1fr;
		grid-gap: 0 2em;

		article {
			margin-bottom: 2.5em;
			background-color: #fff;
			word-break: break-word;
			&:not(.disable-shadow) {
				box-shadow: 1px 1px 5px rgba(155, 155, 155, 0.7);
			}
			&.no-placeholder {
				> .lsx-block-post-grid-text {
					> .lsx-block-post-grid-title {
						padding-top: 10px;
					}
				}
			}
		}
	}

	.is-grid.columns-2 {
		grid-template-columns: 1fr 1fr;
	}

	.is-grid.columns-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.is-grid.columns-4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	div[class*="columns"].is-grid {
		@media only screen and (max-width: 600px) {
			grid-template-columns: 1fr;
		}
	}

	.lsx-block-post-grid-image {
		margin-bottom: 30px;

		img {
			display: block;
			width: 100%;
		}
	}

	.lsx-block-post-grid-text {
		text-align: left;
	}
	.editor-styles-wrapper h2.entry-title {
		margin-top: 0;
		margin-bottom: 0;
	}
	h2 {
		margin-top: 0;
		margin-bottom: 0;
		font-size: 20px;
		line-height: 1.2;
		padding: 0px 15px 10px;
		a {
			color: $blue;
			box-shadow: none;
			transition: 0.3s ease;
			font-size: 20px;
			&:hover {
				color: $orange !important;
			}
		}
	}

	.lsx-block-post-grid-byline {
		font-size: 13px;
		color: $textgray;
		margin-bottom: 5px;
		padding-left: 15px;
		padding-right: 15px;
		&:empty {
			margin: 0;
		}
		.lsx-block-post-avatar {
			position: relative;
			top: -4em;
			margin-bottom: -4em;
			img {
				border-radius: 50%;
				width: 75px !important;
				margin-bottom: 1em;
				border: 2px solid #fff;
				margin-left: auto;
				margin-right: auto;
			}
			+ time.lsx-block-post-grid-date {
				padding-top: 0;
			}
		}
	}

	#post-meta-categories,
	#post-tags {
		font-size: 13px;
		color: $textgray;
		margin-bottom: 15px;
		padding-left: 15px;
		padding-right: 15px;
		a {
			color: $textgray;
			&:hover {
				color: $orange;
			}
		}
	}

	#post-meta-categories {
		margin-bottom: 20px;
		padding: 0;
		span:not(.cat-title) {
			&:after {
				content: ", ";
			}
			&:last-child {
				&:after {
					content: "";
				}
			}
		}
	}

	#post-tags {
		border-top: 2px solid #d8d8d8;
		margin: 0 15px 15px;
		padding: 10px 0 0;
		font-style: italic;
		a,
		span:not(.tags-title) {
			&:after {
				content: ", ";
			}
			&:last-child {
				&:after {
					content: "";
				}
			}
		}
	}

	.lsx-block-post-grid-author,
	.lsx-block-post-grid-date {
		display: inline-block;
		margin-right: 5px;
	}

	.lsx-block-post-grid-author a {
		box-shadow: none;
		color: $textgray !important;
		&:hover {
			color: inherit;
			box-shadow: none;
			color: $orange !important;
			text-decoration: none;
		}
		&:before {
			content: "By ";
			line-height: 1;
		}
	}

	.lsx-block-post-grid-text p {
		margin: 0 0 15px 0;
		line-height: 1.5;
		font-size: 18px;

		@media only screen and (max-width: 600px) {
			font-size: 16px;
		}

		&:last-of-type {
			margin-bottom: 0;
		}
	}

	.lsx-block-post-grid-link {
		display: inline-block;
		box-shadow: none;
		transition: 0.3s ease;
		font-weight: bold;
		color: $black;
		text-transform: uppercase;
		&:hover {
			box-shadow: none;
		}
		&:after {
			content: "\f178";
			padding-left: 5px;
			font-family: FontAwesome;
		}
	}

	.lsx-block-post-grid-excerpt {
		padding: 0 15px 15px 15px;
		font-size: 15px;
		font-weight: normal;
		div + p {
			margin-top: 15px;
		}
		p,
		a {
			font-size: 15px;
			font-weight: normal;
		}
		.moretag {
			display: none;
		}
		&:empty {
			padding-bottom: 1px;
		}
	}

	.is-list {
		article {
			display: grid;
			grid-template-columns: 30% 1fr;
			grid-template-rows: 1fr;
			grid-gap: 0 1em;
			word-break: break-word;
			&:not(.disable-shadow) {
				box-shadow: 1px 1px 5px rgba(155, 155, 155, 0.7);
			}
			&:not(:last-child) {
				margin-bottom: 5%;
			}

			@media only screen and (min-width: 600px) {
				&:not(:last-child) {
					border-bottom: solid 1px #eee;
				}
			}

			@media only screen and (max-width: 600px) {
				grid-template-columns: 1fr;
			}
		}

		.lsx-block-post-grid-image {
			margin-bottom: 0;
			@media only screen and (max-width: 600px) {
				margin-bottom: 5%;
			}
			img {
				height: 100%;
				object-fit: cover;
			}
		}

		.lsx-block-post-grid-title {
			display: flex;
			padding-top: 15px;
			@media only screen and (min-width: 600px) {
				font-size: 34px;
			}
		}

		.no-thumb:not(.placeholder-thumb) {
			.lsx-block-post-grid-text {
				grid-column: span 2;
			}
		}
	}
	//Gray BG
	&.gray-bg {
		.has-thumb.slick-slide {
			.lsx-block-post-grid-text {
				background: $graybg;
			}
		}
	}
}
