/*--------------------------------------------------------------
# Single Post — the read page
#
# Measure over decoration: one narrow column, generous leading, and
# no sidebar. Depends on blog-list.css for .blog-card2, which the
# related strip at the foot of the page reuses.
--------------------------------------------------------------*/

/* Reading measure. 720px holds roughly 70–80 characters at the body size
   below, which is the range long-form prose stays comfortable in. Declared
   once here and referenced by every band so they stay aligned with each
   other. */
.blog-post {
	--post-measure: 720px;

	background: var(--tpp-white);
	padding: 64px 0 0;
}


/* ──────────────────────────────────────────────
   Header
   ────────────────────────────────────────────── */

.blog-post__header-inner {
	width: 100%;
	max-width: var(--post-measure);
	margin: 0 auto;
	padding: 0 var(--tpp-container-padding);
	text-align: center;
}

.blog-post__back {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-family: var(--tpp-font-body);
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--tpp-blue);
	text-decoration: none;
	margin-bottom: 28px;
	transition: color 0.25s ease, gap 0.25s ease;
}

/* Blue in every link state: style.css's a:visited / a:focus / a:active
   (color: inherit) outrank one class. */
.blog-post__back:visited,
.blog-post__back:focus,
.blog-post__back:active {
	color: var(--tpp-blue);
}

.blog-post__back:hover {
	color: var(--tpp-blue-dark);
	gap: 11px;
}

.blog-post__cat {
	display: inline-block;
	font-family: var(--tpp-font-body);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--tpp-black);
	border: 1px solid var(--tpp-border);
	border-radius: var(--tpp-radius-pill);
	padding: 4px 12px;
	margin-bottom: 20px;
}

.blog-post__title {
	font-family: var(--tpp-font-heading);
	font-size: clamp(1.9rem, 3.4vw + 0.6rem, 3rem);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.03em;
	color: var(--tpp-black);
	margin: 0;
	/* Stops a lone word dangling on its own line under a long headline. */
	text-wrap: balance;
}

.blog-post__meta {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 20px;
	font-family: var(--tpp-font-body);
	font-size: 0.875rem;
	color: var(--tpp-text-light);
}

.blog-post__meta-sep {
	opacity: 0.5;
}


/* ──────────────────────────────────────────────
   Featured image
   ────────────────────────────────────────────── */

/* Wider than the text, so the article opens on something with presence
   before narrowing to the reading measure. */
.blog-post__media {
	width: 100%;
	max-width: 1000px;
	margin: 48px auto 0;
	padding: 0 var(--tpp-container-padding);
}

.blog-post__img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 18px;
}


/* ──────────────────────────────────────────────
   Body — prose
   ────────────────────────────────────────────── */

.blog-post__body {
	width: 100%;
	max-width: var(--post-measure);
	margin: 0 auto;
	padding: 56px var(--tpp-container-padding) 0;

	font-family: var(--tpp-font-body);
	font-size: 1.0625rem;
	line-height: 1.8;
	color: var(--tpp-text);
}

/* Descendant selectors rather than classes: this content comes from the
   editor, so the theme never gets to put classes on it. */
.blog-post__body > *:first-child {
	margin-top: 0;
}

.blog-post__body p {
	margin: 0 0 1.5em;
}

.blog-post__body h2,
.blog-post__body h3,
.blog-post__body h4 {
	font-family: var(--tpp-font-heading);
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.25;
	color: var(--tpp-black);
	/* Asymmetric: a heading belongs to what follows it, so it sits closer to
	   its own section than to the paragraph above. */
	margin: 2.2em 0 0.7em;
}

.blog-post__body h2 {
	font-size: 1.6rem;
}

.blog-post__body h3 {
	font-size: 1.3rem;
}

.blog-post__body h4 {
	font-size: 1.1rem;
}

.blog-post__body a {
	color: var(--tpp-blue);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
	text-decoration-color: rgba(21, 101, 192, 0.35);
	transition: text-decoration-color 0.25s ease;
}

.blog-post__body a:hover {
	color: var(--tpp-blue-dark);
	text-decoration-color: currentColor;
}

