/**
 * BC Blog Grid Widget - Front-end styles.
 * Text Domain: bc_elm
 */

.bc-blog-grid-widget {
	--bc-navy: #1f2b6c;
	--bc-blue: #3457d5;
	--bc-ink: #1a1a2e;
	--bc-muted: #6b6b78;
	--bc-border: #ececf1;
	box-sizing: border-box;
}

.bc-blog-grid-widget *,
.bc-blog-grid-widget *::before,
.bc-blog-grid-widget *::after {
	box-sizing: border-box;
}

.bc-blog-grid-inner {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 32px;
	align-items: start;
}

/* ---------- Sidebar (left column) ---------- */

.bc-blog-sidebar {
	display: flex;
	flex-direction: column;
	gap: 28px;
}

.bc-sidebar-heading {
	margin: 0 0 14px;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.01em;
}

.bc-categories-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.bc-cat-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 11px 14px;
	border-radius: 8px;
	font-size: 14px;
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease;
	user-select: none;
}

.bc-cat-item:hover:not(.bc-active) {
	background-color: rgba(31, 43, 108, 0.06);
}

.bc-cat-item .bc-cat-name {
	flex: 1 1 auto;
}

.bc-cat-item .bc-cat-count {
	flex: 0 0 auto;
	font-size: 12px;
	font-weight: 600;
	min-width: 22px;
	text-align: right;
}

/* ---------- Hot Post / Editor's Choice ---------- */

.bc-hotpost-box {
	overflow: hidden;
}

.bc-hotpost-image {
	display: block;
	line-height: 0;
}

.bc-hotpost-image img {
	display: block;
	width: 100%;
}

.bc-hotpost-body {
	padding: 16px;
}

.bc-hotpost-heading {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 600;
}

.bc-hotpost-title {
	margin: 0 0 8px;
	font-size: 16px;
	line-height: 1.35;
	font-weight: 700;
}

.bc-hotpost-title a {
	color: inherit;
	text-decoration: none;
}

.bc-hotpost-title a:hover {
	text-decoration: underline;
}

.bc-hotpost-excerpt {
	margin: 0 0 10px;
	font-size: 13px;
	line-height: 1.5;
}

.bc-hotpost-link {
	display: inline-block;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
}

.bc-hotpost-link:hover {
	text-decoration: underline;
}

/* ---------- Posts grid (right column) ---------- */

.bc-posts-grid-wrap {
	position: relative;
}

.bc-posts-grid-wrap.bc-is-loading {
	opacity: 0.55;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.bc-posts-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 24px;
}

.bc-post-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.bc-post-thumb {
	display: block;
	line-height: 0;
}

.bc-post-thumb img {
	display: block;
	width: 100%;
}

.bc-post-body {
	padding: 18px;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.bc-post-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.bc-post-category {
	font-weight: 700;
}

.bc-post-date {
	font-weight: 500;
	text-transform: none;
	letter-spacing: normal;
}

.bc-post-title {
	margin: 0 0 8px;
	font-size: 17px;
	line-height: 1.35;
	font-weight: 700;
}

.bc-post-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.15s ease;
}

.bc-post-excerpt {
	margin: 0 0 12px;
	font-size: 13.5px;
	line-height: 1.6;
	flex: 1 1 auto;
}

.bc-post-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
	margin-top: auto;
	width: fit-content;
}

.bc-post-link:hover {
	text-decoration: underline;
}

.bc-no-posts {
	grid-column: 1 / -1;
	text-align: center;
	padding: 40px 20px;
	color: var(--bc-muted);
}

/* ---------- Pagination ---------- */

.bc-load-more-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-top: 30px;
}

.bc-load-more-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: none;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	padding: 12px 30px;
	border-radius: 8px;
	transition: background-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.bc-load-more-btn[disabled] {
	opacity: 0.65;
	cursor: default;
}

.bc-no-more-posts {
	margin: 0;
	font-size: 13px;
	color: var(--bc-muted);
}

.bc-pagination-numbers {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 30px;
	flex-wrap: wrap;
}

.bc-pagination-numbers .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	color: var(--bc-ink);
	background: #fff;
	border: 1px solid var(--bc-border);
}

.bc-pagination-numbers .page-numbers.current {
	background: var(--bc-navy);
	border-color: var(--bc-navy);
	color: #fff;
}

.bc-pagination-numbers .page-numbers:hover:not(.current) {
	background: rgba(31, 43, 108, 0.08);
}

/* ---------- Infinite scroll sentinel ---------- */

.bc-infinite-sentinel {
	height: 1px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.bc-blog-grid-inner {
		grid-template-columns: 220px 1fr;
		gap: 24px;
	}
}

@media (max-width: 767px) {
	.bc-blog-grid-inner {
		grid-template-columns: 1fr;
	}

	.bc-posts-grid {
		grid-template-columns: 1fr !important;
	}

	.bc-blog-sidebar {
		order: 2;
	}

	.bc-blog-main {
		order: 1;
	}
}
