/* Listing Manager — blog (templates/blog-archive.php, blog-single.php, parts/blog-card.php)
   /blog/, its category and tag archives, and single posts. Loads after archive.css; colours come from
   the tokens in global.css, so dark and light both follow. */

/* ------------------------------------------------------------------
 * Card grid: 1 column on phones, 2 from 640px, 3 from 1000px
 * ------------------------------------------------------------------ */

.lm-blog-grid {
	display: grid;
	grid-template-columns: minmax( 0, 1fr );
	gap: 20px;
}

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

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

.lm-post-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	background: var( --lm-panel );
	border: 1px solid var( --lm-line );
	border-radius: var( --lm-radius );
}

.lm-post-card:hover,
.lm-post-card:focus-within {
	border-color: var( --lm-blue );
}

.lm-post-card-media {
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var( --lm-panel2 );
}

.lm-post-card-media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.lm-post-card-media.is-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	color: var( --lm-muted );
}

.lm-post-card-body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 8px;
	padding: 16px;
}

.lm-post-card-title {
	margin: 0;
	font-size: 19px;
	font-weight: 800;
	line-height: 1.3;
	letter-spacing: -0.01em;
	overflow-wrap: anywhere;
}

/* The title link covers the whole card, so the card is one big tap target. */
.lm-post-card-title a {
	color: var( --lm-ink );
	text-decoration: none;
}

.lm-post-card-title a::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
}

.lm-post-card-title a:focus-visible {
	outline: none;
}

.lm-post-card:has( .lm-post-card-title a:focus-visible ) {
	outline: 2px solid var( --lm-blue );
	outline-offset: 2px;
}

.lm-post-card-title a:hover {
	color: var( --lm-link );
}

.lm-post-card-excerpt {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
	color: var( --lm-muted );
}

.lm-post-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0 6px;
	margin: auto 0 0;
	padding-top: 4px;
	font-size: 13px;
	line-height: 1.5;
	color: var( --lm-muted );
}

.lm-post-card-by {
	min-width: 0;
	overflow-wrap: anywhere;
}

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

/* Breadcrumb links are 44px tall here (32px elsewhere); on a post the trail lines up with the article column. */
.lm-blog .lm-breadcrumbs a {
	min-height: var( --lm-tap );
}

.lm-blog-single .breadcrumbs-section {
	max-width: 760px;
	margin-right: auto;
	margin-left: auto;
}

.lm-blog-article {
	max-width: 760px;
	margin: 6px auto 0;
}

.lm-blog-header {
	margin-bottom: 18px;
}

.lm-blog-title {
	margin: 0;
	font-size: 36px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: -0.02em;
	color: var( --lm-ink );
	overflow-wrap: anywhere;
}

.lm-blog-date {
	margin: 10px 0 0;
	font-size: 14px;
	color: var( --lm-muted );
}

.lm-blog-figure {
	margin: 0 0 26px;
}

.lm-blog-figure img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var( --lm-radius );
	background: var( --lm-panel2 );
}

.lm-blog-content {
	font-size: 17px;
	line-height: 1.75;
	color: var( --lm-ink );
	overflow-wrap: break-word;
}

.lm-blog-content > :first-child {
	margin-top: 0;
}

.lm-blog-content p,
.lm-blog-content ul,
.lm-blog-content ol,
.lm-blog-content figure,
.lm-blog-content table,
.lm-blog-content pre {
	margin: 0 0 1.25em;
}

.lm-blog-content h2,
.lm-blog-content h3,
.lm-blog-content h4 {
	margin: 1.8em 0 0.6em;
	font-weight: 800;
	line-height: 1.3;
	letter-spacing: -0.01em;
	color: var( --lm-ink );
}

.lm-blog-content h2 {
	font-size: 26px;
}

.lm-blog-content h3 {
	font-size: 21px;
}

.lm-blog-content h4 {
	font-size: 18px;
}

.lm-blog-content ul,
.lm-blog-content ol {
	padding-left: 1.4em;
}

.lm-blog-content li {
	margin-bottom: 0.4em;
}

.lm-blog-content a {
	color: var( --lm-link );
	text-decoration: underline;
	text-underline-offset: 2px;
}

.lm-blog-content img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
}

.lm-blog-content figcaption {
	margin-top: 6px;
	font-size: 14px;
	color: var( --lm-muted );
}

.lm-blog-content blockquote {
	margin: 1.5em 0;
	padding: 4px 0 4px 18px;
	border-left: 4px solid var( --lm-blue );
	color: var( --lm-muted );
}

.lm-blog-content blockquote p:last-child {
	margin-bottom: 0;
}

.lm-blog-content pre,
.lm-blog-content code {
	font-size: 0.92em;
	background: var( --lm-panel2 );
	border-radius: 6px;
}

.lm-blog-content code {
	padding: 0.1em 0.35em;
}

.lm-blog-content pre {
	padding: 14px 16px;
	overflow-x: auto;
}

.lm-blog-content pre code {
	padding: 0;
	background: none;
}

.lm-blog-content table {
	display: block;
	width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
	font-size: 15px;
}

.lm-blog-content th,
.lm-blog-content td {
	padding: 8px 12px;
	border: 1px solid var( --lm-line );
	text-align: left;
}

/* ------------------------------------------------------------------
 * Related posts
 * ------------------------------------------------------------------ */

.lm-blog-related {
	margin: 44px 0 8px;
	padding-top: 28px;
	border-top: 1px solid var( --lm-line );
}

.lm-blog-related-title {
	margin: 0 0 16px;
	font-size: 22px;
	font-weight: 800;
	line-height: 1.25;
	color: var( --lm-ink );
}

@media ( max-width: 768px ) {
	.lm-blog-title {
		font-size: 27px;
	}

	.lm-blog-content {
		font-size: 16px;
		line-height: 1.7;
	}

	.lm-blog-content h2 {
		font-size: 22px;
	}

	.lm-blog-content h3 {
		font-size: 19px;
	}

	.lm-blog-related {
		margin-top: 32px;
	}

	.lm-post-card-body {
		padding: 14px;
	}
}
