/*---------------------------------------------------------
 5. Posts (_posts.scss)
-------------------------------------------------------- */

.post-grid {
	text-align: center;
	position: relative;
	background-color: #000;
	color: #fff;
	overflow: hidden;

	@include transform(translate3d(0, 0, 0));

	a {
		color: #fff;
		border: 0;
		line-height: 1.25;
	}

	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.hover-overlay {
	.post-grid {
		position: relative;

		.post-content,
		.post-content-overlay,
		.entry-header,
		.entry-meta,
		.entry-categories,
		.post-excerpt {
			@include transition(all 200ms);
		}
	}

	.post-content-overlay {
		position: absolute;
		z-index: 1100;
		opacity: 0;
		display: block;
		cursor: pointer;

		button {
			@extend %vertical-align;

			color: #fff;
			border-color: currentColor;

			&:hover {
				background: $accent;
			}
		}

		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		height: 100%;
	}

	&.no-touch {
		.post-content:hover {
			.post-content-overlay {
				opacity: 1;
			}

			&:after {
				opacity: 1;
				margin-left: 0;
			}

			.entry-header,
			.entry-meta,
			.entry-categories,
			.post-excerpt {
				opacity: 0;

				a {
					pointer-events: none;
				}
			}
		}
	}
}

.post-grid.post-grid {
	padding-bottom: 0;
}

.entry-title {
	@extend %break-word;
}

.post-content {
	@extend %vertical-align;

	padding: {
		left: 50px;
		right: 50px;
		top: 10px;
		bottom: 10px;
	}
	z-index: 1002;

	@include backface-visibility(hidden);

	.entry-title {
		a {
			display: block;
			border: 0;
		}
	}

	display: inline-block;

	.entry-header {
		margin-bottom: 20px;
	}
}

.post-excerpt {
	@include rem('margin-top', 20px);

	line-height: 1.8;
	max-height: 195px;
	overflow: hidden;
}

.run-in,
.stag-intro-text {
	@include rem('font-size', 25px);

	line-height: 1.7;
	margin-top: 0;

	@include rem('margin-bottom', 80px);
}

.post-cover-link {
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 1001;

	@include backface-visibility(hidden);
}

.textwidget,
.entry-content,
.page-content,
.comment-content {
	@extend %cf;

	line-height: 1.8;

	@include word-break(break-word);
	@include rem('font-size', 20px);

	p,
	ul,
	dl,
	table,
	blockquote {
		@include rem('margin-bottom', $base * 3);
	}

	h1 {
		@include rem('margin-bottom', 30px);
	}

	h2 {
		@include rem('margin-bottom', 25px);
	}

	h3 {
		@include rem('margin-bottom', 22px);
	}

	h4 {
		@include rem('margin-bottom', 18px);
	}

	h5 {
		@include rem('margin-bottom', 15px);

		// text-transform: uppercase;
		font-weight: normal;
	}

	h6 {
		@include rem('margin-bottom', 15px);

		// text-transform: uppercase;
		font-weight: normal;
	}

	// p:last-of-type {
	// 	margin-bottom: 0;
	// }

	ul {
		list-style: disc;
	}

	ol {
		list-style: decimal;
	}

	ul,
	ol {
		list-style-position: inside;

		ul,
		ol {
			padding-left: 30px;
			margin-bottom: 0;
		}
	}

	.stag-icon-link {
		border: 0;
	}
}

.textwidget {
	.site-footer & {
		@include rem('font-size', 17px);

		line-height: 1.6;
		color: #2c2c2c;
	}

	p,
	ul,
	dl,
	table {
		@include rem('margin-bottom', $base * 2);
	}

	p:last-child {
		margin-bottom: 0;
	}
}

.comment-content {
	@include rem('font-size', 16px);

	p,
	ul,
	dl,
	table {
		@include rem('margin-bottom', $base * 1.5);
	}
}

.entry-footer {
	border-top: 2px solid #333;
	border-bottom: 2px solid #333;
	margin: {
		top: $base;
		bottom: $base;
	}
	overflow: hidden;

	@include rem('padding', $base 0);

	.one-of-two {
		vertical-align: middle;

		@include media(max-width $one) {
			text-align: center;
			padding-top: 10px;
		}
	}
}

.post-share-buttons {
	@include media($grid-breakpoint) {
		text-align: right;

		h5 {
			display: inline-block;
			margin-right: 10px;
		}
	}

	@include media(max-width($grid-breakpoint - 1)) {
		h5 {
			margin: 20px 0;
		}

		.button {
			display: block;
			width: 100%;
			text-align: center;
			margin-top: 20px;
		}
	}
}

.entry-meta {
	span {
		&:first-child::before {
			display: none;
		}

		&::before {
			content: '\2022';
			display: inline-block;
			padding: 0 7px 0 7px;
			font-size: 20px;
			position: relative;
			top: 3px;
		}
	}
}

.site,
.post {
	position: relative;
}

.post-cover {
	position: absolute;
	width: 100%;
	height: 100%;
	background-repeat: no-repeat;
	background-position: center center;

	@include background-size(cover);
	@include transform(translate3d(0, 0, 0));
}

.premium-tag,
.sticky-tag {
	display: inline-block;
	padding: 6px 18px;
	font-size: 14px;
	letter-spacing: 2px;
	text-transform: uppercase;
	border: 2px solid #fff;
	font-weight: 700;
	margin: 0 10px 40px 10px;

	@include media(max-width $one) {
		padding: 6px 14px;
		font-size: 12px;
		margin: 0 5px 20px 5px;
	}
}

.article-cover {
	position: relative;
	overflow: hidden;
	height: 100%;
	height: 100vh;
	background: #000;
	color: #fff;
	-webkit-overflow-scrolling: touch;

	@include rem('margin-bottom', $base * 4);
	@include transform(translate3d(0, 0, 0));

	@include media($grid-breakpoint) {
		min-height: 500px;
	}

	.admin-bar & {
		height: calc(100vh - 32px);

		@include media(max-width 782px) {
			height: calc(100vh - 46px);
		}
	}

	@include media(max-width $grid-breakpoint) {
		min-height: 400px;
	}

	a {
		color: #fff;
		border: 0;
	}

	&__content {
		position: absolute;
		width: 100%;
		text-align: center;
		top: 50%;
		left: 0px;
		right: 0px;
		padding: {
			left: $base + 10;
			right: $base + 10;
		}
		-webkit-overflow-scrolling: touch;

		@include transform(translateY(-50%));
		@include backface-visibility(hidden);
	}

	&__inner {
		position: relative;
		z-index: 3;
		height: 100%;

		@include rem('padding-top', 64px);
		@include rem('padding-bottom', 64px);
	}

	&__background {
		position: absolute;
		width: 100%;
		height: 100%;
		background-repeat: no-repeat;
		background-position: center;
		z-index: 2;

		@include background-size(cover);
		@include transform(translate3d(0, 0, 0));
	}

	.entry-meta {
		margin-top: 20px;

		@include backface-visibility(hidden);
		@include transform(translate3d(0, 0, 0));
	}

	.entry-title {
		@include rem('font-size', 75px);

		line-height: 1.1;

		@include media(max-width 480px) {
			@include rem('font-size', 30px);
		}

		@include media(min-width 481px max-width 768px) {
			@include rem('font-size', 60px);
		}
	}

	&__arrow {
		position: absolute;
		bottom: 30px;
		right: 30px;
		z-index: 4;
		font-size: 30px;
		line-height: 1;
		cursor: pointer;
		padding-top: 60px;
		font-size: 15px;
		border: 0;

		&.no-text {
			right: 45px;
		}

		span {
			position: absolute;
			top: 0;
			left: 50%;
			width: 30px;
			height: 50px;
			margin-left: -15px;
			border: 2px solid #fff;
			border-radius: 50px;

			&:before {
				position: absolute;
				top: 10px;
				left: 50%;
				content: '';
				width: 6px;
				height: 6px;
				margin-left: -3px;
				background-color: #fff;
				border-radius: 100%;
				-webkit-animation: sdb10 2s infinite;
				animation: sdb10 2s infinite;
			}
		}

		// hide on mobile
		@include media(max-width $one) {
			display: none;
		}
	}

	&__caption {
		position: absolute;
		bottom: 35px;
		color: white;
		z-index: 4;

		@include rem(font-size, 15px);

		opacity: 0.75;
		width: 100%;

		p {
			padding-left: 30px;
			max-width: 80%;
		}

		a {
			border-bottom: 1px solid;
		}
	}
}

.article-cover.page-cover {
	min-height: auto;
	height: auto;
	position: relative;
}

.page-cover {
	@include rem(padding, 125px 0);

	.entry-meta,
	.article-cover__arrow {
		display: none;
	}

	.article-cover__background {
		top: 0;
	}

	.article-cover__content {
		position: relative;
		top: 0;

		@include transform(none);
	}
}

@-webkit-keyframes sdb10 {
	0% {
		-webkit-transform: translate(0, 0);
		opacity: 0;
	}

	40% {
		opacity: 1;
	}

	80% {
		-webkit-transform: translate(0, 20px);
		opacity: 0;
	}

	100% {
		opacity: 0;
	}
}

@keyframes sdb10 {
	0% {
		transform: translate(0, 0);
		opacity: 0;
	}

	40% {
		opacity: 1;
	}

	80% {
		transform: translate(0, 20px);
		opacity: 0;
	}

	100% {
		opacity: 0;
	}
}

.background-video {
	position: absolute;
	top: 0px;
	right: 0px;
	min-width: 100%;
	min-height: 100%;
	width: auto;
	height: auto;
	z-index: 3;
	overflow: hidden;
	max-width: none;
	object-fit: cover;
	left: 0;

	@include media(max-width $grid-breakpoint) {
		display: none;
	}
}

@include media($grid-breakpoint) {
	.has-video {
		.article-cover__caption,
		.article-cover__background {
			display: none;
		}
	}
}

@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) {
	.background-video {
		display: none;
	}

	.article-cover {
		&__caption,
		&__background {
			display: block !important;
		}
	}
}

