/**
 * Blog archives, single posts and comments.
 */

/* .pct-page-header lives in layout.css: page.php uses it too, and pages do not
   load this stylesheet. */

/* ---- Post grid ---- */

.pct-posts {
	display: grid;
	gap: var(--pct-space-6);
	grid-template-columns: 1fr;
}

@media (min-width: 620px) {
	.pct-posts {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1000px) {
	.pct-no-sidebar .pct-posts {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.pct-post-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--pct-surface);
	border: 1px solid var(--pct-border);
	border-radius: var(--pct-radius-lg);
	overflow: hidden;
	transition: border-color var(--pct-transition), box-shadow var(--pct-transition), transform var(--pct-transition);
}

.pct-post-card:hover {
	border-color: var(--pct-accent-border);
	box-shadow: var(--pct-shadow-md);
	transform: translateY(-2px);
}

.pct-post-card__media {
	display: block;
	aspect-ratio: 16 / 10;
	background: var(--pct-bg-muted);
	overflow: hidden;
}

.pct-post-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 300ms ease;
}

.pct-post-card:hover .pct-post-card__media img {
	transform: scale(1.03);
}

.pct-post-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: var(--pct-space-5);
}

.pct-post-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--pct-space-2);
	margin-bottom: var(--pct-space-3);
	color: var(--pct-text-subtle);
	font-size: var(--pct-text-xs);
}

.pct-post-card__title {
	margin-bottom: var(--pct-space-2);
	font-size: var(--pct-text-lg);
	line-height: var(--pct-leading-snug);
}

.pct-post-card__title a {
	color: var(--pct-heading);
	text-decoration: none;
}

.pct-post-card__title a:hover {
	color: var(--pct-accent);
}

.pct-post-card__excerpt {
	flex: 1;
	margin-bottom: var(--pct-space-4);
	color: var(--pct-text-muted);
	font-size: var(--pct-text-sm);
}

.pct-post-card__more {
	align-self: flex-start;
	font-size: var(--pct-text-sm);
	font-weight: 600;
	text-decoration: none;
}

.pct-post-card__more:hover {
	text-decoration: underline;
}

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

.pct-single {
	padding-block: var(--pct-space-10);
}

.pct-single__header {
	max-width: 68ch;
	margin-bottom: var(--pct-space-8);
}

.pct-single__title {
	margin-bottom: var(--pct-space-4);
}

.pct-single__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--pct-space-3);
	color: var(--pct-text-subtle);
	font-size: var(--pct-text-sm);
}

.pct-single__meta a {
	color: var(--pct-text-muted);
	text-decoration: none;
}

.pct-single__meta a:hover {
	color: var(--pct-accent);
	text-decoration: underline;
}

.pct-author {
	display: inline-flex;
	align-items: center;
	gap: var(--pct-space-2);
}

.pct-author img {
	width: 28px;
	height: 28px;
	border-radius: var(--pct-radius-full);
}

.pct-single__media {
	margin-bottom: var(--pct-space-8);
	border-radius: var(--pct-radius-lg);
	overflow: hidden;
}

.pct-single__footer {
	max-width: 68ch;
	margin-top: var(--pct-space-10);
	padding-top: var(--pct-space-6);
	border-top: 1px solid var(--pct-border);
}

.pct-taxonomy {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--pct-space-2);
	margin-bottom: var(--pct-space-4);
	font-size: var(--pct-text-sm);
}

.pct-taxonomy__label {
	color: var(--pct-text-subtle);
}

.pct-tag {
	display: inline-block;
	padding: 0.2em 0.7em;
	background: var(--pct-bg-muted);
	border: 1px solid var(--pct-border);
	border-radius: var(--pct-radius-full);
	color: var(--pct-text-muted);
	font-size: var(--pct-text-xs);
	text-decoration: none;
	transition: border-color var(--pct-transition), color var(--pct-transition);
}

.pct-tag:hover {
	border-color: var(--pct-accent);
	color: var(--pct-accent);
}

/* ---- Author box ---- */

.pct-author-box {
	display: flex;
	gap: var(--pct-space-4);
	padding: var(--pct-space-5);
	margin-top: var(--pct-space-8);
	background: var(--pct-surface-sunken);
	border: 1px solid var(--pct-border);
	border-radius: var(--pct-radius-lg);
}

.pct-author-box img {
	width: 56px;
	height: 56px;
	flex-shrink: 0;
	border-radius: var(--pct-radius-full);
}

.pct-author-box__name {
	margin-bottom: var(--pct-space-1);
	font-size: var(--pct-text-base);
}

