/* ============================================================
   Ality 样式补丁（itlife 主题）
   原 style.css 保持原样不动，此文件只修正：
   1) 现代 DOM / PHP 8 渲染差异
   2) 原主题在无 lazy-load JS 时的显示问题
   3) 老内容（h1 当小标题）的排版
   加载顺序：style.css → mediaqueries.css → fixes.css
   ============================================================ */

/* ---------- 1. 头部浮动闭合 ---------- */
/* 原主题靠 float 排版，.main-header 高度会塌陷，
   导致 #site-nav 被浮动元素挤成窄条 */
.main-header {
	display: flow-root;
	overflow: hidden;
}

.main-header::after {
	content: "";
	display: table;
	clear: both;
}

/* ---------- 2. 缩略图 ---------- */
/* 原主题依赖 jQuery lazyload 把 data-original 换成 src，
   本主题不再引入该脚本，直接渲染真实地址 */
.thumbnail {
	margin: 6px 10px 0 0;
}

.thumbnail a {
	display: block;
}

.thumbnail img.home-thumb,
.thumbnail img {
	width: 140px;
	height: 100px;
	object-fit: cover;
	display: block;
	border: 1px solid #ccc;
	background: #f5f5f5;
}

/* ---------- 3. 主导航 ---------- */
#site-nav {
	clear: both !important;
	width: 100% !important;
	float: none !important;
	display: block !important;
	height: 40px !important;
	background: #04a4cc !important;
	overflow: hidden;
}

#site-nav ul.menu {
	float: left;
	margin: 0;
	padding: 0;
	list-style: none;
}

#site-nav ul.menu li.menu-item {
	float: left;
	height: 40px;
	list-style: none;
}

#site-nav ul.menu li.menu-item > a {
	display: block;
	line-height: 40px;
	padding: 0 20px;
	color: #fff !important;
	text-decoration: none;
}

#site-nav ul.menu li.menu-item > a:hover {
	background: #2e8abd;
}

/* ---------- 4. 侧栏 widget 浮动闭合 ---------- */
.widget {
	overflow: hidden;
}

.widget::after {
	content: "";
	display: table;
	clear: both;
}

/* ---------- 5. 分类 / 归档 / 链接：单列左对齐 ---------- */
/* 原主题是两列居中，310px 侧栏下长分类名会折行错位。
   这里改单列，保证一行一项、计数不错行 */
.widget_categories li,
.widget_archive li,
.widget_links li {
	float: none !important;
	width: 100% !important;
	text-align: left !important;
	padding: 0 !important;
	font-size: 13px;
	line-height: 1.9;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* 注意：链接必须是 inline，否则计数会被挤到下一行 */
.widget_categories li a,
.widget_archive li a,
.widget_links li a {
	display: inline;
}

/* ---------- 6. 搜索表单 ---------- */
#searchform div {
	position: relative;
	display: flex;
}

#searchsubmit {
	border: none;
	cursor: pointer;
}

/* ---------- 7. 图片不溢出 ---------- */
.single-content-article img,
.single-content img,
.entry-site img {
	max-width: 100% !important;
	height: auto !important;
}

/* ---------- 8. 单篇标签与上下篇 ---------- */
.single-tag {
	margin: 10px 0 0;
	padding: 6px 10px;
	background: #fff;
	border: 1px solid #ccc;
	font-size: 13px;
}

.single-tag a {
	margin-right: 8px;
	color: #04a4cc;
}

.nav-single {
	margin: 10px 0;
	padding: 8px 10px;
	background: #fff;
	border: 1px solid #ccc;
	font-size: 13px;
	line-height: 1.9;
}

.nav-single a {
	color: #04a4cc;
}

/* ---------- 9. 分页 ---------- */
#pagenavi {
	float: none;
	clear: both;
	overflow: hidden;
	padding: 6px 0 0;
}

#pagenavi .pages {
	float: left;
	background: #fff;
	margin: 0 5px 10px 0;
	padding: 6px 8px;
	line-height: 100%;
	border: 1px solid #ccc;
	color: #8b8b8b;
	font-size: 12px;
}

