/* ============================================================================
 * MechenDiy · 博客 (blog.css)
 * 列表页 /blogs/、分类页、文章页。文章正文沿用 .mchd-prose / .mchd-entry（base.css、blocks.css），
 * 这里只补文章卡片、目录、文章页头、正文里的表格 / 图片 / 引用 / 要点框。
 *
 * 正文可用的附加 CSS 类（区块「高级 → 附加 CSS 类」）：
 *   段落 / 区块组  mchd-answer   开头的直接回答框（GEO：一段话答完标题里的问题）
 *   区块组         mchd-takeaways 要点 / 小结框
 *   区块组         mchd-sources   文末参考资料
 *   段落           mchd-note-box 安全提示
 * ========================================================================== */

/* ---------------------------------------------------------------- 列表页 */
.mchd-grid--posts { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: clamp(36px, 4vw, 56px); }

.mchd-blog-cats ul {
	list-style: none; display: flex; flex-wrap: wrap; gap: 10px;
	padding: 0; margin: 0 0 clamp(32px, 4vw, 52px);
}
.mchd-blog-cats a {
	display: inline-block; padding: 9px 18px; border: 1px solid var(--mchd-line-strong);
	font-family: var(--mchd-font-display); font-weight: 600; font-size: .86rem;
	transition: background-color .2s var(--mchd-ease), color .2s var(--mchd-ease);
}
.mchd-blog-cats a:hover { border-color: var(--mchd-ink); }
.mchd-blog-cats a[aria-current="page"] { background: var(--mchd-ink); color: var(--mchd-paper); border-color: var(--mchd-ink); }

/* ---------------------------------------------------------------- 文章卡片 */
.mchd-post-card { display: flex; flex-direction: column; }
.mchd-post-card__media { display: block; overflow: hidden; background: var(--mchd-paper-2); aspect-ratio: 3 / 2; }
.mchd-post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .55s var(--mchd-ease); }
.mchd-post-card:hover .mchd-post-card__media img { transform: scale(1.04); }
.mchd-post-card__body { padding-top: 20px; display: flex; flex-direction: column; flex: 1; }
.mchd-post-card__cat {
	font-family: var(--mchd-font-mono); font-size: .7rem; letter-spacing: .14em;
	text-transform: uppercase; color: var(--mchd-gray); margin-bottom: 10px;
}
.mchd-post-card__cat a:hover { color: var(--mchd-ink); }
.mchd-post-card__title { font-size: clamp(1.15rem, 1.6vw, 1.38rem); line-height: 1.25; margin-bottom: 12px; }
.mchd-post-card__title a:hover { text-decoration: underline; text-decoration-color: var(--mchd-accent); text-underline-offset: 4px; }
.mchd-post-card__excerpt {
	font-size: .92rem; line-height: 1.65; color: var(--mchd-gray); margin-bottom: 16px;
	display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.mchd-post-card__meta { margin: auto 0 0; display: flex; gap: 8px; font-family: var(--mchd-font-mono); font-size: .72rem; color: var(--mchd-gray); }

/* ---------------------------------------------------------------- 分页 */
.mchd-pagination { margin-top: clamp(44px, 5vw, 72px); }
.mchd-pagination .nav-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.mchd-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 44px; height: 44px; padding: 0 12px;
	border: 1px solid var(--mchd-line-strong); font-family: var(--mchd-font-display); font-weight: 600;
}
.mchd-pagination .page-numbers.current { background: var(--mchd-ink); color: var(--mchd-paper); border-color: var(--mchd-ink); }
.mchd-pagination a.page-numbers:hover { background: var(--mchd-accent); border-color: var(--mchd-accent); }

/* ---------------------------------------------------------------- 文章页头 */
.mchd-post__hero .mchd-eyebrow a:hover { color: var(--mchd-accent); }
.mchd-post__hero .mchd-page-hero__title { font-size: clamp(2.1rem, 4.4vw, 3.6rem); }
.mchd-post__meta {
	display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 28px 0 0;
	font-family: var(--mchd-font-mono); font-size: .74rem; letter-spacing: .04em; color: rgba(245, 244, 239, .6);
}
.mchd-post__cover { margin-top: clamp(32px, 4vw, 56px); margin-bottom: 0; }
.mchd-post__cover img { width: 100%; aspect-ratio: 3 / 2; max-height: 640px; object-fit: cover; }