.pct-author-box__bio {
	margin: 0;
	color: var(--pct-text-muted);
	font-size: var(--pct-text-sm);
}

/* ---- Post navigation ---- */

.pct-post-nav {
	display: grid;
	gap: var(--pct-space-4);
	margin-top: var(--pct-space-10);
	grid-template-columns: 1fr;
}

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

.pct-post-nav__link {
	display: block;
	padding: var(--pct-space-4);
	background: var(--pct-surface);
	border: 1px solid var(--pct-border);
	border-radius: var(--pct-radius-md);
	text-decoration: none;
	transition: border-color var(--pct-transition);
}

.pct-post-nav__link:hover {
	border-color: var(--pct-accent);
}

.pct-post-nav__direction {
	display: block;
	margin-bottom: var(--pct-space-1);
	color: var(--pct-text-subtle);
	font-size: var(--pct-text-xs);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.pct-post-nav__title {
	color: var(--pct-heading);
	font-size: var(--pct-text-sm);
	font-weight: 600;
}

.pct-post-nav__link--next {
	text-align: right;
}

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

.pct-related {
	margin-top: var(--pct-space-12);
	padding-top: var(--pct-space-8);
	border-top: 1px solid var(--pct-border);
}

.pct-related__title {
	margin-bottom: var(--pct-space-6);
	font-size: var(--pct-text-xl);
}

/* ---- Comments ---- */

.pct-comments {
	max-width: 68ch;
	margin-top: var(--pct-space-12);
	padding-top: var(--pct-space-8);
	border-top: 1px solid var(--pct-border);
}

.pct-comments__title {
	margin-bottom: var(--pct-space-6);
	font-size: var(--pct-text-xl);
}

.pct-comments .comment-list {
	margin: 0 0 var(--pct-space-8);
	padding: 0;
	list-style: none;
}

.pct-comments .comment-list ol.children {
	margin: var(--pct-space-4) 0 0;
	padding-left: var(--pct-space-6);
	list-style: none;
	border-left: 2px solid var(--pct-border);
}

.pct-comments .comment-body {
	padding: var(--pct-space-4);
	margin-bottom: var(--pct-space-4);
	background: var(--pct-surface);
	border: 1px solid var(--pct-border);
	border-radius: var(--pct-radius-md);
}

.pct-comments .comment-author {
	display: flex;
	align-items: center;
	gap: var(--pct-space-2);
	margin-bottom: var(--pct-space-2);
	font-size: var(--pct-text-sm);
	font-weight: 600;
}

.pct-comments .comment-author img {
	width: 32px;
	height: 32px;
	border-radius: var(--pct-radius-full);
}

.pct-comments .comment-meta {
	margin-bottom: var(--pct-space-3);
	color: var(--pct-text-subtle);
	font-size: var(--pct-text-xs);
}

.pct-comments .comment-meta a {
	color: inherit;
	text-decoration: none;
}

.pct-comments .reply {
	margin-top: var(--pct-space-2);
	font-size: var(--pct-text-sm);
}

.pct-comments .comment-respond {
	padding: var(--pct-space-6);
	background: var(--pct-surface-sunken);
	border: 1px solid var(--pct-border);
	border-radius: var(--pct-radius-lg);
}

.pct-comments .comment-reply-title {
	margin-bottom: var(--pct-space-4);
	font-size: var(--pct-text-lg);
}

.pct-comments .comment-form p {
	margin-bottom: var(--pct-space-4);
}

.pct-comments .comment-form-cookies-consent {
	display: flex;
	align-items: flex-start;
	gap: var(--pct-space-2);
	font-size: var(--pct-text-sm);
}

.pct-comments .comment-form-cookies-consent label {
	margin: 0;
	font-weight: 400;
}

.pct-comments .form-submit input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: var(--pct-space-3) var(--pct-space-6);
	background: var(--pct-accent);
	border: 0;
	border-radius: var(--pct-radius);
	color: var(--pct-accent-text);
	font-size: var(--pct-text-sm);
	font-weight: 600;
	cursor: pointer;
}

.pct-comments .form-submit input[type="submit"]:hover {
	background: var(--pct-accent-hover);
}

/* ---- Empty states ---- */

.pct-empty {
	padding: var(--pct-space-16) var(--pct-space-6);
	text-align: center;
}

.pct-empty__title {
	margin-bottom: var(--pct-space-3);
}

.pct-empty__text {
	max-width: 36rem;
	margin-inline: auto;
	margin-bottom: var(--pct-space-6);
	color: var(--pct-text-muted);
}