/* ---------- 10. 正文小标题 ---------- */
/* 2012-2016 年的文章习惯用 <h1> 当段落小标题，
   原主题只定义了 h2/h3，这里补齐 h1 */
.single-content-article h1,
.single-content h1 {
	font-size: 15px;
	line-height: 190%;
	text-indent: 3em;
	margin: 12px -20px 5px -20px;
	border-left: 5px solid #04a4cc;
	padding-left: 8px;
	font-weight: 700;
}

/* ---------- 11. 正文段落缩进 ---------- */
.single-content-article p,
.single-content p {
	text-indent: 2em;
	margin: 0 0 8px;
}

.single-content-article ul li,
.single-content-article ol li {
	text-indent: 0;
}

/* ---------- 12. 移动端 ---------- */
html,
body {
	max-width: 100%;
	overflow-x: hidden;
}

@media screen and (max-width: 900px) {
	.logo-simple .logo-title,
	#simple-top .logo-title {
		font-size: 17px !important;
		line-height: 30px;
		margin: 0;
		padding: 0 0 0 10px;
	}

	#simple-top {
		height: 40px;
		line-height: 40px;
		overflow: hidden;
	}

	#page {
		width: 100% !important;
		box-sizing: border-box;
		padding: 0 6px;
	}

	.content {
		padding: 10px;
		overflow: hidden;
		box-sizing: border-box;
	}

	.entry-site {
		word-wrap: break-word;
		word-break: break-all;
		overflow: hidden;
	}

	.thumbnail img.home-thumb,
	.thumbnail img {
		width: 106px !important;
		height: 76px !important;
	}

	.single-content-article h1,
	.single-content h1 {
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	.single-content-article p,
	.single-content p {
		text-indent: 0;
	}
}

/* ============================================================
   13. 列表容器重置
   原主题只写了 ul { list-style: none }，没有清 padding-left，
   浏览器默认的 40px 缩进会导致：顶部菜单整体右移、侧栏列表缩进错位
   ============================================================ */

/* ---------- 顶部导航 ---------- */
#top-nav ul.menu {
	float: left;
	margin: 0;
	padding: 0;
	list-style: none;
}

#top-nav ul.menu li.menu-item {
	float: left;
	height: 40px;
	line-height: 40px;
	margin: 0;
	border-right: 1px solid #ccc;
}

#top-nav ul.menu li.menu-item > a {
	display: block;
	height: 40px;
	line-height: 40px;
	padding: 0 20px;
	color: #444;
	text-decoration: none;
}

#top-nav ul.menu li.menu-item > a:hover {
	background: #afafaf;
	color: #fff;
}

#top-nav ul.menu li.current-menu-item,
#top-nav ul.menu li.current_page_item {
	background: #afafaf;
}

#top-nav ul.menu li.current-menu-item > a,
#top-nav ul.menu li.current_page_item > a {
	color: #fff !important;
}

/* 首页图标与菜单项等高 */
#top-nav .home_h a {
	box-sizing: border-box;
	height: 40px;
	line-height: 40px;
}

/* ---------- 侧栏列表 ---------- */
.widget ul {
	margin: 0;
	padding: 5px 10px;
	list-style: none;
}

.widget ul li {
	margin: 0;
	padding: 0;
	line-height: 1.85;
}

.widget ul li a {
	line-height: 1.85;
}

/* 子分类：轻微缩进，不累积 40px */
.widget ul li ul.children {
	margin: 0;
	padding: 0 0 0 14px;
	list-style: none;
}

/* 分类/归档/链接项：保持单行，靠外层 padding 对齐 */
.widget_categories ul,
.widget_archive ul,
.widget_links ul {
	padding: 5px 10px 8px;
}

/* ---------- 面包屑与导航的呼吸间距 ---------- */
.crumbs {
	margin-top: 6px;
	margin-bottom: 4px;
}

/* ---------- 站点标题区 ---------- */
.main-header {
	padding-top: 4px;
	padding-bottom: 8px;
}

#set-main {
	margin-top: 0;
}

#searchform div {
	align-items: center;
}
