/* =============================================================================
 * Blog (archive / posts page) — per-template styles
 *
 * Loads after global.css (priority 20) so it wins equal-specificity overrides.
 * Prefix: .ba-blog* (archive), .ba-blog-card* (cards), .ba-blog-filter*,
 *         .ba-blog-pagination*, .ba-blog-banner*.
 * ========================================================================== */

/* ---------------------------------------------------------------------------
 * 1. HERO
 * Panel: `.ba-section--blog-hero` is added to the canonical hero panel rule
 * in global.css §5 (shared bg / padding / radius). This file only carries the
 * inner primitive (`.ba-blog-hero` grid + typography + media) since
 * pricing.css is NOT enqueued on /blog/.
 * ------------------------------------------------------------------------- */

.ba-blog-hero {
	display: grid;
	grid-template-columns: minmax(0, 630fr) minmax(0, 515fr);
	gap: 40px;
	align-items: stretch;
}
.ba-blog-hero .ba-hero__text {
	display: flex;
	flex-direction: column;
	gap: 20px;
	align-self: center;
}
.ba-blog-hero .ba-hero__title {
	font-family: var(--ba-font-heading);
	font-weight: 400;
	font-size: 60px;
	line-height: 1.05;
	color: var(--ba-text-primary);
	margin: 0;
}
.ba-blog-hero .ba-hero__lead {
	font-family: var(--ba-font-body);
	font-weight: 400;
	font-size: 18px;
	line-height: 1.55;
	color: var(--ba-text-muted);
	margin: 0;
	max-width: 560px;
}
.ba-blog-hero .ba-hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.ba-blog-hero__media {
	position: relative;
	border-radius: var(--ba-radius-card);
	overflow: hidden;
	min-height: 640px; /* design ≈ 648, snapped to 8px grid */
	background: linear-gradient(180deg, #EDE1D5, #D8CBBE);
}
.ba-blog-hero__media img {
	position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}

/* ---------------------------------------------------------------------------
 * 2. ARTICLES SECTION
 * ------------------------------------------------------------------------- */

.ba-blog {
	background: var(--ba-section-bg-1);
}

/* Head: left (label + title), right (sub copy) */
.ba-blog__head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: var(--ba-gap-lg);
	align-items: start;
	margin-bottom: var(--ba-space-9); /* ≈ 40 (closest token to design 44) */
}
.ba-blog__head-left { display: flex; flex-direction: column; }
.ba-blog__title {
	font-family: var(--ba-font-heading);
	font-weight: 400;
	font-size: var(--ba-fs-h2);
	line-height: var(--ba-lh-heading);
	color: var(--ba-text-primary);
	margin: 0;
}
.ba-blog__head-right { display: flex; align-items: flex-start; justify-content: flex-end; }
.ba-blog__sub {
	font-family: var(--ba-font-body);
	font-weight: 400;
	font-size: var(--ba-fs-body);
	line-height: var(--ba-lh-body);
	color: var(--ba-text-muted);
	margin: 0;
	max-width: 400px;
}

/* Filter row */
.ba-blog-filter {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ba-gap-sm);
	margin-bottom: var(--ba-space-9);
}
.ba-blog-filter__item {
	display: inline-flex;
	align-items: center;
	padding: 15px 18px;
	background: #EFE6DD;
	border: 1px solid transparent;
	border-radius: var(--ba-radius-pill);
	font-family: var(--ba-font-body);
	font-weight: 500;
	font-size: var(--ba-fs-small);
	line-height: 1;
	color: var(--ba-text-secondary);
	text-decoration: none;
	transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.ba-blog-filter__item:hover {
	background: #E5D8C8;
}
.ba-blog-filter__item.is-active {
	border-color: #D8CBBE;
	color: var(--ba-text-primary);
}

/* List wrapper */
.ba-blog__list {
	display: flex;
	flex-direction: column;
	gap: var(--ba-gap-lg);
}

/* Row layouts */
.ba-blog__row {
	display: grid;
	gap: var(--ba-gap-lg);
}
.ba-blog__row--first {
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}
.ba-blog__row--rest {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* ---------------------------------------------------------------------------
 * Cards
 * ------------------------------------------------------------------------- */

.ba-blog-card {
	display: flex;
	flex-direction: column;
	border-radius: var(--ba-radius-card);
	padding: 18px;
	overflow: hidden;
}
.ba-blog-card--filled { background: rgba(237, 225, 213, 0.46); }
.ba-blog-card--plain  { background: rgba(250, 245, 239, 0.94); }

.ba-blog-card__media {
	display: block;
	position: relative;
	overflow: hidden;
	background: linear-gradient(180deg, #EDE1D5, #D8CBBE);
}
.ba-blog-card__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.ba-blog-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-width: 0;
}

/* Category pill */
.ba-blog-card__cat {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	padding: 8px 12px;
	background: #EFE6DD;
	border-radius: var(--ba-radius-pill);
	font-family: var(--ba-font-body);
	font-weight: 500;
	font-size: 11px;
	line-height: 1;
	letter-spacing: 1.54px;
	text-transform: uppercase;
	color: var(--ba-text-muted);
	text-decoration: none;
}
.ba-blog-card__cat:hover { color: var(--ba-text-primary); }

/* Title */
.ba-blog-card__title {
	font-family: var(--ba-font-heading);
	font-weight: 400;
	color: var(--ba-text-primary);
	line-height: 1.15;
	margin: 14px 0 0;
}
.ba-blog-card__title a { color: inherit; text-decoration: none; }
.ba-blog-card__title a:hover { color: var(--ba-text-secondary); }

/* Excerpt */
.ba-blog-card__excerpt {
	font-family: var(--ba-font-body);
	font-weight: 400;
	color: var(--ba-text-muted);
	line-height: var(--ba-lh-body);
	margin: 15px 0 0;
}

/* Footer (meta + read more) */
.ba-blog-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ba-gap-md);
	flex-wrap: wrap;
	margin-top: auto;
	padding-top: var(--ba-space-7);
}
.ba-blog-card__meta {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	font-size: var(--ba-fs-small);
	color: var(--ba-text-muted);
}
.ba-blog-card__meta span::after {
	/* Same square 4×4 separator as `.ba-hero__trust` on Home (global.css §10). */
	content: '';
	display: inline-block;
	width: 4px;
	height: 4px;
	background: currentColor;
	margin-left: 14px;
	vertical-align: middle;
	opacity: 0.55;
}
.ba-blog-card__meta span:last-child::after { display: none; }
.ba-blog-card__more.ba-tcard__link { margin-top: 0; align-self: center; }

