/**
 * Preluence News — external video embeds.
 *
 * Only the surrounding presentation lives here; the player belongs to the
 * platform. Everything is click-to-load by default so no third-party request
 * is made until the visitor asks for the video.
 */

.pn-ext__frame {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: var(--pn-ext-aspect, 16 / 9);
	overflow: hidden;
	border-radius: var(--pn-radius, 8px);
	background: #0b0d10;
}

.pn-ext__frame iframe,
.pn-ext__frame .pn-ext__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.pn-ext__poster {
	object-fit: cover;
}

.pn-ext__poster--none {
	background: linear-gradient(135deg, #111827, #1f2937);
}

.pn-ext__play {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: var(--pn-accent, #d92d20);
	opacity: 0.92;
	transition: transform 0.2s var(--pn-ease, ease), opacity 0.2s var(--pn-ease, ease);
}

.pn-ext__frame--facade {
	cursor: pointer;
}

.pn-ext__frame--facade:hover .pn-ext__play,
.pn-ext__frame--facade:focus-visible .pn-ext__play {
	transform: scale(1.06);
	opacity: 1;
}

.pn-ext__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-block: 0.75rem;
}

.pn-ext__tab {
	border: 1px solid var(--pn-border);
	border-radius: 999px;
	background: transparent;
	color: inherit;
	padding: 0.3rem 0.85rem;
	font-size: 0.8125rem;
	cursor: pointer;
}

.pn-ext__tab.is-active {
	border-color: var(--pn-primary);
	background: color-mix(in srgb, var(--pn-primary) 12%, transparent);
}

.pn-ext--single .pn-ext__frame,
.pn-ext--hero .pn-ext__frame {
	aspect-ratio: var(--pn-ext-aspect, 16 / 9);
}

/* Portrait sources (TikTok, Reels) keep their own shape. */
.pn-ext--portrait .pn-ext__frame,
.pn-ext__frame[data-provider="tiktok"],
.pn-ext__frame[data-provider="instagram"] {
	aspect-ratio: var(--pn-ext-aspect, 9 / 16);
	max-width: min(100%, 420px);
	margin-inline: auto;
}

.pn-ext--empty .pn-ext__note {
	color: var(--pn-text-muted);
	font-style: italic;
}
.pn-ext__hint {
	margin-block-start: 0.35rem;
	padding: 0.5rem 0.75rem;
	border-inline-start: 3px solid var(--pn-accent, #d92d20);
	background: color-mix(in srgb, var(--pn-accent, #d92d20) 8%, transparent);
	font-size: 0.875rem;
}
/* ---------- External channel layout ----------
   Self-sufficient grid and card polish, scoped to .pn-ext so it applies whether
   or not the internal video stylesheet is on the page. */

.pn-ext {
	margin-block: var(--pn-section-gap, clamp(1.5rem, 3vw, 2.75rem));
}

.pn-ext__title {
	margin-block: 0 0.75rem;
	font-family: var(--pn-font-heading);
}

.pn-ext .pn-vgrid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
	gap: 1rem;
}

.pn-ext .pn-vcard {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--pn-border);
	border-radius: var(--pn-radius, 8px);
	background: var(--pn-surface, var(--pn-bg));
	cursor: pointer;
	transition: transform 0.2s var(--pn-ease, ease), box-shadow 0.2s var(--pn-ease, ease);
}

.pn-ext .pn-vcard:hover,
.pn-ext .pn-vcard:focus-visible {
	transform: translateY(-3px);
	box-shadow: 0 14px 30px -18px rgb(11 16 32 / 55%);
}

.pn-ext .pn-vcard:focus-visible {
	outline: 2px solid var(--pn-primary);
	outline-offset: 2px;
}

.pn-ext .pn-vcard__media {
	position: relative;
	aspect-ratio: var(--pn-ext-aspect, 16 / 9);
	background: #0b0d10;
}

.pn-ext .pn-vcard__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pn-ext .pn-vcard__noimg {
	position: absolute;
	inset: 0;
	background: linear-gradient(135deg, #111827, #1f2937);
}

.pn-ext .pn-vcard__play {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: #fff;
	filter: drop-shadow(0 4px 12px rgb(0 0 0 / 45%));
	transition: transform 0.2s var(--pn-ease, ease);
}

.pn-ext .pn-vcard:hover .pn-vcard__play {
	transform: scale(1.08);
}

.pn-ext .pn-vcard__duration {
	position: absolute;
	inset-block-end: 0.5rem;
	inset-inline-end: 0.5rem;
	padding: 0.1rem 0.4rem;
	border-radius: 4px;
	background: rgb(0 0 0 / 78%);
	color: #fff;
	font-size: 0.75rem;
	font-variant-numeric: tabular-nums;
}

.pn-ext .pn-vcard__body {
	display: grid;
	gap: 0.35rem;
	padding: 0.75rem 0.85rem 0.9rem;
}

.pn-ext .pn-vcard__title {
	margin: 0;
	font-size: 1rem;
	line-height: 1.25;
	overflow-wrap: break-word;
}

.pn-ext .pn-vcard__cat {
	font-family: var(--pn-font-ui);
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--pn-text-muted);
}

/* Portrait sources keep their shape inside the grid. */
.pn-ext .pn-vcard--ext[data-provider="tiktok"] .pn-vcard__media,
.pn-ext .pn-vcard--ext[data-provider="instagram"] .pn-vcard__media {
	aspect-ratio: var(--pn-ext-aspect, 9 / 16);
	max-height: 70vh;
}

/* ---------- Lightbox ---------- */

.pn-ext-lb {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: none;
	place-items: center;
	padding: clamp(0.75rem, 4vw, 3rem);
	background: rgb(6 8 14 / 88%);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.pn-ext-lb.is-open {
	display: grid;
}

.pn-ext-lb__inner {
	position: relative;
	width: min(100%, 1100px);
	aspect-ratio: var(--pn-ext-aspect, 16 / 9);
	max-height: 88vh;
}

.pn-ext-lb__inner[data-provider="tiktok"],
.pn-ext-lb__inner[data-provider="instagram"] {
	width: min(100%, 420px);
	aspect-ratio: 9 / 16;
}

.pn-ext-lb__inner iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: var(--pn-radius, 8px);
}

.pn-ext-lb__close {
	position: absolute;
	inset-block-start: 1rem;
	inset-inline-end: 1rem;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgb(255 255 255 / 14%);
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.pn-ext-lb__close:hover {
	background: rgb(255 255 255 / 26%);
}

html.pn-ext-locked {
	overflow: hidden;
}