/*
Theme Name: Flyvalve
Theme URI: https://www.flyvalve.com
Author: Cixi Fly Pipe Equipment Co., Ltd
Author URI: https://www.flyvalve.com
Description: 工业阀门管件外贸站主题。水平导航菜单；列表页以每行 5 个的缩略图网格展示（首图缩略图+下方标题）；首页含可自定义的轮播横幅（最多5张可链接产品页）、Hot Products / Recommended for You / Spot Goods 产品版块（按分类自定义选取产品）和 Company Profile 版块，并原样保留主页既有内容。
Version: 4.0.0
Requires at least: 5.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flyvalve
Tags: custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, two-columns, right-sidebar
*/

/* ============================================================
   1. 基础与变量
   ============================================================ */
:root {
	--fv-primary: #0e3a5d;          /* 深钢蓝：导航、标题 */
	--fv-primary-dark: #0a2c47;
	--fv-accent: #e8710a;           /* 工业橙：强调、按钮 */
	--fv-accent-dark: #c85f06;
	--fv-bg: #f5f7f9;               /* 页面底色 */
	--fv-surface: #ffffff;
	--fv-text: #23282d;
	--fv-text-muted: #5a6470;
	--fv-border: #dfe5ea;
	--fv-topbar-bg: #0a2c47;
	--fv-radius: 6px;
	--fv-shadow: 0 1px 3px rgba(14, 58, 93, .08), 0 4px 14px rgba(14, 58, 93, .06);
	--fv-shadow-hover: 0 4px 10px rgba(14, 58, 93, .14), 0 10px 28px rgba(14, 58, 93, .12);
	--fv-font: "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
	--fv-container: 1200px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	font-family: var(--fv-font);
	font-size: 16px;
	line-height: 1.7;
	color: var(--fv-text);
	background: var(--fv-bg);
}

img { max-width: 100%; height: auto; }

a { color: var(--fv-primary); text-decoration: none; transition: color .2s ease; }
a:hover, a:focus { color: var(--fv-accent); }

h1, h2, h3, h4 { color: var(--fv-primary); line-height: 1.3; margin: 0 0 .6em; font-weight: 700; }

a:focus-visible,
button:focus-visible,
.menu-toggle:focus-visible {
	outline: 2px solid var(--fv-accent);
	outline-offset: 2px;
}

.container {
	max-width: var(--fv-container);
	margin: 0 auto;
	padding: 0 20px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ============================================================
   2. 顶栏（联系信息）
   ============================================================ */
.topbar {
	background: var(--fv-topbar-bg);
	color: rgba(255, 255, 255, .85);
	font-size: 13px;
}
.topbar .container {
	display: flex;
	justify-content: space-between;
	align-items: center;
	min-height: 38px;
	gap: 16px;
	flex-wrap: wrap;
}
.topbar a { color: rgba(255, 255, 255, .85); }
.topbar a:hover { color: var(--fv-accent); }
.topbar .topbar-contact span { margin-right: 18px; }
.topbar .topbar-contact svg { vertical-align: -3px; margin-right: 4px; }

/* ============================================================
   3. 站点头部（Logo + 标语）
   ============================================================ */
.site-header {
	background: var(--fv-surface);
	border-bottom: 1px solid var(--fv-border);
}
.site-header .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding-top: 18px;
	padding-bottom: 18px;
}
.site-branding { display: flex; align-items: center; gap: 14px; min-width: 0; }
.site-branding .custom-logo { max-height: 64px; width: auto; }
.site-title { font-size: 24px; margin: 0; }
.site-title a { color: var(--fv-primary); font-weight: 800; letter-spacing: .5px; }
.site-description { margin: 2px 0 0; font-size: 13px; color: var(--fv-text-muted); }

