/**
 * Blog posts: the single post page, post listings (posts page, categories,
 * search) and post cards. Loaded after pages.css, whose banner and
 * .hm-hope-card styles they build on.
 *
 * Phones: one column. 600px+: two cards a row. 992px+: the story beside
 * its sidebar, three cards a row.
 */

/* Banner extras -------------------------------------------------------- */

.hm-page-hero__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 18px 0 0;
	padding: 0;
	list-style: none;
}

.hm-page-hero__meta li {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 12px;
	border-radius: var(--hm-radius-pill);
	background: rgb(255 255 255 / 0.85);
	box-shadow: 0 6px 16px -12px rgb(10 47 96 / 0.5);
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1.3;
	color: var(--hm-color-primary);
}

.hm-page-hero__meta svg {
	flex: none;
	width: 15px;
	height: 15px;
	color: var(--hm-color-highlight);
}

/* A long post title is cut short in the breadcrumb, not wrapped. */
.hm-post .hm-breadcrumb ol {
	flex-wrap: nowrap;
	max-width: 100%;
}

.hm-post .hm-breadcrumb li {
	white-space: nowrap;
}

.hm-post .hm-breadcrumb [aria-current] {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Single post ------------------------------------------------------------ */

.hm-post__layout {
	display: grid;
	gap: 40px;
	padding-block: 28px var(--hm-section-space);
}

.hm-post__article {
	min-width: 0;
}

.hm-post__media {
	margin: 0 0 28px;
	overflow: hidden;
	border-radius: 16px;
	background: linear-gradient(135deg, #cfe3fa, #8fbaea);
	box-shadow: 0 24px 48px -32px rgb(10 47 96 / 0.6);
}

.hm-post__media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.hm-post__content {
	font-size: 17px;
	line-height: 1.75;
	color: var(--hm-color-text);
}

.hm-post__content > :first-child {
	margin-top: 0;
}

.hm-post__content p {
	margin: 0 0 1.2em;
}

/* The opening paragraph reads as a lead-in. */
.hm-post__content > p:first-child {
	font-size: 1.1em;
	font-weight: 500;
	color: #0b2a5e;
}

.hm-post__content h2,
.hm-post__content h3,
.hm-post__content h4 {
	margin: 1.6em 0 0.6em;
	font-family: var(--hm-font-heading);
	line-height: 1.25;
	color: var(--hm-color-primary);
}

.hm-post__content h2 {
	font-size: clamp(22px, 1.2vw + 16px, 28px);
}

.hm-post__content h3 {
	font-size: 21px;
}

.hm-post__content a {
	color: var(--hm-color-highlight);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Bullet lists: a tinted box with ticks. */
.hm-post__content ul {
	display: grid;
	gap: 10px;
	margin: 0 0 1.4em;
	padding: 18px 22px;
	list-style: none;
	border-radius: 14px;
	background: var(--hm-color-button-soft);
}

.hm-post__content ul li {
	position: relative;
	padding-left: 32px;
}

.hm-post__content ul li::before {
	content: "";
	position: absolute;
	top: 0.25em;
	left: 0;
	width: 21px;
	height: 21px;
	border-radius: 50%;
	background: var(--hm-color-highlight) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1.5 5.2 4.5 8 10.5 1.8' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.hm-post__content ol {
	margin: 0 0 1.4em;
	padding-left: 1.4em;
}

.hm-post__content ol li::marker {
	font-weight: 700;
	color: var(--hm-color-highlight);
}

.hm-post__content blockquote {
	margin: 1.6em 0;
	padding: 18px 22px;
	border-left: 4px solid var(--hm-color-highlight);
	border-radius: 0 14px 14px 0;
	background: #f5f9ff;
	font-size: 1.08em;
	font-style: italic;
	color: #0b2a5e;
}

.hm-post__content blockquote p:last-child {
	margin-bottom: 0;
}

.hm-post__content img {
	max-width: 100%;
	height: auto;
	border-radius: 12px;
}

.hm-post__content figure {
	margin: 1.6em 0;
}

.hm-post__content figcaption {
	margin-top: 8px;
	font-size: 14px;
	text-align: center;
	color: #5b6b82;
}

/* Categories and sharing */
.hm-post__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 24px;
	margin-top: 32px;
	padding-top: 22px;
	border-top: 1px solid #e3ebf5;
}

.hm-post__terms,
.hm-post__share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.hm-post__foot-label {
	margin-right: 4px;
	font-family: var(--hm-font-heading);
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #6b7c93;
}

.hm-post__terms a {
	padding: 5px 12px;
	border-radius: var(--hm-radius-pill);
	background: var(--hm-color-button-soft);
	font-family: var(--hm-font-heading);
	font-size: 13.5px;
	font-weight: 600;
	color: var(--hm-color-highlight);
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.hm-post__terms a:hover {
	background: var(--hm-color-button);
	color: var(--hm-color-white);
}

.hm-post__share-link {
	--hm-share: var(--hm-color-highlight);

	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--hm-share);
	color: var(--hm-color-white);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hm-post__share-link--facebook { --hm-share: #1877f2; }
.hm-post__share-link--x { --hm-share: #0f1419; }
.hm-post__share-link--whatsapp { --hm-share: #25d366; }
.hm-post__share-link--linkedin { --hm-share: #0a66c2; }

.hm-post__share-link svg {
	width: 17px;
	height: 17px;
}

.hm-post__share-link:hover {
	color: var(--hm-color-white);
	box-shadow: 0 8px 16px -8px var(--hm-share);
	transform: translateY(-2px);
}

/* Previous / next story */
.hm-post-nav {
	display: grid;
	gap: 12px;
	margin-top: 28px;
}

.hm-post-nav__link {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 16px 18px;
	border: 1px solid #e3ebf5;
	border-radius: 14px;
	background: var(--hm-color-white);
	text-decoration: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hm-post-nav__link:hover {
	border-color: var(--hm-color-highlight);
	box-shadow: 0 16px 30px -24px rgb(10 47 96 / 0.6);
}

.hm-post-nav__link--next {
	align-items: flex-end;
	text-align: right;
}

.hm-post-nav__label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-family: var(--hm-font-heading);
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--hm-color-highlight);
}

.hm-post-nav__link--next .hm-post-nav__label {
	flex-direction: row-reverse;
}

.hm-post-nav__label svg {
	width: 14px;
	height: auto;
}

.hm-post-nav__link--prev .hm-post-nav__label svg {
	transform: rotate(180deg);
}

.hm-post-nav__title {
	font-family: var(--hm-font-heading);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	color: #0b2a5e;
}

/* Sidebar */
.hm-post__aside {
	display: grid;
	align-content: start;
	gap: 24px;
}

.hm-post-donate {
	position: relative;
	overflow: hidden;
	padding: 26px 24px;
	border-radius: 16px;
	background: linear-gradient(150deg, var(--hm-color-highlight) 0%, var(--hm-color-primary-dark) 100%);
	box-shadow: 0 24px 44px -28px rgb(10 47 96 / 0.8);
	color: var(--hm-color-white);
}

.hm-post-donate__icon {
	position: absolute;
	right: -22px;
	bottom: -26px;
	width: 140px;
	height: auto;
	opacity: 0.12;
}

.hm-post-donate__eyebrow {
	position: relative;
	margin: 0 0 6px;
	font-family: var(--hm-font-heading);
	font-size: 12.5px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.85;
}

.hm-post-donate__title {
	position: relative;
	margin: 0;
	font-family: var(--hm-font-heading);
	font-size: 23px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--hm-color-white);
}

.hm-post-donate__text {
	position: relative;
	margin: 10px 0 20px;
	font-size: 14.5px;
	line-height: 1.55;
	opacity: 0.92;
}

.hm-post-donate__btn {
	position: relative;
	min-height: 44px;
	border-color: var(--hm-color-white);
}

.hm-post-cats {
	padding: 20px;
	border: 1px solid #e3ebf5;
	border-radius: 16px;
	background: var(--hm-color-white);
	box-shadow: 0 16px 34px -28px rgb(10 47 96 / 0.5);
}

.hm-post-cats__title {
	margin: 0 0 10px;
	padding-inline: 10px;
	font-family: var(--hm-font-heading);
	font-size: 18px;
	font-weight: 700;
	color: var(--hm-color-primary);
}

.hm-post-cats ul {
	display: grid;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hm-post-cats a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 10px;
	border-radius: 10px;
	font-size: 14.5px;
	font-weight: 500;
	color: #0b2a5e;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.hm-post-cats a:hover,
.hm-post-cats a[aria-current] {
	background: var(--hm-color-button-soft);
	color: var(--hm-color-highlight);
}

.hm-post-cats a[aria-current] {
	font-weight: 700;
}

.hm-post-cats__icon {
	display: grid;
	flex: none;
	place-items: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--hm-color-button-soft);
	color: var(--hm-color-highlight);
}

.hm-post-cats a[aria-current] .hm-post-cats__icon {
	background: var(--hm-color-button);
	color: var(--hm-color-white);
}

.hm-post-cats__icon svg {
	width: 15px;
	height: 15px;
}

.hm-post-cats__name {
	flex: 1;
}

.hm-post-cats__count {
	min-width: 28px;
	padding: 2px 8px;
	border-radius: var(--hm-radius-pill);
	background: #eef3f9;
	font-size: 12px;
	font-weight: 600;
	text-align: center;
	color: #4a5d78;
}

/* More stories */
.hm-post-related {
	padding-block: var(--hm-section-space);
	background: linear-gradient(180deg, #f5f9ff 0%, var(--hm-color-white) 100%);
}

.hm-post-related__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px 24px;
	margin-bottom: 28px;
}

/* Post cards ------------------------------------------------------------- */

.hm-post-grid {
	display: grid;
	gap: 20px;
}

.hm-post-card .hm-hope-card__media {
	position: relative;
}

.hm-post-card .hm-hope-card__media img {
	aspect-ratio: 16 / 10;
}

.hm-post-card__flag {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 4px 10px;
	border-radius: var(--hm-radius-pill);
	background: var(--hm-color-accent);
	box-shadow: 0 6px 14px -8px rgb(0 0 0 / 0.5);
	font-family: var(--hm-font-heading);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--hm-color-white);
}

a.hm-hope-card__badge {
	text-decoration: none;
	transition: background-color 0.2s ease;
}

a.hm-hope-card__badge:hover {
	background: var(--hm-color-button-tint);
}

.hm-post-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	margin: 0 0 8px;
	font-size: 13px;
	line-height: 1.4;
	color: #5b6b82;
}

.hm-post-card__meta span {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.hm-post-card__meta svg {
	flex: none;
	width: 14px;
	height: 14px;
	color: var(--hm-color-highlight);
}

.hm-post-card .hm-hope-card__text {
	margin-bottom: 14px;
}

/* Pinned to the bottom so the links line up across a row. */
.hm-post-card__more {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	font-family: var(--hm-font-heading);
	font-size: 14.5px;
	font-weight: 600;
	color: var(--hm-color-highlight);
	text-decoration: none;
}

.hm-post-card__more svg {
	width: 14px;
	height: auto;
	transition: transform 0.2s ease;
}

.hm-post-card:hover .hm-post-card__more svg {
	transform: translateX(3px);
}

/* Listings ------------------------------------------------------------- */

.hm-posts__inner {
	padding-block: 28px var(--hm-section-space);
}

/* Category filter: one scrolling row on phones, wrapped on desktop. */
.hm-post-filter {
	margin: 0 calc(-1 * var(--hm-gutter)) 28px;
	padding-inline: var(--hm-gutter);
	overflow-x: auto;
	scrollbar-width: none;
}

.hm-post-filter::-webkit-scrollbar {
	display: none;
}

.hm-post-filter ul {
	display: flex;
	gap: 8px;
	width: max-content;
	margin: 0;
	padding: 4px 0;
	list-style: none;
}

.hm-post-filter a {
	display: block;
	padding: 8px 16px;
	border: 1px solid #d9e4f2;
	border-radius: var(--hm-radius-pill);
	background: var(--hm-color-white);
	font-family: var(--hm-font-heading);
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	color: #0b2a5e;
	text-decoration: none;
	transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.hm-post-filter a:hover {
	border-color: var(--hm-color-highlight);
	color: var(--hm-color-highlight);
}

.hm-post-filter a[aria-current] {
	border-color: transparent;
	background: var(--hm-color-button);
	color: var(--hm-color-white);
}

/* Page numbers */
.hm-posts .pagination {
	margin-top: 40px;
}

.hm-posts .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.hm-posts .page-numbers {
	display: grid;
	place-items: center;
	min-width: 42px;
	height: 42px;
	padding: 0 12px;
	border: 1px solid #d9e4f2;
	border-radius: var(--hm-radius-pill);
	background: var(--hm-color-white);
	font-family: var(--hm-font-heading);
	font-weight: 600;
	color: #0b2a5e;
	text-decoration: none;
}

.hm-posts a.page-numbers:hover {
	border-color: var(--hm-color-highlight);
	color: var(--hm-color-highlight);
}

.hm-posts .page-numbers.current {
	border-color: transparent;
	background: var(--hm-color-button);
	color: var(--hm-color-white);
}

.hm-posts .page-numbers.dots {
	border: 0;
	background: none;
}

.hm-posts .page-numbers svg {
	width: 14px;
	height: auto;
}

.hm-posts .page-numbers.prev svg {
	transform: rotate(180deg);
}

/* Nothing found */
.hm-posts__empty {
	display: grid;
	justify-items: center;
	gap: 20px;
	max-width: 560px;
	margin: 0 auto;
	padding-block: 24px;
	font-size: 17px;
	text-align: center;
}

.hm-posts__empty p {
	margin: 0;
}

.hm-posts__empty .hm-search-form {
	width: 100%;
}

@media (min-width: 600px) {
	.hm-post-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.hm-post-nav {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.hm-post-nav__link--next {
		grid-column: 2;
	}
}

@media (min-width: 992px) {
	.hm-post__layout {
		grid-template-columns: minmax(0, 1fr) 330px;
		gap: 56px;
		padding-top: 40px;
	}

	.hm-post-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 24px;
	}

	.hm-post-filter {
		margin-inline: 0;
		padding-inline: 0;
		overflow: visible;
	}

	.hm-post-filter ul {
		flex-wrap: wrap;
		width: auto;
	}
}

@media (min-width: 1200px) {
	.hm-post__layout {
		grid-template-columns: minmax(0, 1fr) calc(380 * var(--hm-u));
		gap: calc(80 * var(--hm-u));
	}

	.hm-post__content {
		font-size: max(17px, calc(19 * var(--hm-u)));
	}
}
