/**
 * Related Posts
 */
.related-posts {
	
	.posts {
		margin-bottom: -30px;
		padding-top: 58px;
		padding-bottom: 10px; // Margins will equal it out
	}
	
	// Set margins to support more than 3 posts
	.post {
		margin-bottom: 30px;
		
		// For medium devices only, revert it back to 3 columns
		// Columns fluid on medium - set in _grid.scss 
		@include breakpoint(medium, small) {
			float: left;
			width: 33.333%;
		}
		
		@include breakpoint(small) {
			max-width: 500px;
			margin-left: auto;
			margin-right: auto;
		}
	}
	
	.post:nth-child(3n+1) {
		clear: both;
	} 
	
	.image-link img {
		display: block;
		width: 100%;
		
		@include breakpoint(small) {
			max-width: initial;
		}
	}
	
	.post-title {
		display: block;
		margin-top: 25px;
		margin-bottom: 12px;
		font-size: 18px;
		font-weight: 500;
		line-height: 1.45;
		
		em {
			font-style: normal;
			font-weight: inherit;
		}
	}
	
	.post-meta {
		font-size: 11px;
		margin-bottom: 15px;
	}

	.content {
		padding-left: 20px;
		padding-right: 20px;
	
		@include breakpoint(x-small) {
			padding-left: 0;
			padding-right: 0;
		}
		
	}
}

.related-posts.grid-2 {
	.post:nth-child(3n+1) {
		clear: none;
	}
	
	.post:nth-child(2n+1) {
		clear: both;
	}
	
	.post {
		width: 50%;
		
		@include breakpoint(small) {
			width: 100%;
			max-width: 500px;
		}
	}
	
	.post-title {
		margin-top: 25px;
		margin-bottom: 15px;
		padding: 0;
		font-size: 20px;

		@include breakpoint(small) {
			font-size: 18px;
		}
	}
	
	.post-meta {
		font-size: 12px;
	}
}

/**
 * Special style for modern full
 */
.the-post-modern .related-posts {
	position: relative;
	margin-top: 75px;
	margin-bottom: 90px;

	@include breakpoint(false, large) {
		margin-left: -190px;
		margin-right: -190px;
	}

	@include breakpoint(large) {
		margin-left: calc(50% - 50vw);
		width: 100vw;
		max-width: 100vw;
	}

	// Background	
	&:before {
		content: "";
		background: #f7f7f7;
		position: absolute;
		width: 100vw;
		max-width: 100vw;
		margin-left: calc(50% - 50vw) !important;
		height: 100%;
		left: 0;
		right: 0;
		top: auto;
		bottom: auto;
		z-index: -1;
		border-top: 1px solid #f1f1f1;
		border-bottom: 1px solid #f1f1f1;
	}

	.section-head {
		padding-top: 60px;
		padding-bottom: 2px;
		
		&:after {
			content: "";
			position: absolute;
			top: 100%;
			left: calc(50% - 12px);
			margin-top: 6px;
			width: 24px;
			height: 2px;
			background: #000;
		}

		&:before {
			display: none;
		}

		.title {
			background: transparent;
			font-size: 24px;

			@include breakpoint(small) {
				font-size: 20px;
			}
		}
	}

	.posts {
		margin-bottom: 0;
		padding-bottom: 15px;

		@include breakpoint(large) {
			margin: 0 auto;
			max-width: 85%;
		}

		@include breakpoint(medium) {
			$size: fluid-size((small: 25px, large: 55px));
			max-width: calc(95vw - #{$size});
		}

		@include breakpoint(small) {
			padding-bottom: 30px;
		}
	}

	.post-title {
		font-size: 20px;
		margin-bottom: 15px;

		@include breakpoint(large) {
			font-size: 18px;
		}
	}

	.content {
		@include breakpoint(large) {
			padding-left: 0;
			padding-right: 0;
		}
	}

}

// Remove margins if related posts is the last element on page
.the-post-modern .the-post:last-child {
	.related-posts:last-child {
		margin-bottom: -97px;
		&:before {
			background: #fafafa;
		}
	}
}