/**
 * 首页 · 热门游戏模块（横向轮播 · 海报式卡片 · 紧凑版）
 *
 * 模板：template-parts/home-popular.php
 * 加载：is_front_page() 时由 inc/enqueue.php 注入
 */

.yk-popular {
	background: transparent;
	border: 0;
	padding: 0;
}

/* ----- 头部 ----- */
.yk-popular__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
}
.yk-popular__title {
	font-size: 17px;
	font-weight: 800;
	color: #1e293b;
	margin: 0;
	line-height: 1.2;
	letter-spacing: -.01em;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.yk-popular__head-actions {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.yk-popular__more {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	font-size: 12px;
	color: #64748b;
	text-decoration: none;
	font-weight: 500;
	transition: color .15s;
}
.yk-popular__more:hover { color: #6d4aff; }
.yk-popular__nav {
	display: inline-flex;
	gap: 6px;
}
.yk-popular__nav-btn {
	width: 26px;
	height: 26px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	color: #64748b;
	cursor: pointer;
	transition: all .15s;
}
.yk-popular__nav-btn:hover:not(:disabled) {
	background: #f3f0ff;
	border-color: #c4b5fd;
	color: #6d4aff;
}
.yk-popular__nav-btn:disabled {
	opacity: .35;
	cursor: not-allowed;
}

/* ----- 滑动视口 ----- */
.yk-popular__viewport {
	overflow: hidden;
	position: relative;
}
.yk-popular__track {
	display: flex;
	scroll-snap-type: x mandatory;
	overflow-x: auto;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-ms-overflow-style: none;
}
.yk-popular__track::-webkit-scrollbar { display: none; }
.yk-popular__page {
	flex: 0 0 100%;
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 10px;
	scroll-snap-align: start;
}
@media (max-width: 1280px) { .yk-popular__page { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 1024px) { .yk-popular__page { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 768px)  { .yk-popular__page { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px)  { .yk-popular__page { grid-template-columns: repeat(2, 1fr); gap: 8px; } }

/* ----- 海报卡片 ----- */
.yk-popular__card {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	border-radius: 8px;
	overflow: hidden;
	text-decoration: none;
	background: #0f172a;
	transition: transform .25s cubic-bezier(.16, 1, .3, 1), box-shadow .25s;
	box-shadow: 0 2px 6px rgba(15, 23, 42, .05);
}
.yk-popular__card:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(15, 23, 42, .14);
}
.yk-popular__card img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .5s;
}
.yk-popular__card:hover img { transform: scale(1.06); }

/* 评分徽章（右上） */
.yk-popular__rating {
	position: absolute;
	top: 6px;
	right: 6px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 2px;
	padding: 2px 6px;
	background: rgba(15, 23, 42, .75);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	border-radius: 999px;
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .02em;
}
.yk-popular__rating-star {
	color: #fbbf24;
}

/* 底部信息覆盖（黑色渐变） */
.yk-popular__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.35) 50%, transparent 80%);
	pointer-events: none;
}
.yk-popular__info {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 8px 9px 7px;
	z-index: 1;
}
.yk-popular__name {
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	color: #fff;
	line-height: 1.2;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
.yk-popular__cat {
	margin: 2px 0 0 0;
	font-size: 10px;
	color: rgba(255, 255, 255, .75);
	font-weight: 500;
	display: -webkit-box;
	-webkit-line-clamp: 1;
	line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ----- 分页圆点 ----- */
.yk-popular__dots {
	display: flex;
	justify-content: center;
	gap: 5px;
	margin-top: 12px;
}
.yk-popular__dot {
	width: 6px;
	height: 6px;
	border-radius: 999px;
	background: #cbd5e1;
	border: 0;
	padding: 0;
	cursor: pointer;
	transition: background .15s, width .2s;
}
.yk-popular__dot:hover { background: #94a3b8; }
.yk-popular__dot.is-active {
	background: #6d4aff;
	width: 16px;
}
