/*
Theme Name: Wallmama Clone (GeneratePress Child)
Theme URI: https://www.meowzo.com
Author: Meowzo
Description: 系统字体栈、内容导航、评论区；主内容区全宽且正文+侧栏整体限宽居中。页眉等沿用 GeneratePress。
Template: generatepress
Version: 1.3.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
Text Domain: wallmama-clone
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* —— 变量（字体 + 评论区） —— */
:root {
	--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	--font-display: var(--font-sans);
	/* --wm-heading-color: #1e293b; */
	/* --wm-text-muted: #94a3b8;
	--wm-comment-accent: #2a7b9b; */
	--wm-comment-link: #ff0000;
	/* --wm-border-soft: #e0e0e0;
	--ast-border-color: #dddddd; */
	--wm-link: #247BA0;
	--wm-link-hover: #ff0000;
	/*
	 * 主栏 + 侧栏合计最大宽度（二选一思路）：
	 * - 同时限制「不超过视口 70%」且「不超过固定像素」：min(70vw, 1200px)
	 * - 只要视口 70%：改为 70vw
	 * - 只要固定值：改为 1200px 或 1100px 等
	 */
	--wm-content-cluster-max: min(70vw, 1200px);
	/* 主导航悬停下划线 */
	--wm-nav-underline: #ff1654;
}

/* —— 全站字体（在父主题与自定义器之后微调） —— */
body {
	font-family: var(--font-sans);
	font-size: 18px;
	font-size: 1rem;
	line-height: 1.5em;
}

body .site :where(h1, h2, h3, h4, h5, h6) {
	font-family: var(--font-display);
	line-height: 1.3em;
	font-weight: 700;
}

/* —— 站点名称 .main-title：对齐原 .site-title 规格（class / ID 不变；含 Navigation Branding 内链接） —— */
.main-title,
.main-title a,
.navigation-branding .main-title,
.navigation-branding .main-title a {
	font-weight: 800;
	font-family: var(--font-sans);
	line-height: 1.23em;
}

.main-title {
	margin: 0;
	font-size: 24px;
	font-size: 1.3333333333333rem;
	display: block;
	word-wrap: break-word;
	text-transform: none;
	color: #1E293B;
}

.content-area :where(h2), h2 {
	font-size: 36px;
	font-size: 2rem;
}

.content-area :where(h3), h3 {
	font-size: 28px;
	font-size: 1.5555555555556rem;
}

h1 {
	font-size: 30px;
	font-size: 1.6666666666667rem;
}

/* —— 主内容区：#content 横向占满，正文+侧栏 flex 区域总宽约等于 --wm-content-cluster-max 并居中 —— */
#content.site-content {
	max-width: none !important;
	width: 100%;
	margin-left: 0 !important;
	margin-right: 0 !important;
	box-sizing: border-box;
	padding-left: max(1rem, calc((100% - var(--wm-content-cluster-max)) / 2));
	padding-right: max(1rem, calc((100% - var(--wm-content-cluster-max)) / 2));
}

#content.site-content.grid-container {
	max-width: none !important;
}

/* —— 页眉粘顶：站点标识 + 位于 header 内的主导航随滚动固定在视口顶部 ——
 * （GP 默认「导航浮动」时菜单在 .site-header 内；若主题为「导航在页眉下方」，菜单不在 header 内，需用自定义器/GP Menu Plus 粘性导航或再单独加规则） */
.site-header {
	position: sticky;
	top: 0;
	z-index: 1000;
}

body.admin-bar .site-header {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .site-header {
		top: 46px;
	}
}

/* —— 页头：站点标识靠左、主导航靠右（与 GP「导航浮动」同排时生效） —— */
@media (min-width: 769px) {
	body[class*="nav-float-"] .site-header .inside-header {
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		column-gap: 1.5rem;
		row-gap: 0.75rem;
	}

	body[class*="nav-float-"] .site-header .inside-header .site-branding-container,
	body[class*="nav-float-"] .site-header .inside-header .site-logo,
	body[class*="nav-float-"] .site-header .inside-header .site-branding {
		flex: 0 1 auto;
	}

	body[class*="nav-float-"] .site-header .inside-header .header-widget {
		flex: 0 1 auto;
	}

	body[class*="nav-float-"] .site-header .inside-header #site-navigation.main-navigation,
	body[class*="nav-float-"] .site-header .inside-header nav.main-navigation#site-navigation {
		flex: 0 0 auto;
		margin-left: auto;
	}
}

