/**
 * Blog Archive styles.
 *
 * @package NexioEducation
 */

/* ---- Archive wrapper ---- */
.blog-archive {
	max-width: 1440px;
	margin: 0 auto;
	padding: 0 142px 80px;
	box-sizing: border-box;
}

/* ---- Filter bar ---- */
.blog-archive-filters {
	display: flex;
	align-items: center;
	gap: 24px;
	margin-bottom: 54px;
	position: relative;
}

.blog-archive-filters-label {
	font-family: 'Manrope', sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 20px;
	color: #064d8e;
	flex-shrink: 0;
	order: 0;
}

.blog-archive-filters::after {
	content: "";
	flex: 1;
	height: 1px;
	background-color: #064d8e;
	margin: 0 24px;
	order: 1;
}

.blog-archive-filters-buttons {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	order: 2;
	flex-wrap: wrap;
}

.blog-archive-filter {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 32px;
	border: 1px solid rgba(6, 77, 142, 0.25);
	border-radius: 30px;
	background: transparent;
	font-family: 'Manrope', sans-serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 18px;
	color: #064d8e;
	cursor: pointer;
	text-decoration: none;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.blog-archive-filter:hover,
.blog-archive-filter.active {
	background-color: #064d8e;
	border-color: #064d8e;
	color: #fffefa;
}

/* ---- Post template grid ---- */
.blog-posts-template {
	display: grid !important;
	grid-template-columns: repeat(3, 1fr);
	gap: 48px 24px;
	margin-bottom: 64px;
	list-style: none;
	padding: 0 !important;
	margin-top: 0;
}

/* Reset WordPress layout overrides on cards */
.blog-post-card.is-layout-constrained,
.blog-post-card-image-wrap.is-layout-constrained,
.blog-post-card-content.is-layout-constrained,
.blog-post-card-meta.is-layout-flex {
	padding: 0 !important;
	max-width: none !important;
}

.blog-post-card.is-layout-constrained > *,
.blog-post-card-content.is-layout-constrained > * {
	max-width: none !important;
}

/* ---- Featured: first post spans full width ---- */
.blog-posts-template > .wp-block-post:first-child {
	grid-column: 1 / -1;
}

.blog-posts-template > .wp-block-post:first-child .blog-post-card {
	display: flex !important;
	flex-direction: row !important;
	gap: 48px;
	align-items: stretch;
}

.blog-posts-template > .wp-block-post:first-child .blog-post-card-image-wrap {
	flex: 0 0 55%;
	max-width: 55%;
	background-color: transparent;
	overflow: visible;
	display: flex;
	align-items: center;
}

.blog-posts-template > .wp-block-post:first-child .blog-post-card-image-wrap .wp-block-post-featured-image {
	height: auto;
	overflow: visible;
	margin: 0;
}

.blog-posts-template > .wp-block-post:first-child .blog-post-card-image-wrap .wp-block-post-featured-image a {
	height: auto;
}

.blog-posts-template > .wp-block-post:first-child .blog-post-card-image-wrap .wp-block-post-featured-image img {
	width: 100%;
	height: auto;
	object-fit: contain;
	display: block;
	border-radius: 8px;
}

.blog-posts-template > .wp-block-post:first-child .blog-post-card-content {
	flex: 1;
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: wrap;
	row-gap: 8px;
	column-gap: 12px;
	padding: 24px 0;
}

.blog-posts-template > .wp-block-post:first-child .blog-post-card-category {
	display: none !important;
}

.blog-posts-template > .wp-block-post:first-child .blog-post-card-title {
	width: 100%;
	order: 1;
	margin: 0 0 4px;
}

.blog-posts-template > .wp-block-post:first-child .blog-post-card-title a {
	font-family: 'Apris Trial', serif;
	font-size: 42px;
	font-weight: 400;
	line-height: 50px;
	color: #064d8e;
	text-decoration: none;
}

.blog-posts-template > .wp-block-post:first-child .blog-post-card-title a:hover {
	opacity: 0.8;
}

.blog-posts-template > .wp-block-post:first-child .blog-post-card-author {
	display: block !important;
	width: auto;
	order: 2;
	margin: 0 !important;
	font-family: 'Manrope', sans-serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 18px;
	color: #064d8e;
}

.blog-posts-template > .wp-block-post:first-child .blog-post-card-meta {
	display: contents;
}

.blog-posts-template > .wp-block-post:first-child .blog-post-card-date {
	width: auto;
	order: 2;
	font-size: 14px;
	color: rgba(6, 77, 142, 0.6);
	white-space: nowrap;
}

.blog-posts-template > .wp-block-post:first-child .blog-post-card-excerpt {
	width: 100%;
	order: 3;
	font-size: 16px;
	line-height: 24px;
	opacity: 0.8;
	margin-top: 4px;
}

.blog-posts-template > .wp-block-post:first-child .blog-post-card-readmore {
	order: 4;
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	padding: 12px 32px;
	border: 1px solid #064d8e;
	border-radius: 30px;
	font-family: 'Manrope', sans-serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 18px;
	color: #064d8e;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.blog-posts-template > .wp-block-post:first-child .blog-post-card-readmore:hover {
	background-color: #064d8e;
	color: #fffefa;
	opacity: 1;
}

/* ---- Grid cards (all posts except first) ---- */
.blog-post-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	position: relative;
}

