/*
Article reading experience — single.php, page.php, author.php.
Tokens, resets and shared components live in style.css; nothing here redefines them.
*/

/* ==========================================================================
   1. Article shell
   ========================================================================== */

.article {
	padding-block: var(--space-7) var(--space-6);
}

/* The reading column. Media sits in a slightly wider box below (see §2). */
.article__col {
	max-width: var(--measure);
	margin-inline: auto;
}

.article__head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-4);
}

.article__title {
	margin: 0;
}

.article__meta {
	margin: 0;
}

/* ==========================================================================
   2. Featured plate — contained, never full-bleed
   ========================================================================== */

/* Sources are 800x600 native; 800px is the hard ceiling before it upscales. */
.article__media {
	max-width: 800px;
	margin: var(--space-6) auto var(--space-7);
}

.article__media .duotone-plate {
	display: block;
}

/* ==========================================================================
   3. Body typography
   ========================================================================== */

.entry-content {
	font-size: var(--text-md);
	line-height: 1.68;
}

.entry-content > * + * {
	margin-top: var(--space-5);
}

.entry-content p {
	margin: 0;
}

.entry-content a {
	text-decoration: underline;
}

/* --- headings --- */

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	font-family: var(--font-body);
	font-weight: 600;
	letter-spacing: -0.005em;
}

.entry-content h2 {
	font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.7rem);
	line-height: 1.2;
	border-top: 1px solid var(--color-line);
	padding-top: var(--space-5);
}

.entry-content h3 {
	font-size: clamp(1.1rem, 1.02rem + 0.35vw, 1.3rem);
	line-height: 1.25;
}

.entry-content h4 {
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--color-ink-soft);
}

.entry-content > h2 {
	margin-top: var(--space-7);
}

.entry-content > h3,
.entry-content > h4 {
	margin-top: var(--space-6);
}

.entry-content > h2 + *,
.entry-content > h3 + *,
.entry-content > h4 + * {
	margin-top: var(--space-4);
}

/* --- lists: mono tick marker, never a default bullet --- */

.entry-content ul,
.entry-content ol {
	list-style: none;
	margin: 0;
	padding-left: 0;
}

.entry-content li {
	position: relative;
	padding-left: 2em;
}

.entry-content li + li {
	margin-top: var(--space-3);
}

.entry-content ul > li::before,
.entry-content ol > li::before {
	position: absolute;
	left: 0;
	top: 0.12em;
	font-family: var(--font-mono);
	font-size: var(--text-sm);
	line-height: 1.6;
}

.entry-content ul > li::before {
	content: "—";
	color: var(--color-signal);
}

.entry-content ol {
	counter-reset: aiblogsai-ol;
}

.entry-content ol > li {
	counter-increment: aiblogsai-ol;
}

.entry-content ol > li::before {
	content: counter(aiblogsai-ol) ".";
	color: var(--color-ink-soft);
}

.entry-content li > ul,
.entry-content li > ol {
	margin-top: var(--space-3);
	padding-left: var(--space-3);
}

/* --- pull-quote --- */

.entry-content blockquote,
.entry-content .wp-block-quote {
	font-family: var(--font-display);
	font-style: italic;
	font-size: clamp(1.4rem, 1.2rem + 1vw, 1.9rem);
	line-height: 1.3;
	color: var(--color-ink);
	border-left: 0;
	border-top: 1px solid var(--color-line);
	border-bottom: 1px solid var(--color-line);
	padding: var(--space-5) 0;
	margin-block: var(--space-7);
}

.entry-content blockquote p + p {
	margin-top: var(--space-4);
}

.entry-content blockquote cite,
.entry-content .wp-block-quote__citation,
.entry-content .wp-block-quote cite {
	display: block;
	font-family: var(--font-mono);
	font-style: normal;
	font-size: var(--text-xs);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--color-ink-soft);
	margin-top: var(--space-4);
}

/* --- table: simple bordered, scrolls sideways on narrow screens --- */

.entry-content .wp-block-table {
	overflow-x: auto;
}

/* ponytail: display:block turns a bare classic-editor <table> into its own
   scroll container. It stops stretching to 100% when the content is narrow —
   fine for a site whose articles contain zero tables today. */
.entry-content table {
	display: block;
	width: 100%;
	overflow-x: auto;
	font-size: var(--text-sm);
	line-height: 1.5;
	margin: 0;
}

.entry-content th,
.entry-content td {
	border: 1px solid var(--color-line);
	padding: var(--space-2) var(--space-3);
	vertical-align: top;
}

.entry-content thead th {
	background: var(--color-surface);
}

/* --- code --- */

.entry-content pre {
	font-size: var(--text-sm);
	line-height: 1.5;
	tab-size: 2;
}

.entry-content :not(pre) > code {
	font-size: 0.85em;
	word-break: break-word;
}

/* --- media inside the body --- */

.entry-content figure {
	margin: 0;
}

.entry-content img {
	border-radius: var(--radius-sm);
}

.entry-content figure img {
	margin-inline: auto;
}

.entry-content figcaption {
	text-align: left;
}

/* --- multipage posts --- */

.page-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--space-2);
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--color-ink-soft);
	border-top: 1px solid var(--color-line);
	padding-top: var(--space-4);
}

.page-links a {
	color: var(--color-signal);
	text-decoration: none;
}

/* ==========================================================================
   4. Related + adjacent posts
   ========================================================================== */

.article-related {
	margin-top: var(--space-8);
}

.post-nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: var(--space-5);
	margin-top: var(--space-7);
	padding-top: var(--space-5);
	border-top: 1px solid var(--color-line);
}

.post-nav__link {
	display: flex;
	flex-direction: column;
	gap: var(--space-2);
	color: var(--color-ink);
	text-decoration: none;
}

/* keep "next" hard right even when there is no "previous" */
.post-nav__link--next {
	grid-column: 2;
	text-align: right;
}

.post-nav__label {
	font-family: var(--font-mono);
	font-size: var(--text-xs);
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--color-ink-soft);
}

.post-nav__title {
	font-family: var(--font-body);
	font-size: var(--text-base);
	font-weight: 600;
	line-height: 1.3;
}

.post-nav__link:hover .post-nav__title,
.post-nav__link:focus .post-nav__title {
	color: var(--color-signal);
}

@media (max-width: 639px) {
	.post-nav {
		grid-template-columns: 1fr;
	}

	.post-nav__link--next {
		grid-column: 1;
		text-align: left;
	}
}

/* ==========================================================================
   5. Author archive (no bio — bylines are a generic house account)
   ========================================================================== */

.author-archive {
	padding-block: var(--space-7) var(--space-6);
}

.author-archive__head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-3);
	margin-bottom: var(--space-6);
	padding-bottom: var(--space-5);
	border-bottom: 1px solid var(--color-line);
}

.author-archive__name {
	margin: 0;
}

.author-archive__empty {
	color: var(--color-ink-soft);
}