.blog-post__body strong,
.blog-post__body b {
	font-weight: 600;
	color: var(--tpp-black);
}

.blog-post__body ul,
.blog-post__body ol {
	margin: 0 0 1.5em;
	padding-left: 1.35em;
}

.blog-post__body li {
	margin-bottom: 0.6em;
}

.blog-post__body li::marker {
	color: var(--tpp-text-light);
}

.blog-post__body blockquote {
	margin: 2em 0;
	padding: 4px 0 4px 24px;
	border-left: 2px solid var(--tpp-accent);
	font-family: var(--tpp-font-heading);
	font-size: 1.2rem;
	font-weight: 500;
	line-height: 1.55;
	letter-spacing: -0.01em;
	color: var(--tpp-black);
}

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

.blog-post__body img,
.blog-post__body iframe,
.blog-post__body video {
	max-width: 100%;
	height: auto;
	border-radius: 12px;
	display: block;
}

.blog-post__body figure {
	margin: 2em 0;
}

.blog-post__body figcaption {
	margin-top: 10px;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--tpp-text-light);
	text-align: center;
}

.blog-post__body hr {
	margin: 2.5em 0;
	border: 0;
	border-top: 1px solid var(--tpp-border-light);
}

.blog-post__body code {
	font-family: monospace, monospace;
	font-size: 0.9em;
	background: var(--tpp-off-white);
	border: 1px solid var(--tpp-border-light);
	border-radius: var(--tpp-radius-sm);
	padding: 2px 6px;
}

.blog-post__body pre {
	margin: 2em 0;
	padding: 20px;
	background: var(--tpp-off-white);
	border: 1px solid var(--tpp-border-light);
	border-radius: var(--tpp-radius-md);
	/* Long lines scroll inside the block instead of widening the page. */
	overflow-x: auto;
}

.blog-post__body pre code {
	background: none;
	border: 0;
	padding: 0;
}

/* Editor tables can be wider than the measure; let them scroll. */
.blog-post__body table {
	width: 100%;
	margin: 2em 0;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.blog-post__body th,
.blog-post__body td {
	padding: 10px 12px;
	border-bottom: 1px solid var(--tpp-border-light);
	text-align: left;
}

.blog-post__body th {
	font-family: var(--tpp-font-heading);
	font-weight: 600;
	color: var(--tpp-black);
}


/* ──────────────────────────────────────────────
   Footer — tags
   ────────────────────────────────────────────── */

.blog-post__footer {
	width: 100%;
	max-width: var(--post-measure);
	margin: 0 auto;
	padding: 40px var(--tpp-container-padding) 0;
}

.blog-post__tags {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	padding-top: 28px;
	border-top: 1px solid var(--tpp-border-light);
}

.blog-post__tags-label {
	font-family: var(--tpp-font-body);
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--tpp-text-light);
	margin-right: 4px;
}

/* get_the_tag_list() emits bare anchors, so they are styled by element. */
.blog-post__tags a {
	font-family: var(--tpp-font-body);
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--tpp-text);
	text-decoration: none;
	border: 1px solid var(--tpp-border-light);
	border-radius: var(--tpp-radius-pill);
	padding: 5px 14px;
	transition: border-color 0.25s ease, color 0.25s ease;
}

.blog-post__tags a:hover {
	color: var(--tpp-black);
	border-color: var(--tpp-black);
}

.blog-post__pagelinks {
	margin-top: 2em;
	font-family: var(--tpp-font-body);
	font-size: 0.875rem;
	color: var(--tpp-text-light);
}


/* ──────────────────────────────────────────────
   Previous / next
   ────────────────────────────────────────────── */

.blog-postnav {
	background: var(--tpp-white);
	padding: 72px 0 0;
}

.blog-postnav__container {
	width: 100%;
	max-width: var(--post-measure, 720px);
	margin: 0 auto;
	padding: 0 var(--tpp-container-padding);
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
}

.blog-postnav__link {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 20px 22px;
	border: 1px solid var(--tpp-border-light);
	border-radius: 14px;
	text-decoration: none;
	transition: border-color 0.25s ease, background 0.25s ease;
}

