/**
 * CLW Blog Grid & News List Styles
 * Matches high-end automotive fleet aesthetic with responsive grid & micro-interactions
 */

:root {
	--clw-primary: #0284c7;
	--clw-primary-dark: #0369a1;
	--clw-heading: #0f172a;
	--clw-text: #64748b;
	--clw-border: #e2e8f0;
	--clw-radius: 16px;
}

/* Base Container */
.clw-blog-wrapper {
	width: 100%;
	box-sizing: border-box;
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.clw-blog-wrapper *,
.clw-blog-wrapper *::before,
.clw-blog-wrapper *::after {
	box-sizing: border-box;
}

/* Header Section */
.clw-blog-header {
	margin-bottom: 36px;
	display: flex;
	flex-direction: column;
}

.clw-blog-header.align-left {
	text-align: left;
	align-items: flex-start;
}

.clw-blog-header.align-center {
	text-align: center;
	align-items: center;
}

.clw-blog-header.align-right {
	text-align: right;
	align-items: flex-end;
}

.clw-blog-subtitle-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 11.5px;
	font-weight: 800;
	letter-spacing: 0.8px;
	text-transform: uppercase;
	padding: 5px 14px;
	border-radius: 9999px;
	background-color: #e0f2fe;
	color: #0284c7;
	border: 1px solid rgba(2, 132, 199, 0.15);
	margin-bottom: 12px;
	transition: background-color 0.25s ease, color 0.25s ease;
	line-height: 1.3;
}

.clw-blog-title {
	font-family: 'Inter', 'Outfit', sans-serif;
	font-size: 32px;
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: -0.5px;
	color: #0f172a;
	margin: 0;
	word-break: break-word;
}

.clw-blog-header-desc {
	margin: 12px 0 0 0;
	font-size: 15px;
	line-height: 1.6;
	color: #64748b;
	max-width: 650px;
}

/* Blog Grid System */
.clw-blog-grid {
	display: grid;
	grid-template-columns: repeat(var(--clw-cols-desktop, 3), minmax(0, 1fr));
	column-gap: var(--clw-gap-col, 28px);
	row-gap: var(--clw-gap-row, 28px);
	width: 100%;
}

/* Responsive Grid Breakpoints */
@media (max-width: 1024px) {
	.clw-blog-grid {
		grid-template-columns: repeat(var(--clw-cols-tablet, 2), minmax(0, 1fr));
		column-gap: var(--clw-gap-col-tablet, 20px);
		row-gap: var(--clw-gap-row-tablet, 20px);
	}
	.clw-blog-title {
		font-size: 28px;
	}
}

@media (max-width: 640px) {
	.clw-blog-grid {
		grid-template-columns: repeat(var(--clw-cols-mobile, 1), minmax(0, 1fr));
		column-gap: var(--clw-gap-col-mobile, 18px);
		row-gap: var(--clw-gap-row-mobile, 18px);
	}
	.clw-blog-title {
		font-size: 24px;
	}
	.clw-blog-header {
		margin-bottom: 24px;
	}
}

/* Individual Card */
.clw-blog-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: var(--clw-card-radius, 16px);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	height: 100%;
	position: relative;
	box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
	            box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
	            border-color 0.35s ease;
}

.clw-blog-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 20px 30px -8px rgba(15, 23, 42, 0.12), 0 8px 16px -4px rgba(15, 23, 42, 0.06);
	border-color: #cbd5e1;
}

/* Card Thumbnail Area */
.clw-blog-thumb-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background-color: #f1f5f9;
	display: block;
}

.clw-blog-thumb-wrap.ratio-16-9 {
	aspect-ratio: 16 / 9;
}

.clw-blog-thumb-wrap.ratio-4-3 {
	aspect-ratio: 4 / 3;
}

.clw-blog-thumb-wrap.ratio-1-1 {
	aspect-ratio: 1 / 1;
}

.clw-blog-thumb-link {
	display: block;
	width: 100%;
	height: 100%;
	text-decoration: none;
	overflow: hidden;
}

.clw-blog-thumb-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.clw-blog-card:hover .clw-blog-thumb-img {
	transform: scale(1.06);
}

/* Category Badge (Top-left of Image) */
.clw-blog-badge {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 3;
	padding: 4px 10px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #ffffff;
	border-radius: 4px;
	line-height: 1.3;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
	white-space: nowrap;
	text-decoration: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
	display: inline-block;
}

.clw-blog-badge:hover {
	opacity: 0.92;
	color: #ffffff;
	transform: translateY(-1px);
}

/* Preset Badge Themes */
.clw-badge-blue {
	background-color: #0284c7;
}

.clw-badge-green {
	background-color: #10b981;
}

.clw-badge-red {
	background-color: #dc2626;
}

.clw-badge-amber {
	background-color: #d97706;
}

.clw-badge-purple {
	background-color: #8b5cf6;
}

.clw-badge-cyan {
	background-color: #06b6d4;
}

/* Card Body Content */
.clw-blog-body {
	padding: 22px 22px 24px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

/* Date Meta Row */
.clw-blog-date {
	display: flex;
	align-items: center;
	gap: 7px;
	margin-bottom: 12px;
	font-size: 13px;
	color: #64748b;
	font-weight: 500;
	line-height: 1;
}

.clw-blog-date-icon {
	width: 14px;
	height: 14px;
	color: #94a3b8;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.clw-blog-date-icon svg {
	width: 14px;
	height: 14px;
	stroke: currentColor;
}

/* Title */
.clw-blog-card-title {
	margin: 0 0 12px 0;
	font-family: 'Inter', sans-serif;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.36;
	letter-spacing: -0.2px;
	color: #0f172a;
}

.clw-blog-card-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.clw-blog-card-title a:hover,
.clw-blog-card:hover .clw-blog-card-title a {
	color: #0284c7;
}

/* Excerpt */
.clw-blog-card-excerpt {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: #64748b;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Optional Read More */
.clw-blog-read-more-wrap {
	margin-top: auto;
	padding-top: 16px;
}

.clw-blog-read-more {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13.5px;
	font-weight: 600;
	color: #0284c7;
	text-decoration: none;
	transition: gap 0.25s ease, color 0.2s ease;
}

.clw-blog-read-more svg {
	width: 14px;
	height: 14px;
	stroke: currentColor;
	transition: transform 0.2s ease;
}

.clw-blog-read-more:hover {
	gap: 9px;
	color: #0369a1;
}

.clw-blog-read-more:hover svg {
	transform: translateX(2px);
}

/* No Posts / Fallback state */
.clw-blog-no-posts {
	padding: 40px;
	text-align: center;
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: 12px;
	color: #64748b;
	font-size: 15px;
	grid-column: 1 / -1;
}
