﻿/*
Theme Name: CHACH
Theme URI: 
Author: CHACHE
Description: 叉车企业站模板。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
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: dtka
Tags: custom-logo, custom-menu, translation-ready, one-column
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
	--dtka-blue:        #0b57c2;   /* 品牌主蓝 */
	--dtka-blue-dark:   #08408f;
	--dtka-blue-soft:   #eef4ff;
	--dtka-red:         #e7161c;   /* logo 红（取自 logo111.png 实测均值） */
	--dtka-orange:      #e7161c;   /* 页头强调色：顶部信息条 + 强调链接（原橙，现随 logo 改红） */
	--dtka-orange-dark: #b80f14;
	--dtka-nav-gray:    #212121;   /* 导航条底色 + 灰色胶囊按钮（偏黑） */
	--dtka-nav-gray-dk: #000000;
	--dtka-text:        #1f2937;
	--dtka-heading:     #0f172a;
	--dtka-muted:       #6b7280;
	--dtka-bg:          #ffffff;   /* 主背景：白 */
	--dtka-border:      #e6e8eb;
	--dtka-footer-bg:   #12233f;   /* 页脚深蓝 */
	--dtka-footer-text: #b9c4d6;
	--dtka-header-h:    120px;
	--dtka-topbar-h:    43px;
	--dtka-nav-h:       46px;
	--dtka-radius:      6px;
	--dtka-shadow:      0 12px 30px rgba(2, 16, 48, .12);
	--dtka-container:   1100px;
	--dtka-transition:  .18s ease;
}

/* ==========================================================================
   Base / reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", Roboto, Helvetica, Arial, sans-serif;
	font-size: 16px;
	line-height: 1.7;
	color: var(--dtka-text);
	background: var(--dtka-bg);
}
h1, h2, h3, h4, h5, h6 { color: var(--dtka-heading); line-height: 1.3; margin: 0 0 .5em; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--dtka-blue); text-decoration: none; transition: color var(--dtka-transition); }
a:hover { color: var(--dtka-blue-dark); }
img { max-width: 100%; height: auto; display: block; }
ul { margin: 0; padding: 0; }

.container {
	width: 100%;
	max-width: var(--dtka-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;
}
.skip-link {
	position: absolute; left: -9999px; top: 0;
	background: var(--dtka-blue); color: #fff; padding: 10px 16px; z-index: 9999;
}
.skip-link:focus { left: 0; color: #fff; }

/* ==========================================================================
   Topbar — orange slogan bar: welcome text (left) + Global + social rings (right)
   ========================================================================== */
.header-topbar {
	background: var(--dtka-orange);
	font-size: 13px;
	color: #fff;
}
.topbar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	min-height: var(--dtka-topbar-h);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-welcome {
	color: #fff;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .2px;
}

.topbar-right { display: flex; align-items: center; gap: 20px; }

