/*
Theme Name: Momaking Latest
Description: Momaking 官网主题：新版首页与新闻资讯（文章列表 / 详情），多语言由 Polylang 提供。
Version: 1.9.4
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: momaking-latest
*/

/* 页面样式在 assets/css/main.css；这里只放 WordPress 环境下的补丁 */

/* 登录状态下顶部有管理工具栏，吸顶页头需要让出它的高度 */
.admin-bar header {
	top: 32px;
}
@media (max-width: 782px) {
	.admin-bar header {
		top: 46px;
	}
}
@media (max-width: 600px) {
	/* 这个宽度下工具栏不再固定，会随页面滚走 */
	.admin-bar header {
		top: 0;
	}
}

/* 新闻头条的文章缩略图铺满封面 */
.nh-cover .nh-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* 文章标题来自后台、长短不一，最多显示两行，超出省略 */
.nh-hero h3,
.nh-it strong {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	overflow-wrap: anywhere;
}

/* 悬浮右移改用 transform：原稿加 padding-left 会压窄标题列，刚好一行的标题被挤成两行 */
.nh-it:hover {
	padding-left: clamp(14px, 1.8vw, 20px);
}
.nh-it > .news-tag,
.nh-it > strong {
	transition:
		transform 0.25s,
		color 0.2s;
}
.nh-it:hover > .news-tag,
.nh-it:hover > strong {
	transform: translateX(8px);
}

/* 没有分类标签的文章，标题仍放在标题列，日期和箭头与其它行对齐 */
.nh-it > strong {
	grid-column: 2;
}

/* 页头登录态（site.js）：未登录时隐藏「退出登录」；昵称过长截断 */
[data-auth][hidden] {
	display: none !important;
}
[data-auth="login"] span {
	max-width: 10em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.logout {
	color: var(--k600);
	transition: color 0.2s;
}
.logout:hover {
	color: var(--ink);
}
.mnav-logout {
	margin-left: auto;
	margin-right: 16px;
	font-size: 14px;
}

/* 导航高亮（inc/nav.php）：顶部栏目的下划线沿用 main.css 的 .is-active > .nav-link */
/* 下拉菜单里的当前页 */
.mi.is-current {
	background: var(--o50);
}
.mi.is-current .mi-tx strong {
	color: var(--o700);
}
/* 移动端抽屉：当前栏目、当前页 */
.mnav-link.is-active,
.mnav-link.is-current,
.mnav-acc.is-active .mnav-acc-l {
	color: var(--o700);
}
.mnav-sub.is-current {
	font-weight: 700;
	color: var(--o700);
}
.mnav-sub.is-current::before {
	content: "";
	width: 6px;
	height: 6px;
	margin-right: 10px;
	border-radius: 50%;
	background: var(--o500);
}
