/* Blog listing — loaded only on blog views (see inc/blog.php). */

body.hs-blog {
	--hs-navy: #152556;
	--hs-ink: #0b0b0f;
	--hs-text: #4b5563;
	--hs-page: #f3f4f6;
	--hs-card: #ffffff;
	--hs-muted: #b8bcc6;
	--hs-field: #e9e9f2;
	--hs-field-border: #c9cadb;
	--hs-radius: 12px;
	--hs-font-heading: 'Plus Jakarta Sans', sans-serif;
	--hs-font-body: 'Inter', sans-serif;
}

/*
 * The theme sets `* { font-family: 'Inter' }` and `!important` heading sizes,
 * so fonts are set on every element directly and heading sizes use !important.
 */

body.hs-blog #page-container {
	background-color: var(--hs-page);
	overflow: hidden;
}

/* Green blob behind the nav, as on the FAQ page. */
body.hs-blog #page-container::before {
	content: "";
	background: url('/wp-content/themes/Divi-Child/img/blog-header.svg') no-repeat;
	background-size: contain;
	width: 666px;
	height: 211px;
	display: block;
	position: absolute;
	top: 0;
	right: 0;
	z-index: 9;
	pointer-events: none;
}

body.hs-blog #et-main-area,
body.hs-blog #main-content.hs-blog-listing {
	background-color: var(--hs-page) !important;
}

/* Overrides the theme's generic `body.archive #main-content` spacing. */
body.hs-blog #main-content.hs-blog-listing {
	padding: 8.5em 0 5em;
	min-height: 75vh;
}

.hs-blog-listing__inner {
	max-width: 1200px;
	width: 90%;
	margin: 0 auto;
	/* Above the header blob (z-index 9), which reaches down over content on narrow screens. */
	position: relative;
	z-index: 10;
}

/* Header: title left, search + chips right */
.hs-blog-listing__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 2em;
	margin-bottom: 2.5em;
}

.hs-blog-listing__title {
	font-family: var(--hs-font-heading);
	font-weight: bold;
	line-height: 1.1 !important;
	color: var(--hs-navy);
	padding: 0;
	margin: 0;
}

.hs-blog-listing__tools {
	flex: 0 1 560px;
	display: flex;
	flex-direction: column;
	gap: 0.75em;
}

.hs-blog-search {
	display: flex;
	gap: 0;
	border-radius: 8px;
	transition: box-shadow 0.15s ease;
}

/* Input and button read as one control, so focus rings the pair. */
.hs-blog-search:focus-within {
	box-shadow: 0 0 0 3px rgba(21, 37, 86, 0.2);
}

.hs-blog-search__input:focus {
	outline: none;
	background: #fff;
	border-color: var(--hs-navy);
}

.hs-blog-search__button:focus-visible {
	outline: none;
	background: #0d1a40;
}

.hs-blog-search__button:hover {
	background: #0d1a40;
}

.hs-blog-search__input {
	flex: 1;
	min-width: 0;
	height: 44px;
	padding: 0 1em;
	font-family: var(--hs-font-body);
	font-size: 1em;
	color: var(--hs-ink);
	background: var(--hs-field);
	border: 1px solid var(--hs-field-border);
	border-right: 0;
	border-radius: 8px 0 0 8px;
	-webkit-appearance: none;
	appearance: none;
}

.hs-blog-search__button {
	height: 44px;
	padding: 0 1.5em;
	font-family: var(--hs-font-body);
	font-weight: 600;
	font-size: 1em;
	color: #fff;
	background: var(--hs-navy);
	border: 0;
	border-radius: 0 8px 8px 0;
	cursor: pointer;
}

.hs-blog-chip:focus-visible,
.hs-card__title a:focus-visible,
.hs-card__author:focus-visible,
.hs-blog-pagination .page-numbers:focus-visible {
	outline: 2px solid var(--hs-navy);
	outline-offset: 2px;
}

.hs-blog-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em;
}

.hs-blog-chip {
	display: inline-block;
	padding: 0.2em 0.9em;
	font-family: var(--hs-font-heading);
	font-size: 0.8125em;
	font-weight: bold;
	line-height: 1.6;
	color: #fff !important;
	background: var(--hs-cat);
	border: 2px solid var(--hs-cat);
	border-radius: 999px;
	text-decoration: none;
	transition: opacity 0.15s ease;
}

.hs-blog-chip:hover {
	opacity: 0.85;
}

.hs-blog-chip.is-current {
	background: transparent;
	color: var(--hs-navy) !important;
}