.blog-post-card-image-wrap {
	position: relative;
	width: 100%;
	background-color: rgba(6, 77, 142, 0.08);
	border-radius: 8px;
	overflow: hidden;
	min-height: 220px;
}

.blog-post-card-image-wrap .wp-block-post-featured-image {
	height: 220px;
	overflow: hidden;
	margin: 0;
}

.blog-post-card-image-wrap .wp-block-post-featured-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.blog-post-card-image-wrap .wp-block-post-featured-image a {
	display: block;
	height: 100%;
}

.blog-post-card:hover .wp-block-post-featured-image img {
	transform: scale(1.03);
}

/* Category badge on grid cards */
.blog-post-card-category {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 1;
}

.blog-post-card-category a {
	display: inline-block;
	font-family: 'Manrope', sans-serif;
	font-size: 12px;
	font-weight: 700;
	line-height: 16px;
	color: #fffefa;
	background-color: #064d8e;
	padding: 4px 12px;
	border-radius: 30px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	text-decoration: none;
}

/* Separator between multiple categories */
.blog-post-card-category .wp-block-post-terms__separator {
	display: none;
}

.blog-post-card-category a + a {
	margin-left: 4px;
}

/* Card content */
.blog-post-card-content {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: wrap;
	row-gap: 8px;
	padding: 20px 0;
	flex: 1;
	position: static !important;
}

.blog-post-card-title {
	width: 100%;
	order: 1;
	margin: 0;
}

.blog-post-card-title a {
	font-family: 'Apris Trial', serif;
	font-size: 24px;
	font-weight: 400;
	line-height: 30px;
	color: #064d8e;
	text-decoration: none;
	margin-top: 10px;
}

.blog-post-card-title a:hover {
	opacity: 0.8;
}

.blog-post-card-excerpt {
	width: 100%;
	order: 3;
	font-family: 'Manrope', sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 20px;
	color: #064d8e;
	margin: 0;
	opacity: 0.7;
}

.blog-post-card-excerpt .wp-block-post-excerpt__excerpt {
	margin: 0;
}

.blog-post-card-author {
	width: auto;
	order: 2;
	margin: 0 !important;
	font-family: 'Manrope', sans-serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 18px;
	color: #064d8e;
}

.blog-post-card-meta {
	display: contents !important;
}

.blog-post-card-date {
	display: none;
}

.blog-post-card-readmore {
	order: 4;
	margin-top: auto;
	display: inline-block;
	font-family: 'Manrope', sans-serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 18px;
	color: #064d8e;
	text-decoration: none;
}

.blog-post-card-readmore:hover {
	opacity: 0.7;
}

