/* Blog Card Grid for Elementor
 * Defaults match the reference design. Every value here can be changed
 * from the widget's Style tab; Elementor's rules are more specific and win.
 * Selectors are prefixed with .bcg-wrap so theme and kit styles (h3, a, button)
 * don't override the cards.
 */

.bcg-wrap {
	width: 100%;
}

/* ---------- Grid ---------- */
.bcg-wrap .bcg-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: 24px;
	row-gap: 32px;
	align-items: stretch;
}

@media (max-width: 1024px) {
	.bcg-wrap .bcg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
	.bcg-wrap .bcg-grid { grid-template-columns: minmax(0, 1fr); row-gap: 24px; }
}

/* ---------- Card ---------- */
.bcg-wrap .bcg-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-width: 0;
	margin: 0;
	padding: 10px;
	background-color: #ffffff;
	border: 0 solid transparent;
	border-radius: 8px;
	box-shadow: 0 4px 22px rgba(30, 50, 20, 0.08);
	overflow: hidden;
	box-sizing: border-box;
	transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}

.bcg-lift-yes .bcg-wrap .bcg-card:hover {
	transform: translateY(-4px);
}

/* ---------- Image: always fills its box, any upload size ---------- */
.bcg-wrap .bcg-thumb {
	position: relative;
	display: block;
	flex-shrink: 0;
	width: 100%;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	border-radius: 4px;
	background-color: #eef2e6;
	line-height: 0;
}

.bcg-wrap .bcg-thumb img,
.bcg-wrap .bcg-thumb .bcg-thumb__empty {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	object-fit: cover;
	object-position: center center;
	transition: transform 0.5s ease, opacity 0.4s ease;
}

.bcg-zoom-yes .bcg-wrap .bcg-card:hover .bcg-thumb img {
	transform: scale(1.05);
}

/* Fade-in only runs once JS is active, so images never stay hidden */
.bcg-wrap.bcg-fade.bcg-js .bcg-thumb img:not(.is-loaded) {
	opacity: 0;
}

/* ---------- Body ---------- */
.bcg-wrap .bcg-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
	padding: 16px 8px 8px;
	text-align: start;
}

/* ---------- Meta (single line) ---------- */
.bcg-wrap .bcg-meta {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	column-gap: 18px;
	margin: 0 0 10px;
	overflow: hidden;
	white-space: nowrap;
	font-size: 12px;
	line-height: 1.4;
	color: #8db33a;
}

.bcg-wrap .bcg-meta__item {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	min-width: 0;
}

.bcg-wrap .bcg-meta__text {
	overflow: hidden;
	text-overflow: ellipsis;
}

.bcg-wrap .bcg-meta__icon {
	flex-shrink: 0;
	width: 1.1em;
	height: 1.1em;
}

/* ---------- Title & excerpt: fixed number of lines ---------- */
.bcg-wrap .bcg-title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--bcg-title-lines, 2);
	line-clamp: var(--bcg-title-lines, 2);
	overflow: hidden;
	margin: 0 0 8px;
	padding: 0;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
	color: #1f3b1d;
	overflow-wrap: anywhere;
	/* Reserve the space even for short titles; lh = this element's own line-height */
	min-height: calc(var(--bcg-title-lines, 2) * 1.3em);
	min-height: calc(var(--bcg-title-lines, 2) * 1lh);
}

.bcg-wrap .bcg-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.bcg-wrap .bcg-title a:hover,
.bcg-wrap .bcg-title a:focus-visible {
	color: #6a9a22;
}

.bcg-wrap .bcg-excerpt {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--bcg-excerpt-lines, 2);
	line-clamp: var(--bcg-excerpt-lines, 2);
	overflow: hidden;
	margin: 0 0 16px;
	padding: 0;
	font-size: 13px;
	line-height: 1.6;
	color: #666666;
	overflow-wrap: anywhere;
	min-height: calc(var(--bcg-excerpt-lines, 2) * 1.6em);
	min-height: calc(var(--bcg-excerpt-lines, 2) * 1lh);
}

