/* JCNM YouTube — the cards. Fonts and text colour come from the theme.
   Desktop from 960px (Uncode's breakpoint): Videos/Live 3 across, Shorts 4.
   Phones: Videos/Live 1 across, Shorts 2. */

.jcnm-yt {
	--jcnm-yt-accent: #c9a227;
	--jcnm-yt-gap: 16px;
	margin: 0 0 2em;
}

.jcnm-yt__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 28px var(--jcnm-yt-gap);
}

.jcnm-yt--short .jcnm-yt__grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 960px) {
	.jcnm-yt { --jcnm-yt-gap: 24px; }
	.jcnm-yt__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.jcnm-yt--short .jcnm-yt__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.jcnm-yt__card { margin: 0; }

.jcnm-yt__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.jcnm-yt__frame {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 4px;
	background: #1a1a1a;
}

.jcnm-yt--short .jcnm-yt__frame { aspect-ratio: 9 / 16; }

.jcnm-yt__poster,
.jcnm-yt__frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	object-fit: cover;
}

.jcnm-yt__play {
	position: absolute;
	left: 12px;
	bottom: 12px;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.72);
	transition: background-color 0.15s;
}

.jcnm-yt__play::after {
	content: "";
	position: absolute;
	left: 17px;
	top: 13px;
	border-style: solid;
	border-width: 9px 0 9px 14px;
	border-color: transparent transparent transparent #fff;
}

.jcnm-yt__link:hover .jcnm-yt__play,
.jcnm-yt__link:focus-visible .jcnm-yt__play {
	background: var(--jcnm-yt-accent);
}

.jcnm-yt__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.jcnm-yt__title {
	display: -webkit-box;
	margin-top: 10px;
	font-size: 0.95em;
	line-height: 1.4;
	overflow: hidden;
	overflow-wrap: anywhere;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.jcnm-yt--short .jcnm-yt__title { font-size: 0.875em; }

.jcnm-yt__all {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 28px;
	margin: 1.5em 0 0;
}

.jcnm-yt__all a {
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: var(--jcnm-yt-accent);
	text-underline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
	.jcnm-yt__play { transition: none; }
}
