/*
Theme Name: Vertex
Theme URI: https://example.com/vertex
Author: Your Name
Author URI: https://example.com
Description: Vertex 是一套面向 B2B / 外贸企业的现代 WordPress 区块主题(Full Site Editing)。以 theme.json v3 作为唯一设计令牌来源,配套产品展示、团队介绍、FAQ、询盘引导等可复用区块模式,支持深色模式变体与Interactivity API,零 jQuery 依赖。适合企业官网、外贸站、制造业与专业服务站点。
Version: 1.2.2
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: vertex
Tags: block-theme, block-patterns, full-site-editing, business, portfolio, e-commerce, blog, one-column, two-columns, right-sidebar, custom-colors, custom-logo, custom-menu, editor-style, featured-images, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready, wide-blocks
*/

/*
 * 注意:本主题的样式绝大部分由 theme.json 统一驱动(设计令牌 + 元素/区块样式)。
 * 本文件仅保留少量无法用 theme.json 表达的组件级样式(卡片微交互、
 * 导航覆盖层、ProseMirror 编辑器微调等)。
 * 修改顺序建议:先改 theme.json 的 settings/styles,再回来加例外。
 */

/* ---------------------------------------------------------------
 * 1. 基础重置与可访问性
 * ------------------------------------------------------------- */

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: var(--wp--preset--color--paper);
	clip-path: none;
	color: var(--wp--preset--color--ink);
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	height: auto;
	left: 1rem;
	line-height: normal;
	padding: 0.75rem 1.25rem;
	text-decoration: none;
	top: 1rem;
	width: auto;
	z-index: 100000;
}

.skip-link:focus {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* 尊重用户的减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
	}
}

/* 键盘焦点可见:只在键盘导航时显示焦点环 */
:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* ---------------------------------------------------------------
 * 2. 组件:卡片(产品 / 文章)
 * ------------------------------------------------------------- */

.vertex-card {
	background-color: var(--wp--preset--color--paper);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--preset--custom--radius--medium);
	height: 100%;
	overflow: hidden;
	transition:
		border-color 0.25s ease,
		box-shadow 0.25s ease,
		transform 0.25s ease;
}

.vertex-card:hover {
	border-color: var(--wp--preset--color--mist);
	box-shadow: 0 18px 40px -24px rgba(22, 24, 29, 0.35);
	transform: translateY(-4px);
}

/* 图片占位:未上传真实图片前用渐变兜底,避免出现破图 */
.vertex-card__media {
	align-items: center;
	aspect-ratio: 4 / 3;
	background: linear-gradient(135deg, var(--wp--preset--color--sand) 0%, var(--wp--preset--color--line) 100%);
	color: var(--wp--preset--color--stone);
	display: flex;
	font-size: 0.875rem;
	justify-content: center;
	letter-spacing: 0.08em;
	overflow: hidden;
	text-transform: uppercase;
}

.vertex-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.vertex-card__title {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.3;
	margin: 0;
}

.vertex-card__title a {
	color: inherit;
	text-decoration: none;
}

/* 整卡可点击:伪元素铺满,保持链接语义与可访问性 */
.vertex-card__link::after {
	content: "";
	inset: 0;
	position: absolute;
	z-index: 1;
}

.vertex-card:hover .vertex-card__title a {
	color: var(--wp--preset--color--brand);
}

/* ---------------------------------------------------------------
 * 3. 组件:首屏
 * ------------------------------------------------------------- */

.vertex-hero__eyebrow {
	color: var(--wp--preset--color--accent);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	margin: 0;
	text-transform: uppercase;
}

.vertex-hero__title {
	font-size: var(--wp--preset--font-size--xx-large);
	letter-spacing: -0.02em;
	line-height: 1.1;
	margin: 0;
	max-width: 20ch;
}

.vertex-hero__text {
	color: var(--wp--preset--color--stone);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.7;
	max-width: 52ch;
}

/* ---------------------------------------------------------------
 * 4. 组件:数据指标条
 * ------------------------------------------------------------- */

.vertex-stat {
	border-left: 2px solid var(--wp--preset--color--accent);
	padding-left: 1.25rem;
}

