/*
Theme Name: Blocksy YT — 悦腾竹文化
Theme URI: https://www.ytbamboo.com/
Description: 悦腾竹文化官网子主题。基于 Blocksy（父主题），以「竹绿 + 暖竹金」为基调，中文使用系统字体栈（不加载 Web 字体），面向竹建筑设计施工行业做排版、组件与响应式优化。
Author: 悦腾竹文化
Author URI: https://www.ytbamboo.com/
Template: blocksy
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: blocksy-yueteng
Tags: bamboo, architecture, business, chinese
*/

/* ==========================================================================
   1. 设计令牌（Design Tokens）
   用 html:root 提升优先级，稳定覆盖父主题输出的 :root 变量，与加载顺序无关。
   ========================================================================== */
html:root {
	/* —— Blocksy 全局 8 色板 —— */
	--theme-palette-color-1: #2F5D3A; /* 竹绿 · 主色（按钮/链接/强调） */
	--theme-palette-color-2: #3C7449; /* 竹绿 · 深一档（hover / 次级强调） */
	--theme-palette-color-3: #12301F; /* 墨绿 · 标题 */
	--theme-palette-color-4: #1B211D; /* 近黑 · 正文与深色块 */
	--theme-palette-color-5: #CFE0D4; /* 浅竹青 · 分隔线 / 描边 */
	--theme-palette-color-6: #F5F2E9; /* 暖竹米 · 区块底色 */
	--theme-palette-color-7: #FAFBF8; /* 极浅底 */
	--theme-palette-color-8: #FFFFFF; /* 白 */

	/* —— 业务扩展色 —— */
	--ytb-gold: #C8A96A;        /* 暖竹金 · 点缀 / 图标 / 数字 */
	--ytb-gold-deep: #A9873F;   /* 暖竹金 · 深档 */
	--ytb-green-soft: #7BA383;  /* 浅竹绿 */
	--ytb-green-deep: #163522;  /* 深底（页脚导航 / 深色区块） */
	--ytb-green-ink: #122A1B;   /* 更深底（页脚主体） */
	--ytb-green-abyss: #0C1C11; /* 最深底（版权条） */
	--ytb-ink: #3E4741;         /* 正文深灰绿 */
	--ytb-muted: #6E7A72;       /* 次要文字 */
	--ytb-line: #E2E8E3;        /* 细描边 */
	--ytb-line-strong: #CFD8D1;

	--ytb-radius: 10px;
	--ytb-radius-sm: 6px;
	--ytb-radius-pill: 999px;
	--ytb-shadow-sm: 0 2px 10px rgba(22, 53, 34, .05);
	--ytb-shadow: 0 8px 28px rgba(22, 53, 34, .08);
	--ytb-shadow-hover: 0 14px 38px rgba(22, 53, 34, .13);
	--ytb-container: 1180px;

	/* —— 中文系统字体栈：不请求任何 Web 字体 —— */
	--theme-font-stack-default: -apple-system, BlinkMacSystemFont, "Segoe UI",
		"PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
		"Noto Sans CJK SC", "WenQuanYi Micro Hei", Roboto, Helvetica, Arial, sans-serif;
	--theme-font-weight-headings: 800;
}

/* ==========================================================================
   2. 全局中文排版
   ========================================================================== */
html { -webkit-text-size-adjust: 100%; }

body {
	color: var(--ytb-ink);
	line-height: 1.85;
	letter-spacing: .01em;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	background: #fff;
}

h1, h2, h3, h4, h5, h6,
.entry-content h1, .entry-content h2, .entry-content h3,
.entry-content h4, .entry-content h5, .entry-content h6 {
	color: var(--theme-palette-color-3);
	line-height: 1.4;
	letter-spacing: .005em;
	font-weight: 800;
	text-wrap: pretty;
}

/* 中文标题层级：块级标题用 clamp 做流体字号，避免移动端溢出 */
h1, .entry-content h1 { font-size: clamp(27px, 3.1vw, 38px); }
h2, .entry-content h2 { font-size: clamp(22px, 2.2vw, 28px); }
h3, .entry-content h3 { font-size: clamp(17.5px, 1.5vw, 21px); }
h4, .entry-content h4 { font-size: 17px; }