/* ---- Big variant (row 1, left, 2/3 width) ---- */
.ba-blog-card--big {
	display: grid;
	grid-template-columns: 399px minmax(0, 1fr);
	gap: var(--ba-gap-lg);
	padding: 18px;
}
.ba-blog-card--big .ba-blog-card__media {
	min-height: 471px;
	border-radius: 18px;
}
.ba-blog-card--big .ba-blog-card__body {
	padding: var(--ba-space-3) 0; /* light internal vertical breathing */
}
.ba-blog-card--big .ba-blog-card__title { font-size: 36px; }
.ba-blog-card--big .ba-blog-card__excerpt { font-size: var(--ba-fs-body); margin-top: 15px; }

/* ---- Small variant (everything else) ---- */
.ba-blog-card--small .ba-blog-card__media {
	height: 214px;
	border-radius: 18px;
	margin-bottom: 18px;
}
.ba-blog-card--small .ba-blog-card__cat { margin-top: 0; }
.ba-blog-card--small .ba-blog-card__title {
	font-size: 26px;
	margin-top: 13px;
}
.ba-blog-card--small .ba-blog-card__excerpt {
	font-size: 15px;
	margin-top: 13px;
}

/* AJAX loading state */
.ba-blog-results { transition: opacity .15s ease; }
.ba-blog-results.is-loading { opacity: .55; pointer-events: none; }

/* Empty state */
.ba-blog__empty {
	font-size: var(--ba-fs-body);
	color: var(--ba-text-muted);
	margin: var(--ba-space-9) 0 0;
	text-align: center;
}

/* ---------------------------------------------------------------------------
 * Pagination
 * ------------------------------------------------------------------------- */

.ba-blog-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: var(--ba-gap-sm);
	margin-top: var(--ba-space-9);
}
.ba-blog-pagination__nav,
.ba-blog-pagination__page {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--ba-font-body);
	font-weight: 400;
	font-size: var(--ba-fs-small);
	line-height: 1;
	text-decoration: none;
	transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.ba-blog-pagination__nav {
	padding: 14px 16px;
	border: 1px solid rgba(237, 225, 213, 0.8);
	border-radius: var(--ba-radius-pill);
	color: var(--ba-text-muted);
	background: transparent;
}
.ba-blog-pagination__page {
	width: 44px;
	height: 44px;
	border: 1px solid rgba(237, 225, 213, 0.8);
	border-radius: 50%;
	color: var(--ba-text-primary);
	background: transparent;
}
.ba-blog-pagination__nav:hover,
.ba-blog-pagination__page:hover,
.ba-blog-pagination__page.is-active {
	background: var(--ba-card-bg-accent);
	border-color: var(--ba-card-bg-accent);
	color: var(--ba-text-on-dark);
}
.ba-blog-pagination__nav.is-disabled {
	opacity: .45;
	pointer-events: none;
}

/* ---------------------------------------------------------------------------
 * 3. BANNER (uses shared `.ba-banner` primitive — extra class for any
 * Blog-specific tweaks).
 * ------------------------------------------------------------------------- */

/* ---------------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------------- */

@media (max-width: 1100px) {
	.ba-blog-hero { grid-template-columns: 1fr; gap: 28px; }
	.ba-blog-hero .ba-hero__title { font-size: 46px; }
	.ba-blog-hero__media { min-height: 380px; }

	.ba-blog__head { grid-template-columns: 1fr; gap: var(--ba-gap-md); }
	.ba-blog__row--first { grid-template-columns: 1fr; }
	.ba-blog__row--rest  { grid-template-columns: repeat(2, minmax(0, 1fr)); }

	.ba-blog-card--big {
		grid-template-columns: 1fr;
	}
	.ba-blog-card--big .ba-blog-card__media {
		min-height: 320px;
	}
	.ba-blog-card--big .ba-blog-card__title { font-size: 30px; }
}

@media (max-width: 720px) {
	.ba-blog-hero .ba-hero__title { font-size: 36px; }
	.ba-blog-hero__media { min-height: 280px; }

	.ba-blog__row--rest { grid-template-columns: 1fr; }
	.ba-blog-card--small .ba-blog-card__media { height: 200px; }
	.ba-blog-card--big .ba-blog-card__media { min-height: 240px; }
	.ba-blog-card--big .ba-blog-card__title { font-size: 26px; }
	.ba-blog-card__foot { flex-direction: column; align-items: flex-start; gap: var(--ba-gap-sm); }
	.ba-blog-pagination__nav { padding: 12px 14px; }
	.ba-blog-pagination__page { width: 40px; height: 40px; }
}