.single,
.page {
	.entry-meta,
	.entry-footer,
	.post-navigation,
	.comments-area {
		@extend %site-width;
	}
}

.page-content,
.entry-content {
	@extend %site-width;
}

div.wp-caption {
	@include media(max-width $content-width) {
		max-width: 100% !important;
	}
}

.site-content,
.screen-content {
	.site-nav-drawer-open & {
		overflow: hidden;
	}
}

.tiled-gallery {
	@include rem('margin', 50px 0);
}

.related-posts {
	@include rem('margin-top', 50px);

	@extend %cf;

	.post-grid {
		&:nth-last-child(2),
		&:nth-last-child(1) {
			border-bottom: none;

			@include media(max-width $one) {
				border-bottom: 2px solid #fff;
			}
		}
	}
}

.restricted-post {
	@include rem('padding-bottom', 80px);

	text-align: center;
}

.page-links {
	@include rem('margin', $base 0);
	@include rem('padding-top', $base);

	border-top: 2px solid #333;
	text-align: center;
	font-size: 16px;

	h5,
	span {
		display: inline-block;
		vertical-align: middle;
		line-height: 1;
		margin: auto;
	}

	h5 {
		margin-right: 10px;
	}

	a {
		color: inherit !important;
		display: inline-block;
	}

	> {
		a,
		span {
			margin: 0 9px;
		}
	}

	span {
		width: 46px;
		height: 46px;
		text-align: center;
		padding-top: 14px;
		border: 2px solid #020303;

		@include transition(all 100ms ease-in-out);

		&:hover {
			background-color: #020303;
			color: white;
		}
	}

	> span {
		background-color: #020303;
		color: white;
	}
}