p { margin-bottom: 1.05em; }
strong, b { font-weight: 700; color: #1F2A23; }

::selection { background: var(--theme-palette-color-1); color: #fff; }

a { text-decoration-thickness: 1px; text-underline-offset: .18em; }

/* 统一焦点态，键盘可达性 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
	outline: 2px solid var(--ytb-gold);
	outline-offset: 2px;
	border-radius: 3px;
}

/* 图片不拖出容器 */
img { max-width: 100%; height: auto; }

/* 滚动到锚点时的头部补偿 */
:target { scroll-margin-top: 96px; }

/* ==========================================================================
   3. 站点头部
   ========================================================================== */
.ct-header,
.site-header {
	background: rgba(255, 255, 255, .96);
	backdrop-filter: saturate(150%) blur(8px);
	box-shadow: 0 1px 0 var(--ytb-line);
}

/* 吸顶时给一点存在感 */
.ct-header[data-sticky],
.ct-header.is-sticky,
header[data-sticky="fixed"] {
	box-shadow: 0 1px 0 var(--ytb-line), 0 6px 22px rgba(22, 53, 34, .07);
}

/* Logo：图内已含品牌字样，隐藏重复的站名文字（alt 与 schema 仍保留全称） */
.ct-header [data-id="logo"] .site-title-container { display: none; }
.ct-header [data-id="logo"] .site-logo-container { display: flex; align-items: center; }
.ct-header [data-id="logo"] .site-logo-container img {
	display: block;
	max-height: 44px;
	width: auto;
}

/* 一级导航 */
.ct-header .menu > li > a,
.ct-header [data-id="menu"] .menu > li > a {
	font-weight: 600;
	font-size: 15px;
	letter-spacing: .02em;
	padding: .5em .1em;
	position: relative;
	transition: color .18s ease;
}
.ct-header .menu > li > a:hover,
.ct-header .menu > li.current-menu-item > a,
.ct-header .menu > li.current_page_item > a,
.ct-header .menu > li.current-menu-ancestor > a {
	color: var(--theme-palette-color-1);
}
/* 当前项与 hover：底部一条暖竹金细线 */
.ct-header .menu > li.current-menu-item > a:after,
.ct-header .menu > li.current_page_item > a:after,
.ct-header .menu > li.current-menu-ancestor > a:after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 2px;
	height: 2px;
	background: var(--ytb-gold);
	border-radius: 2px;
}

/* 下拉菜单：白底卡片 + 细描边，比 Blocky 默认更克制 */
.ct-header .sub-menu,
.ct-header .ct-dropdown {
	background: #fff;
	border: 1px solid var(--ytb-line);
	border-radius: var(--ytb-radius);
	box-shadow: var(--ytb-shadow);
	padding: 8px;
	min-width: 208px;
}
.ct-header .sub-menu li a,
.ct-header .ct-dropdown li a {
	border-radius: var(--ytb-radius-sm);
	padding: .58em .8em;
	font-size: 14.5px;
	line-height: 1.5;
	transition: background .16s ease, color .16s ease;
}
.ct-header .sub-menu li a:hover,
.ct-header .ct-dropdown li a:hover {
	background: #F3F7F4;
	color: var(--theme-palette-color-1);
}

/* 头部按钮（询价 / 联系我们） */
.ct-header .ct-button,
.ct-header [data-id="button"] .ct-button {
	background: var(--theme-palette-color-1);
	border-color: var(--theme-palette-color-1);
	color: #fff;
	border-radius: var(--ytb-radius-sm);
	font-weight: 600;
	font-size: 14.5px;
	padding: .68em 1.3em;
	transition: background .18s ease, transform .18s ease;
}
.ct-header .ct-button:hover {
	background: var(--theme-palette-color-2);
	border-color: var(--theme-palette-color-2);
	transform: translateY(-1px);
}

/* 移动端抽屉：分组标题与触控尺寸 */
.ct-header .ct-panel .menu > li > a,
.ct-header [data-id="mobile-menu"] .menu > li > a {
	font-size: 16px;
	font-weight: 600;
}
.ct-header .ct-panel .sub-menu li a {
	font-size: 15px;
}

/* 页头容器与正文 / 页脚对齐：
   父主题页头容器是 1290px 宽、无内边距，内容从左 68px 起；
   而首页正文与页脚内容都按 1180px + 24px 内边距（左 123px）排版。
   这里把页头容器改成同一套盒子模型，避免 logo 与正文左边缘错位。 */
@media (min-width: 1000px) {
	.ct-header [data-row] .ct-container {
		max-width: calc(var(--ytb-container) + 48px);
		padding-inline: 24px;
	}
}

/* 移动端抽屉：品牌深绿底（替换父主题的中性近黑），并把竹产品排到主业之后。
   注意：#offcanvas 面板由 Blocksy 输出在 .ct-header 之外，选择器不要再加 .ct-header 前缀。 */
#offcanvas .ct-panel-inner {
	background-color: var(--ytb-green-deep) !important;
}
#offcanvas .mobile-menu > ul {
	display: flex;
	flex-direction: column;
}
#offcanvas .mobile-menu > ul > li.menu-item-4237 { order: 8; }

