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

.c9-block-post-grid {
	margin: 0 0 1.2em 0;
	position: relative;
	z-index: 7;

	a {
		color: inherit;
	}

	&.c9-is-vertically-aligned-top {
		align-self: flex-start;
	}

	&.c9-is-vertically-aligned-center {
		align-self: center;
	}

	&.c9-is-vertically-aligned-bottom {
		align-self: flex-end;
	}

	.is-grid {
		display: -ms-grid;
		display: grid;
		-ms-grid-columns: 1fr 1fr;
		grid-template-columns: 1fr 1fr;
		-ms-grid-rows: 1fr;
		grid-template-rows: 1fr;
		grid-gap: 0 2em;

		@media all and (-ms-high-contrast: none) {
			display: block;
		}

		article {
			margin-bottom: 2.5em;
			min-width: 0;

			@media all and (-ms-high-contrast: none) {
				padding-left: 10px;
				padding-right: 10px;
				display: inline-block;
				vertical-align: top;
			}
		}

		article:last-child {
			margin-bottom: 0px;
		}
	}

	.is-grid.columns-1 {
		-ms-grid-columns: 1fr;
		grid-template-columns: 1fr;

		h2.c9-block-post-grid-title {
			font-size: 3.6em;
		}

		h3.c9-block-post-grid-title {
			font-size: 3em;
		}

		h4.c9-block-post-grid-title {
			font-size: 2.6em;
		}

		h5.c9-block-post-grid-title {
			font-size: 2.2em;
		}

		h6.c9-block-post-grid-title {
			font-size: 1.8em;
		}
	}

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

		@media all and (-ms-high-contrast: none) {
			article {
				width: 48%;
			}
		}
	}

	.is-grid.columns-3 {
		-ms-grid-columns: 1fr 1fr 1fr;
		grid-template-columns: 1fr 1fr 1fr;

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

		@media all and (-ms-high-contrast: none) {
			article {
				width: 32%;
			}
		}
	}

	.is-grid.columns-4 {
		-ms-grid-columns: 1fr 1fr 1fr 1fr;
		grid-template-columns: 1fr 1fr 1fr 1fr;

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

		@media all and (-ms-high-contrast: none) {
			article {
				width: 24%;
			}
		}
	}

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

	.c9-post-grid-section-title {
		text-align: left;
	}

	.c9-block-post-grid-image {
		margin-bottom: 1em;

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

	.c9-block-post-grid-text {
		text-align: left;
	}

	a {
		text-decoration: none;
	}

	header .c9-block-post-grid-title {
		margin-top: 0;
		margin-bottom: 1em;
		font-size: 2em;
		line-height: 1.1;

		a {
			text-decoration: none;

			&:hover {
				text-decoration: underline;
				color: inherit;
			}
		}
	}

	header h1.c9-block-post-grid-title {
		font-size: 3.6em;
	}

	header h2.c9-block-post-grid-title {
		font-size: 2.8em;
	}

	header h3.c9-block-post-grid-title {
		font-size: 2em;
	}

	header h4.c9-block-post-grid-title {
		font-size: 1.8em;
	}

	header h5.c9-block-post-grid-title {
		font-size: 1.5em;
	}

	header h6.c9-block-post-grid-title {
		font-size: 1.2em;
	}

	.c9-block-post-grid-byline {
		font-size: 14px;
		color: #999;
		margin-bottom: 1em;
	}

	.c9-block-post-grid-author,
	.c9-block-post-grid-date {
		display: inline-block;

		&:not(:last-child):after {
			content: "\B7";
			vertical-align: middle;
			margin: 0 5px;
			line-height: 1;
		}
	}

	.c9-block-post-grid-author a {
		color: inherit;
		text-decoration: none;

		&:hover {
			color: inherit;
			text-decoration: underline;
		}
	}

	.c9-block-post-grid-text p {
		margin: 0 0 15px 0;
		font-size: inherit;

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

	.c9-block-post-grid-excerpt .c9-block-post-grid-more-link {
		display: inline-block;
		box-shadow: none;
		transition: 0.3s ease;
		font-weight: bold;
		color: black;
		text-decoration: none;

		&:hover {
			text-decoration: underline;
		}
	}

	.c9-block-post-grid-excerpt {
		font-size: 1.4em;
		margin-bottom: 3em;
	}

	.c9-block-post-grid-excerpt:empty {
		margin: 0px;
	}

	.c9-block-post-grid-excerpt div+p {
		margin-top: 1em;
	}

	.is-list {
		article {
			display: -ms-grid;
			display: grid;
			-ms-grid-columns: 30% 1fr;
			grid-template-columns: 30% 1fr;
			-ms-grid-rows: 1fr;
			grid-template-rows: 1fr;
			grid-gap: 0 2em;
			align-items: center;

			@media all and (-ms-high-contrast: none) {
				display: block;
			}

			&:before {
				display: none;
			}

			&:not(:last-child) {
				margin-bottom: 5%;
				padding-bottom: 5%;
			}

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

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

		article:not(.has-post-thumbnail) {
			-ms-grid-columns: 1fr;
			grid-template-columns: 1fr;
		}

		.c9-block-post-grid-image {
			margin-bottom: 0;

			@media all and (-ms-high-contrast: none) {
				width: 30%;
				display: inline-block;
				vertical-align: top;
			}

			@media only screen and (max-width: 600px) {
				margin-bottom: 5%;
			}
		}

		@media all and (-ms-high-contrast: none) {
			.c9-block-post-grid-text {
				width: 65%;
				padding-left: 5%;
				display: inline-block;
				vertical-align: top;
			}

			.post:not(.has-post-thumbnail) .c9-block-post-grid-text {
				width: 100%;
				padding-left: 0;
			}
		}

		.c9-block-post-grid-title {
			font-size: 3.6em;
		}

		h1.c9-block-post-grid-title {
			font-size: 4em;
		}

		h2.c9-block-post-grid-title {
			font-size: 3.6em;
		}

		h3.c9-block-post-grid-title {
			font-size: 3.2em;
		}

		h4.c9-block-post-grid-title {
			font-size: 2.8em;
		}

		h5.c9-block-post-grid-title {
			font-size: 2.4em;
		}

		h6.c9-block-post-grid-title {
			font-size: 2em;
		}

		.no-thumb .c9-block-post-grid-text {
			grid-column: span 2;
		}
	}
}

.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	height: 1px;
	overflow: hidden;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

.entry-content .c9-block-post-grid-excerpt p {
	line-height: 1.8;
}