.blog-post-card-category {
	display: none;
}

/* ---- Pagination ---- */
.blog-archive-pagination {
	margin-top: 48px;
	gap: 8px;
}

.blog-archive-pagination .wp-block-query-pagination-numbers .page-numbers,
.blog-archive-pagination a,
.blog-archive-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 8px 16px;
	border: 1px solid rgba(6, 77, 142, 0.25);
	border-radius: 30px;
	font-family: 'Manrope', sans-serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 18px;
	color: #064d8e;
	text-decoration: none;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.blog-archive-pagination a:hover {
	background-color: #064d8e;
	border-color: #064d8e;
	color: #fffefa;
}

.blog-archive-pagination .wp-block-query-pagination-numbers .page-numbers.current {
	background-color: #064d8e;
	border-color: #064d8e;
	color: #fffefa;
}

/* No results */
.blog-no-results {
	font-family: 'Manrope', sans-serif;
	font-size: 16px;
	color: rgba(6, 77, 142, 0.6);
	text-align: center;
	padding: 64px 0;
}

/* ---- Blog page header padding ---- */
.blog-page-header {
	padding: 80px 142px 80px;
}

/* ---- Hide page header extras ---- */
.blog-page-header .page-header-cta,
.blog-page-header .page-header-tagline {
	display: none;
}

/* ---- Responsive: Large ---- */
@media (max-width: 1350px) {
	.blog-page-header {
		padding: 80px max(60px, calc((100% - 1156px) / 2)) 80px;
	}

	.blog-archive {
		padding: 0 max(60px, calc((100% - 1156px) / 2)) 80px;
	}
}

/* ---- Responsive: Tablet ---- */
@media (max-width: 1200px) {
	.blog-page-header {
		padding: 80px 60px 80px;
	}

	.blog-archive {
		padding: 0 60px 60px;
	}

	.blog-archive-filters {
		margin-bottom: 48px;
	}

	.blog-posts-template > .wp-block-post:first-child .blog-post-card-title a {
		font-size: 32px;
		line-height: 40px;
	}

}

@media (max-width: 1100px) {
	.blog-posts-template {
		grid-template-columns: repeat(2, 1fr);
	}

	.blog-posts-template > .wp-block-post:first-child {
		grid-column: 1 / -1;
	}
}

/* ---- Responsive: Mobile ---- */
@media (max-width: 768px) {
	.blog-page-header {
		padding: 40px 24px 32px;
	}

	.blog-archive {
		padding: 32px 24px 40px;
	}

	.blog-archive-filters {
		flex-wrap: wrap;
		gap: 16px;
		margin-bottom: 32px;
	}

	.blog-archive-filters::after {
		display: none;
	}

	.blog-archive-filters-buttons {
		width: 100%;
		flex-wrap: wrap;
	}

	.blog-archive-filter {
		padding: 6px 20px;
		font-size: 13px;
	}

	.blog-posts-template {
		grid-template-columns: 1fr;
	}

	.blog-posts-template > .wp-block-post:first-child .blog-post-card {
		flex-direction: column !important;
		gap: 24px;
	}

	.blog-posts-template > .wp-block-post:first-child .blog-post-card-image-wrap {
		flex: none;
		max-width: 100%;
	}

	.blog-posts-template > .wp-block-post:first-child .blog-post-card-content {
		grid-template-columns: auto auto 1fr;
		padding: 0;
	}

	.blog-posts-template > .wp-block-post:first-child .blog-post-card-title a {
		font-size: 28px;
		line-height: 34px;
	}

	.blog-post-card-title a {
		font-size: 20px;
		line-height: 26px;
	}
}

@media (max-width: 420px) {
	.blog-page-header {
		padding: 32px 16px 24px;
	}

	.blog-archive {
		padding: 24px 16px 32px;
	}

	.blog-archive-filters-label {
		font-size: 14px;
	}

	.blog-archive-filter {
		padding: 6px 16px;
		font-size: 12px;
	}
}