/* 二级菜单直接展开：不做折叠、不显示箭头、去掉白底卡片。
   原因：折叠箭头太小，用户容易漏点、也容易误点整行；
   且父主题给展开态的 .sub-menu 配了白底圆角，在深绿抽屉里非常突兀。
   全部用 !important 是因为父主题会按 data-toggle-type 输出折叠规则。 */
#offcanvas .mobile-menu .sub-menu {
	display: block !important;
	position: static !important;
	opacity: 1 !important;
	visibility: visible !important;
	max-height: none !important;
	height: auto !important;
	overflow: visible !important;
	transform: none !important;
	background: transparent !important;
	box-shadow: inset 1px 0 0 rgba(255, 255, 255, .14) !important;
	border: 0 !important;
	border-radius: 0 !important;
	margin: 2px 0 4px !important;
	padding: 2px 0 4px 14px !important;
}
#offcanvas .mobile-menu .sub-menu .ct-menu-link {
	color: #C8DCCE !important;
	font-size: 15px !important;
	font-weight: 500 !important;
	padding: .58em 0 !important;
}
#offcanvas .mobile-menu .sub-menu .ct-menu-link:hover {
	color: #fff !important;
}
/* 折叠箭头不再需要 */
#offcanvas .mobile-menu .ct-toggle-dropdown-mobile { display: none !important; }
#offcanvas .mobile-menu .ct-sub-menu-parent { display: block !important; }
/* 去掉子项前的「子菜单圆点」装饰（data-submenu-dots="yes"：
   圆点画在 .ct-menu-link::before 上，宽 3px、绝对定位在文字左侧 30px 处） */
#offcanvas .mobile-menu .sub-menu li { list-style: none !important; }
#offcanvas .mobile-menu .sub-menu li::before,
#offcanvas .mobile-menu .sub-menu li::after,
#offcanvas .mobile-menu .sub-menu .ct-menu-link::before,
#offcanvas .mobile-menu .sub-menu .ct-menu-link::after {
	content: none !important;
	display: none !important;
}

/* 桌面端主导航：主业优先排序 + 主行动按钮 */
.ct-header .header-menu-1 > ul.menu {
	display: flex;
	align-items: center;
	gap: 2px;
}
.ct-header .header-menu-1 > ul.menu > li > .ct-menu-link {
	font-size: 15.5px;
	font-weight: 600;
	letter-spacing: .01em;
	padding: .55em .82em;
	border-radius: var(--ytb-radius-sm);
	transition: color .16s ease, background .16s ease;
}
.ct-header .header-menu-1 > ul.menu > li > .ct-menu-link:hover {
	background: #F2F7F3;
	color: var(--theme-palette-color-1);
}
/* 「悦腾竹产品」从第 2 位后移到最后：首页与主导航以竹建筑业务为主 */
.ct-header .header-menu-1 > ul.menu > li.menu-item-4237 { order: 6; }