/* —— 主导航：字号略大；下划线与字同宽、出现时自左向右展开，消失无动画 —— */
@media (min-width: 769px) {
	#site-navigation.main-navigation .main-nav > ul > li > a {
		position: relative;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-height: 60px;
		line-height: 1.25;
		text-decoration: none;
		font-size: 1.125rem;
		box-sizing: border-box;
	}

	#site-navigation.main-navigation .menu-bar-items {
		font-size: 1.125rem;
	}

	/* 左略小于右 padding，动画起点更靠左；右与 GP 一致 */
	#site-navigation.main-navigation .main-nav > ul > li > a::after {
		content: "";
		position: absolute;
		left: 16px;
		right: 16px;
		/* 与行高垂直居中，贴近字下方（栏高 60px 与父主题一致时可改） */
		bottom: 0.5em;/*calc((60px - 1.25em) / 2 - 3px);*/
		height: 2px;
		background-color: var(--wm-nav-underline);
		transform: scaleX(0);
		transform-origin: left center;
		transition: none;
		pointer-events: none;
	}

	/* 仅「出现」时过渡；移开时沿用上面 transition: none，直接消失 */
	#site-navigation.main-navigation .main-nav > ul > li > a:hover::after,
	#site-navigation.main-navigation .main-nav > ul > li > a:focus-visible::after {
		transform: scaleX(1);
		transition: transform 0.28s ease;
	}
}

@media (min-width: 769px) and (prefers-reduced-motion: reduce) {
	#site-navigation.main-navigation .main-nav > ul > li > a:hover::after,
	#site-navigation.main-navigation .main-nav > ul > li > a:focus-visible::after {
		transition: none;
	}
}

/* 移动端展开菜单：悬停/聚焦用同色下划线（无 scale 动画） */
.main-navigation.toggled .main-nav ul li a:hover,
.main-navigation.toggled .main-nav ul li a:focus-visible {
	text-decoration: underline;
	text-decoration-color: var(--wm-nav-underline);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.5em;
}

/* —— 标题下方：评论链接 / 更新时间（同一行） —— */
.inside-article .wmclone-entry-title-meta-line {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 0.35em;
	row-gap: 0.15em;
	margin: 1em 0 0;
	/* margin-top: 20px; */
	font-size: 18px;
	font-size: 1rem;
	line-height: 1.4;
	color: var(--wm-link);
}

.inside-article .wmclone-entry-title-meta-line .wmclone-entry-meta-sep {
	user-select: none;
	opacity: 0.85;
}

.inside-article .wmclone-entry-title-meta-line .wmclone-entry-meta-comments a {
	color: inherit;
	text-decoration: none;
	/* border-bottom: 1px solid transparent; */
	transition: color 0.15s ease, border-color 0.15s ease;
}

.inside-article .wmclone-entry-title-meta-line .wmclone-entry-meta-comments a:hover,
.inside-article .wmclone-entry-title-meta-line .wmclone-entry-meta-comments a:focus-visible {
	color: var(--wm-link-hover);
	border-bottom-color: var(--wm-link-hover);
	outline: none;
}

.inside-article .wmclone-entry-title-meta-line .wmclone-entry-meta-updated time {
	color: var(--wm-link);
}

/* —— 正文内：内容导航（H2/H3）：统一字号 + 黑色线框（无阴影、无背景） —— */
.entry-content .wmclone-content-nav.lwptoc,
.entry-content .lwptoc.wmclone-content-nav {
	margin: 0 0 1.75em;
	padding: 1.25em 1.35em;
	border: 1px solid #000;
	border-radius: 0;
	box-shadow: none;
	background: transparent;
	font-size: 18px;
	font-size: 1.125rem;
	line-height: 1.65;
}

.entry-content .lwptoc_header {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	flex-wrap: wrap;
	gap: 0.35em 0.65em;
	margin-bottom: 0.85em;
}

.entry-content .lwptoc_title {
	font-size: inherit;
	font-weight: 700;
	color: var(--wm-heading-color);
}

.entry-content .lwptoc_toggle_label {
	color: var(--wm-text-muted);
	font-weight: 400;
	font-size: inherit;
	text-decoration: none;
}

.entry-content .lwptoc_toggle_label:hover {
	color: var(--wm-link-hover);
	text-decoration: none;
}

.entry-content .lwptoc_itemWrap {
	list-style: disc;
	margin: 0;
	padding-left: 1.35em;
}

.entry-content .lwptoc_itemWrap .lwptoc_itemWrap {
	margin-top: 0.4em;
	margin-bottom: 0.35em;
	padding-left: 1.5em;
	list-style: circle;
}

.entry-content .lwptoc_item {
	margin: 0.4em 0;
}

.entry-content .lwptoc_item_label {
	text-decoration: none;
}

.entry-content .lwptoc_item a {
	font-size: inherit;
	color: #247ba0;
	text-decoration: none;
}

