/*
 * val-machine — local card in place of a YouTube / Spotify / X embed
 * (includes/embeds.php). Theme tokens, so it follows the sun too.
 */

.val-embed {
	box-sizing: border-box;
}
.wp-block-embed:has(.val-embed) {
	margin-block: 28px;
}

/* The card stays in the flow (16:9, taller if its text needs it); once
   loaded, the iframe fills WordPress's 16:9 box as before. */
.wp-has-aspect-ratio .wp-block-embed__wrapper:has(> .val-embed:not([data-val-loaded]))::before {
	display: none;
}
.wp-has-aspect-ratio .val-embed[data-val-loaded] {
	position: absolute;
	inset: 0;
}
.val-embed--youtube .val-embed__card {
	min-height: 0;
	aspect-ratio: 16 / 9;
}
.val-embed iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}
.val-embed--spotify iframe {
	height: 152px;
	border-radius: 12px;
}

.val-embed__card {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 10px;
	width: 100%;
	height: 100%;
	min-height: 200px;
	padding: clamp(16px, 4vw, 32px);
	border: 1px solid var(--ln, #e6e8ec);
	border-radius: 18px;
	background: var(--sf, #f4f5f7);
	color: var(--ink, #0f1115);
	text-align: left;
}
.val-embed--x .val-embed__card {
	min-height: 0;
	margin-top: 12px;
}
.val-embed__title {
	margin: 0;
	font-size: clamp(17px, 2.2vw, 21px);
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: -0.01em;
}
.val-embed__note {
	margin: 0;
	max-width: 60ch;
	font-size: 15px;
	line-height: 1.5;
	color: var(--mu, #5b6270);
}
.val-embed__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 20px;
	margin: 4px 0 0;
}
.val-embed__btn {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	padding: 0 22px;
	border: 1px solid var(--ink, #0f1115);
	border-radius: 12px;
	background: var(--ink, #0f1115);
	color: var(--bg, #fff);
	font-family: var(--val-font, inherit);
	font-size: 16px;
	font-weight: 500;
	cursor: pointer;
}
.val-embed__btn:hover { opacity: .9; }
.val-embed__btn:focus-visible,
.val-embed .val-embed__open:focus-visible {
	outline: 2px solid var(--ac, #2a33e0);
	outline-offset: 3px;
}
.val-embed__btn[aria-busy="true"] { opacity: .7; cursor: progress; }
/* Two classes: beats the article's « .val-article__content a » (accent). */
.val-embed .val-embed__open {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	font-size: 15px;
	color: var(--ink, #0f1115);
	text-underline-offset: 4px;
}