/* Language slot — falls back to a plain "Global" link when no widget is set. */
.topbar-lang { display: flex; align-items: center; gap: 10px; color: #fff; }
.topbar-global {
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	text-decoration: underline;
}
.topbar-global:hover { color: #fff; opacity: .85; }

/* White rings on the orange field — not brand-coloured discs. */
.topbar-social { display: flex; align-items: center; gap: 8px; }
.social-circle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px; height: 26px;
	border: 1px solid rgba(255, 255, 255, .9);
	border-radius: 50%;
	color: #fff;
	transition: transform .2s ease, background .2s ease, color .2s ease;
}
.social-circle svg { width: 12px; height: 12px; }
.social-circle:hover { background: #fff; color: var(--dtka-orange); transform: translateY(-2px); }

@media (max-width: 992px) {
	.header-topbar { display: none; }
}

/* ==========================================================================
   Header — white row: logo (left) + phone / pricing / portal (right)
   ========================================================================== */
.site-header { background: var(--dtka-bg); }
.header-inner {
	display: flex;
	align-items: center;
	gap: 24px;
	min-height: var(--dtka-header-h);
}

/* Branding / logo */
.site-branding { flex: 0 0 auto; }
.custom-logo-link { display: inline-flex; align-items: center; }
.custom-logo { max-height: 112px; width: auto; }
.brand-text { display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none; }
.brand-mark { font-weight: 900; font-size: 30px; letter-spacing: -1px; line-height: 1; }
.brand-dt { color: var(--dtka-red); }
.brand-ka { color: var(--dtka-blue); }
.brand-name { font-size: 15px; font-weight: 600; color: var(--dtka-heading); letter-spacing: 1px; }

/* Header contact block — phone, gray pill button, portal links. */
.header-contact {
	flex: 0 0 auto;
	margin-left: auto;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 7px;
}
.header-phone {
	font-size: 22px;
	font-weight: 800;
	line-height: 1.15;
	color: var(--dtka-heading);
	white-space: nowrap;
}
.header-phone:hover { color: var(--dtka-orange); }
.header-pricing-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 30px;
	padding: 0 26px;
	border-radius: 999px;
	background: var(--dtka-nav-gray);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .5px;
	text-transform: uppercase;
	white-space: nowrap;
	transition: background .2s ease;
}
.header-pricing-btn:hover { background: var(--dtka-nav-gray-dk); color: #fff; }
.header-portal { display: flex; align-items: center; font-size: 14px; }
.header-portal ul { display: flex; align-items: center; list-style: none; }
.header-portal li + li::before { content: "|"; color: #b6b7b9; margin: 0 9px; }
.header-portal a {
	color: var(--dtka-orange);
	font-weight: 700;
	text-transform: uppercase;
	text-decoration: underline;
}
.header-portal a:hover { color: var(--dtka-orange-dark); }
.header-portal .portal-sep { color: #b6b7b9; margin: 0 9px; }

/* Main navigation — full-width gray bar, centred items split by pipes.
   Only this bar sticks, so the 120px logo row scrolls away with the page. */
.site-nav-bar {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--dtka-nav-gray);
}
.site-navigation { display: flex; justify-content: center; }
.primary-menu { display: flex; justify-content: center; }
.primary-menu > ul {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	list-style: none;
}
.primary-menu > ul > li { display: flex; align-items: center; }
.primary-menu > ul > li + li::before { content: "|"; color: rgba(255, 255, 255, .42); }
.primary-menu > ul > li > a {
	display: inline-flex;
	align-items: center;
	height: var(--dtka-nav-h);
	padding: 0 13px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .4px;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .88);
	white-space: nowrap;
}
.primary-menu > ul > li > a:hover,
.primary-menu > ul > .current-menu-item > a,
.primary-menu > ul > .current-menu-ancestor > a,
.primary-menu > ul > .current_page_item > a {
	color: #fff;
	font-weight: 700;
}

/* Desktop carets */
.primary-menu > ul > .menu-item-has-children > a::after {
	content: "";
	width: 7px; height: 7px;
	margin-left: 8px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-2px);
	transition: transform var(--dtka-transition);
}
.sub-menu .menu-item-has-children > a::after {
	content: "";
	width: 7px; height: 7px;
	margin-left: auto;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	transform: rotate(45deg);
}

/* Dropdown panels (level 2 & 3) */
.primary-menu .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 232px;
	list-style: none;
	background: #fff;
	border: 1px solid var(--dtka-border);
	border-top: 3px solid var(--dtka-orange);
	border-radius: 0 0 var(--dtka-radius) var(--dtka-radius);
	box-shadow: var(--dtka-shadow);
	padding: 8px 0;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity var(--dtka-transition), transform var(--dtka-transition), visibility var(--dtka-transition);
	z-index: 120;
}
.primary-menu li { position: relative; }
.primary-menu li:hover > .sub-menu,
.primary-menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}
.primary-menu .sub-menu li { width: 100%; }
.primary-menu .sub-menu a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 20px;
	font-size: 15px;
	color: var(--dtka-text);
	white-space: nowrap;
}
.primary-menu .sub-menu a:hover {
	color: var(--dtka-orange);
	background: #fbe9ea;
}
/* Level 3 flyout to the right */
.primary-menu .sub-menu .sub-menu {
	top: -8px;
	left: 100%;
	border-top-width: 1px;
	border-left: 3px solid var(--dtka-orange);
	border-radius: 0 var(--dtka-radius) var(--dtka-radius) 0;
}


/* Mobile toggle (hidden on desktop) */
.menu-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px; height: 44px;
	background: transparent;
	border: 1px solid var(--dtka-border);
	border-radius: var(--dtka-radius);
	cursor: pointer;
}
.menu-toggle-box { position: relative; width: 20px; height: 14px; display: block; }
.menu-toggle-bar,
.menu-toggle-bar::before,
.menu-toggle-bar::after {
	position: absolute;
	left: 0;
	width: 20px; height: 2px;
	background: var(--dtka-heading);
	content: "";
	transition: transform var(--dtka-transition), opacity var(--dtka-transition);
}
.menu-toggle-bar { top: 6px; }
.menu-toggle-bar::before { top: -6px; }
.menu-toggle-bar::after { top: 6px; }
.menu-toggle.is-active .menu-toggle-bar { background: transparent; }
.menu-toggle.is-active .menu-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle.is-active .menu-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