.entry-content .lwptoc_item a:hover {
	color: #ff0000;
	text-decoration: none;
}

.entry-content .lwptoc_collapsed {
	display: none !important;
}

/* 锚点：避免被固定顶栏遮挡（目录点击跳转） */
:root {
	/*
	 * 目录锚点顶部预留高度：
	 * - 覆盖范围：粘性 .site-header + 额外呼吸空间
	 * - 如仍被遮挡：把该值调大（例如 7.5rem / 9rem）
	 */
	--wm-anchor-offset: 7.5rem;
}

/* 让浏览器原生 hash 跳转也自动预留顶部空间 */
html {
	scroll-padding-top: var(--wm-anchor-offset);
}

/* 兼容不同目录/编辑器的锚点落点：可能是 h1~h6，也可能是带 id 的 span/div */
.entry-content :where(h1, h2, h3, h4, h5, h6, [id]) {
	scroll-margin-top: var(--wm-anchor-offset);
}

/* —— 侧栏小工具：链接无下划线（含悬停 / 已访问 / 聚焦） —— */
.inside-left-sidebar a,
.inside-right-sidebar a {
	text-decoration: none;
}

.inside-left-sidebar a:hover,
.inside-left-sidebar a:visited,
.inside-left-sidebar a:active,
.inside-left-sidebar a:focus,
.inside-left-sidebar a:focus-visible,
.inside-right-sidebar a:hover,
.inside-right-sidebar a:visited,
.inside-right-sidebar a:active,
.inside-right-sidebar a:focus,
.inside-right-sidebar a:focus-visible {
	text-decoration: none;
}

/* —— 评论区：表单在上、列表在下（子主题 comments.php） —— */
#comments {
	margin-top: 2.5em;
	padding-top: 1.5em;
}

#comments .comment-respond {
	margin-bottom: 0;
}

/* 表单与下方列表分隔 */
#comments .comment-respond + .wmclone-comments-list-head {
	margin-top: 2.25rem;
	padding-top: 1.75rem;
}

.wmclone-comments-list-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem 1.25rem;
	margin: 0 0 1.25rem;
}

.wmclone-comments-title {
	flex: 1 1 auto;
	margin: 0;
	min-width: min(100%, 12rem);
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.5;
	color: var(--wm-text-muted);
}

.wmclone-comments-head-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 0.65rem 1rem;
	font-size: 0.9375rem;
}

.wmclone-comments-head-nav a {
	color: var(--wm-comment-link);
	text-decoration: none;
	white-space: nowrap;
}

.wmclone-comments-head-nav a:hover,
.wmclone-comments-head-nav a:focus-visible {
	color: var(--wm-comment-accent);
	text-decoration: underline;
	outline: none;
}

.wmclone-reply-title {
	font-size: 29px;
	font-size: 1.6111111111111rem;
	font-weight: 700;
	margin: 0 0 0.65rem;
	color: var(--wm-heading-color);
	letter-spacing: -0.02em;
}

.wmclone-comment-form {
	display: grid;
	grid-template-columns: 1fr 1fr minmax(min-content, auto);
	gap: 0.75rem 1rem;
	align-items: end;
	margin-top: 0.5rem;
}

.wmclone-comment-form .wmclone-comment-notes,
.wmclone-comment-form .comment-notes {
	grid-column: 1 / -1;
	margin: 0 0 0.25rem;
	font-size: 0.875rem;
	color: var(--wm-text-muted);
	line-height: 1.5;
}

.wmclone-comment-form .comment-form-comment {
	grid-column: 1 / -1;
	margin: 0;
}

.wmclone-comment-form .comment-form-comment label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
	font-size: 0.9375rem;
	color: var(--wm-heading-color);
}

.wmclone-comment-form .comment-form-comment textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 0.65rem 0.75rem;
	border: 1px solid #dddddd;
	border-radius: 2px;
	background: #fff;
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.5;
	resize: vertical;
	min-height: 140px;
}

.wmclone-comment-form .comment-form-comment textarea:focus {
	outline: none;
	border-color: var(--wm-comment-accent);
	box-shadow: 0 0 0 1px var(--wm-comment-accent);
}

.wmclone-comment-form .comment-form-author,
.wmclone-comment-form .comment-form-email {
	margin: 0;
}

.wmclone-comment-form .comment-form-author input,
.wmclone-comment-form .comment-form-email input {
	width: 100%;
	box-sizing: border-box;
	padding: 0.65rem 0.75rem;
	border: 1px solid #dddddd;
	border-radius: 2px;
	background: #f7f7f7;
	font-size: 1rem;
	line-height: 1.4;
	height: 42px;
}

