/*
 * Video Center (category-video.php)
 * Standalone stylesheet, enqueued only on the video category archive.
 */
.plm-video-center__top {
	display: flex;
	gap: 1.5rem;
	padding-bottom: 2.5rem;
	margin-bottom: 2.5rem;
	border-bottom: 1px solid var(--plm-color-neutral, #d1d3d4);
}

.plm-video-center__lead {
	flex: 2 1 0;
	min-width: 0;
}

.plm-video-center__secondary {
	flex: 1 1 0;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2.5rem;
	padding-left: 1.5rem;
	border-left: 1px solid var(--plm-color-neutral, #d1d3d4);
}

.plm-video-center__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	row-gap: 2.5rem;
	column-gap: 1.5rem;
	padding-bottom: 2.5rem;
	margin-bottom: 2.5rem;
	border-bottom: 1px solid var(--plm-color-neutral, #d1d3d4);
}

.plm-video-center__list {
	display: flex;
	flex-direction: column;
	gap: 2.5rem;
}

/* Divider between the two stacked secondary items */
.plm-video-center__secondary > * + * {
	border-top: 1px solid var(--plm-color-neutral, #d1d3d4);
	padding-top: 2.5rem;
}

/* Cards fill their cell rather than shrinking to content width */
.plm-video-center .plm-post-card__contents {
	max-width: none;
	min-width: 0;
}

.plm-video-center .plm-post-card__thumbnail-wrapper {
	max-height: none;
}

/* Side-by-side cards: lead is 50/50, secondary and list give the text more room */
.plm-video-center__lead .plm-post-card:not(.plm-post-card--ou) .plm-post-card__thumbnail-wrapper {
	flex: 0 0 50%;
}

.plm-video-center__secondary .plm-post-card:not(.plm-post-card--ou) .plm-post-card__thumbnail-wrapper {
	flex: 0 0 38%;
}

.plm-video-center__list .plm-post-card:not(.plm-post-card--ou) .plm-post-card__thumbnail-wrapper {
	flex: 0 0 38%;
}

/* Titles clamp to two lines, list excerpts to four */
.plm-video-center .plm-post-title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

.plm-video-center__list .plm-post-card__excerpt {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
	line-clamp: 4;
	overflow: hidden;
}

/* Grid and secondary cards use the smaller title size */
.plm-video-center__secondary .plm-post-title,
.plm-video-center__grid .plm-post-title {
	font-size: 1em;
}

.plm-video-center__lead .plm-post-title {
	font-size: 1.3em;
}

@media (max-width: 991.98px) {
	.plm-video-center__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 767.98px) {
	.plm-video-center .plm-post-card:not(.plm-post-card--ou) .plm-post-card__thumbnail-wrapper {
		flex-basis: auto;
	}

	.plm-video-center__top {
		flex-direction: column;
	}

	.plm-video-center__secondary {
		padding-left: 0;
		border-left: 0;
		padding-top: 1.5rem;
		border-top: 1px solid var(--plm-color-neutral, #d1d3d4);
	}
}

@media (max-width: 575.98px) {
	.plm-video-center__grid {
		grid-template-columns: 1fr;
	}
}

/* Hide empty slots: fewer than seven videos leaves empty SelectPost wrappers */
.plm-video-center__grid:not(:has(.plm-post-card)),
.plm-video-center__top:not(:has(.plm-post-card)) {
	display: none;
}

.plm-video-center__secondary:not(:has(.plm-post-card)) {
	display: none;
}

.plm-video-center .plm-post-card__body:has(.plm-post-card__excerpt:empty) {
	display: none;
}

/* The image link (added in category-video.php) must fill the thumbnail wrapper so the cropped image keeps its size */
.plm-video-center .plm-post-card__thumbnail-wrapper > a {
	display: block;
	width: 100%;
	height: 100%;
	img {
		width: 100%;
		height: auto;
	}
}
