/* ═══════════════════════════════════════════════════
   Elementor Blog Grid – Premium Styles
   ═══════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
	--ebg-primary: #16a34a;
	--ebg-primary-hover: #15803d;
	--ebg-text-dark: #111827;
	--ebg-text-body: #4b5563;
	--ebg-text-muted: #9ca3af;
	--ebg-border: #e5e7eb;
	--ebg-bg-light: #f9fafb;
	--ebg-card-bg: #ffffff;
	--ebg-radius: 12px;
	--ebg-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
	--ebg-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.08), 0 4px 10px rgba(0, 0, 0, 0.04);
	--ebg-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Wrapper ── */
.ebg-blog-grid-wrapper {
	position: relative;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ── Filter Tabs ── */
.ebg-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
	padding: 0;
}

.ebg-filter__btn {
	display: inline-flex;
	align-items: center;
	padding: 8px 18px;
	border: 1.5px solid var(--ebg-border);
	border-radius: 50px;
	background: var(--ebg-card-bg);
	color: var(--ebg-text-body);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: all var(--ebg-transition);
	white-space: nowrap;
	line-height: 1.4;
	letter-spacing: 0.01em;
}

.ebg-filter__btn:hover {
	border-color: var(--ebg-primary);
	color: var(--ebg-primary);
	background: rgba(22, 163, 74, 0.04);
}

.ebg-filter__btn--active {
	background: var(--ebg-primary);
	border-color: var(--ebg-primary);
	color: #fff;
	box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
}

.ebg-filter__btn--active:hover {
	background: var(--ebg-primary-hover);
	border-color: var(--ebg-primary-hover);
	color: #fff;
}

/* ── Post Count ── */
.ebg-post-count {
	font-size: 14px;
	color: var(--ebg-text-muted);
	margin-bottom: 20px;
	padding-left: 2px;
}

.ebg-post-count strong {
	color: var(--ebg-text-dark);
	font-weight: 700;
}

/* ── Grid ── */
.ebg-grid {
	display: grid;
	gap: 24px;
	margin-bottom: 32px;
}

.ebg-grid--cols-1 { grid-template-columns: 1fr; }
.ebg-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.ebg-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.ebg-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Card ── */
.ebg-card {
	background: var(--ebg-card-bg);
	border-radius: var(--ebg-radius);
	border: 1px solid var(--ebg-border);
	overflow: hidden;
	box-shadow: var(--ebg-shadow);
	transition: all var(--ebg-transition);
	display: flex;
	flex-direction: column;
	animation: ebgFadeInUp 0.5s ease both;
}

.ebg-card:hover {
	box-shadow: var(--ebg-shadow-hover);
	transform: translateY(-4px);
	border-color: rgba(22, 163, 74, 0.15);
}

/* Card image */
.ebg-card__image-link {
	display: block;
	text-decoration: none;
	overflow: hidden;
}

.ebg-card__image {
	position: relative;
	height: 200px;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transition: transform var(--ebg-transition);
}

.ebg-card:hover .ebg-card__image {
	transform: scale(1.05);
}

/* Category Badge */
.ebg-card__badge {
	position: absolute;
	top: 14px;
	left: 14px;
	padding: 5px 12px;
	border-radius: 6px;
	color: #fff;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1.3;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
	z-index: 2;
}

/* Card Body */
.ebg-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 18px 20px 16px;
}

.ebg-card__title {
	margin: 0 0 8px;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--ebg-text-dark);
}

.ebg-card__title a {
	text-decoration: none;
	color: inherit;
	transition: color var(--ebg-transition);
}

.ebg-card__title a:hover {
	color: var(--ebg-primary);
}

.ebg-card__excerpt {
	margin: 0 0 16px;
	font-size: 13.5px;
	line-height: 1.6;
	color: var(--ebg-text-body);
	flex: 1;
}

/* Card Footer */
.ebg-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding-top: 14px;
	border-top: 1px solid var(--ebg-border);
	margin-top: auto;
}

.ebg-card__meta {
	display: flex;
	align-items: center;
	gap: 14px;
	font-size: 12px;
	color: var(--ebg-text-muted);
}