.header-search { flex-shrink: 0; }
.header-search form { display: flex; }
.header-search input[type="search"] {
	width: 220px;
	padding: 8px 12px;
	border: 1px solid var(--fv-border);
	border-right: 0;
	border-radius: var(--fv-radius) 0 0 var(--fv-radius);
	font-size: 14px;
}
.header-search button {
	padding: 8px 14px;
	border: 0;
	border-radius: 0 var(--fv-radius) var(--fv-radius) 0;
	background: var(--fv-primary);
	color: #fff;
	cursor: pointer;
	transition: background .2s ease;
}
.header-search button:hover { background: var(--fv-accent); }

/* ============================================================
   4. 水平主菜单
   ============================================================ */
.main-navigation {
	background: var(--fv-primary);
	position: relative;
	z-index: 100;
}
.main-navigation .container { display: flex; align-items: center; }

.menu-toggle {
	display: none;
	align-items: center;
	gap: 8px;
	background: none;
	border: 0;
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	padding: 14px 0;
	cursor: pointer;
}
.menu-toggle svg { display: block; }

.main-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
}
.main-menu li { position: relative; }
.main-menu a {
	display: block;
	padding: 15px 22px;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .3px;
	transition: background .2s ease, color .2s ease;
}
.main-menu > li > a:hover,
.main-menu > li > a:focus,
.main-menu > li.current-menu-item > a,
.main-menu > li.current-menu-ancestor > a {
	background: var(--fv-accent);
	color: #fff;
}

/* 下拉子菜单（悬停与键盘聚焦均可展开） */
.main-menu .sub-menu {
	list-style: none;
	margin: 0;
	padding: 6px 0;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	background: var(--fv-surface);
	box-shadow: var(--fv-shadow-hover);
	border-top: 3px solid var(--fv-accent);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .2s ease, transform .2s ease, visibility .2s;
	z-index: 200;
}
.main-menu li:hover > .sub-menu,
.main-menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.main-menu .sub-menu a {
	padding: 10px 18px;
	color: var(--fv-text);
	font-weight: 500;
	font-size: 14px;
	border-bottom: 1px solid var(--fv-border);
}
.main-menu .sub-menu li:last-child > a { border-bottom: 0; }
.main-menu .sub-menu a:hover,
.main-menu .sub-menu a:focus {
	background: var(--fv-bg);
	color: var(--fv-accent);
	padding-left: 24px;
}
.main-menu .sub-menu .sub-menu { top: -6px; left: 100%; }

/* 带下拉的父级箭头 */
.main-menu .menu-item-has-children > a::after {
	content: "";
	display: inline-block;
	margin-left: 8px;
	border: 4px solid transparent;
	border-top-color: currentColor;
	vertical-align: 2px;
}

/* ============================================================
   5. 首页：轮播横幅 / 产品版块 / Company Profile
   ============================================================ */
.fv-slider {
	position: relative;
	overflow: hidden;
	background: var(--fv-primary-dark);
}
.fv-slider-track { position: relative; }
.fv-slide {
	display: none;
	position: relative;
}
.fv-slide.is-active { display: block; }
.fv-slide-link { display: block; }
.fv-slide img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 10 / 3;
	object-fit: cover;
}
.fv-slide-caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 18px 60px 22px;
	background: linear-gradient(to top, rgba(10, 44, 71, .78), rgba(10, 44, 71, 0));
	color: #fff;
	font-size: 20px;
	font-weight: 700;
	text-align: center;
	pointer-events: none;
}

.fv-slider-prev,
.fv-slider-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(10, 44, 71, .55);
	color: #fff;
	font-size: 18px;
	cursor: pointer;
	transition: background .2s ease;
	z-index: 5;
}
.fv-slider-prev:hover, .fv-slider-next:hover { background: var(--fv-accent); }
.fv-slider-prev { left: 18px; }
.fv-slider-next { right: 18px; }

.fv-slider-dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 12px;
	display: flex;
	justify-content: center;
	gap: 8px;
	z-index: 5;
}
.fv-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, .8);
	background: transparent;
	cursor: pointer;
	padding: 0;
	transition: background .2s ease;
}
.fv-dot.is-active { background: var(--fv-accent); border-color: var(--fv-accent); }

