/**
 * Blog Listing — Common base CSS ( loads for every style ).
 *
 * Owns the shared skeleton: the row stack, thumbnail box, body content,
 * category, meta row, pagination and the date block ( hidden until the
 * Date Block style shows it ). Per-style files paint the row chrome.
 * CSS variables drive theme and sizing:
 *   --captwiki-bl-accent   → category / link accent colour
 *   --captwiki-bl-gap      → gap between rows
 *   --captwiki-bl-thumb-w  → thumbnail width
 *
 * @package captain-widgets-kit
 * @since   1.7.0
 */

.captwiki-blog-listing {
	--captwiki-bl-accent: #6d5efc;
	--captwiki-bl-gap: 28px;
	--captwiki-bl-thumb-w: 240px;
	display: flex;
	flex-direction: column;
	gap: var( --captwiki-bl-gap );
	width: 100%;
	box-sizing: border-box;
}

.captwiki-blog-listing *,
.captwiki-blog-listing *::before,
.captwiki-blog-listing *::after {
	box-sizing: border-box;
}

/* ── Row ───────────────────────────────────────────────── */
.captwiki-blog-listing__item {
	display: flex;
	align-items: stretch;
	gap: 22px;
	min-width: 0;
}

/* ── Date block ( Date Block style only ) ──────────────── */
.captwiki-blog-listing__date-block {
	display: none;
}

/* ── Media ─────────────────────────────────────────────── */
.captwiki-blog-listing__media {
	flex: 0 0 var( --captwiki-bl-thumb-w );
	max-width: var( --captwiki-bl-thumb-w );
	overflow: hidden;
	border-radius: 12px;
}

.captwiki-blog-listing__media-link {
	display: block;
	height: 100%;
}

.captwiki-blog-listing__img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 150px;
	margin: 0;
	object-fit: cover;
	transition: transform 0.45s ease;
}

.captwiki-blog-listing__item:hover .captwiki-blog-listing__img {
	transform: scale( 1.05 );
}

.captwiki-blog-listing__img--empty {
	background: linear-gradient( 135deg, #eef0f7, #dde1ee );
}

/* ── Body ──────────────────────────────────────────────── */
.captwiki-blog-listing__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	justify-content: center;
	gap: 8px;
	min-width: 0;
}

.captwiki-blog-listing__category {
	align-self: flex-start;
	color: var( --captwiki-bl-accent );
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.4;
	text-decoration: none;
	text-transform: uppercase;
}

.captwiki-blog-listing__category:hover {
	color: var( --captwiki-bl-accent );
	text-decoration: underline;
}

.captwiki-blog-listing__title {
	margin: 0;
	font-size: 21px;
	font-weight: 700;
	line-height: 1.35;
}

.captwiki-blog-listing__title a {
	color: #1f2937;
	text-decoration: none;
	transition: color 0.25s ease;
}

.captwiki-blog-listing__title a:hover {
	color: var( --captwiki-bl-accent );
}

.captwiki-blog-listing__excerpt {
	margin: 0;
	font-size: 14px;
	line-height: 1.65;
	color: #6b7280;
}

.captwiki-blog-listing__meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #9ca3af;
}

.captwiki-blog-listing__meta .captwiki-blog-listing__author::after {
	content: "·";
	margin-left: 8px;
}

.captwiki-blog-listing__meta .captwiki-blog-listing__author:last-child::after {
	content: none;
}

/* ── Pagination ────────────────────────────────────────── */
.captwiki-blog-listing__pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.captwiki-blog-listing__pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	background: #f3f4f8;
	border-radius: 8px;
	color: #374151;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.25s ease, color 0.25s ease;
}

.captwiki-blog-listing__pagination .page-numbers:hover {
	background: #e5e7f2;
}

.captwiki-blog-listing__pagination .page-numbers.current {
	background: var( --captwiki-bl-accent );
	color: #ffffff;
}

.captwiki-blog-listing__pagination .page-numbers.dots {
	background: transparent;
}

/* ── Empty state ───────────────────────────────────────── */
.captwiki-blog-listing__empty {
	padding: 24px;
	background: #f6f7fb;
	border-radius: 10px;
	color: #6b7280;
	font-size: 14px;
	text-align: center;
}

/* ── Small screens ─────────────────────────────────────── */
@media ( max-width: 767px ) {
	.captwiki-blog-listing__item {
		flex-direction: column;
	}

	.captwiki-blog-listing__media {
		flex: 0 0 auto;
		max-width: 100%;
	}

	.captwiki-blog-listing__img {
		height: auto;
		min-height: 0;
		aspect-ratio: 16 / 9;
	}
}
