/* ==============================================
   Category Posts Grid Widget
   ============================================== */

.cpg-grid {
	display: grid;
	gap: 24px;
	width: 100%;
}

.cpg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.cpg-cols-3 { grid-template-columns: repeat(3, 1fr); }
.cpg-cols-4 { grid-template-columns: repeat(4, 1fr); }

.cpg-card {
	background-color: #ffffff;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	display: flex;
	flex-direction: column;
}

.cpg-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
}

.cpg-image-link {
	display: block;
	text-decoration: none;
}

.cpg-image {
	height: 220px;
	background-size: cover;
	background-position: center;
	background-color: #f3f4f6;
	position: relative;
	overflow: hidden;
}

.cpg-image::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 60px;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
	pointer-events: none;
}

.cpg-badge {
	position: absolute;
	bottom: 12px;
	left: 12px;
	background-color: #1f3fa0;
	color: #ffffff;
	font-size: 12px;
	font-weight: 600;
	padding: 4px 12px;
	border-radius: 4px;
	z-index: 2;
	letter-spacing: 0.02em;
}

.cpg-body {
	padding: 20px;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.cpg-date {
	font-size: 13px;
	color: #9ca3af;
	margin-bottom: 8px;
	display: block;
}

.cpg-title {
	font-size: 17px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0 0 10px;
	color: #1f2937;
}

.cpg-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.cpg-card:hover .cpg-title a {
	color: #1f3fa0;
}

.cpg-excerpt {
	font-size: 14px;
	line-height: 1.6;
	color: #6b7280;
	margin: 0 0 16px;
	flex: 1;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.cpg-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background-color: #1f3fa0;
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	padding: 10px 20px;
	border-radius: 6px;
	text-decoration: none;
	transition: background-color 0.2s ease, transform 0.2s ease;
	align-self: flex-start;
}

.cpg-btn:hover {
	background-color: #142d75;
	transform: translateX(2px);
}

.cpg-btn svg {
	transition: transform 0.2s ease;
}

.cpg-btn:hover svg {
	transform: translateX(3px);
}

/* --- 响应式 --- */
@media (max-width: 1024px) {
	.cpg-cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
	.cpg-cols-3,
	.cpg-cols-4 { grid-template-columns: repeat(2, 1fr); }
	.cpg-grid { gap: 16px; }
	.cpg-body { padding: 16px; }
	.cpg-title { font-size: 15px; }
}

@media (max-width: 480px) {
	.cpg-cols-2,
	.cpg-cols-3,
	.cpg-cols-4 { grid-template-columns: 1fr; }
}
