/* 视频中心 — 列表 + 弹窗 */

.cx-video-ui .content-area {
	margin-top: 0;
}

.cx-video-page {
	--cx-v-accent: #e74b11;
	--cx-v-border: #e5e5e5;
	--cx-v-muted: #666;
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 20px 48px;
}

/* 覆盖 Kadence 归档页标题默认蓝底 */
.cx-video-ui .cx-video-hero,
.cx-video-ui .cx-video-hero__inner,
.cx-video-ui .cx-video-hero__title,
.cx-video-ui .cx-video-hero .cx-video-hero__title {
	background: transparent !important;
	background-color: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
}

.cx-video-hero {
	margin: 0 -20px 32px;
	padding: 40px 20px 36px;
	background: transparent !important;
	border: none;
}

.cx-video-hero__kicker {
	display: block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--cx-v-accent);
	margin-bottom: 8px;
}

.cx-video-hero__title {
	margin: 0 0 10px;
	padding: 0 !important;
	font-size: clamp(1.75rem, 4vw, 2.25rem);
	line-height: 1.2;
	color: inherit;
}

.cx-video-hero__desc {
	margin: 0;
	max-width: 640px;
	color: var(--cx-v-muted);
	line-height: 1.6;
}

.cx-video-layout {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 32px;
	align-items: start;
}

.cx-video-sidebar {
	position: sticky;
	top: 100px;
	background: #fff;
	border: 1px solid var(--cx-v-border);
	border-radius: 8px;
	padding: 20px 16px;
}

.cx-video-sidebar__title {
	margin: 0 0 14px;
	font-size: 15px;
	font-weight: 700;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--cx-v-border);
}

.cx-video-sidebar__list,
.cx-video-sidebar__sublist {
	list-style: none;
	margin: 0;
	padding: 0;
}

.cx-video-sidebar__sublist {
	margin: 4px 0 4px 12px;
	padding-left: 8px;
	border-left: 2px solid #f0f0f0;
}

.cx-video-sidebar__item a {
	display: block;
	padding: 8px 10px;
	border-radius: 6px;
	color: #1a1a1a;
	text-decoration: none;
	font-size: 14px;
}

.cx-video-sidebar__item a:hover {
	background: #fff5f0;
	color: var(--cx-v-accent);
}

.cx-video-sidebar__item.is-active > a {
	background: var(--cx-v-accent);
	color: #fff;
	font-weight: 600;
}

/* 视频卡片网格 */
.cx-video-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.cx-video-grid__item {
	margin: 0;
	min-width: 0;
}

.cx-video-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 1px solid var(--cx-v-border);
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
	text-align: left;
	color: inherit;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cx-video-card:hover,
.cx-video-card:focus,
.cx-video-card:focus-visible {
	border-color: #d0d0d0;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
	background: #fff !important;
}

.cx-video-card__body,
.cx-video-card__body:hover {
	background: transparent !important;
}

.cx-video-card__media {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #1a1a1a;
}

.cx-video-card__img,
.cx-video-card__thumb {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	pointer-events: none;
}

.cx-video-card__thumb {
	background: #1a1a1a;
}

.cx-video-card__thumb--error {
	opacity: 0;
}

.cx-video-card__thumb--saving {
	opacity: 0.65;
}

.cx-video-card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #2a2a2a, #444);
}

.cx-video-card__play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.35);
	color: #fff;
	transition: background 0.2s ease;
}

.cx-video-card:hover .cx-video-card__play {
	background: rgba(231, 75, 17, 0.45);
}

.cx-video-card__body {
	padding: 14px 16px 16px;
}

.cx-video-card__title {
	margin: 0 0 6px;
	padding: 0 !important;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.35;
	color: #1a1a1a;
	background: transparent !important;
	background-color: transparent !important;
}

.cx-video-card:hover .cx-video-card__title,
.cx-video-card:focus .cx-video-card__title,
.cx-video-card:focus-visible .cx-video-card__title {
	background: transparent !important;
	background-color: transparent !important;
	box-shadow: none !important;
	color: #1a1a1a;
}

.cx-video-card__excerpt {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--cx-v-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cx-video-empty {
	padding: 48px 20px;
	text-align: center;
	color: var(--cx-v-muted);
	background: #fafafa;
	border-radius: 8px;
}

.cx-video-pagination {
	margin-top: 32px;
}

.cx-video-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	margin: 0 4px;
	padding: 0 12px;
	border: 1px solid var(--cx-v-border);
	border-radius: 6px;
	text-decoration: none;
	color: #1a1a1a;
}

.cx-video-pagination .page-numbers.current {
	background: var(--cx-v-accent);
	border-color: var(--cx-v-accent);
	color: #fff;
}

/* 弹窗播放器 */
.cx-video-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.cx-video-modal[hidden] {
	display: none !important;
}

.cx-video-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
}

.cx-video-modal__dialog {
	position: relative;
	z-index: 1;
	width: min(960px, 100%);
	max-height: calc(100vh - 48px);
	overflow: visible;
	background: #111;
	border-radius: 8px;
	padding: 12px;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

.cx-video-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: var(--cx-v-accent);
	color: #fff;
	cursor: pointer;
	transition: background 0.15s ease;
}

.cx-video-modal__close:hover {
	background: #c93d0e;
}

.cx-video-modal__close-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 26px;
	line-height: 1;
	font-weight: 300;
}

.cx-video-modal__player {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 4px;
	overflow: hidden;
}

.cx-video-modal__player video {
	display: block;
	width: 100%;
	height: 100%;
	max-height: 70vh;
}

.cx-video-modal__player iframe {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 360px;
	border: 0;
}

body.cx-video-modal-open {
	overflow: hidden;
}

@media (max-width: 1024px) {
	.cx-video-layout {
		grid-template-columns: 1fr;
	}

	.cx-video-sidebar {
		position: static;
	}

	.cx-video-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.cx-video-grid {
		grid-template-columns: 1fr;
	}
}