.pct-empty .pct-search-form {
	max-width: 28rem;
	margin-inline: auto;
}

/* ---------------------------------------------------------------------------
 * Blog hero (index and archives)
 * ------------------------------------------------------------------------ */

.pct-blog-hero {
	padding-block: var(--pct-space-10) var(--pct-space-8);
	border-bottom: 1px solid var(--pct-border);
}

.pct-blog-hero__eyebrow {
	display: block;
	margin-bottom: var(--pct-space-3);
	color: var(--pct-accent);
	font-size: var(--pct-text-xs);
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.pct-blog-hero__title {
	max-width: 20ch;
	margin: 0 0 var(--pct-space-4);
	font-size: clamp(2rem, 6vw, 3.25rem);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: -0.03em;
}

.pct-blog-hero__lead {
	max-width: 58ch;
	margin: 0;
	color: var(--pct-text-muted);
	font-size: var(--pct-text-lg);
	line-height: 1.6;
}

@media (min-width: 640px) {
	.pct-blog-hero {
		padding-block: var(--pct-space-16) var(--pct-space-12);
	}
}

/* ---------------------------------------------------------------------------
 * Category pill
 * ------------------------------------------------------------------------ */

.pct-eyebrow-pill {
	display: inline-block;
	margin-bottom: var(--pct-space-3);
	padding: 0.3rem 0.7rem;
	background: var(--pct-accent-subtle);
	border: 1px solid var(--pct-accent-border);
	border-radius: var(--pct-radius-full);
	color: var(--pct-accent);
	font-size: var(--pct-text-xs);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
}

.pct-eyebrow-pill:hover {
	background: var(--pct-accent);
	color: var(--pct-accent-text);
}

/* ---------------------------------------------------------------------------
 * Featured card
 * ------------------------------------------------------------------------ */

.pct-featured-card {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
	margin-bottom: var(--pct-space-10);
	background: var(--pct-surface);
	border: 1px solid var(--pct-border);
	border-radius: var(--pct-radius-lg);
	overflow: hidden;
}

.pct-featured-card__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: var(--pct-bg-subtle);
}

.pct-featured-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--pct-transition);
}

.pct-featured-card:hover .pct-featured-card__media img {
	transform: scale(1.03);
}

.pct-featured-card__flag {
	position: absolute;
	top: var(--pct-space-4);
	left: var(--pct-space-4);
	padding: 0.3rem 0.7rem;
	background: var(--pct-bg);
	border-radius: var(--pct-radius-full);
	color: var(--pct-text);
	font-size: var(--pct-text-xs);
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.pct-featured-card__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: var(--pct-space-6);
}