.wmclone-comment-form .comment-form-author input:focus,
.wmclone-comment-form .comment-form-email input:focus {
	outline: none;
	border-color: var(--wm-comment-accent);
}

.wmclone-comment-form .form-submit {
	grid-column: 3;
	margin: 0;
	display: flex;
	align-items: flex-end;
}

.wmclone-comment-form .comment-form-cookies-consent {
	grid-column: 1 / -1;
	margin: 0;
	font-size: 0.875rem;
}

.wmclone-comment-submit {
	height: 42px;
	padding: 0 1.35rem;
	border: none;
	border-radius: 2px;
	background: var(--wm-comment-accent);
	color: #fff !important;
	font-size: 0.9375rem;
	font-weight: 500;
	cursor: pointer;
	font-family: inherit;
	line-height: 1;
	transition: background-color 0.2s ease;
}

.wmclone-comment-submit:hover {
	background: #236a87;
	color: #fff !important;
}

body.logged-in .wmclone-comment-form {
	grid-template-columns: 1fr auto;
}

body.logged-in .wmclone-comment-form .comment-form-comment {
	grid-column: 1 / -1;
}

body.logged-in .wmclone-comment-form .form-submit {
	grid-column: 2;
}

body.logged-in .wmclone-comment-form .logged-in-as {
	grid-column: 1 / -1;
	margin: 0 0 0.5rem;
	font-size: 0.875rem;
	color: var(--wm-text-muted);
}

@media (max-width: 640px) {
	.wmclone-comment-form {
		grid-template-columns: 1fr;
	}

	.wmclone-comment-form .form-submit {
		grid-column: 1;
		justify-content: stretch;
	}

	.wmclone-comment-form .wmclone-comment-submit {
		width: 100%;
	}

	body.logged-in .wmclone-comment-form {
		grid-template-columns: 1fr;
	}

	body.logged-in .wmclone-comment-form .form-submit {
		grid-column: 1;
	}
}

/* 评论列表（GeneratePress：li > article.comment-body） */
#comments .comment-list {
	list-style: none;
	padding: 0;
	margin: 0;
	font-size: 18px;
}

#comments .comment-list > li {
	margin: 0 0 4.5rem;
	padding: 0;
	list-style: none;
}

#comments .comment-list .children {
	list-style: none;
	margin: 1.25rem 0 0;
	padding-left: 1.25rem;
	border: none;
	border-left: none;
	box-shadow: none;
}

/* 覆盖父主题 comments.css：去掉评论块与嵌套线的边框 */
#comments .depth-1.parent > .children {
	border-bottom: none !important;
}

#comments .pingback .comment-body,
#comments .trackback .comment-body {
	border: none !important;
	border-bottom: none !important;
}

#comments .comment-list > .comment:first-child {
	border-top: none !important;
	padding-top: 50px;
	padding-top: 1rem;
}

#comments article.comment-body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding-top: 0;
	padding-bottom: 0;
	border: none !important;
}

#comments .comment-author-info {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

#comments .comment-author-info .comment-author {
	display: none;
}

#comments .comment-metadata,
#comments .entry-meta.comment-metadata {
	margin: 0;
	font-size: 0.875rem;
	color: var(--wm-link);
	line-height: 1.4;
	order: -1;
}

#comments .comment-metadata a,
#comments .entry-meta.comment-metadata a {
	color: var(--wm-comment-link);
	text-decoration: none;
}

#comments .comment-metadata a:hover,
#comments .entry-meta.comment-metadata a:hover {
	color: var(--wm-comment-accent);
}

#comments .comment-body .edit-link {
	display: none;
}

#comments .comment-awaiting-moderation {
	font-size: 0.875rem;
	color: var(--wm-text-muted);
	margin: 0;
}

#comments .comment-content {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	margin: 0;
	padding: 0;
	font-size: 1rem;
	line-height: 1.75;
	border: none !important;
	box-shadow: none;
}

#comments .comment-content p {
	margin: 0 0 0.65em;
}

#comments .comment-content p:last-child {
	margin-bottom: 0;
}

#comments .comment-content .reply {
	margin: 0.35rem 0 0;
	margin-left: auto;
	text-align: right;
	align-self: flex-end;
	width: fit-content;
	max-width: 100%;
}

#comments .reply a {
	color: var(--wm-link);
	text-decoration: none;
	font-size: 18px;
	font-size: 1rem;
}

#comments .reply a:hover {
	color: var(--wm-link-hover);
	text-decoration: underline;
}

#comments .comment-body footer.comment-meta {
	padding: 0;
	border: none;
	background: none;
}

/* Pingback 条目 */
#comments .pingback .comment-body {
	font-size: 0.9375rem;
	line-height: 1.6;
}
