.tpe-nextgen {
	--tpe-ng-bg: #fff;
	--tpe-ng-fg: #17191d;
	--tpe-ng-muted: #5d6470;
	--tpe-ng-border: #dfe2e7;
	--tpe-ng-accent: #5b4df5;
	box-sizing: border-box;
	color: var(--tpe-ng-fg);
	font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tpe-nextgen * {
	box-sizing: border-box;
}

.tpe-nextgen__card {
	max-width: 100%;
	overflow: hidden;
	border: 1px solid var(--tpe-ng-border);
	border-radius: 14px;
	background: var(--tpe-ng-bg);
}

.tpe-nextgen__card .tpe-nextgen__title,
.tpe-nextgen__card p {
	margin-top: 0;
}

.tpe-nextgen__external {
	display: inline-flex;
	align-items: center;
	min-height: 24px;
	color: var(--tpe-ng-accent);
	font-size: 0.85rem;
	font-weight: 650;
	text-decoration: none;
}

.tpe-nextgen__external:hover {
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.tpe-nextgen :is(a,button):focus-visible {
	outline: 3px solid var(--tpe-ng-accent);
	outline-offset: 3px;
}

.tpe-nextgen__media {
	max-width: 680px;
}

.tpe-nextgen__media-shell {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16/9;
	background: #111318;
}

.tpe-nextgen--figma .tpe-nextgen__media-shell {
	aspect-ratio: 4/3;
}

.tpe-nextgen--codepen .tpe-nextgen__media-shell {
	height: clamp(360px, 60vh, 640px);
	min-height: 360px;
	aspect-ratio: auto;
}

.tpe-nextgen__media-shell > img,
.tpe-nextgen__iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
	object-fit: cover;
}

.tpe-nextgen__play {
	position: absolute;
	inset: 50% auto auto 50%;
	display: grid;
	width: 58px;
	height: 58px;
	place-items: center;
	transform: translate(-50%, -50%);
	border: 0;
	border-radius: 50%;
	background: var(--tpe-ng-accent);
	color: #fff;
	cursor: pointer;
}

.tpe-nextgen__content {
	padding: 20px;
}

.tpe-nextgen__content small,
.tpe-nextgen__post small,
.tpe-nextgen__link small {
	color: var(--tpe-ng-muted);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.tpe-nextgen__content .tpe-nextgen__title {
	margin: 0.35rem 0;
	color: var(--tpe-ng-fg);
	font-size: 1.17rem;
	font-weight: 700;
}

.tpe-nextgen__content p {
	margin-bottom: 0.5rem;
	color: var(--tpe-ng-muted);
}

.tpe-nextgen__code header,
.tpe-nextgen__code footer {
	position: relative;
	padding: 16px 20px;
}

.tpe-nextgen__code header > span {
	color: var(--tpe-ng-muted);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
}

.tpe-nextgen__code .tpe-nextgen__title {
	margin: 0.25rem 0;
	color: var(--tpe-ng-fg);
	font-size: 1.17rem;
	font-weight: 700;
}

.tpe-nextgen__copy {
	position: absolute;
	top: 16px;
	right: 20px;
	padding: 7px 11px;
	border: 1px solid var(--tpe-ng-border);
	border-radius: 6px;
	background: transparent;
	cursor: pointer;
	min-height: 40px;
}

@media (prefers-reduced-motion: reduce) {

	.tpe-nextgen *,
	.tpe-nextgen *::before,
	.tpe-nextgen *::after {
		scroll-behavior: auto !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

.tpe-nextgen__code pre {
	max-height: 480px;
	margin: 0;
	overflow: auto;
	padding: 14px 0;
	background: #0d0f12;
	color: #edf0f5;
	font: 13px/1.65 ui-monospace, monospace;
}

.tpe-nextgen__line {
	display: block;
	min-width: max-content;
	padding: 0 16px;
	white-space: pre;
}

.tpe-nextgen__line b {
	display: inline-block;
	width: 3rem;
	margin-right: 12px;
	border-right: 1px solid #30343c;
	color: #8f98a8;
	font-weight: 400;
	text-align: right;
	padding-right: 12px;
	user-select: none;
}

.tpe-nextgen__code footer {
	display: flex;
	justify-content: space-between;
	color: var(--tpe-ng-muted);
	font-size: 0.8rem;
}

.tpe-nextgen__post {
	max-width: 620px;
	padding: 22px;
}

.tpe-nextgen__post header {
	display: flex;
	gap: 12px;
	align-items: center;
}

.tpe-nextgen__post header img {
	width: 44px;
	height: 44px;
	border-radius: 50%;
}

.tpe-nextgen__post header .tpe-nextgen__title {
	margin: 0;
	color: var(--tpe-ng-fg) !important;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.3;
}

.tpe-nextgen__post header small {
	display: block;
	margin-top: 2px;
	color: var(--tpe-ng-muted) !important;
}

.tpe-nextgen__post > p {
	margin: 18px 0;
	white-space: pre-wrap;
}

.tpe-nextgen__post-image {
	width: 100%;
	max-height: 420px;
	border-radius: 10px;
	object-fit: cover;
}

.tpe-nextgen__post footer {
	display: flex;
	justify-content: space-between;
	margin-top: 16px;
	color: var(--tpe-ng-muted);
}

.tpe-nextgen__link {
	display: grid;
	max-width: 760px;
	grid-template-columns: minmax(180px, 35%) 1fr;
}

.tpe-nextgen__link-image {
	width: 100%;
	height: 100%;
	min-height: 220px;
	object-fit: cover;
}

.tpe-nextgen__link > div {
	padding: 24px;
}

/* stylelint-disable-next-line no-descending-specificity */
.tpe-nextgen__link .tpe-nextgen__title {
	margin: 0.4rem 0;
	color: var(--tpe-ng-fg);
	font-size: 1.17rem;
	font-weight: 700;
}

.tpe-nextgen__link p {
	color: var(--tpe-ng-muted);
}

@media (prefers-color-scheme: dark) {

	.tpe-nextgen {
		--tpe-ng-bg: #15171b;
		--tpe-ng-fg: #f2f3f5;
		--tpe-ng-muted: #b0b6c0;
		--tpe-ng-border: #30343c;
		--tpe-ng-accent: #9b8cff;
		color-scheme: dark;
	}
}

@media (max-width: 520px) {

	.tpe-nextgen__link {
		grid-template-columns: 1fr;
	}

	.tpe-nextgen__link-image {
		min-height: 180px;
		aspect-ratio: 16/9;
	}

	.tpe-nextgen__content,
	.tpe-nextgen__post {
		padding: 16px;
	}

	.tpe-nextgen__code header,
	.tpe-nextgen__code footer {
		padding: 14px;
	}

	.tpe-nextgen__copy {
		position: static;
		margin-top: 10px;
	}

	.tpe-nextgen__code footer {
		gap: 8px;
		flex-wrap: wrap;
	}
}