.entry-meta,
.entry-categories {
	a {
		@include transition(opacity 150ms);

		&:hover {
			opacity: 0.6;
		}
	}
}

.entry-categories {
	margin-top: 5px;
}

.post-navigation {
	@extend %cf;

	@include rem(padding-top, 20px);

	border-top: 2px solid #333;
	font-weight: bold;
	line-height: 1;

	@include media(min-width $grid-breakpoint) {
		.nav-previous {
			float: left;
		}

		.nav-next {
			float: right;
		}
	}

	@include media(max-width($grid-breakpoint - 1)) {
		.nav-link {
			text-align: center;

			&:first-of-type {
				margin-bottom: 10px;
			}
		}
	}

	a {
		color: currentColor;
		border: 0;
	}

	.arrow {
		@include transition(padding 200ms);
		@include transform(translated3d(0, 0, 0));
	}

	.nav-previous {
		&:hover {
			.arrow {
				padding-right: 7px;
			}
		}
	}

	.nav-next {
		&:hover {
			.arrow {
				padding-left: 7px;
			}
		}
	}
}

.post-grid,
.article-cover {
	text-shadow: 1px 1px 3px rgba(black, 0.3);
}

.author {
	.author-avatar {
		margin-bottom: 30px;

		img {
			border-radius: 50%;
			max-width: 84px;
		}
	}
}