.pct-featured-card__title {
	margin: 0 0 var(--pct-space-3);
	font-size: clamp(1.4rem, 3vw, 2rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.02em;
}

.pct-featured-card__title a {
	color: var(--pct-heading);
	text-decoration: none;
}

.pct-featured-card__title a:hover {
	color: var(--pct-accent);
}

.pct-featured-card__excerpt {
	margin: 0 0 var(--pct-space-4);
	color: var(--pct-text-muted);
	line-height: 1.65;
}

.pct-featured-card__meta {
	display: flex;
	align-items: center;
	gap: var(--pct-space-2);
	color: var(--pct-text-muted);
	font-size: var(--pct-text-sm);
}

@media (min-width: 860px) {
	.pct-featured-card {
		grid-template-columns: 1.1fr 1fr;
	}

	.pct-featured-card__media {
		height: 100%;
		aspect-ratio: auto;
	}

	.pct-featured-card__body {
		padding: var(--pct-space-10);
	}
}

/* Full-width grid now that the blog has no widget sidebar. */
@media (min-width: 1000px) {
	.pct-posts {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* ---------------------------------------------------------------------------
 * Single post: lead, TOC rail and share
 * ------------------------------------------------------------------------ */

.pct-single__lead {
	max-width: 62ch;
	margin: 0 0 var(--pct-space-5);
	color: var(--pct-text-muted);
	font-size: var(--pct-text-lg);
	line-height: 1.6;
}

.pct-single__rail-inner {
	display: flex;
	flex-direction: column;
	gap: var(--pct-space-6);
}

.pct-toc {
	padding: var(--pct-space-4);
	background: var(--pct-surface);
	border: 1px solid var(--pct-border);
	border-radius: var(--pct-radius-lg);
}

.pct-toc__title {
	margin: 0 0 var(--pct-space-3);
	font-size: var(--pct-text-xs);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--pct-text-muted);
}

.pct-toc__list {
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: pct-toc-h2;
}

.pct-toc__item {
	margin: 0;
	counter-increment: pct-toc-h2;
}

.pct-toc__sublist {
	margin: 0 0 var(--pct-space-1);
	padding: 0 0 0 1.15rem;
	list-style: none;
	counter-reset: pct-toc-h3;
}

.pct-toc__subitem {
	margin: 0;
	counter-increment: pct-toc-h3;
}

/* Number sits in its own column so wrapped lines align under the text. */
.pct-toc__link {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	column-gap: 0.4rem;
	align-items: start;
	padding: 0.3rem 0.25rem 0.3rem 0.5rem;
	border-left: 2px solid transparent;
	color: var(--pct-text-muted);
	font-size: 0.8125rem;
	line-height: 1.4;
	text-decoration: none;
	transition: color var(--pct-transition), border-color var(--pct-transition);
}

.pct-toc__link::before {
	content: counter(pct-toc-h2) ".";
	color: var(--pct-text-subtle);
	font-variant-numeric: tabular-nums;
	font-size: 0.75rem;
	line-height: 1.5;
}

.pct-toc__link--sub {
	font-size: 0.78125rem;
	padding-top: 0.22rem;
	padding-bottom: 0.22rem;
}

.pct-toc__link--sub::before {
	content: counter(pct-toc-h2) "." counter(pct-toc-h3) ".";
	font-size: 0.7rem;
}

.pct-toc__link:hover,
.pct-toc__link:focus-visible {
	color: var(--pct-accent);
	border-left-color: var(--pct-accent);
}

.pct-toc__link:hover::before,
.pct-toc__link:focus-visible::before {
	color: var(--pct-accent);
}

.pct-share {
	display: flex;
	align-items: center;
	gap: var(--pct-space-2);
	flex-wrap: wrap;
}

.pct-share__label {
	color: var(--pct-text-muted);
	font-size: var(--pct-text-xs);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.pct-share__link {
	display: grid;
	place-items: center;
	position: relative;
	box-sizing: border-box;
	width: 36px;
	height: 36px;
	padding: 0;
	background: transparent;
	border: 1px solid var(--pct-border);
	border-radius: var(--pct-radius);
	color: var(--pct-text-muted);
	cursor: pointer;
	text-decoration: none;
	transition: background-color var(--pct-transition), color var(--pct-transition), border-color var(--pct-transition);
}

.pct-share__link:hover {
	background: var(--pct-accent-subtle);
	border-color: var(--pct-accent-border);
	color: var(--pct-accent);
}

.pct-share__link svg {
	width: 17px;
	height: 17px;
	fill: currentColor;
}

.pct-share__copy svg {
	fill: none;
}

.pct-share__copied {
	position: absolute;
	bottom: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	padding: 0.2rem 0.45rem;
	background: var(--pct-surface-raised);
	border: 1px solid var(--pct-border);
	border-radius: var(--pct-radius-sm);
	color: var(--pct-text);
	font-size: var(--pct-text-xs);
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--pct-transition);
}

.pct-share__copy.is-copied .pct-share__copied {
	opacity: 1;
}

/* Put the rail on the left at desktop, matching the reference layout. */
@media (min-width: 1000px) {
	.pct-single .pct-content-grid {
		grid-template-columns: 17rem minmax(0, 1fr);
	}

	.pct-single__rail {
		order: -1;
	}

	.pct-single__rail-inner {
		position: sticky;
		top: calc(var(--pct-header-height) + var(--pct-space-6));
		max-height: calc(100vh - var(--pct-header-height) - var(--pct-space-10));
		overflow-y: auto;
	}
}

/* Headings need clearance so anchor jumps are not hidden by the sticky header. */
.pct-prose h2[id] {
	scroll-margin-top: calc(var(--pct-header-height) + var(--pct-space-4));
}


/* Full-width header above the two column body. */
.pct-single__header {
	max-width: 52rem;
	margin-bottom: var(--pct-space-8);
	padding-top: var(--pct-space-8);
}

.pct-single__title {
	margin: 0 0 var(--pct-space-4);
	font-size: clamp(1.9rem, 4.5vw, 3rem);
	line-height: 1.12;
	letter-spacing: -0.03em;
}

.pct-single__media {
	margin: 0 0 var(--pct-space-8);
	border-radius: var(--pct-radius-lg);
	overflow: hidden;
}

.pct-single__media img {
	width: 100%;
	height: auto;
	display: block;
}