/* 首页版块 */
.section { padding: 48px 0; }
.section-title { text-align: center; font-size: 28px; }
.section-title::after {
	content: "";
	display: block;
	width: 56px;
	height: 3px;
	background: var(--fv-accent);
	margin: 12px auto 0;
}
.section-title-left { text-align: left; }
.section-title-left::after { margin-left: 0; margin-right: 0; }
.section-subtitle { text-align: center; color: var(--fv-text-muted); margin: 0 0 36px; }

.home-product-section:nth-of-type(even) { background: var(--fv-surface); }
.section-more { text-align: center; margin: 30px 0 0; }

/* Company Profile */
.home-company-section { background: var(--fv-surface); }
.company-profile .company-text { max-width: 900px; font-size: 15.5px; }

/* 首页原有内容版块 */
.home-original-content { padding-top: 20px; }

/* 保留旧 Hero 按钮样式（自定义器按钮等仍使用 .btn） */
.btn {
	display: inline-block;
	padding: 12px 30px;
	background: var(--fv-accent);
	color: #fff;
	font-weight: 700;
	border-radius: var(--fv-radius);
	border: 0;
	cursor: pointer;
	font-size: 15px;
	transition: background .2s ease, transform .2s ease;
}
.btn:hover, .btn:focus { background: var(--fv-accent-dark); color: #fff; transform: translateY(-1px); }

/* ============================================================
   6. 内容布局（主栏 + 侧栏）
   ============================================================ */
.site-content { padding: 40px 0 56px; }
.content-area-wrap {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 36px;
	align-items: start;
}
.content-area-wrap.no-sidebar { grid-template-columns: 1fr; }

/* ============================================================
   7. 文章 / 产品卡片（缩略图列表）
   ============================================================ */
/* 列表页缩略图网格：桌面每行 5 个 */
.post-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 22px;
}
@media (max-width: 1100px) {
	.post-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
	.post-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
}
.post-card {
	background: var(--fv-surface);
	border: 1px solid var(--fv-border);
	border-radius: var(--fv-radius);
	overflow: hidden;
	box-shadow: var(--fv-shadow);
	display: flex;
	flex-direction: column;
	transition: box-shadow .25s ease, transform .25s ease;
}
.post-card:hover { box-shadow: var(--fv-shadow-hover); transform: translateY(-3px); }

.post-card .thumb {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #e9edf1;
}
.post-card .thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .35s ease;
}
.post-card:hover .thumb img { transform: scale(1.06); }

.post-card .card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.post-card .entry-title { font-size: 17px; margin: 0 0 8px; }
.post-card .entry-title a { color: var(--fv-primary); }
.post-card .entry-title a:hover { color: var(--fv-accent); }
.post-card .entry-meta { font-size: 12.5px; color: var(--fv-text-muted); margin-bottom: 10px; }
.post-card .entry-summary { font-size: 14px; color: var(--fv-text-muted); flex: 1; margin: 0 0 14px; }
.post-card .read-more {
	align-self: flex-start;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--fv-accent);
}
.post-card .read-more::after { content: " →"; }

/* ============================================================
   7b. 缩略图卡片（首图缩略图 + 下方产品标题）
   ============================================================ */
.thumb-card {
	position: relative;
	background: var(--fv-surface);
	border: 1px solid var(--fv-border);
	border-radius: var(--fv-radius);
	overflow: hidden;
	box-shadow: var(--fv-shadow);
	transition: box-shadow .25s ease, transform .25s ease;
}
.thumb-card:hover,
.thumb-card:focus-within {
	box-shadow: var(--fv-shadow-hover);
	transform: translateY(-3px);
}

.thumb-card .thumb-link {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #e9edf1;
}
.thumb-card .thumb-link img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .35s ease;
}
.thumb-card:hover .thumb-link img,
.thumb-card:focus-within .thumb-link img { transform: scale(1.06); }