.custom-header-media img,
.custom-header-media video,
.custom-header-media iframe {
	height: auto;
	left: 50%;
	max-width: 1000%;
	min-height: 100%;
	min-width: 100%;
	min-width: 100vw;

	/* vw prevents 1px gap on left that 100% has
width: auto;
top: 50%;
padding-bottom: 1px; /* Prevent header from extending beyond the footer */
	-ms-transform: translateX(-50%) translateY(-50%);
	-moz-transform: translateX(-50%) translateY(-50%);
	-webkit-transform: translateX(-50%) translateY(-50%);
	transform: translateX(-50%) translateY(-50%);
}

.custom-header-media {
	position: absolute;
	height: 100%;
	max-height: 100%;
	overflow: hidden;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: -1;
}

/* For browsers that support 'object-fit' */
@supports (object-fit: cover) {
	.custom-header-media img,
	.custom-header-media video,
	.custom-header-media iframe {
		position: absolute;
		height: auto;
		left: 50%;
		max-width: 1000%;
		min-height: 100%;
		min-width: 100%;
		min-width: 100vw;
		width: auto;
		top: 50%;
		transform: translateX(-50%) translateY(-50%);
	}
}

.wp-custom-header-video-button {
	display: none;
	position: absolute;
	top: 30px;
	right: 30px;
	color: #fff;
	border-color: #fff;
	background: transparent;
	z-index: 21;
	padding: 16px;

	&:hover {
		background: transparent;
	}

	.fas {
		width: 14px;
		text-align: center;
	}

	.site-nav-drawer-open & {
		display: none;
	}

	.header-over & {
		top: auto;
		bottom: 30px;
	}

	@include media(max-width 480px) {
		display: none;
	}
}

.content-area,
.site-footer {
	position: relative;
	z-index: 20;
}

figure {
	@include rem('margin-bottom', 60px);
}

@media (min-width: 750px) {
	.site-main:not(.single-sidebar-on) .wp-caption.alignnone,
	.site-main:not(.single-sidebar-on) img.alignnone {
		margin-left: calc(50% - 50vw);
		margin-right: calc(50% - 50vw);
		width: 100vw;
		max-width: 1000%;
	}
	.site-main:not(.single-sidebar-on) .alignfull {
		margin-left: calc(50% - 50vw);
		margin-right: calc(50% - 50vw);
		width: auto;
		max-width: 1000%;

		img {
			width: 100%;
		}
	}

	.site-main:not(.single-sidebar-on) .alignwide {
		margin-left: calc(25% - 25vw);
		margin-right: calc(25% - 25vw);
		width: auto;
		max-width: 1000%;
	}
}

.pagination {
	text-align: center;
	color: #494949;
	font-weight: bold;

	a {
		color: inherit;
		border: none;

		&:hover {
			background: #000;
			color: white;
		}
	}

	.page-numbers {
		display: inline-flex;
		text-transform: uppercase;
		background: #f6f6f6;
		min-width: 46px;
		justify-content: center;
		padding: 10px 15px;
		border: 1px solid transparent;
	}

	.current {
		border-color: darken(#f6f6f6, 10%);
	}

	.dots,
	.current {
		background: transparent;
	}
}

.wp-block-quote {
	border-left: 0 !important;
}


.entry-content {
	p,
	ul,
	dl,
	table,
	blockquote {
		margin-bottom: 28px;
	}
}