.sub-toggle { display: none; }

/* ==========================================================================
   Main content (minimal scaffolding)
   ========================================================================== */
.site-main { min-height: 50vh; }
.menu-hint {
	padding: 16px 20px;
	color: var(--dtka-muted);
	font-size: 14px;
	background: var(--dtka-blue-soft);
	border-radius: var(--dtka-radius);
}
/* The hint renders inside the gray nav bar, where the blue-soft box is unreadable. */
.site-nav-bar .menu-hint {
	background: transparent;
	color: #fff;
	padding: 12px 0;
}

/* ==========================================================================
   Responsive — mobile drawer + accordion (supports 3 levels)
   ========================================================================== */
@media (max-width: 992px) {
	/* row-gap:0 — the collapsed nav is its own zero-height flex line; a row gap
	   would still push 12px of blank space under the logo row. */
	.header-inner { flex-wrap: wrap; gap: 0 12px; padding: 8px 16px; min-height: 0; }
	.site-branding { order: 1; }
	.custom-logo { max-height: 46px; }
	.menu-toggle { order: 2; display: inline-flex; margin-left: auto; }

	/* Phone / pricing / portal block is a desktop affordance; on mobile the
	   floating contact bar and the footer already carry it. */
	.header-contact { display: none; }

	/* The gray bar collapses to a zero-height drawer under the logo row. */
	.site-nav-bar { position: static; }
	.site-navigation,
	.primary-menu { justify-content: flex-start; }
	.site-navigation {
		max-height: 0;
		overflow: hidden;
		transition: max-height .3s ease;
	}
	.site-navigation.is-open { max-height: 75vh; overflow-y: auto; }

	.primary-menu > ul { flex-direction: column; align-items: stretch; }
	.primary-menu > ul > li + li::before { display: none; }

	/* One flex line per row: link + its toggle, submenu wrapped onto its own line.
	   Keeps a parent toggle from stretching over the rows it contains. */
	.primary-menu li { display: flex; flex-wrap: wrap; align-items: stretch; }
	.primary-menu li > a { flex: 1 1 auto; min-width: 0; }
	.primary-menu > ul > li > a {
		display: flex;
		align-items: center;
		height: auto;
		padding: 14px 8px;
		font-size: 14px;
		text-transform: none;
		border-bottom: 1px solid rgba(255, 255, 255, .16);
	}
	.primary-menu > ul > li > a:hover,
	.primary-menu > ul > .current-menu-item > a { font-weight: 600; }
	.primary-menu > ul > .menu-item-has-children > a::after { display: none; }

	/* Submenus become static accordions */
	.primary-menu .sub-menu {
		flex: 1 1 100%;
		order: 3;
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: none;
		border-radius: 0;
		padding: 0;
		min-width: 0;
		display: none;
		background: rgba(0, 0, 0, .12);
	}
	.primary-menu li.submenu-open > .sub-menu { display: block; }
	.primary-menu .sub-menu a {
		white-space: normal;
		padding: 12px 8px 12px 22px;
		font-size: 14px;
		text-transform: none;
		color: rgba(255, 255, 255, .8);
		border-bottom: 1px solid rgba(255, 255, 255, .12);
	}
	.primary-menu .sub-menu a:hover { color: #fff; background: rgba(0, 0, 0, .1); }
	.primary-menu .sub-menu .sub-menu { border-left: 3px solid var(--dtka-orange); background: rgba(0, 0, 0, .06); }
	.primary-menu .sub-level-3 a { padding-left: 40px; font-size: 13px; }
	.sub-menu .menu-item-has-children > a::after { display: none; }

	/* Mobile submenu toggle buttons — confined to their own row. */
	.sub-toggle {
		display: inline-flex;
		flex: 0 0 52px;
		align-items: center;
		justify-content: center;
		width: 52px;
		background: transparent;
		border: none;
		border-bottom: 1px solid rgba(255, 255, 255, .16);
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
		touch-action: manipulation;
	}
	li.submenu-open > .sub-toggle { border-bottom-color: transparent; }
	.sub-toggle-icon {
		width: 9px; height: 9px;
		border-right: 2px solid #fff;
		border-bottom: 2px solid #fff;
		transform: rotate(45deg);
		transition: transform var(--dtka-transition);
	}
	li.submenu-open > .sub-toggle .sub-toggle-icon { transform: rotate(225deg); }

}

@media (max-width: 560px) {
	.brand-mark { font-size: 26px; }
}
