/* Single post and page reading layout. */
.reading-wrap {
	width: min(calc(100% - 40px), var(--pm-reading));
	margin-inline: auto;
}

/* Hero posts start directly below the sticky header; non-hero singular views keep global main spacing. */
.site-main--hero { padding-top: 0; }

.entry-header { margin-bottom: 32px; }

/* Breadcrumbs remain compact so they orient the reader without competing with the title. */
.breadcrumbs { margin: 0 0 14px; }

.breadcrumbs__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: .76rem;
	line-height: 1.45;
	color: var(--pm-muted);
}

.breadcrumbs__item { display: inline-flex; align-items: center; min-width: 0; }
.breadcrumbs__item:not(:last-child)::after { content: "/"; margin: 0 8px; opacity: .55; }
.breadcrumbs a { color: inherit; text-decoration: none; }
.breadcrumbs a:hover { color: var(--pm-purple-deep); text-decoration: underline; }
.breadcrumbs__item:last-child span { overflow-wrap: anywhere; }

.entry-details {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	margin-top: 14px;
	font-size: .78rem;
	line-height: 1.5;
	color: var(--pm-muted);
}

.entry-details__item { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 5px; }
.entry-details__label { font-weight: 750; color: var(--pm-text); }
.entry-details a { color: inherit; text-decoration: none; }
.entry-details a:hover { color: var(--pm-purple-deep); text-decoration: underline; }

.entry-title {
	margin: 0 0 12px;
	font-size: clamp(2rem, 6vw, 3.4rem);
	line-height: 1.08;
	letter-spacing: -0.045em;
}

/* Full-width single-post hero. The article is full width; reading content stays inside .reading-wrap. */
.entry-thumbnail {
	position: relative;
	width: 100%;
	height: clamp(500px, 72vh, 820px);
	height: clamp(500px, 72svh, 820px);
	margin: 0 0 42px;
	overflow: hidden;
	background: var(--pm-black);
}

.entry-thumbnail::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	background: linear-gradient(
		180deg,
		rgba(10, 10, 10, 0.06) 18%,
		rgba(10, 10, 10, 0.16) 52%,
		rgba(10, 10, 10, 0.82) 100%
	);
	pointer-events: none;
}

.entry-thumbnail img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center center;
	border-radius: 0;
}

.entry-header--hero {
	position: absolute;
	z-index: 1;
	left: 50%;
	bottom: clamp(30px, 6vh, 72px);
	width: min(calc(100% - 40px), var(--pm-reading));
	margin: 0;
	transform: translateX(-50%);
	color: var(--pm-white);
}

.entry-header--hero .breadcrumbs,
.entry-header--hero .entry-details {
	color: rgba(255, 255, 255, 0.82);
}

.entry-header--hero .breadcrumbs a,
.entry-header--hero .entry-details a { color: inherit; }
.entry-header--hero .breadcrumbs a:hover,
.entry-header--hero .entry-details a:hover { color: var(--pm-white); }
.entry-header--hero .entry-details__label { color: rgba(255, 255, 255, 0.96); }

.entry-header--hero .entry-title {
	margin-bottom: 0;
	font-size: clamp(2.5rem, 6vw, 4.8rem);
	text-shadow: 0 2px 24px rgba(0, 0, 0, 0.3);
}

.entry-content {
	font-size: clamp(1.0625rem, 1.2vw, 1.1875rem);
	line-height: 1.75;
}

.entry-content > * { max-width: 100%; }

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	line-height: 1.25;
	letter-spacing: -0.025em;
	scroll-margin-top: 88px;
}

.entry-content h2 {
	margin-top: 2.2em;
	margin-bottom: .8em;
}

.entry-content h3 {
	margin-top: 1.8em;
	margin-bottom: .7em;
}

.entry-content h4 { margin-top: 1.6em; }

.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content blockquote {
	margin-top: 0;
	margin-bottom: 1.4em;
}

.entry-content a:not(.wp-element-button) {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.entry-content blockquote {
	margin-left: 0;
	padding-left: 20px;
	border-left: 3px solid var(--pm-orange);
	color: #444;
}

.entry-content pre {
	overflow: auto;
	padding: 18px;
	background: var(--pm-black);
	color: #f2f2f2;
	border-radius: 10px;
}

.entry-content code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: .92em;
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1.4em;
}

.entry-content th,
.entry-content td {
	padding: 10px 12px;
	border: 1px solid var(--pm-border);
	text-align: left;
}

/* Lightweight post table of contents: only injected when >= 3 H2/H3 headings exist. */
.article-toc {
	margin: 0 0 2.2em;
	padding: 18px 20px;
	border: 1px solid var(--pm-border);
	border-radius: 12px;
	background: #fbfbfb;
}

.article-toc__title {
	margin: 0 0 10px;
	font-size: .8rem;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--pm-muted);
}

.article-toc__list {
	margin: 0;
	padding-left: 1.35em;
	font-size: .94em;
	line-height: 1.55;
}

.article-toc__item { margin: .35em 0; }
.article-toc__item--h3 { margin-left: 1.1em; }
.article-toc a { color: var(--pm-text); text-decoration: none; }
.article-toc a:hover { color: var(--pm-purple-deep); text-decoration: underline; }

/* End-of-article navigation keeps a clear next action after reading. */
.article-footer {
	margin-top: 54px;
	padding-top: 24px;
	border-top: 1px solid var(--pm-border);
}

.article-navigation {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.article-navigation__item { min-width: 0; }
.article-navigation__item--next { text-align: right; }

.article-navigation a {
	display: block;
	min-height: 100%;
	padding: 14px 0;
	color: var(--pm-text);
	text-decoration: none;
}

.article-navigation a:hover .article-navigation__title { color: var(--pm-purple-deep); }

.article-navigation__label {
	display: block;
	margin-bottom: 5px;
	font-size: .76rem;
	font-weight: 750;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--pm-muted);
}

.article-navigation__title {
	display: block;
	font-size: 1rem;
	font-weight: 750;
	line-height: 1.35;
	transition: color .15s ease;
}

.article-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 10px 18px;
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--pm-border);
	font-size: .88rem;
	font-weight: 700;
}

.article-actions a { text-decoration: none; }

@media (max-width: 1024px) {
	.entry-thumbnail {
		height: clamp(440px, 64vh, 680px);
		height: clamp(440px, 64svh, 680px);
	}
	.entry-header--hero .entry-title { font-size: clamp(2.35rem, 7vw, 4rem); }
}

@media (max-width: 620px) {
	.reading-wrap { width: min(calc(100% - 28px), var(--pm-reading)); }
	.entry-thumbnail {
		height: clamp(380px, 58vh, 560px);
		height: clamp(380px, 58svh, 560px);
		margin-bottom: 30px;
	}
	.entry-header--hero {
		bottom: 24px;
		width: min(calc(100% - 28px), var(--pm-reading));
	}
	.entry-header--hero .entry-details,
	.entry-header--hero .breadcrumbs__list { font-size: .72rem; }
	.entry-header--hero .entry-title { font-size: clamp(2rem, 10vw, 3.25rem); }
	.article-navigation { grid-template-columns: 1fr; }
	.article-navigation__item--next { text-align: left; }
	.article-navigation__item + .article-navigation__item { border-top: 1px solid var(--pm-border); }
	.article-toc { padding: 16px; }
}

@media (max-height: 600px) and (orientation: landscape) {
	.entry-thumbnail {
		height: clamp(320px, 78vh, 520px);
		height: clamp(320px, 78svh, 520px);
	}
	.entry-header--hero { bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
	.article-navigation__title { transition: none; }
}
