/*
 * Modernizes the Blog/News "Post Grid" module into an actual responsive
 * card grid. Pure CSS override of the existing BB module markup — no
 * Beaver Builder layout changes. Selectors intentionally mirror the
 * existing (very specific) rules in style.css so they win on source
 * order without needing !important.
 */

.fl-post-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 28px;
}

/* BB's clearfix pseudo-elements become grid items under display:grid and
   steal the first cell — suppress them. */
.fl-post-grid::before,
.fl-post-grid::after {
	content: none;
}

.archive-module-wrapper .fl-post-column {
	padding-bottom: 0;
}

.archive-module-wrapper .fl-post-column .fl-post-grid-post {
	height: 100%;
	padding: 0;
	border: 1px solid rgba(30, 31, 75, 0.08);
	border-radius: 16px;
	box-shadow: 0 8px 24px rgba(71, 95, 107, 0.08);
	overflow: hidden;
	transition: transform .2s ease, box-shadow .2s ease;
}

.archive-module-wrapper .fl-post-column .fl-post-grid-post:hover {
	transform: translateY(-4px);
	box-shadow: 0 16px 32px rgba(71, 95, 107, 0.14);
}

.archive-module-wrapper .fl-post-column .fl-post-grid-post .post-archive-wrapper,
.archive-module-wrapper .fl-post-column .fl-post-grid-post .post-inner-wrap {
	height: 100%;
}

.archive-module-wrapper .fl-post-column .fl-post-grid-post .post-archive-wrapper .post-row {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	height: 100%;
}

.archive-module-wrapper .fl-post-column .fl-post-grid-post .post-archive-wrapper .post-row .post-col:first-child {
	width: 100%;
}

.archive-module-wrapper .fl-post-column .fl-post-grid-post .post-archive-wrapper .post-row .fl-post-image {
	line-height: 0;
}

.archive-module-wrapper .fl-post-column .fl-post-grid-post .post-archive-wrapper .post-row .fl-post-image a {
	display: block;
}

.archive-module-wrapper .fl-post-column .fl-post-grid-post .post-archive-wrapper .post-row .fl-post-image img {
	width: 100%;
	height: 170px;
	object-fit: contain;
	padding: 14px;
	background: #f7f8fc;
	border: none;
	border-radius: 0;
}

.archive-module-wrapper .fl-post-column .fl-post-grid-post .post-archive-wrapper .post-row .post-col:nth-child(2) {
	width: 100%;
	flex: 1 1 auto;
	display: flex;
}

.archive-module-wrapper .fl-post-column .fl-post-grid-post .post-archive-wrapper .post-row .post-col.post-content-col {
	padding: 20px 22px 18px;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

.archive-module-wrapper .fl-post-column .fl-post-grid-post .post-archive-wrapper .post-row .fl-post-title,
.archive-module-wrapper .fl-post-column .fl-post-grid-post .post-archive-wrapper .post-row .fl-post-title a {
	font-size: 19px;
	line-height: 1.35em;
	color: #1e1f4b;
	margin-bottom: 10px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.archive-module-wrapper .fl-post-column .fl-post-grid-post .post-archive-wrapper .post-row .fl-post-excerpt,
.archive-module-wrapper .fl-post-column .fl-post-grid-post .post-archive-wrapper .post-row .fl-post-excerpt p {
	font-size: 14px;
	line-height: 1.5em;
	font-weight: 400;
	color: #5f6682;
	min-height: 0;
}

.archive-module-wrapper .fl-post-column .fl-post-grid-post .post-archive-wrapper .post-row .fl-post-excerpt {
	margin-bottom: 16px;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.archive-module-wrapper .fl-post-column .fl-post-grid-post .post-archive-wrapper .post-row .fl-post_tag {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin: 0;
	margin-top: auto;
	padding-top: 12px;
}

.archive-module-wrapper .fl-post-column .fl-post-grid-post .post-archive-wrapper .post-row .fl-post_tag li span {
	background-color: #eef2ff;
	border: none;
	border-radius: 999px;
	padding: 5px 12px;
	font-size: 12px;
	color: #235fe8;
}

.archive-module-wrapper .fl-post-column .fl-post-grid-post .post-archive-wrapper .post-row .post-col:last-child {
	width: 100%;
	order: 3;
	padding: 0 22px 18px;
	font-size: 12px;
	color: #9ba0b8;
	border-top: 1px solid rgba(30, 31, 75, 0.06);
	margin-top: 0;
	padding-top: 12px;
}

/* Breathing room between the card grid and the pagination row. */
.fl-post-grid + .fl-builder-pagination,
.fl-builder-pagination {
	margin-top: 48px;
}

@media screen and (max-width: 767px) {
	.fl-post-grid {
		grid-template-columns: 1fr;
	}

	.archive-module-wrapper .fl-post-column .fl-post-grid-post .post-archive-wrapper .post-row {
		gap: 0;
	}
}
