/* =====================================================
   Baijia Posts Grid Widget
   ===================================================== */

/* ── Two-column layout ── */
.bjpw-section {
	display: grid;
	grid-template-columns: 48% 1fr;
	column-gap: 24px;
	align-items: start;
}

/* ════════════════════════════════════════
   Featured Post (Left)
   ════════════════════════════════════════ */

.bjpw-featured {
	display: flex;
	flex-direction: column;
}

.bjpw-featured-img-link {
	display: block;
	overflow: hidden;
}

.bjpw-featured-img {
	display: block;
	width: 100%;
	height: 300px;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.bjpw-featured-img-link:hover .bjpw-featured-img {
	transform: scale(1.03);
}

.bjpw-featured-body {
	padding-top: 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.bjpw-featured-title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.4;
}

.bjpw-featured-title a {
	color: #111111;
	text-decoration: none;
}

.bjpw-featured-title a:hover {
	text-decoration: underline;
}

/* ════════════════════════════════════════
   Category Badge
   ════════════════════════════════════════ */

.bjpw-cat {
	display: inline-block;
	align-self: flex-start; /* prevent stretch inside flex-column parents */
	background: #eeeeee;
	color: #555555;
	font-size: 11px;
	font-weight: 500;
	padding: 3px 8px;
	border-radius: 4px;
	line-height: 1.5;
	white-space: nowrap;
	max-width: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}

.bjpw-cat a {
	color: inherit;
	text-decoration: none;
}

.bjpw-cat a:hover {
	text-decoration: underline;
}

/* ════════════════════════════════════════
   Excerpt
   ════════════════════════════════════════ */

.bjpw-excerpt {
	margin: 0;
	font-size: 13px;
	line-height: 1.6;
	color: #777777;
}

/* ════════════════════════════════════════
   List Posts (Right)
   ════════════════════════════════════════ */

.bjpw-list {
	display: flex;
	flex-direction: column;
	row-gap: 0;
}

/* ── Each list item ── */
.bjpw-list-item {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 16px 0;
	border-top: 1px solid #eeeeee;
}

.bjpw-list-item:first-child {
	padding-top: 0;
	border-top: none;
}

/* ── Thumbnail ── */
.bjpw-list-img-wrap {
	width: 140px;
	flex-shrink: 0;
	overflow: hidden;
}

.bjpw-list-img {
	display: block;
	width: 100%;
	height: 110px;
	object-fit: cover;
	transition: transform 0.35s ease;
}

.bjpw-list-img-wrap a:hover .bjpw-list-img {
	transform: scale(1.04);
}

/* ── List body ── */
.bjpw-list-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.bjpw-list-body--full {
	width: 100%;
}

/* ── List title ── */
.bjpw-list-title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.45;
}

.bjpw-list-title a {
	color: #111111;
	text-decoration: none;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.bjpw-list-title a:hover {
	text-decoration: underline;
}

/* ════════════════════════════════════════
   Responsive
   ════════════════════════════════════════ */

/* Tablet: narrow thumbnails */
@media (max-width: 1024px) {
	.bjpw-section {
		grid-template-columns: 50% 1fr;
		column-gap: 18px;
	}

	.bjpw-list-img-wrap {
		width: 110px;
	}

	.bjpw-list-img {
		height: 90px;
	}

	.bjpw-featured-img {
		height: 240px;
	}
}

/* ══════════════════════════════════════════════════════
   Mobile — use widget class selector to match Elementor
   dynamic CSS specificity (.elementor-element-XXXX .bjpw-section
   = 2 classes), then !important wins over any same-level rule.
   ══════════════════════════════════════════════════════ */
@media (max-width: 767px) {
	.elementor-widget-baijia-posts .bjpw-section,
	.bjpw-section {
		grid-template-columns: 1fr !important;
		column-gap: 0 !important;
		row-gap: 28px !important;
	}

	.elementor-widget-baijia-posts .bjpw-featured-img,
	.bjpw-featured-img {
		height: 220px !important;
	}

	.bjpw-featured-title {
		font-size: 18px;
	}

	.elementor-widget-baijia-posts .bjpw-list-img-wrap,
	.bjpw-list-img-wrap {
		width: 110px !important;
	}

	.elementor-widget-baijia-posts .bjpw-list-img,
	.bjpw-list-img {
		height: 88px !important;
	}
}

@media (max-width: 480px) {
	.bjpw-list-item {
		gap: 10px;
	}

	.elementor-widget-baijia-posts .bjpw-list-img-wrap,
	.bjpw-list-img-wrap {
		width: 90px !important;
	}

	.elementor-widget-baijia-posts .bjpw-list-img,
	.bjpw-list-img {
		height: 75px !important;
	}

	.bjpw-list-title {
		font-size: 13px;
	}
}

/* Very small screens ≤360px: list items stack vertically */
@media (max-width: 360px) {
	.bjpw-list-item {
		flex-direction: column;
	}

	.elementor-widget-baijia-posts .bjpw-list-img-wrap,
	.bjpw-list-img-wrap {
		width: 100% !important;
	}

	.elementor-widget-baijia-posts .bjpw-list-img,
	.bjpw-list-img {
		height: 160px !important;
		width: 100%;
	}
}