.vertex-stat__value {
	display: block;
	font-size: var(--wp--preset--font-size--x-large);
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.1;
}

.vertex-stat__label {
	color: var(--wp--preset--color--stone);
	font-size: var(--wp--preset--font-size--small);
}

/* ---------------------------------------------------------------
 * 5. 组件:特色列表
 * ------------------------------------------------------------- */

.vertex-feature {
	border-top: 1px solid var(--wp--preset--color--line);
	padding-top: 1.5rem;
}

.vertex-feature__title {
	font-size: var(--wp--preset--font-size--medium);
	margin: 0 0 0.5rem;
}

.vertex-feature__text {
	color: var(--wp--preset--color--stone);
	font-size: 0.9375rem;
	line-height: 1.7;
	margin: 0;
}

/* ---------------------------------------------------------------
 * 6. 组件:FAQ
 * ------------------------------------------------------------- */

.wp-block-details.vertex-faq {
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 0.25rem 0;
}

.wp-block-details__summary {
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600;
	list-style: none;
	padding: 1rem 2.5rem 1rem 0;
	position: relative;
}

.wp-block-details__summary::-webkit-details-marker {
	display: none;
}

.wp-block-details__summary::after {
	color: var(--wp--preset--color--accent);
	content: "+";
	font-size: 1.5rem;
	font-weight: 400;
	line-height: 1;
	position: absolute;
	right: 0.5rem;
	top: 50%;
	transform: translateY(-50%);
	transition: transform 0.2s ease;
}

.wp-block-details[open] > .wp-block-details__summary::after {
	transform: translateY(-50%) rotate(45deg);
}

.wp-block-details__content {
	color: var(--wp--preset--color--stone);
	font-size: 0.9375rem;
	line-height: 1.8;
	padding: 0 2.5rem 1.25rem 0;
}

/* ---------------------------------------------------------------
 * 7. 组件:CTA、侧栏小工具与页脚
 * ------------------------------------------------------------- */

.vertex-cta {
	background: linear-gradient(135deg, var(--wp--preset--color--brand-deep) 0%, var(--wp--preset--color--brand) 100%);
	border-radius: var(--wp--preset--custom--radius--large);
}

/* 侧栏小工具卡片 */
.vertex-aside-box {
	background-color: var(--wp--preset--color--sand);
	border-radius: var(--wp--preset--custom--radius--medium);
}

.vertex-aside-box--accent {
	background-color: var(--wp--preset--color--accent-soft);
}

/* 流程步骤序号 */
.vertex-process__num {
	color: var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1;
	margin: 0;
}

/* 特色列表的勾选符号 */
.vertex-checklist {
	list-style: none;
	padding-left: 0;
}

.vertex-checklist li {
	padding-left: 1.75rem;
	position: relative;
}

.vertex-checklist li::before {
	color: var(--wp--preset--color--accent);
	content: "✓";
	font-weight: 700;
	left: 0;
	position: absolute;
}

/* 评价星级 */
.vertex-rating {
	font-size: 1.125rem;
	letter-spacing: 0.15em;
	margin: 0;
}

/* 区块级标题统一样式 */
.vertex-section-heading {
	margin-bottom: 0;
}

.vertex-section-intro {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.7;
	max-width: 60ch;
}

.vertex-page-heading {
	margin-bottom: 0;
}

/* 章节标题行的「查看全部」链接 */
.vertex-section-head-row__link {
	font-size: var(--wp--preset--font-size--small);
	margin: 0;
	white-space: nowrap;
}

/* 图片占位提示(替换为真实图片后可删除) */
.vertex-media-placeholder {
	opacity: 0.7;
}

/* 客户 Logo 灰度化,避免颜色打架 */
.vertex-logo img {
	filter: grayscale(1);
	opacity: 0.55;
	transition:
		filter 0.25s ease,
		opacity 0.25s ease;
}

.vertex-logo:hover img {
	filter: grayscale(0);
	opacity: 1;
}

/* 站点页眉页脚 */
.vertex-site-header {
	position: relative;
	z-index: 20;
}

/* 语言切换器(Polylang 启用后生效) */
.vertex-lang-switcher {
	align-items: center;
	display: flex;
	gap: 0.75rem;
}