/* ---------- CTA: pinned to the bottom of every card ---------- */
.bcg-wrap .bcg-cta-wrap {
	display: flex;
	justify-content: flex-start;
	margin-top: auto;
}

.bcg-wrap .bcg-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: var(--bcg-cta-width, auto);
	padding: 8px 20px;
	border: 0 solid transparent;
	border-radius: 50px;
	background-color: #ffcb08;
	color: #1a1a1a;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	box-sizing: border-box;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.bcg-wrap .bcg-cta:hover,
.bcg-wrap .bcg-cta:focus-visible {
	background-color: #f0b900;
	color: #1a1a1a;
}

.bcg-wrap .bcg-cta:focus-visible,
.bcg-wrap .bcg-title a:focus-visible,
.bcg-wrap .bcg-pagination a:focus-visible,
.bcg-wrap .bcg-loadmore:focus-visible {
	outline: 2px solid #1f3b1d;
	outline-offset: 2px;
}

.bcg-wrap .bcg-cta__icon {
	display: inline-flex;
	align-items: center;
	line-height: 1;
	font-size: 1em;
}

.bcg-wrap .bcg-cta__icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

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

.bcg-wrap .bcg-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 14px;
	border-radius: 6px;
	background-color: #f1f3ec;
	color: #1f3b1d;
	font-size: 14px;
	line-height: 1;
	text-decoration: none;
	box-sizing: border-box;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.bcg-wrap .bcg-pagination a.page-numbers:hover {
	background-color: #e2e8d5;
}

.bcg-wrap .bcg-pagination .page-numbers.current {
	background-color: #ffcb08;
	color: #1a1a1a;
	font-weight: 600;
}

.bcg-wrap .bcg-pagination .page-numbers.dots {
	background-color: transparent;
	min-width: 0;
	padding: 0 4px;
}

.bcg-wrap .bcg-pagination .page-numbers.is-disabled {
	opacity: 0.45;
	cursor: default;
}

.bcg-wrap .bcg-loadmore {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 12px 28px;
	border: 0;
	border-radius: 50px;
	background-color: #ffcb08;
	color: #1a1a1a;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: none;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.bcg-wrap .bcg-loadmore:hover {
	background-color: #f0b900;
	color: #1a1a1a;
}

.bcg-wrap .bcg-loadmore[disabled] {
	opacity: 0.7;
	cursor: progress;
}

.bcg-wrap .bcg-status {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: #666666;
}

.bcg-wrap .bcg-pagination[hidden],
.bcg-wrap .bcg-status[hidden] {
	display: none;
}

.bcg-wrap .bcg-spinner {
	width: 18px;
	height: 18px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: bcg-spin 0.7s linear infinite;
}

.bcg-wrap .bcg-sentinel {
	display: block;
	width: 100%;
	height: 1px;
}

@keyframes bcg-spin {
	to { transform: rotate(360deg); }
}

.bcg-wrap .bcg-empty {
	margin: 0;
	padding: 24px 0;
	text-align: center;
	color: #666666;
}

/* ---------- Screen reader text ---------- */
.bcg-wrap .bcg-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ---------- Mobile tweaks ---------- */
@media (max-width: 767px) {
	.bcg-wrap .bcg-pagination .page-numbers {
		min-width: 36px;
		height: 36px;
		padding: 0 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bcg-wrap .bcg-card,
	.bcg-wrap .bcg-thumb img,
	.bcg-wrap .bcg-cta {
		transition: none;
	}
	.bcg-lift-yes .bcg-wrap .bcg-card:hover,
	.bcg-zoom-yes .bcg-wrap .bcg-card:hover .bcg-thumb img {
		transform: none;
	}
	.bcg-wrap .bcg-spinner {
		animation-duration: 2s;
	}
}
