/**
 * Single post and post archives.
 * Enqueued only on those views. Card look stays in components.css.
 *
 * The post title follows the kit H2 global font.
 * Headings inside the article follow the kit H3 global font.
 */

body.single-post {
	background-color: var(--hbn-color-bg-alt);
}

.hbn-post-cover {
	--hbn-post-cover-max: 500px;
	line-height: 0;
	max-height: var(--hbn-post-cover-max);
	overflow: hidden;
	width: 100%;
}

.hbn-post-cover__img,
.hbn-post-cover img {
	display: block;
	height: var(--hbn-post-cover-max);
	max-height: var(--hbn-post-cover-max);
	object-fit: cover;
	object-position: center;
	width: 100%;
}

.hbn-blog-archive {
	box-sizing: border-box;
	padding-block: var(--hbn-section-py);
	padding-inline: var(--hbn-gutter);
	width: 100%;
}

.hbn-post-content {
	box-sizing: border-box;
	margin-inline: auto;
	max-width: 800px;
	padding-block: var(--hbn-section-py);
	width: min(800px, calc(100% - 2 * var(--hbn-gutter)));
}

.hbn-post-bottom-template {
	box-sizing: border-box;
	max-width: 100%;
	width: 100%;
}

h1.hbn-post-title,
h1.hbn-archive-title {
	color: var(--hbn-color-navy);
	font-family: var(--e-global-typography-hbn_h2-font-family, var(--hbn-font-heading));
	font-size: var(--e-global-typography-hbn_h2-font-size);
	font-weight: var(--e-global-typography-hbn_h2-font-weight);
	line-height: var(--e-global-typography-hbn_h2-line-height);
	margin: 0;
	overflow-wrap: anywhere;
	text-align: left;
}

.hbn-post-meta {
	color: var(--hbn-color-text);
	display: flex;
	flex-wrap: wrap;
	font-family: var(--hbn-font-body);
	gap: 8px 16px;
	margin: var(--hbn-journal-card-title-excerpt-gap) 0 0;
}

.hbn-post-meta a {
	color: inherit;
	text-decoration: none;
}

.hbn-post-body {
	margin-top: var(--hbn-section-gap);
	overflow-wrap: anywhere;
	text-align: left;
}

.hbn-post-body :where(p, ul, ol, blockquote, figure, h2, h3, h4, h5, h6) {
	text-align: left;
}

.hbn-post-body :is(h2, h3, h4, h5, h6) {
	color: var(--hbn-color-navy);
	font-family: var(--e-global-typography-hbn_h3-font-family, var(--hbn-font-heading));
	font-size: var(--e-global-typography-hbn_h3-font-size);
	font-weight: var(--e-global-typography-hbn_h3-font-weight);
	/* Kit H3 tag is 1.1 / 1.3. The H3 global-font variable is 0.9 on desktop. */
	line-height: 1.1em;
}

.hbn-post-body > * + * {
	margin-block-start: var(--hbn-journal-card-title-excerpt-gap);
}

.hbn-post-body img,
.hbn-post-body video,
.hbn-post-body iframe {
	height: auto;
	max-width: 100%;
}

.hbn-post-body :where(ul, ol) {
	padding-inline-start: 1.25em;
}

.hbn-post-body :where(blockquote) {
	border-inline-start: 2px solid var(--hbn-color-teal-on-light);
	margin-inline: 0;
	padding-inline-start: 1em;
}

.hbn-post-body :where(figure) {
	margin-inline: 0;
}

.hbn-archive-description {
	color: var(--hbn-color-text);
	font-family: var(--hbn-font-body);
	margin-top: var(--hbn-journal-card-title-excerpt-gap);
	max-width: 42em;
	text-align: left;
}

.hbn-archive-description :where(p) {
	margin: 0;
}

.hbn-blog-grid {
	display: grid;
	gap: var(--hbn-journal-card-gap);
	grid-template-columns: minmax(0, 1fr);
	margin-top: var(--hbn-section-gap);
	width: 100%;
}

.hbn-blog-empty {
	color: var(--hbn-color-text);
	font-family: var(--hbn-font-body);
	margin: var(--hbn-section-gap) 0 0;
}

.hbn-pagination {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin-top: var(--hbn-section-gap);
}

.hbn-pagination__item,
.hbn-pagination a,
.hbn-pagination span {
	align-items: center;
	background-color: transparent;
	border: 1px solid transparent;
	border-radius: var(--hbn-radius-btn);
	box-sizing: border-box;
	color: var(--hbn-color-navy);
	display: inline-flex;
	font-family: var(--hbn-font-body);
	font-size: var(--e-global-typography-text-font-size);
	font-weight: var(--e-global-typography-accent-font-weight, 600);
	justify-content: center;
	line-height: var(--e-global-typography-text-line-height, 1.5);
	min-height: 40px;
	min-width: 40px;
	padding: 8px 12px;
	text-decoration: none;
}

a.hbn-pagination__item:hover {
	background-color: var(--hbn-color-cream);
	color: var(--hbn-color-navy);
	filter: none;
}

.hbn-pagination__item.is-current,
.hbn-pagination .current {
	background-color: var(--hbn-color-teal-on-light);
	color: var(--hbn-color-white);
}

.hbn-pagination__item.is-disabled {
	color: var(--hbn-color-text);
	opacity: 0.4;
	pointer-events: none;
}

.hbn-pagination__item:focus-visible {
	outline: 2px solid var(--hbn-color-teal-on-light);
	outline-offset: 2px;
}

@media (min-width: 768px) {
	.hbn-blog-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1025px) {
	.hbn-blog-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.hbn-post-cover {
		--hbn-post-cover-max: 280px;
	}

	.hbn-post-body :is(h2, h3, h4, h5, h6) {
		line-height: 1.3em;
	}
}
