/**
 * Feng Shen 2026 — Layout Overrides
 *
 * PERF-02（2026-10-10）：由 inc/custom-css.php 的内联 <style> 拆出为独立文件。
 *
 * 原因：这段约 200 行的覆盖样式原先以 PHP heredoc 内联输出到每个页面，
 * 1) 无法被浏览器/CDN 作为独立资源缓存；2) 每页 HTML 体积 +7KB（gzip 前）；
 * 3) 混在 PHP 字符串中无法用 CSS 工具压缩校验。
 * 拆出后由 wp_enqueue_style 加载（?ver= 文件 mtime 缓存失效），
 * 依赖 fengshen2026-base-css，输出顺序仍在其后。
 *
 * 规则内容与拆分前 100% 一致（含原有 !important），仅迁移容器，不改任何选择器与值。
 *
 * 2026-10-10 theme.json 迁移判定（18 条规则组逐条审查）：
 *   ✅ 已迁移 1 条：.wp-block-query 容器 spacing → theme.json styles.blocks["core/query"]
 *      （块根元素 + 纯 spacing/margin/padding，theme.json schema 完整支持；
 *      global-styles 输出晚于 core block-library，无需 !important；已确认
 *      base-css 与用户 wp-global-styles(post 7344) 均无同属性对抗规则。）
 *
 *   ❌ 不可迁移 17 条，受阻于四类 theme.json schema 无法表达的结构：
 *      1. 块内后代选择器（.page-numbers、.article-title a、-arrow 等
 *         约 11 条）—— theme.json 只能作用块根，无后代选择器；
 *      2. 伪类/伪元素/类变体（:hover、.current、::before/::after、
 *         `.wp-block-query-pagination ~ *` 兄弟选择器）—— schema 不支持；
 *      3. 对抗源在 base-css 同名规则（.wp-block-query-pagination margin-top
 *         base 为 24px、overrides 为 20px !important）—— 迁到 theme.json 后
 *         输出位置在 base-css link 之前，同特异性会被 base-css 后输出的规则
 *         覆盖而回归，除非同时改 base-css（超出本次范围）；
 *      4. 自定义类/属性选择器（.title-divider、.content-area、
 *         .card-edit-link、[data-area="footer"]）—— 非块根，schema 无法定位。
 *      其中 white-space/text-overflow/outline/justify-content/gap/display
 *      等属性本身也不在 theme.json schema 内。
 *
 * 输出优先级说明：原先内联块挂在 wp_head priority 999，位于
 * global-styles-inline-css 之后以确保覆盖。改为 enqueue 后位置由
 * 依赖链决定（base-css 之后），已实测确认对本文件全部规则无回归：
 * 带 !important 的规则不受顺序影响；无 !important 的规则（.article-excerpt、
 * .content-area、.site-footer、.card-edit-link 等）与
 * global-styles 的选择器无交集，且在 base-css 之后仍可覆盖基础样式。
 */

/* Article Card: title forced single line */
.article-card .article-title {
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: clip !important;
	line-height: 1.4 !important;
}
.article-card .article-title a {
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: clip !important;
	display: inline !important;
}
/* Article Card: excerpt adaptive height, no line limit */
.article-card .article-excerpt {
	line-height: 1.6;
}
/* Pagination: force-remove all red lines / borders */
.wp-block-query-pagination,
.wp-block-query-pagination * {
	border-color: #dddddd !important;
	outline-color: transparent !important;
	box-shadow: none !important;
}
.wp-block-query-pagination {
	justify-content: flex-start !important;
	border: none !important;
	outline: none !important;
	background: transparent !important;
	gap: 6px !important;
	padding: 0 !important;
	margin-top: 20px !important;
	margin-bottom: 0 !important;
}
.wp-block-query-pagination::before,
.wp-block-query-pagination::after {
	display: none !important;
	border: none !important;
}
/* Force-remove all red lines: cover all borders and dividers */
hr, .title-divider {
	border-color: var(--color-border) !important;
	background-color: var(--color-border) !important;
	color: var(--color-border) !important;
}
/* Content area: remove extra bottom margin */
.content-area {
	margin-bottom: 0;
	padding-bottom: 0;
}
/* Query block container: 已迁移到 theme.json styles.blocks["core/query"].spacing
   （2026-10-10，迁移判定详见文件头部注释）—— 块根元素 + 纯 spacing，
   global-styles 输出顺序晚于 core block-library，无需 !important 即可生效，
   且 base-css 与用户 global-styles 均无同属性规则，无对抗源。 */
/* Pagination area: fully clear bottom margin */
.wp-block-query-pagination {
	padding-bottom: 0 !important;
	margin-bottom: 0 !important;
}
/* Elements after pagination: remove top margin */
.wp-block-query-pagination ~ * {
	margin-top: 0 !important;
	padding-top: 0 !important;
}
/* Footer top line: fully remove + spacing matches upper section */
.site-footer,
.wp-block-template-part[data-area="footer"] {
	border-top: none !important;
	margin-top: 0;
	padding-top: 8px;
	padding-bottom: 8px;
}
/* Edit button styling */
.card-edit-link a,
.post-edit-link {
	display: inline-block;
	margin-left: 8px;
	padding: 2px 8px;
	background: #f0f0f0;
	border-radius: 3px;
	font-size: 12px;
	color: var(--wp--preset--color--steel);
	text-decoration: none;
}
.card-edit-link a:hover,
.post-edit-link:hover {
	background: var(--wp--preset--color--primary);
	color: #fff;
}
/* Pagination buttons: unified style + hover effect */
.wp-block-query-pagination .page-numbers,
.wp-block-query-pagination a,
.wp-block-query-pagination span,
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
	display: inline-flex !important;
	align-items: center !important;
	gap: 6px !important;
	padding: 6px 14px !important;
	background: #fff !important;
	border: 1px solid var(--color-border) !important;
	border-radius: var(--radius-sm) !important;
	color: var(--color-text) !important;
	font-size: 13px !important;
	transition: all 0.2s !important;
	line-height: 1 !important;
	text-decoration: none !important;
	outline: none !important;
	box-shadow: none !important;
}
/* Hover for non-current page links */
a.wp-block-query-pagination .page-numbers:not(.current):hover,
.wp-block-query-pagination a.page-numbers:not(.current):hover,
.wp-block-query-pagination a:not(.current):hover,
.wp-block-query-pagination-previous:hover,
.wp-block-query-pagination-next:hover {
	background: var(--color-accent-lighter) !important;
	color: var(--color-text) !important;
	border-color: var(--color-accent) !important;
}
.wp-block-query-pagination .current {
	background: var(--color-accent-lighter) !important;
	color: var(--color-text) !important;
	border-color: var(--color-accent) !important;
	font-weight: 700 !important;
}
/* Prev/Next: arrow merges into button */
.wp-block-query-pagination-previous .wp-block-query-pagination-previous-arrow,
.wp-block-query-pagination-next .wp-block-query-pagination-next-arrow {
	background: none !important;
	border: none !important;
	padding: 0 !important;
	margin: 0 !important;
	color: inherit !important;
	font-size: inherit !important;
	line-height: 1 !important;
	outline: none !important;
	box-shadow: none !important;
}
