/**
 * Blog Card — Common base CSS ( loads for every style ).
 *
 * Owns the shared skeleton: the responsive grid, card item, media box,
 * category badge, body content, meta row and read-more link. Per-style
 * files paint the card chrome. CSS variables drive theme and sizing:
 *   --captwiki-bc-cols     → grid column count ( responsive control )
 *   --captwiki-bc-gap      → grid gap
 *   --captwiki-bc-accent   → category / link accent colour
 *   --captwiki-bc-card-bg  → card background
 *   --captwiki-bc-img-h    → media height
 *
 * @package captain-widgets-kit
 * @since   1.7.0
 */

.captwiki-blog-card {
	--captwiki-bc-cols: 3;
	--captwiki-bc-gap: 28px;
	--captwiki-bc-accent: #6d5efc;
	--captwiki-bc-card-bg: #ffffff;
	--captwiki-bc-img-h: 220px;
	display: grid;
	grid-template-columns: repeat( var( --captwiki-bc-cols ), minmax( 0, 1fr ) );
	gap: var( --captwiki-bc-gap );
	width: 100%;
	box-sizing: border-box;
}

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

/* ── Card ──────────────────────────────────────────────── */
.captwiki-blog-card__item {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: var( --captwiki-bc-card-bg );
}

/* ── Media ─────────────────────────────────────────────── */
.captwiki-blog-card__media {
	position: relative;
	overflow: hidden;
}

.captwiki-blog-card__media-link {
	display: block;
}

.captwiki-blog-card__img {
	display: block;
	width: 100%;
	height: var( --captwiki-bc-img-h );
	margin: 0;
	object-fit: cover;
	transition: transform 0.45s ease;
}

.captwiki-blog-card__item:hover .captwiki-blog-card__img {
	transform: scale( 1.05 );
}

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

.captwiki-blog-card__category {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 1;
	padding: 4px 12px;
	background: var( --captwiki-bc-accent );
	border-radius: 99px;
	color: #ffffff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.5;
	text-decoration: none;
	text-transform: uppercase;
}

.captwiki-blog-card__category:hover {
	color: #ffffff;
	filter: brightness( 1.1 );
}

/* ── Body ──────────────────────────────────────────────── */
.captwiki-blog-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 10px;
	padding: 20px;
}

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

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

.captwiki-blog-card__title a:hover {
	color: var( --captwiki-bc-accent );
}

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

/* ── Meta ──────────────────────────────────────────────── */
.captwiki-blog-card__meta {
	display: flex;
	align-items: center;
	gap: 14px;
	font-size: 13px;
	color: #6b7280;
}

.captwiki-blog-card__author {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-width: 0;
}

.captwiki-blog-card__avatar {
	width: 24px;
	height: 24px;
	border-radius: 50%;
}

/* ── Read more ─────────────────────────────────────────── */
.captwiki-blog-card__more {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: auto;
	color: var( --captwiki-bc-accent );
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.captwiki-blog-card__more svg {
	width: 15px;
	height: 15px;
	transition: transform 0.25s ease;
}

.captwiki-blog-card__more:hover svg {
	transform: translateX( 4px );
}

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