.blog-postnav__link:hover {
	border-color: rgba(0, 0, 0, 0.16);
	background: var(--tpp-off-white);
}

/* When a post has only a newer neighbour, the single card would otherwise
   sit in the left column and read as "older". */
.blog-postnav__link--next:only-child {
	grid-column: 2;
}

.blog-postnav__link--next {
	text-align: right;
}

.blog-postnav__label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: var(--tpp-font-body);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--tpp-text-light);
}

.blog-postnav__link--next .blog-postnav__label {
	justify-content: flex-end;
}

.blog-postnav__title {
	font-family: var(--tpp-font-heading);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--tpp-black);

	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}


/* ──────────────────────────────────────────────
   Related posts
   ────────────────────────────────────────────── */

.blog-related {
	background: var(--tpp-white);
	padding: 72px 0 100px;
}

.blog-related__container {
	width: 100%;
	max-width: 1140px;
	margin: 0 auto;
	padding: 0 var(--tpp-container-padding);
}

.blog-related__heading {
	font-family: var(--tpp-font-heading);
	font-size: clamp(1.5rem, 2vw + 0.5rem, 2rem);
	font-weight: 600;
	letter-spacing: -0.02em;
	color: var(--tpp-black);
	margin: 0 0 32px;
}

.blog-related__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}


/* ──────────────────────────────────────────────
   Responsive — Tablet (≤991px)
   ────────────────────────────────────────────── */

@media screen and (max-width: 991px) {
	.blog-post {
		padding: 48px 0 0;
	}

	.blog-post__media {
		margin-top: 40px;
	}

	.blog-post__body {
		padding-top: 44px;
	}

	.blog-postnav {
		padding-top: 56px;
	}

	.blog-related {
		padding: 56px 0 80px;
	}

	/* Three related cards at this width leave too little per card; two reads
	   better and the third wraps. */
	.blog-related__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px;
	}
}


/* ──────────────────────────────────────────────
   Responsive — Mobile (≤767px)
   ────────────────────────────────────────────── */

@media screen and (max-width: 767px) {
	.blog-post {
		padding: 32px 0 0;
	}

	.blog-post__back {
		margin-bottom: 20px;
	}

	.blog-post__media {
		margin-top: 32px;
	}

	.blog-post__img {
		border-radius: 14px;
	}

	.blog-post__body {
		padding-top: 36px;
		font-size: 1rem;
		line-height: 1.75;
	}

	.blog-post__body h2 {
		font-size: 1.35rem;
	}

	.blog-post__body h3 {
		font-size: 1.15rem;
	}

	.blog-post__body blockquote {
		margin: 1.6em 0;
		padding-left: 18px;
		font-size: 1.075rem;
	}

	.blog-postnav {
		padding-top: 44px;
	}

	/* Side by side these become two very narrow cards; stacked, each keeps a
	   readable title. */
	.blog-postnav__container {
		grid-template-columns: 1fr;
	}

	.blog-postnav__link--next {
		text-align: left;
	}

	.blog-postnav__link--next:only-child {
		grid-column: 1;
	}

	.blog-postnav__link--next .blog-postnav__label {
		justify-content: flex-start;
	}

	.blog-related {
		padding: 44px 0 64px;
	}

	.blog-related__grid {
		grid-template-columns: 1fr;
		gap: 18px;
	}

	.blog-related__heading {
		margin-bottom: 24px;
	}
}


/* ──────────────────────────────────────────────
   Responsive — Small mobile (≤480px)
   ────────────────────────────────────────────── */

@media screen and (max-width: 480px) {
	.blog-post__body {
		padding-top: 30px;
	}

	.blog-post__media {
		margin-top: 26px;
	}

	.blog-related {
		padding: 36px 0 56px;
	}
}

/* Tap targets at least 44px tall on phones (Owen's request). */
@media screen and (max-width: 767px) {
	.blog-post__back {
		min-height: 44px;
		margin-top: -12px;
		margin-bottom: 8px;
	}
}
