/**
 * LearnPress 与主题衔接样式
 * 由 inc/zhanlan-learnpress.php 在课程相关页入队
 */

/* 课时完成表单：避免 MEJS 层叠上下文盖住下方按钮；与 Bootstrap 主按钮一致 */
body.zhanlan-lp-course-context #learn-press-content-item .content-item-description .wp-video,
body.zhanlan-lp-course-context #learn-press-content-item .lesson-description .wp-video {
	position: relative;
	z-index: 1;
}

body.zhanlan-lp-course-context #learn-press-content-item form[name="learn-press-form-complete-lesson"] {
	position: relative;
	z-index: 2;
}

body.zhanlan-lp-course-context #learn-press-content-item form[name="learn-press-form-complete-lesson"] .button-complete-lesson {
	pointer-events: auto;
}

body.zhanlan-lp-course-context #learn-press-content-item .learn-press-form.form-button.completed .zhanlan-lp-lesson-completed-msg {
	padding: 0.5rem 0.85rem;
	border-radius: var(--border-radius-md, 0.5rem);
	background: rgba(var(--primary-color-rgb, 13, 110, 253), 0.12);
	border: 1px solid rgba(var(--primary-color-rgb, 13, 110, 253), 0.35);
	color: var(--text-color, #fff);
	font-weight: 600;
}

body.zhanlan-lp-course-context #learn-press-content-item .learn-press-form.form-button.completed .zhanlan-lp-lesson-completed-msg .bi-check-circle-fill {
	color: var(--primary-color, #0d6efd);
}

body.light-theme.zhanlan-lp-course-context #learn-press-content-item .learn-press-form.form-button.completed .zhanlan-lp-lesson-completed-msg {
	background: rgba(var(--primary-color-rgb, 13, 110, 253), 0.08);
	color: var(--text-color, #212529);
}

/* 课时视频：本机续播提示（由 zhanlan-lp-video-progress.js 插入） */
.zhanlan-lp-video-progress-hint {
	margin: 0.4rem auto 0;
	max-width: 48rem;
	font-size: 0.8125rem;
	line-height: 1.45;
	color: var(--text-muted, #888);
	text-align: center;
}

body.light-theme .zhanlan-lp-video-progress-hint {
	color: var(--text-muted, #666);
}

/* 课时顶栏：去掉搜索后的 flex 布局，与主题变量一致 */
body.zhanlan-lp-course-context #course-item-content-header {
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
	gap: 0.5rem 0.75rem;
	padding: 0 0.75rem;
	background: var(--card-bg, #1a1d24);
	border-bottom: 1px solid var(--border-color, #333);
	line-height: 1.25;
}

body.light-theme.zhanlan-lp-course-context #course-item-content-header {
	background: var(--card-bg, #f8f9fa);
	border-bottom-color: var(--border-color, #dee2e6);
}

body.zhanlan-lp-course-context #course-item-content-header .course-title {
	float: none;
	flex: 1 1 auto;
	min-width: 0;
	height: auto;
	line-height: 1.35;
	padding: 0.65rem 0;
	margin: 0;
	font-size: clamp(1rem, 2.5vw, 1.25rem);
}

body.zhanlan-lp-course-context #course-item-content-header .course-title a {
	color: var(--text-color, #fff);
	text-decoration: none;
	box-shadow: none;
}

body.zhanlan-lp-course-context #course-item-content-header .course-title a:hover {
	color: var(--primary-color, #0d6efd);
}

body.zhanlan-lp-course-context #course-item-content-header .form-button.lp-button-back {
	float: none;
	flex: 0 0 auto;
	margin: 0;
}

body.zhanlan-lp-course-context #course-item-content-header .toggle-content-item {
	float: none;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	margin: 0;
	padding: 0;
	border-left: 1px solid var(--border-color, #444);
	text-align: center;
	text-decoration: none;
	color: var(--text-color, #fff);
	background: transparent;
	border-radius: var(--border-radius-md, 0.375rem);
	transition: background-color 0.15s ease, color 0.15s ease;
}

body.zhanlan-lp-course-context #course-item-content-header .toggle-content-item:hover,
body.zhanlan-lp-course-context #course-item-content-header .toggle-content-item:focus-visible {
	color: var(--primary-color, #0d6efd);
	background: color-mix(in srgb, var(--text-color) 8%, transparent);
	outline: none;
}

/* 禁用 LearnPress 自带 FontAwesome 伪元素，改用模板内 .bi */
body.zhanlan-lp-course-context #course-item-content-header .toggle-content-item::before {
	content: none !important;
	display: none !important;
}

body.zhanlan-lp-course-context #course-item-content-header .toggle-content-item .bi {
	font-size: 1.35rem;
	line-height: 1;
	color: currentColor;
}

/* 课时正文内 [video]：居中且覆盖 WP 写入的固定宽高（避免窄屏左顶对齐） */
body.zhanlan-lp-course-context #learn-press-content-item .content-item-body .wp-video,
body.zhanlan-lp-course-context #learn-press-content-item .content-item-description .wp-video,
body.zhanlan-lp-course-context #learn-press-content-item .lesson-description .wp-video {
	display: block;
	width: auto !important;
	max-width: min(100%, 75rem);
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

body.zhanlan-lp-course-context #learn-press-content-item .wp-video video.wp-video-shortcode {
	display: block;
	max-width: 100% !important;
	width: 100% !important;
	height: auto !important;
	margin-left: auto;
	margin-right: auto;
}

body.zhanlan-lp-course-context #learn-press-content-item .wp-video .mejs-container {
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
}

/* MEJS：课时内再压一层音量柄（抵消脚本写入的异常 margin-left） */
body.zhanlan-lp-course-context #learn-press-content-item .mejs-container .mejs-horizontal-volume-handle {
	margin-left: 0 !important;
	transform: translateX(-50%) !important;
}

body.zhanlan-lp-course-context #learn-press-content-item .mejs-container .mejs-controls {
	border-radius: 0 0 var(--border-radius-md, 8px) var(--border-radius-md, 8px) !important;
	box-shadow: 0 -6px 20px color-mix(in srgb, var(--text-color) 12%, transparent);
}

/* 课时 MEJS 底栏可点：见 theme.css「LearnPress 课时 #learn-press-content-item」 */