.hs-blog-listing__context {
	font-family: var(--hs-font-body);
	color: var(--hs-text);
	margin: -1em 0 1.5em;
}

.hs-blog-listing__context a {
	color: var(--hs-navy);
	text-decoration: underline;
}

/* Card grid */
.hs-blog-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.75em;
}

.hs-card {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 6px 6px 1.5em;
	background: var(--hs-card);
	border-radius: 16px;
	box-shadow: 0 1px 2px rgba(21, 37, 86, 0.06);
}

.hs-card__media {
	position: relative;
	margin-bottom: 1.25em;
}

.hs-card__image {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	border: 3px solid var(--hs-cat);
	border-radius: 12px;
}

.hs-card__image--empty {
	background: var(--hs-field);
}

.hs-card__badge {
	position: absolute;
	top: 10px;
	left: 10px;
	padding: 0.3em 1.1em;
	font-family: var(--hs-font-heading);
	font-size: 0.8125em;
	font-weight: bold;
	line-height: 1.4;
	color: #fff;
	background: var(--hs-cat);
	border-radius: 999px;
}

.hs-card__title,
.hs-card__excerpt,
.hs-card__author {
	padding-left: 0.75rem;
	padding-right: 0.75rem;
}

.hs-card__title {
	font-family: var(--hs-font-heading);
	font-weight: bold;
	font-size: 1.375em !important;
	line-height: 1.25 !important;
	/* Two lines (2 × line-height), so excerpts line up across 1- and 2-line titles. */
	min-height: 2.5em;
	padding-bottom: 0;
	margin: 0 0 1.25rem;
}

.hs-card__title a {
	font-family: var(--hs-font-heading);
	font-weight: bold;
	color: var(--hs-ink);
	text-decoration: none;
}

/* Covers the whole card, so hovering anywhere on it hovers the title link. */
.hs-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 16px;
}

.hs-card__title a:hover,
.hs-card__title a:focus-visible {
	text-decoration: underline;
}

.hs-card__excerpt {
	font-family: var(--hs-font-heading);
	font-weight: normal;
	font-size: 0.875em;
	line-height: 1.55;
	color: var(--hs-ink);
	padding-bottom: 0;
	margin: 0 0 1.1rem;
	flex: 1;
}

/* Sits above the title link's overlay; links to the author's posts. */
.hs-card__author {
	position: relative;
	z-index: 1;
	align-self: flex-start;
	text-decoration: none;
	display: flex;
	align-items: center;
	gap: 0.6em;
}

.hs-card__avatar {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	object-fit: cover;
}

.hs-card__author-name {
	font-family: var(--hs-font-heading);
	font-weight: normal;
	font-size: 0.8125em;
	color: var(--hs-navy);
	text-decoration: underline;
}

/* Pagination */
.hs-blog-pagination {
	margin-top: 3em;
}

.hs-blog-pagination .nav-links {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 0.6em;
}

.hs-blog-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	font-family: var(--hs-font-body);
	font-weight: 600;
	font-size: 0.875em;
	color: #fff;
	background: var(--hs-muted);
	border-radius: 50%;
	text-decoration: none;
}

.hs-blog-pagination .page-numbers.current {
	background: var(--hs-navy);
}

.hs-blog-pagination .page-numbers.dots {
	background: transparent;
	color: var(--hs-text);
}

.hs-blog-pagination .page-numbers.prev,
.hs-blog-pagination .page-numbers.next {
	background: transparent;
	color: var(--hs-navy);
	font-size: 1.75em;
	font-weight: 400;
}

.hs-blog-pagination a.page-numbers:hover {
	opacity: 0.85;
}

/* Empty states */
.hs-blog-empty {
	padding: 4em 0;
	text-align: center;
	font-family: var(--hs-font-body);
	color: var(--hs-text);
}

.hs-blog-empty a {
	color: var(--hs-navy);
	text-decoration: underline;
}

/* Tablet */
@media all and (max-width: 980px) {
	body.hs-blog #page-container::before {
		width: 444px;
		height: 140px;
	}

	body.hs-blog #main-content.hs-blog-listing {
		padding-top: 7em;
	}

	.hs-blog-listing__header {
		flex-direction: column;
		gap: 1.25em;
	}

	.hs-blog-listing__tools {
		flex-basis: auto;
		width: 100%;
	}

	.hs-blog-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Mobile */
@media all and (max-width: 600px) {
	body.hs-blog #page-container::before {
		width: 300px;
		height: 95px;
	}

	.hs-blog-listing__title {
		font-size: 2.25em !important;
	}

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

	/* One column: nothing to line up with. */
	.hs-card__title {
		min-height: 0;
	}
}