/* 页头「获取报价」主按钮 */
.ct-header .ytbh-navcta {
	display: inline-flex;
	align-items: center;
	align-self: center;
	margin-left: 14px;
	padding: .62em 1.35em;
	background: var(--theme-palette-color-1);
	color: #fff !important;
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.2;
	white-space: nowrap;
	border-radius: var(--ytb-radius-sm);
	text-decoration: none;
	box-shadow: 0 4px 14px rgba(47, 93, 58, .22);
	transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.ct-header .ytbh-navcta:hover {
	background: var(--theme-palette-color-2);
	color: #fff !important;
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(47, 93, 58, .28);
}
/* 视口不足时优先隐藏按钮，避免导航折行 */
@media (max-width: 1180px) {
	.ct-header .header-menu-1 > ul.menu > li > .ct-menu-link { padding: .5em .62em; font-size: 15px; }
	.ct-header .ytbh-navcta { margin-left: 10px; padding: .58em 1.1em; font-size: 14px; }
}

/* ==========================================================================
   4. 页脚（深竹绿，与首屏收口呼应）
   ========================================================================== */
.ct-footer,
.site-footer {
	background: var(--ytb-green-ink);
	color: #A9C0B1;
	border-top: 0;
}
.ct-footer a,
.site-footer a { color: #C8DCCE; }
.ct-footer a:hover,
.site-footer a:hover { color: var(--ytb-gold); }

.ct-footer h1, .ct-footer h2, .ct-footer h3, .ct-footer h4,
.site-footer h1, .site-footer h2, .site-footer h3, .site-footer h4 {
	color: #fff;
}

.ct-footer .widget,
.ct-footer [data-id] .widget {
	color: #A9C0B1;
}

/* 页脚小工具标题：暖竹金小标题 + 细线 */
.ct-footer .widget-title,
.ct-footer .ct-widget-title {
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .04em;
	padding-bottom: .6em;
	border-bottom: 1px solid rgba(255, 255, 255, .14);
	margin-bottom: 14px;
}

.ct-footer ul { list-style: none; margin: 0; padding: 0; }
.ct-footer li { margin-bottom: 8px; font-size: 14px; line-height: 1.75; }

/* 页脚表单控件（若有） */
.ct-footer input[type="text"],
.ct-footer input[type="email"],
.ct-footer input[type="tel"],
.ct-footer textarea {
	background: rgba(255, 255, 255, .06);
	border: 1px solid rgba(255, 255, 255, .18);
	color: #fff;
	border-radius: var(--ytb-radius-sm);
}
.ct-footer input::placeholder,
.ct-footer textarea::placeholder { color: rgba(255, 255, 255, .45); }

/* 版权条（页脚收口：深一档竹绿，与主体同一色系，不做纯黑）
   注：父主题会在 <head> 末尾输出 [data-footer*="type-1"] 前缀的高优先级规则，
   把 .ct-footer 底色重置为米白、[data-row="bottom"] 重置为 transparent。
   子主题样式先于它加载，同权重必输，因此这里用 !important 明确夺回控制权。 */
html [data-footer] .ct-footer,
.ct-footer,
.site-footer {
	background-color: var(--ytb-green-abyss) !important;
}
html [data-footer] .ct-footer [data-row="bottom"],
.ct-footer [data-row="bottom"] {
	background-color: transparent !important;
	border-top: 1px solid rgba(255, 255, 255, .10);
}
.ct-footer [data-row="bottom"] .ct-container {
	max-width: calc(var(--ytb-container) + 48px);
	padding-inline: 24px;
}
.ct-footer .ct-footer-copyright {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 26px;
	background: transparent;
	margin: 0;
	padding: 17px 0;
	font-size: 13px;
	line-height: 1.75;
	color: #8BA695;
	letter-spacing: .01em;
}
.ytb-cp-left a,
.ytb-cp-right a {
	color: #A9C0B1;
	text-decoration: none;
}
.ytb-cp-left a:hover,
.ytb-cp-right a:hover { color: #fff; }
.ytb-cp-left i {
	font-style: normal;
	margin: 0 7px;
	color: rgba(255, 255, 255, .28);
}
.ytb-cp-right {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 18px;
}
.ytb-cp-right a {
	position: relative;
}
.ytb-cp-right a + a::before {
	content: "";
	position: absolute;
	left: -9px;
	top: 50%;
	width: 1px;
	height: 11px;
	margin-top: -5px;
	background: rgba(255, 255, 255, .16);
}
@media (max-width: 860px) {
	.ct-footer .ct-footer-copyright {
		justify-content: center;
		text-align: center;
		gap: 9px 14px;
		padding: 14px 0 15px;
		font-size: 12px;
	}
	.ytb-cp-left i { margin: 0 5px; }
	.ytb-cp-right { justify-content: center; gap: 5px 14px; font-size: 12px; }
}

/* ==========================================================================
   5. 页面标题区 / 面包屑
   ========================================================================== */
.entry-header .page-title,
.hero-section .page-title,
h1.page-title {
	font-size: clamp(26px, 3vw, 36px);
	line-height: 1.32;
	letter-spacing: .005em;
	font-weight: 800;
	color: var(--theme-palette-color-3);
}

/* 页面描述（当它不与正文导语重复时展示） */
.page-description {
	font-size: 16px;
	line-height: 1.9;
	color: var(--ytb-muted);
	max-width: 56em;
	margin-top: .7em;
}

.ct-breadcrumbs {
	color: var(--ytb-muted);
	font-size: 13.5px;
	letter-spacing: .02em;
}
.ct-breadcrumbs a { color: var(--ytb-muted); }
.ct-breadcrumbs a:hover { color: var(--theme-palette-color-1); }

/* 页面标题下的一条细线，让区块分界清晰 */
.hero-section {
	border-bottom: 1px solid var(--ytb-line);
}

/* ==========================================================================
   6. 内容区组件
   ========================================================================== */
.entry-content > *:first-child { margin-top: 0; }

.entry-content h2,
.ytb-page h2 { margin-top: 1.7em; }
.entry-content h3,
.ytb-page h3 { margin-top: 1.5em; }

/* 列表：中文行距更舒展 */
.entry-content ul,
.entry-content ol,
.ytb-page ul,
.ytb-page ol { padding-left: 1.35em; }
.entry-content li,
.ytb-page li { margin-bottom: .45em; line-height: 1.85; }

/* 引用 / 提词块 */
.entry-content blockquote,
.ytb-page blockquote {
	margin: 1.6em 0;
	padding: 1.15em 1.35em;
	background: #F5F8F5;
	border-left: 3px solid var(--ytb-gold);
	border-radius: 0 var(--ytb-radius-sm) var(--ytb-radius-sm) 0;
	color: var(--ytb-ink);
}

/* 表格：细线 + 表头竹绿 */
.entry-content table,
.ytb-page table {
	width: 100%;
	border-collapse: collapse;
	margin: 1.5em 0;
	font-size: .96em;
}
.entry-content table th,
.ytb-page table th {
	background: var(--theme-palette-color-1);
	color: #fff;
	font-weight: 600;
	text-align: left;
	padding: .72em .95em;
}
.entry-content table td,
.ytb-page table td {
	border-bottom: 1px solid var(--ytb-line);
	padding: .68em .95em;
	vertical-align: top;
}
.entry-content table tr:nth-child(even) td { background: #FBFCFA; }

/* 分隔线 */
.entry-content hr,
.ytb-page hr {
	border: 0;
	height: 1px;
	background: linear-gradient(90deg, var(--ytb-line), transparent);
	margin: 2.2em 0;
}

/* 正文图 / figure */
.entry-content figure img,
.ytb-page figure img { border-radius: var(--ytb-radius-sm); }
.entry-content figcaption,
.ytb-page figcaption {
	margin-top: .6em;
	font-size: 13.5px;
	color: var(--ytb-muted);
	line-height: 1.7;
}

/* 按钮 */
.entry-content .wp-block-button__link,
.ytb-page a.ytb-btn {
	background: var(--theme-palette-color-1);
	color: #fff;
	border-radius: var(--ytb-radius-sm);
	padding: .76em 1.6em;
	font-weight: 600;
	text-decoration: none;
	display: inline-block;
	transition: background .18s ease, transform .18s ease;
}
.entry-content .wp-block-button__link:hover,
.ytb-page a.ytb-btn:hover {
	background: var(--theme-palette-color-2);
	transform: translateY(-1px);
	color: #fff;
}

.ytb-page .ytb-eyebrow,
.ytb-page .ytb-kicker {
	color: var(--ytb-gold-deep);
	font-weight: 700;
	letter-spacing: .08em;
	font-size: .82em;
}

/* 表单（联系页 / 留言） */
input[type="text"], input[type="email"], input[type="tel"],
input[type="url"], input[type="number"], input[type="search"],
textarea, select {
	border: 1px solid var(--ytb-line-strong);
	border-radius: var(--ytb-radius-sm);
	padding: .72em .9em;
	font-size: 15px;
	color: var(--ytb-ink);
	background: #fff;
	transition: border-color .18s ease, box-shadow .18s ease;
}
input[type="text"]:focus, input[type="email"]:focus, input[type="tel"]:focus,
input[type="url"]:focus, input[type="number"]:focus, input[type="search"]:focus,
textarea:focus, select:focus {
	border-color: var(--theme-palette-color-1);
	box-shadow: 0 0 0 3px rgba(47, 93, 58, .1);
	outline: none;
}
button, input[type="submit"], .wp-block-button__link {
	font-family: inherit;
}

/* 侧边栏 / 小工具 */
.widget-area .widget-title,
.ct-sidebar .widget-title {
	color: var(--theme-palette-color-3);
	font-size: 16px;
	font-weight: 700;
	padding-bottom: .6em;
	border-bottom: 2px solid var(--theme-palette-color-5);
	margin-bottom: 14px;
}

/* 内容容器统一宽度（含侧栏页面不受影响） */
.ct-container:not(.ct-container-full) { --container-max-width: var(--ytb-container); }

/* ==========================================================================
   7. 响应式：移动端阅读与触控
   ========================================================================== */
@media (max-width: 782px) {
	body { line-height: 1.8; font-size: 16px; }

	.entry-content h1, h1 { font-size: 26px; }
	.entry-content h2, h2 { font-size: 21px; }
	.entry-content h3, h3 { font-size: 17.5px; }

	.ct-container { padding-left: 18px; padding-right: 18px; }

	/* 表格：手机上允许横向滚动而不挤压文字 */
	.entry-content table,
	.ytb-page table {
		font-size: .93em;
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	.entry-content table th, .entry-content table td,
	.ytb-page table th, .ytb-page table td { padding: .6em .7em; }

	/* 触控目标：导航与按钮不小于 44px 高度 */
	.ct-header .ct-button,
	.ct-header [data-id="button"] .ct-button { padding: .8em 1.3em; }

	.entry-content .wp-block-button__link,
	.ytb-page a.ytb-btn { padding: .85em 1.6em; }

	/* 中文标题避免单行过长 */
	h1, h2, h3 { letter-spacing: 0; }
}

@media (max-width: 480px) {
	.ct-container { padding-left: 16px; padding-right: 16px; }
	.page-description { font-size: 15px; }
}

/* ==========================================================================
   8. 动效与可达性
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
	*, *:before, *:after {
		transition: none !important;
		animation: none !important;
		scroll-behavior: auto !important;
	}
}

/* 打印：去掉导航与阴影 */
@media print {
	.ct-header, .ct-footer, .ytb-footer-nav, .ytb-mbar { display: none !important; }
	#ytb-home .ytbh-hero { min-height: 0; }
}
