/*
Theme Name: MTHK Archive
Description: 中国税务观察的排版补丁层子主题。结构与配色一律沿用 magazie-minimal，只补中文排版、阅读栏宽、间距节奏、键盘焦点与窄屏细节。
Author: MinterPKU
Version: 0.2.0
Requires at least: 5.9
Tested up to: 7.1
Requires PHP: 8.0
Template: magazie-minimal
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mthk-archive
*/

/*--------------------------------------------------------------

本层只覆盖父主题自己的选择器，不改结构、不改配色、不改栅格。
父主题 style.css 之后加载，同特异性即可生效；每条都注明实测值。

--------------------------------------------------------------*/

/**
 * 父主题约 20 处声明 font-family:"Roboto", sans-serif（导航、日期、按钮、标签）。
 * 与其逐条覆盖，不如把这个名字指向本机字体：外链摘掉后观感仍然稳定。
 * 拉丁字命中本机字体后，汉字回退到元素栈里的 sans-serif 通用族。
 */
@font-face {
	font-family: "Roboto";
	font-style: normal;
	font-weight: 100 900;
	src: local("Helvetica Neue"), local("Segoe UI"), local("PingFang SC"), local("Microsoft YaHei");
}

/* 正文用的 Roboto Slab 是衬线，父主题 body 栈里紧随其后就是通用 serif，
   这里把汉字显式排进链路，免得各系统随机落到宋体或黑体。 */
body,
button,
input,
select,
textarea {
	font-family: "Roboto Slab", Georgia, "Songti SC", "Noto Serif SC", "Source Han Serif SC", SimSun, serif;
}

/*--------------------------------------------------------------
## 阅读栏宽：保持铺满，不设行长上限

试过 34em/36em（38 字/行），但父主题 .container{width:100%} 整栏随
屏幕拉伸，固定上限必然在卡片右侧留空档，且大屏必须连带封顶全站容器
（1920 下卡片与右栏空带 334px）才能成立。宽度沿用原样，只留排版。
--------------------------------------------------------------*/

.entry-content p {
	font-size: 17px;
	line-height: 1.85;
	/* 父主题给 p 定的是 16px/32px = 2.0 倍行距，中文在这个密度显散 */
	margin-bottom: 1.15em;
	text-wrap: pretty;
	hanging-punctuation: allow-end;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
	line-height: 1.45;
	/* 长标题在窄栏里折行时，标题与上一段之间要更明显的呼吸 */
	margin-top: 1.9em;
}

.entry-content ol,
.entry-content ul {
	line-height: 1.8;
	/* 判例文章里大量使用「一、」「1、」列表，父主题没给缩进层级 */
	padding-left: 1.75em;
}

.entry-content li + li {
	margin-top: .35em;
}

/*--------------------------------------------------------------
## 标题层级

实测列表卡片里 .entry-title 是 18px，摘要 16px——标题只大 2px，
扫读时抓不到起点。抬到 20px 并收紧父主题的 1px 字距。

注意父主题用 article.hentry h2 (0,1,2) 把列表标题压到 18px，
而列表标题外面套的是 a.tile_part（a 在 h2 之外），所以必须打在
.entry-header .entry-title 上，父主题那条 .entry-title a 在列表里根本不存在。
--------------------------------------------------------------*/

.entry-header .entry-title {
	font-size: 20px;
	letter-spacing: 0;
	line-height: 1.45;
	/* 24px 标题配 26.4px 行高（1.1），汉字上下会贴边 */
	margin-bottom: 10px;
}

.entry-title {
	text-wrap: balance;
}

a.tile_part {
	display: block;
	transition: color 140ms linear;
}

a.tile_part:hover .entry-title,
.entry-header .entry-title a:hover {
	color: #e43b2c;
}

/*--------------------------------------------------------------
## 间距节奏

父主题 article.hentry 的 margin 是 15px 0 35px 23px，
相邻两张卡片之间实际是 50px 空隙，且首张与页头之间只有 15px。
--------------------------------------------------------------*/

article.hentry {
	margin: 0 0 32px 23px;
	padding: 28px 30px 24px;
}

.sticky {
	margin-top: 0;
}

.entry-meta {
	line-height: 1.6;
}

.entry-header .entry-meta .poston a time {
	letter-spacing: .02em;
}

/*--------------------------------------------------------------
## 键盘焦点

父主题有 a:active, a:hover { outline: 0 }，键盘用户拿不到落点。
颜色沿用主题已有的强调红 #e43b2c，不引入新色。
--------------------------------------------------------------*/

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
	outline: 2px solid #e43b2c;
	outline-offset: 2px;
}

/* 静止态外观不变，只在悬停时给反馈 */
.more-link {
	transition: background-color 140ms linear;
}

.more-link:hover {
	background: #c93224;
}

/*--------------------------------------------------------------
## 窄屏（父主题只有 3 个 767px 断点）

实测 390 视口：卡片 337px，左右各 30px 内边距 → 正文只剩 277px（17 字/行），
而左栏 #secondary 仍带 50px 左缩进。
--------------------------------------------------------------*/

@media (max-width: 767px) {
	article.hentry {
		margin-left: 0;
		padding: 22px 18px 20px;
	}

	#secondary.left-sidebar {
		/* 父主题这条是 #secondary.left-sidebar (0,1,1)，只写 #secondary 压不动 */
		padding-left: 18px;
	}

	.entry-header .entry-title {
		font-size: 18px;
		line-height: 1.5;
	}

	.entry-content p {
		font-size: 16px;
		line-height: 1.8;
	}

	/* 日期与评论数各占 50%，在 277px 里挤成两行 */
	.entry-header .entry-meta .poston,
	.entry-header .entry-meta .comments-link {
		font-size: 15px;
		width: auto;
	}

	.entry-header .entry-meta .comments-link {
		float: right;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
	}
}
