/* =========================================================
   Benaes Blog — Posts Grid  [benaes_blog_grid]
   ========================================================= */

.bbl-grid-wrap {
	margin-top: 45px;
	margin-bottom: 60px;
}

.bbl-grid__heading {
	font-size: 1.5rem;
	font-weight: 700;
	margin: 0 0 28px;
}

/* ── Grid ── */

.bbl-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 28px 24px;
}

@media (max-width: 1024px) {
	.bbl-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 768px) {
	.bbl-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px 16px;
	}
}

@media (max-width: 480px) {
	.bbl-grid {
		grid-template-columns: 1fr;
	}
}

/* ── Card ── */

.bbl-grid__item {
	min-width: 0;
}

.bbl-grid__card-link {
	display: block;
	text-decoration: none;
	color: inherit !important;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 10px;
	overflow: hidden;
	height: 100%;
	transition: transform 0.2s ease;
}

.bbl-grid__card-link:hover {
	transform: translateY(-2px);
}

/* Image */

.bbl-grid__img-wrap {
	overflow: hidden;
	aspect-ratio: 4 / 3;
	border: 8px solid transparent;
	border-radius: 16px;
	box-sizing: border-box;
}

.bbl-grid__img {
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
	border-radius: 8px !important;
}

.bbl-grid__card-link:hover .bbl-grid__img {
	transform: scale(1.04);
}

/* Card body */

.bbl-grid__author,
.bbl-grid__title,
.bbl-grid__meta,
.bbl-grid__excerpt {
	display: block;
	padding-left: 14px;
	padding-right: 14px;
}

/* Author */

.bbl-grid__author {
	display: block;
	margin: 0px 0 15px;
	font-size: 13px;
	font-weight: 500;
	opacity: 0.8;
	color: #3a3a3a;
}

/* Title */

.bbl-grid__title {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.4;
	margin: 6px 0 8px;
	color: #3a3a3a;
}

.bbl-grid__card-link:hover .bbl-grid__title {
	text-decoration: underline;
}

/* Meta row: category badge + date side by side */

.bbl-grid__meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin: 15px 0 10px;
}

/* Category badge — no <a> tag, obfuscated */

.bbl-grid__cat {
	display: inline-block;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.04em;
	cursor: pointer;
	transition:
		background-color 0.15s ease,
		border-color 0.15s ease;
	background: #f2ece8;
	width: fit-content;
	color: #655f5d;
}

.bbl-grid__cat:hover {
	background-color: rgba(0, 0, 0, 0.06);
	color: #3a3a3a;
}

/* Date */

.bbl-grid__date {
	font-size: 13px;
	color: #807875;
	line-height: 1.2;
}

/* Excerpt */

.bbl-grid__excerpt {
	font-size: 16px;
	line-height: 1.5;
	color: #807875;
	margin: 0 0 16px;
}

/* Empty state */

.bbl-grid__empty {
	text-align: center;
	padding: 48px 0;
	opacity: 0.6;
	font-size: 0.95rem;
}

/* ── Pagination ── */

.bbl-pagination {
	margin-top: 48px;
	display: flex;
	justify-content: center;
}

.bbl-pagination__list {
	display: flex;
	align-items: center;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.bbl-pagination__item {
	margin: 0;
	padding: 0;
}

.bbl-pagination__item--info {
	display: inline-flex;
	align-items: center;
	padding: 0 18px;
	height: 36px;
	border-radius: 999px;
	border: 1.5px solid #c8a280;
	font-size: 0.875rem;
	font-weight: 500;
	color: #262522;
	white-space: nowrap;
	margin-right: 4px;
}

.bbl-pagination__item--ellipsis {
	padding: 0 4px;
	opacity: 0.5;
	font-size: 0.9rem;
	pointer-events: none;
}

.bbl-pagination__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border-radius: 50%;
	border: 1.5px solid transparent;
	font-size: 0.875rem;
	font-weight: 500;
	cursor: pointer;
	transition:
		border-color 0.15s ease,
		background-color 0.15s ease;
	user-select: none;
	color: #262522;
}

.bbl-pagination__btn--arrow {
	color: #262522;
}

.bbl-pagination__btn--arrow svg {
	display: block;
}

.bbl-pagination__btn:hover {
	background-color: #f2ece8;
}

.bbl-pagination__item--active .bbl-pagination__btn {
	background-color: #f2ece8;
}

.bbl-pagination__btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ── Posts Slider (benaes_latest_posts + benaes_related_posts) ──────────────
   Mobile  → Swiper with 1.5 visible slides
   Desktop → CSS grid (Swiper disabled, its inline styles cleared by !important)
   ────────────────────────────────────────────────────────────────────────── */

/* Mobile: clip overflowing slides at the section edge */
@media (max-width: 767px) {
	.bbl-posts-slider {
		overflow: hidden;
	}

	/* Space for the pagination dots */
	.bbl-posts-slider .bbl-posts-swiper {
		padding-bottom: 36px;
	}
}

/* Desktop / tablet: neutralise any residual Swiper inline styles, show grid */
@media (min-width: 768px) {
	.bbl-posts-slider .bbl-posts-swiper {
		overflow: visible;
	}

	.bbl-posts-slider .swiper-wrapper {
		display: grid !important;
		grid-template-columns: repeat(3, 1fr);
		gap: 28px 24px;
		transform: none !important;
		width: 100% !important;
		height: auto !important;
		box-sizing: border-box;
	}

	.bbl-posts-slider .swiper-slide {
		width: auto !important;
		margin-right: 0 !important;
		height: auto !important;
	}

	/* Hide dots on desktop */
	.bbl-posts-slider .swiper-pagination {
		display: none;
	}
}

@media (min-width: 1025px) {
	.bbl-posts-slider .swiper-wrapper {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* ── Pagination dots ── */

.bbl-posts-slider .swiper-pagination {
	bottom: 0;
}

.bbl-posts-slider .swiper-pagination-bullet {
	background: #f2ece8;
	opacity: 1;
	width: 8px;
	height: 8px;
}

.bbl-posts-slider .swiper-pagination-bullet-active {
	background: #c8a280;
}

/* ── Equal-height cards in the slider ── */

@media (max-width: 767px) {
	.bbl-posts-slider .swiper-wrapper {
		align-items: stretch;
	}

	.bbl-posts-slider .swiper-slide {
		height: auto;
		display: flex;
		flex-direction: column;
	}

	.bbl-posts-slider .bbl-grid__card-link {
		flex: 1;
		display: flex;
		flex-direction: column;
	}

	.bbl-posts-slider .bbl-grid__excerpt {
		flex: 1;
	}
}
