/* NLH Post Overlay */
html.nlh-overlay-open,
html.nlh-overlay-open body {
	overflow: hidden;
}

.nlh-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 4vh 3vw;
	background: rgba( 10, 10, 10, 0.72 );
	opacity: 0;
	transition: opacity 0.25s ease;
	cursor: pointer; /* the dark area is clickable */
}

.nlh-overlay[hidden] {
	display: none;
}

.nlh-overlay.is-visible {
	opacity: 1;
}

.nlh-overlay__panel {
	position: relative;
	width: min( 1100px, 100% );
	max-height: 92vh;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var( --wp--preset--color--base, #fff );
	color: var( --wp--preset--color--contrast, #111 );
	box-shadow: 0 20px 60px rgba( 0, 0, 0, 0.35 );
	cursor: auto;
	transform: translateY( 24px );
	transition: transform 0.25s ease;
	outline: none;
}

.nlh-overlay.is-visible .nlh-overlay__panel {
	transform: none;
}

.nlh-overlay__body {
	padding: clamp( 24px, 4vw, 56px );
}

/* The fetched <main> may carry full-page spacing; tone it down inside the panel. */
.nlh-overlay__body > main,
.nlh-overlay__body > article {
	margin: 0 !important;
	padding-top: 0 !important;
}

.nlh-overlay__body img,
.nlh-overlay__body iframe,
.nlh-overlay__body video {
	max-width: 100%;
}

.nlh-overlay__close {
	position: sticky;
	top: 0;
	float: right;
	z-index: 2;
	width: 48px;
	height: 48px;
	margin: 8px 8px 0 0;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 36px;
	line-height: 1;
	cursor: pointer;
}

.nlh-overlay__close:hover,
.nlh-overlay__close:focus-visible {
	opacity: 0.6;
}

.nlh-overlay__loading {
	margin: 4em 0;
	text-align: center;
	opacity: 0.6;
}

@media ( max-width: 600px ) {
	.nlh-overlay {
		padding: 0;
	}

	.nlh-overlay__panel {
		max-height: 100vh;
		height: 100vh;
	}
}

/* Post image + video slot (post template) */
.nlh-post-video {
	margin: 0 0 var( --wp--preset--spacing--50, 2rem );
}

.nlh-post-video iframe,
.nlh-post-video video {
	display: block;
	width: 100% !important;
	height: auto !important;
	aspect-ratio: 16 / 9;
	border: 0;
}

/* SoundCloud and similar audio embeds are short, not 16:9. */
.nlh-post-video iframe[src*="soundcloud"] {
	aspect-ratio: auto;
	height: 166px !important;
}

.nlh-overlay__body .wp-block-post-featured-image img {
	width: 100%;
	height: auto;
}

@media ( prefers-reduced-motion: reduce ) {
	.nlh-overlay,
	.nlh-overlay__panel {
		transition: none;
	}
}