/* 缩略图下方的产品标题 */
.thumb-card .thumb-caption {
	margin: 0;
	padding: 10px 12px 12px;
	font-size: 13.5px;
	font-weight: 600;
	line-height: 1.45;
	text-align: center;
}
.thumb-card .thumb-caption a {
	color: var(--fv-primary);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.thumb-card .thumb-caption a:hover,
.thumb-card .thumb-caption a:focus { color: var(--fv-accent); }

/* 首页：原样输出既有页面内容，不加卡片容器样式 */
.home-content { padding: 10px 0 30px; }
.home-entry .entry-content { font-size: 15px; }

/* 保留旧首页内容的分栏结构（原为旧主题 table/float 布局，
   这里用 flex 复原其三栏排列，内容本身不做任何改动） */
.home-content .art-content-layout-row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
}
.home-content .art-layout-cell {
	flex: 0 1 auto;
	min-width: 0;
}

/* 旧首页内容的多栏布局在手机端转为纵向堆叠（桌面端原样） */
@media (max-width: 700px) {
	.home-content .art-content-layout-row { display: block; }
	.home-content .art-layout-cell {
		width: auto !important;
		margin-bottom: 18px;
	}
}

/* 列表页（归档/分类）标题 */
.page-header { margin-bottom: 28px; }
.page-title { font-size: 26px; margin: 0; }
.archive-description { color: var(--fv-text-muted); margin-top: 8px; }

/* 面包屑 */
.breadcrumbs { font-size: 13px; color: var(--fv-text-muted); margin-bottom: 18px; }
.breadcrumbs a { color: var(--fv-text-muted); }
.breadcrumbs a:hover { color: var(--fv-accent); }

/* ============================================================
   8. 文章详情页
   ============================================================ */
.entry-single {
	background: var(--fv-surface);
	border: 1px solid var(--fv-border);
	border-radius: var(--fv-radius);
	box-shadow: var(--fv-shadow);
	padding: 36px 40px;
}
.entry-single .entry-title { font-size: 28px; }
.entry-single .entry-meta { font-size: 13px; color: var(--fv-text-muted); margin-bottom: 22px; padding-bottom: 16px; border-bottom: 1px solid var(--fv-border); }
.entry-content { font-size: 16px; }
.entry-content img { border-radius: var(--fv-radius); }
.entry-content table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 14.5px; }
.entry-content th, .entry-content td { border: 1px solid var(--fv-border); padding: 9px 12px; text-align: left; }
.entry-content th { background: var(--fv-bg); color: var(--fv-primary); }

/* 上一篇 / 下一篇 */
.post-navigation {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin-top: 28px;
	font-size: 14px;
}
.post-navigation a {
	background: var(--fv-surface);
	border: 1px solid var(--fv-border);
	border-radius: var(--fv-radius);
	padding: 12px 18px;
	max-width: 48%;
	transition: border-color .2s ease;
}
.post-navigation a:hover { border-color: var(--fv-accent); }

/* 分页 */
.pagination { margin-top: 36px; text-align: center; }
.pagination .page-numbers {
	display: inline-block;
	padding: 8px 15px;
	margin: 0 3px;
	background: var(--fv-surface);
	border: 1px solid var(--fv-border);
	border-radius: var(--fv-radius);
	font-size: 14px;
}
.pagination .page-numbers.current {
	background: var(--fv-primary);
	border-color: var(--fv-primary);
	color: #fff;
}
.pagination a.page-numbers:hover { border-color: var(--fv-accent); color: var(--fv-accent); }

/* ============================================================
   9. 侧栏小工具
   ============================================================ */