.vertex-lang-switcher__item {
	border-bottom: 2px solid transparent;
	color: var(--wp--preset--color--stone);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 600;
	letter-spacing: 0.06em;
	padding-bottom: 2px;
	text-decoration: none;
	text-transform: uppercase;
	transition: border-color 0.2s ease, color 0.2s ease;
}

.vertex-lang-switcher__item:hover {
	color: var(--wp--preset--color--brand);
	text-decoration: none;
}

.vertex-lang-switcher__item.is-active {
	border-bottom-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--ink);
}

/* 滚动后加底色需要时,给 body 加 .has-sticky-header 即可启用 */
.has-sticky-header .vertex-site-header {
	background-color: var(--wp--preset--color--paper);
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.vertex-site-footer a {
	color: inherit;
	text-decoration: none;
}

.vertex-site-footer a:hover {
	color: var(--wp--preset--color--accent);
	text-decoration: underline;
}

/* ---------------------------------------------------------------
 * 8. 布局:文章页与产品页的双栏结构
 * ------------------------------------------------------------- */

/* 桌面双栏,窄屏自动回落为单栏 */
@media (min-width: 1024px) {
	.vertex-post-main {
		flex-basis: 0;
		flex-grow: 1;
		min-width: 0;
	}

	.vertex-post-aside {
		flex-basis: 320px;
		flex-shrink: 0;
	}

	.vertex-product-gallery {
		flex-basis: 52%;
		flex-shrink: 0;
	}

	.vertex-product-summary {
		flex-basis: 0;
		flex-grow: 1;
		min-width: 0;
	}
}

/* 页脚动态列表(短代码输出) */
.vertex-footer-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.vertex-footer-list li {
	margin-bottom: 0.5rem;
}

.vertex-footer-list a {
	color: var(--wp--preset--color--mist);
	font-size: var(--wp--preset--font-size--small);
	text-decoration: none;
	transition: color 0.2s ease;
}

.vertex-footer-list a:hover {
	color: var(--wp--preset--color--accent-soft);
	text-decoration: underline;
}

/* 产品分类数量徽标 */
.vertex-footer-list__count {
	color: var(--wp--preset--color--stone);
	font-size: var(--wp--preset--font-size--x-small);
	opacity: 0.7;
}

/* 产品页规格表 */
.vertex-product-specs {
	border-top: 1px solid var(--wp--preset--color--line);
}

.vertex-product-specs-table {
	width: 100%;
	border-collapse: collapse;
}

.vertex-product-specs-table td {
	border-bottom: 1px solid var(--wp--preset--color--line);
	padding: 0.75rem 0.5rem;
	vertical-align: top;
}

.vertex-product-specs-table td:first-child {
	color: var(--wp--preset--color--stone);
	font-weight: 600;
	white-space: nowrap;
	width: 30%;
}

.vertex-product-specs-table td p {
	margin: 0;
}

.vertex-product-customizable {
	color: var(--wp--preset--color--accent);
	font-size: var(--wp--preset--font-size--small);
}

/* 分页 */
.vertex-pagination {
	gap: 0.5rem;
}

/* 搜索块不撑满容器 */
.vertex-search-404,
.vertex-search-archive {
	max-width: 420px;
}

/* 页眉 CTA 按钮在窄屏隐藏,避免与汉堡菜单挤在一起 */
@media (max-width: 600px) {
	.vertex-header-cta {
		display: none;
	}
}


/* ---------------------------------------------------------------
 * 8. 组件:移动导航覆盖层
 * ------------------------------------------------------------- */

.wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--paper);
	padding: 1.5rem;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 2rem;
}

/* ---------------------------------------------------------------
 * 9. 编辑器体验:让后台画布更接近前台
 * ------------------------------------------------------------- */

.editor-styles-wrapper .vertex-card,
.editor-styles-wrapper .vertex-cta {
	pointer-events: none;
}

.editor-styles-wrapper .vertex-card__title a::after {
	content: none;
}

/* 前台/后台一致性:避免编辑器里出现额外的焦点描边 */
.wp-block-button__link {
	transition:
		background-color 0.2s ease,
		border-color 0.2s ease,
		color 0.2s ease;
}
