/*
 * P2 Videos: video list and single video pages.
 * Loaded only on those pages (see inc/videos.php).
 */

/* ---------- List ---------- */

/* The grey line under the title: on other P2 pages it is the top border of
   the first #postlist item, so the video page draws the same line here. */
.p2v-body {
	border-top: 1px solid #bbb;
	padding-top: 14px;
}
.p2v-empty {
	margin: 0;
	color: #777;
}

.p2v-archive h2 .controls {
	font-size: 12px;
	font-weight: normal;
}

.p2v-series-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 18px;
}
.p2v-series-nav a {
	display: inline-block;
	padding: 3px 10px;
	border: 1px solid #ddd;
	border-radius: 999px;
	background: #fff;
	color: #555;
	font-size: 12px;
	line-height: 1.6;
}
.p2v-series-nav a:hover {
	border-color: #3478e3;
	color: #3478e3;
}
.p2v-series-nav a.current {
	border-color: #3478e3;
	background: #3478e3;
	color: #fff;
}

.p2v-series-description {
	margin: 0 0 16px;
	color: #555;
}

#main ul.p2v-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 200px, 1fr ) );
	gap: 22px 16px;
	margin: 0 0 8px;
	padding: 0;
	list-style: none;
}
#main ul.p2v-grid li.p2v-card {
	margin: 0;
	padding: 0;
	border: 0;
	list-style: none;
}

.p2v-card-link {
	display: block;
	color: #333;
}
a.p2v-card-link:visited {
	color: #333;
}
.p2v-card-link:hover .p2v-card-title {
	color: #3478e3;
}
/* P2 underlines links on hover with a bottom border; a whole card is one link,
   so that border would show as a line under the title. */
a.p2v-card-link:hover,
a.p2v-card-link:focus {
	border-bottom: 0;
}

.p2v-thumb {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 4px;
	background: #e9e9e9;
}
#main .p2v-thumb img,
.p2v-thumb img,
.p2v-thumb video.p2v-thumb-video {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	object-fit: cover;
	transition: transform .25s ease;
}
.p2v-thumb video.p2v-thumb-video {
	background: #000;
	pointer-events: none; /* The whole card is the link. */
}
.p2v-card-link:hover .p2v-thumb img,
.p2v-card-link:hover .p2v-thumb video {
	transform: scale( 1.03 );
}
.p2v-thumb-empty {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient( 135deg, #dfe6f0, #c9d3e1 );
}

/* Play button, shown on hover (always on touch screens). */
.p2v-play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 44px;
	height: 44px;
	margin: -22px 0 0 -22px;
	border-radius: 50%;
	background: rgba( 0, 0, 0, .55 );
	opacity: 0;
	transition: opacity .2s ease;
}
.p2v-play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	margin: -8px 0 0 -5px;
	border-style: solid;
	border-width: 8px 0 8px 14px;
	border-color: transparent transparent transparent #fff;
}
.p2v-card-link:hover .p2v-play,
.p2v-card-link:focus .p2v-play {
	opacity: 1;
}
@media ( hover: none ) {
	.p2v-play { opacity: .9; }
}

.p2v-duration {
	position: absolute;
	right: 6px;
	bottom: 6px;
	padding: 1px 5px;
	border-radius: 3px;
	background: rgba( 0, 0, 0, .72 );
	color: #fff;
	font-size: 11px;
	line-height: 1.5;
	font-variant-numeric: tabular-nums;
}

.p2v-card-title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	margin-top: 8px;
	font-size: 14px;
	font-weight: bold;
	line-height: 1.4;
}
.p2v-card-meta {
	display: block;
	margin-top: 3px;
	color: #999;
	font-size: 12px;
}

.p2v-locked {
	margin: 0 0 24px;
	padding: 28px 20px;
	border: 1px dashed #ccc;
	border-radius: 4px;
	background: #fff;
	color: #555;
	text-align: center;
}
.p2v-locked p {
	margin: 0 0 12px;
}
.p2v-locked p:last-child {
	margin: 0;
}

/* ---------- Single video ---------- */

.p2v-single .p2v-crumbs {
	margin-bottom: 10px;
	font-size: 12px;
}

.p2v-player {
	margin: 0 0 16px;
}
.p2v-player-embed {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: 4px;
	background: #000;
}
.p2v-player-embed iframe,
.p2v-player-embed video,
.p2v-player-embed object,
.p2v-player-embed embed,
.p2v-player-embed .wp-video,
.p2v-player-embed .mejs-container {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	border: 0;
}
.p2v-player-embed video {
	object-fit: contain;
	background: #000;
}
.p2v-player-link {
	margin: 0 0 16px;
	padding: 18px;
	border-radius: 4px;
	background: #f4f4f4;
	text-align: center;
}

#main .p2v-single h2.p2v-title {
	margin: 0 0 10px;
	padding: 0;
	font-size: 20px;
	line-height: 1.35;
	color: #333;
}
.p2v-meta-duration {
	color: #999;
}

/* Home page row: its styles are printed by home-videos.php itself. */