.ebg-card__date,
.ebg-card__read-time {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.ebg-card__date svg,
.ebg-card__read-time svg {
	opacity: 0.6;
	flex-shrink: 0;
}

.ebg-card__read-more {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	font-weight: 600;
	color: var(--ebg-primary);
	text-decoration: none;
	transition: all var(--ebg-transition);
	white-space: nowrap;
}

.ebg-card__read-more:hover {
	color: var(--ebg-primary-hover);
	gap: 8px;
}

.ebg-card__read-more span {
	transition: transform var(--ebg-transition);
}

.ebg-card__read-more:hover span {
	transform: translateX(3px);
}

/* ── Pagination ── */
.ebg-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin-top: 8px;
	flex-wrap: wrap;
}

.ebg-pagination__num,
.ebg-pagination__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 4px 12px;
	border: 1.5px solid var(--ebg-border);
	border-radius: 8px;
	background: var(--ebg-card-bg);
	color: var(--ebg-text-body);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	text-decoration: none;
	transition: all var(--ebg-transition);
	user-select: none;
}

.ebg-pagination__num:hover,
.ebg-pagination__btn:hover {
	border-color: var(--ebg-primary);
	color: var(--ebg-primary);
	background: rgba(22, 163, 74, 0.04);
}

.ebg-pagination__num--active {
	background: var(--ebg-primary);
	border-color: var(--ebg-primary);
	color: #fff;
	box-shadow: 0 2px 8px rgba(22, 163, 74, 0.25);
	pointer-events: none;
}

.ebg-pagination__num--active:hover {
	background: var(--ebg-primary);
	color: #fff;
}

.ebg-pagination__btn {
	gap: 4px;
	font-weight: 600;
}

.ebg-pagination__ellipsis {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	color: var(--ebg-text-muted);
	font-size: 16px;
	letter-spacing: 2px;
	user-select: none;
}

/* ── Loader ── */
.ebg-loader {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.75);
	backdrop-filter: blur(4px);
	z-index: 100;
	border-radius: var(--ebg-radius);
}

.ebg-loader__spinner {
	width: 40px;
	height: 40px;
	border: 3px solid var(--ebg-border);
	border-top-color: var(--ebg-primary);
	border-radius: 50%;
	animation: ebgSpin 0.7s linear infinite;
}

/* ── No Posts ── */
.ebg-no-posts {
	grid-column: 1 / -1;
	text-align: center;
	padding: 60px 20px;
	color: var(--ebg-text-muted);
	font-size: 15px;
}

/* ── Animations ── */
@keyframes ebgFadeInUp {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes ebgSpin {
	to { transform: rotate(360deg); }
}

/* Staggered entrance */
.ebg-card:nth-child(1) { animation-delay: 0.00s; }
.ebg-card:nth-child(2) { animation-delay: 0.06s; }
.ebg-card:nth-child(3) { animation-delay: 0.12s; }
.ebg-card:nth-child(4) { animation-delay: 0.18s; }
.ebg-card:nth-child(5) { animation-delay: 0.24s; }
.ebg-card:nth-child(6) { animation-delay: 0.30s; }
.ebg-card:nth-child(7) { animation-delay: 0.36s; }
.ebg-card:nth-child(8) { animation-delay: 0.42s; }
.ebg-card:nth-child(9) { animation-delay: 0.48s; }

/* ── Responsive ── */
@media (max-width: 1024px) {
	.ebg-grid--cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
	.ebg-grid--cols-3,
	.ebg-grid--cols-4 { grid-template-columns: repeat(2, 1fr); }

	.ebg-filter { gap: 6px; }
	.ebg-filter__btn { padding: 6px 14px; font-size: 12px; }
	.ebg-card__title { font-size: 15px; }
}

@media (max-width: 480px) {
	.ebg-grid--cols-2,
	.ebg-grid--cols-3,
	.ebg-grid--cols-4 { grid-template-columns: 1fr; }

	.ebg-card__footer {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}

	.ebg-pagination { gap: 4px; }
	.ebg-pagination__num,
	.ebg-pagination__btn { min-width: 34px; height: 34px; font-size: 13px; padding: 4px 8px; }
}
