/**
 * Social embeds (YouTube facade, TikTok iframe, Instagram/Facebook blockquotes).
 * Rendered by includes/social-embeds.php inside story/restaurant bodies.
 * Fixed-size boxes so late-loading third-party content cannot shift the page.
 */

.nge-embed {
	margin: 24px auto;
	max-width: 100%;
}

/* ── YouTube: 16:9 facade box, iframe swaps in on tap ── */
.nge-embed--youtube {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #1A1714;
	border-radius: 8px;
	overflow: hidden;
}

.nge-embed--youtube .nge-embed__facade {
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.nge-embed--youtube .nge-embed__facade img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.nge-embed--youtube .nge-embed__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 64px;
	height: 46px;
	border-radius: 12px;
	background: rgba(26, 23, 20, 0.85);
	color: #FFFFFF;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .2s ease;
}

.nge-embed--youtube .nge-embed__facade:hover .nge-embed__play,
.nge-embed--youtube .nge-embed__facade:focus-visible .nge-embed__play {
	background: #C4A45D;
}

.nge-embed--youtube iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ── TikTok: portrait iframe, TikTok's own embed width ── */
.nge-embed--tiktok {
	max-width: 325px;
}

.nge-embed--tiktok iframe {
	display: block;
	width: 100%;
	height: 745px;
	border: 0;
	border-radius: 9px;
	background: #F4F4F4;
}

/* ── Instagram / Facebook: reserve space; the SDK resizes the card in place ── */
.nge-embed--instagram {
	max-width: 540px;
	min-height: 420px;
	/* Instagram's embed.js hard-codes min-width:326px !important on its
	   iframe (inline, unbeatable from a stylesheet). Centre it and clip the
	   spill so a narrow phone (<390px) never gets horizontal page scroll;
	   the card's own inner padding absorbs the trim. */
	display: flex;
	flex-direction: column;
	align-items: center;
	overflow-x: hidden;
}

/* Facebook: official iframe plugin, fixed heights so nothing shifts. */
.nge-embed--facebook {
	max-width: 500px;
}

.nge-embed--facebook iframe {
	display: block;
	width: 100%;
	border: 0;
	background: #F4F4F4;
}

.nge-embed--facebook-post iframe {
	height: 680px;
}

.nge-embed--facebook-video iframe {
	height: 430px;
}

/* Fallback card shown until the network SDK renders (and for no-JS readers). */
.nge-embed--instagram blockquote,
.nge-embed--facebook blockquote {
	margin: 0;
	padding: 24px;
	border: 1px solid #EAEAEA;
	border-radius: 8px;
	background: #FAFAFA;
	font-family: Open Sans, system-ui, sans-serif;
	font-size: 14px;
}

.nge-embed--instagram blockquote a,
.nge-embed--facebook blockquote a {
	color: #C4A45D;
	text-decoration: underline;
	text-underline-offset: 2px;
	word-break: break-word;
}

/* SDK-rendered iframes centre inside the reserved column. */
.nge-embed--instagram iframe.instagram-media,
.nge-embed--instagram iframe.instagram-media-rendered {
	margin-left: auto !important;
	margin-right: auto !important;
}

/* Editor-only hint when a URL cannot be embedded. */
.nge-embed--error {
	padding: 12px 16px;
	border: 1px dashed #C4A45D;
	border-radius: 8px;
	background: #FDF9F0;
	font-size: 14px;
}

.nge-embed--error code {
	word-break: break-all;
}