/* ---------------------------------------------------------------- 正文 + 目录 */
.mchd-post__layout {
	display: grid; grid-template-columns: 240px minmax(0, 780px); justify-content: center;
	gap: clamp(32px, 5vw, 80px); padding-block: clamp(48px, 6vw, 88px) var(--mchd-section-y);
}
.mchd-post__layout--no-toc { grid-template-columns: minmax(0, 780px); }

.mchd-toc { position: sticky; top: 110px; align-self: start; max-height: calc(100vh - 140px); overflow-y: auto; }
.mchd-toc__title { font-family: var(--mchd-font-mono); font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--mchd-gray); margin-bottom: 14px; }
.mchd-toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--mchd-line-strong); }
.mchd-toc li { margin: 0; }
.mchd-toc a { display: block; padding: 7px 0 7px 16px; margin-left: -1px; border-left: 2px solid transparent; font-size: .86rem; line-height: 1.45; color: var(--mchd-gray); }
.mchd-toc a:hover { color: var(--mchd-ink); border-left-color: var(--mchd-accent); }

.mchd-post__content h2 { scroll-margin-top: 110px; }
.mchd-post__content h3 { font-size: clamp(1.15rem, 1.6vw, 1.35rem); margin: 1.6em 0 .5em; }
.mchd-post__content > :first-child { margin-top: 0; }

/* 直接回答框（文章开头） */
.mchd-answer {
	background: var(--mchd-white); border-left: 3px solid var(--mchd-accent);
	padding: 22px 26px !important; font-size: 1.08rem !important; line-height: 1.75 !important; color: var(--mchd-ink) !important;
}
.mchd-answer > :last-child { margin-bottom: 0; }

/* 要点 / 参考资料 / 安全提示 */
.mchd-takeaways, .mchd-sources { background: var(--mchd-paper-2); padding: 26px 28px; margin-block: 2em; }
.mchd-takeaways > :first-child, .mchd-sources > :first-child { margin-top: 0 !important; }
.mchd-takeaways > :last-child, .mchd-sources > :last-child { margin-bottom: 0; }
.mchd-takeaways h2, .mchd-takeaways h3, .mchd-sources h2, .mchd-sources h3 { font-size: 1.1rem !important; }
.mchd-sources li { font-size: .9rem; }
.mchd-note-box { border: 1px solid var(--mchd-line-strong); padding: 16px 20px !important; font-size: .95rem !important; }
.mchd-note-box strong:first-child { color: var(--mchd-error); }

/* 表格（对比表、规格表） */
.mchd-post__content .wp-block-table { margin: 2em 0; overflow-x: auto; }
.mchd-post__content .wp-block-table table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.mchd-post__content .wp-block-table th,
.mchd-post__content .wp-block-table td { padding: 12px 14px; border: 0; border-bottom: 1px solid var(--mchd-line); text-align: left; vertical-align: top; line-height: 1.55; }
.mchd-post__content .wp-block-table thead th {
	border-bottom: 2px solid var(--mchd-ink); font-family: var(--mchd-font-mono); font-size: .72rem;
	font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
}
.mchd-post__content .wp-block-table figcaption { font-size: .8rem; color: var(--mchd-gray); margin-top: 10px; }

/* 图片 */
.mchd-post__content .wp-block-image { margin: 2em 0; }
.mchd-post__content .wp-block-image img { background: var(--mchd-white); }
.mchd-post__content .wp-block-image figcaption { font-size: .82rem; color: var(--mchd-gray); margin-top: 10px; text-align: left; }

/* 引用 */
.mchd-post__content .wp-block-quote { border-left: 3px solid var(--mchd-ink); margin: 2em 0; padding: 4px 0 4px 24px; }
.mchd-post__content .wp-block-quote p { font-family: var(--mchd-font-display); font-size: 1.2rem; font-weight: 600; }

/* FAQ 区块在文章里与 FAQ 页同款 */
.mchd-post__content h2 + .wp-block-details.mchd-faq__item { border-top: 1px solid var(--mchd-line-strong); }

/* 文末相关文章 */
.mchd-section--related-posts { background: var(--mchd-paper-2); }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1024px) {
	.mchd-grid--posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mchd-post__layout { grid-template-columns: minmax(0, 780px); }
	.mchd-toc { position: static; max-height: none; background: var(--mchd-paper-2); padding: 20px 22px; }
}
@media (max-width: 560px) {
	.mchd-grid--posts { grid-template-columns: 1fr; }
	.mchd-answer, .mchd-takeaways, .mchd-sources { padding: 18px 18px !important; }
}