.widget {
	background: var(--fv-surface);
	border: 1px solid var(--fv-border);
	border-radius: var(--fv-radius);
	box-shadow: var(--fv-shadow);
	padding: 22px;
	margin-bottom: 24px;
}
.widget-title {
	font-size: 16px;
	margin: 0 0 14px;
	padding-bottom: 10px;
	border-bottom: 2px solid var(--fv-primary);
	position: relative;
}
.widget-title::after {
	content: "";
	position: absolute;
	left: 0; bottom: -2px;
	width: 42px; height: 2px;
	background: var(--fv-accent);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li { padding: 7px 0; border-bottom: 1px dashed var(--fv-border); font-size: 14px; }
.widget ul li:last-child { border-bottom: 0; }
.widget ul li a { color: var(--fv-text); }
.widget ul li a:hover { color: var(--fv-accent); }
.widget select, .widget input[type="search"] { width: 100%; padding: 8px 10px; border: 1px solid var(--fv-border); border-radius: var(--fv-radius); }

/* ============================================================
   10. 页脚
   ============================================================ */
.site-footer {
	background: var(--fv-primary-dark);
	color: rgba(255, 255, 255, .75);
	margin-top: 40px;
}
.footer-widgets {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 32px;
	padding: 48px 0 32px;
}
.footer-widgets .widget {
	background: transparent;
	border: 0;
	box-shadow: none;
	padding: 0;
	margin: 0;
}
.footer-widgets .widget-title { color: #fff; border-bottom-color: rgba(255, 255, 255, .2); }
.footer-widgets .widget ul li { border-bottom-color: rgba(255, 255, 255, .12); }
.footer-widgets a,
.footer-widgets .widget ul li a { color: rgba(255, 255, 255, .75); }
.footer-widgets a:hover,
.footer-widgets .widget ul li a:hover { color: var(--fv-accent); }
.footer-widgets .widget ul li { border-bottom-color: rgba(255, 255, 255, .12); }
.footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, .12);
	padding: 18px 0;
	font-size: 13px;
	text-align: center;
}

/* ============================================================
   11. 评论区
   ============================================================ */
.comments-area { margin-top: 36px; }
.comment-list { list-style: none; padding: 0; }
.comment-body { background: var(--fv-surface); border: 1px solid var(--fv-border); border-radius: var(--fv-radius); padding: 18px; margin-bottom: 14px; }
.comment-form input:not([type="submit"]), .comment-form textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--fv-border);
	border-radius: var(--fv-radius);
	font-family: inherit;
	font-size: 14px;
}
.comment-form .submit { background: var(--fv-primary); color: #fff; border: 0; padding: 10px 26px; border-radius: var(--fv-radius); cursor: pointer; font-size: 14px; }
.comment-form .submit:hover { background: var(--fv-accent); }

/* ============================================================
   12. 响应式
   ============================================================ */
@media (max-width: 900px) {
	.content-area-wrap { grid-template-columns: 1fr; }
	.header-search { display: none; }

	.main-navigation .container { flex-direction: column; align-items: stretch; }
	.menu-toggle { display: flex; }
	.main-menu {
		display: none;
		flex-direction: column;
		padding-bottom: 8px;
	}
	.main-menu.is-open { display: flex; }
	.main-menu a { padding: 12px 16px; }
	.main-menu .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border-top: 0;
		background: rgba(255, 255, 255, .08);
		display: none;
		padding: 0;
	}
	.main-menu li.submenu-open > .sub-menu { display: block; }
	.main-menu .sub-menu a { color: rgba(255, 255, 255, .9); border-bottom: 0; padding-left: 32px; }
	.main-menu .sub-menu a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
}

@media (max-width: 600px) {
	.fv-slide img { aspect-ratio: 16 / 9; }
	.fv-slide-caption { font-size: 15px; padding: 12px 46px 26px; }
	.fv-slider-prev, .fv-slider-next { width: 34px; height: 34px; font-size: 14px; }
	.entry-single { padding: 24px 20px; }
	.site-title { font-size: 20px; }
	.post-navigation { flex-direction: column; }
	.post-navigation a { max-width: 100%; }
	.topbar .container { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; }
}
