/*
 * yuxia-wp.css —— WordPress 适配层（本层与设计无关，只管"WP 带来的东西"）。
 *
 * 加载位置：css/style.css → responsive.css → fashion-store.css → yuxia.css 之后。
 * 品牌层（yuxia.css）负责设计，本层负责三件设计之外的事：
 *   1. 后台管理工具栏与固定导航的避让（否则登录后导航被盖住）
 *   2. WP 原生内容元素的兜底样式（正文里的对齐图片、题注、屏幕阅读器文本…）
 *   3. 评论 / 分页等 WP 生成标记的基础外观
 *
 * ⚠️ 导航类名映射不在这里 —— 本主题没有走 wp_nav_menu() 的原生标记，
 *    而是由 inc/template-tags.php 的 yuxia_nav_menu() 直接输出 Crafto 的
 *    mega-menu 结构，所以不需要 `.menu-item` → `.nav-item` 的桥接。
 */

/* ---------------------------------------------------------------------------
 * 1. 后台管理工具栏避让
 *
 * 导航是 position: fixed（Crafto 的吸顶头部），而 WP 登录态会给 <html> 加
 * 32px 的 margin-top。固定定位元素不随 margin 移动，结果是**导航被工具栏盖住**。
 * 这是"缺 <body> / 缺 body_class 时最典型的症状"，这里正面解决。
 * ------------------------------------------------------------------------- */
body.admin-bar .yuxia-navbar,
body.admin-bar .header-with-topbar > .header-top-bar {
	top: 32px;
}
body.admin-bar .header-with-topbar {
	padding-top: 32px;
}
@media screen and (max-width: 782px) {
	body.admin-bar .yuxia-navbar,
	body.admin-bar .header-with-topbar > .header-top-bar {
		top: 46px;
	}
	body.admin-bar .header-with-topbar {
		padding-top: 46px;
	}
}
@media screen and (max-width: 600px) {
	body.admin-bar .header-with-topbar {
		padding-top: 0;
	}
}

/* ---------------------------------------------------------------------------
 * 2. WP 原生内容元素兜底
 *    模板里的正文是静态 HTML，但作者在后台编辑页面/文章时会用 WP 的编辑器，
 *    它会产生这些类名。不兜底就会出现"对齐图片飞出容器""题注没有样式"。
 * ------------------------------------------------------------------------- */

/* 屏幕阅读器专用文本（WP 的 skip-link 也用它） */
.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}
.screen-reader-text:focus {
	background-color: #fff;
	border-radius: 3px;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, .6);
	clip: auto !important;
	clip-path: none;
	color: var(--yuxia-accent-dark);
	display: block;
	font-size: 14px;
	font-weight: 700;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

/* 正文里的图片对齐（WP 编辑器输出） */
.yuxia-article img.alignright,
.yuxia-article .alignright { float: right; margin: 0 0 1.5em 1.5em; }
.yuxia-article img.alignleft,
.yuxia-article .alignleft  { float: left;  margin: 0 1.5em 1.5em 0; }
.yuxia-article img.aligncenter,
.yuxia-article .aligncenter { display: block; margin: 1.5em auto; }
.yuxia-article .alignwide,
.yuxia-article .alignfull { max-width: 100%; height: auto; }

/* 题注 */
.wp-caption { max-width: 100%; }
.wp-caption-text,
.yuxia-article figcaption {
	font-size: 14px;
	line-height: 1.6;
	color: var(--yuxia-muted);
	margin-top: 8px;
	text-align: center;
}

/* 编辑器里最常见的表格 / 引用 / 代码块 */
.yuxia-article table {
	width: 100%;
	margin-bottom: 1.5em;
	border-collapse: collapse;
}
.yuxia-article table th,
.yuxia-article table td {
	border: 1px solid var(--yuxia-border);
	padding: 10px 14px;
	text-align: left;
}
.yuxia-article table th { font-weight: 700; background: var(--yuxia-surface-2); }
.yuxia-article pre {
	background: var(--yuxia-surface-2);
	border: 1px solid var(--yuxia-border);
	border-radius: 6px;
	padding: 18px;
	overflow-x: auto;
	font-size: 14px;
}

/* ---------------------------------------------------------------------------
 * 3. 评论与分页
 * ------------------------------------------------------------------------- */
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 32px; padding: 0; }
.comment-body {
	border: 1px solid var(--yuxia-border);
	border-radius: 8px;
	padding: 22px 24px;
	margin-bottom: 20px;
	background: var(--white);
}
.comment-meta { font-size: 14px; color: var(--yuxia-muted); margin-bottom: 10px; }
.comment-author img { border-radius: 50%; margin-right: 10px; vertical-align: middle; }
.comment-reply-link { font-size: 14px; font-weight: 600; }
.comment-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	border: 1px solid var(--yuxia-border);
	border-radius: 6px;
	padding: 12px 14px;
	margin-bottom: 18px;
	font-family: inherit;
}

/*
 * 分页不需要在这里补样式。
 *
 * yuxia_pagination() 输出的是 `<ul class="yuxia-pagination"><li>…</li></ul>`，
 * 正好命中 yuxia.css 第 1618 行起那 5 条规则 —— 边框、方块、active 态都现成。
 * （静态页那边的分页是 `<div>` + 裸 `<span>/<a>`，没有 `<li>`，所以它反而没吃到
 *   这套样式；WP 侧没有沿用这个疏漏。）
 */

/* 搜索结果 / 空状态的通用块 */
.yuxia-empty {
	border: 1px dashed var(--yuxia-border);
	border-radius: 8px;
	padding: 48px 32px;
	text-align: center;
	color: var(--yuxia-muted);
}
