/*
Theme Name: Lightning Child — Crane WMS
Theme URI: https://cranewms.fstv.vn
Description: Child theme của Lightning cho website giới thiệu Crane WMS (FA System & Technology Vietnam). Bố cục tham khảo amatec.co.jp.
Author: FA System & Technology Vietnam
Template: lightning
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lightning-child-cranewms
*/

/* ------------------------------------------------------------------
 * Màu & biến
 * ------------------------------------------------------------------ */
:root {
	--cw-green: #569638;        /* màu logo FSTV */
	--cw-green-dark: #3d6e27;
	--cw-green-pale: #eef5ea;
	--cw-ink: #1f2a1b;
	--cw-gray: #f5f6f4;
	--cw-line: #dfe3dc;
	--cw-radius: 6px;
	--cw-shadow: 0 6px 24px rgba(31, 42, 27, 0.08);
	--cw-font-ja: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
	--cw-font-latin: "Noto Sans", "Segoe UI", Roboto, Arial, sans-serif;
}

body {
	color: var(--cw-ink);
	font-family: var(--cw-font-latin);
}
body.cw-lang-ja {
	font-family: var(--cw-font-ja);
}

/* ------------------------------------------------------------------
 * Header & menu 2 dòng (nhãn chính + nhãn tiếng Anh nhỏ = "Description" của mục menu)
 * ------------------------------------------------------------------ */
.site-header {
	box-shadow: 0 1px 0 var(--cw-line);
}
.site-header-logo img {
	max-height: 48px;
	width: auto;
}
.global-nav-list > li > a {
	padding-left: 1.1em;
	padding-right: 1.1em;
}
.global-nav-list > li .global-nav-name {
	font-weight: 700;
	letter-spacing: 0.04em;
}
.global-nav-list > li .global-nav-description {
	display: block;
	font-size: 10px;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--cw-green);
	opacity: 1;
}

/* Nút chuyển ngôn ngữ */
.cw-lang-switcher {
	order: 3;
	margin-left: 1rem;
	align-self: center;
}
.cw-lang-switcher ul {
	display: flex;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
	border: 1px solid var(--cw-line);
	border-radius: 999px;
	overflow: hidden;
}
.cw-lang-switcher li {
	margin: 0;
}
.cw-lang-switcher a,
.cw-lang-switcher span {
	display: block;
	padding: 4px 10px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.06em;
	text-decoration: none;
	color: var(--cw-ink);
}
.cw-lang-switcher a:hover {
	background: var(--cw-green-pale);
}
.cw-lang-switcher .is-current span {
	background: var(--cw-green);
	color: #fff;
}
@media (max-width: 991.98px) {
	/* Mobile: đặt cạnh logo, chừa chỗ cho nút menu của Lightning */
	.site-header-container {
		display: flex;
		align-items: center;
	}
	/* Nút menu mobile của Lightning nằm góc trái → đẩy logo sang phải */
	.site-header-logo {
		margin-left: 44px;
	}
	.cw-lang-switcher {
		margin-left: auto;
		margin-right: 0;
	}
}

/* ------------------------------------------------------------------
 * Tiện ích dùng trong nội dung (class gán cho block)
 * ------------------------------------------------------------------ */
.cw-section {
	padding-top: 72px;
	padding-bottom: 72px;
}
.cw-section--gray {
	background: var(--cw-gray);
}
.cw-section--green {
	background: var(--cw-green-pale);
}

/* Tiêu đề section: dòng tiếng Anh nhỏ phía trên + tiêu đề chính */
p.cw-eyebrow {
	margin: 0 0 0.25em;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	text-align: center;
	color: var(--cw-green);
}
h2.cw-title,
.entry-body h2.cw-title {
	margin-top: 0;
	margin-bottom: 1.5em;
	padding: 0 0 0.6em;
	border: 0;
	background: none;
	text-align: center;
	font-size: clamp(1.4rem, 2.6vw, 2rem);
	position: relative;
}
h2.cw-title::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 0;
	width: 48px;
	height: 3px;
	margin-left: -24px;
	background: var(--cw-green);
	border-radius: 2px;
}
h2.cw-title::before {
	display: none;
}
p.cw-lead {
	max-width: 760px;
	margin-left: auto;
	margin-right: auto;
	text-align: center;
	line-height: 2;
}

/* Hero */
.cw-hero {
	position: relative;
	padding: clamp(80px, 14vw, 180px) 24px;
	background: var(--cw-ink) url("assets/img/hero.jpg") center / cover no-repeat;
	color: #fff;
	text-align: center;
	overflow: hidden;
}
.cw-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(120deg, rgba(31, 42, 27, 0.78), rgba(61, 110, 39, 0.45));
}
.cw-hero > * {
	position: relative;
}
.cw-hero p.cw-hero__en {
	margin: 0 0 0.5em;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: #c9e8b8;
}
.cw-hero h2.cw-hero__title,
.entry-body .cw-hero h2.cw-hero__title {
	margin: 0 0 0.6em;
	padding: 0;
	border: 0;
	background: none;
	color: #fff;
	font-size: clamp(1.8rem, 4.4vw, 3.2rem);
	line-height: 1.3;
}
.cw-hero h2.cw-hero__title::before,
.cw-hero h2.cw-hero__title::after {
	display: none;
}
.cw-hero p.cw-hero__lead {
	max-width: 720px;
	margin: 0 auto 2em;
	font-size: 1.05rem;
	line-height: 1.9;
}

/* 3 khối giới thiệu (teaser) dưới hero */
.cw-teasers {
	margin-top: -56px;
	position: relative;
	z-index: 2;
	gap: 24px;
}
.cw-teasers > .wp-block-column {
	padding: 28px 28px 20px;
	background: #fff;
	border-top: 4px solid var(--cw-green);
	border-radius: var(--cw-radius);
	box-shadow: var(--cw-shadow);
}
.cw-teasers h3 {
	margin-top: 0;
	font-size: 1.15rem;
	border: 0;
	padding: 0;
}
.cw-teasers h3::after {
	display: none;
}

/* Thẻ có icon (Take quick action / 技術力 / 商品開発 kiểu amatec) */
.cw-icon-cards {
	gap: 32px;
}
.cw-icon-cards > .wp-block-column {
	text-align: center;
	padding: 32px 24px;
	background: #fff;
	border-radius: var(--cw-radius);
	box-shadow: var(--cw-shadow);
}
.cw-icon-cards h3 {
	margin-top: 0;
	padding: 0;
	border: 0;
	font-size: 1.15rem;
}
.cw-icon-cards h3::after {
	display: none;
}
.cw-icon-cards h3::before {
	content: "";
	display: block;
	width: 72px;
	height: 72px;
	margin: 0 auto 18px;
	border-radius: 50%;
	background: var(--cw-green) var(--cw-icon) center / 40px no-repeat;
}
/* Icon (SVG inline, không phụ thuộc thư viện ngoài) */
.cw-icon-speed { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M13 2 3 14h7l-1 8 10-12h-7z'/%3E%3C/svg%3E"); }
.cw-icon-chart { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M3 21V3h2v16h16v2zm4-4v-6h3v6zm5 0V7h3v10zm5 0v-8h3v8z'/%3E%3C/svg%3E"); }
.cw-icon-link { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M10.6 13.4a1 1 0 0 1 0-1.4l3.5-3.5a3 3 0 1 1 4.3 4.3l-2.1 2.1-1.4-1.4 2.1-2.1a1 1 0 1 0-1.5-1.5L12 13.4a1 1 0 0 1-1.4 0zM13.4 10.6a1 1 0 0 1 0 1.4l-3.5 3.5a3 3 0 1 1-4.3-4.3l2.1-2.1 1.4 1.4-2.1 2.1a1 1 0 1 0 1.5 1.5L12 10.6a1 1 0 0 1 1.4 0z'/%3E%3C/svg%3E"); }
.cw-icon-box { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='m12 2 9 5v10l-9 5-9-5V7zm0 2.3L5.6 7.8 12 11.3l6.4-3.5zM5 9.5v6.3l6 3.4v-6.4zm14 0-6 3.3v6.4l6-3.4z'/%3E%3C/svg%3E"); }
.cw-icon-crane { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M3 3h18v3h-2v2h-2V6H9v14h3v2H3v-2h3V6H3zm14 7h2v3a2 2 0 1 1-2 0z'/%3E%3C/svg%3E"); }
.cw-icon-support { --cw-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M12 2a9 9 0 0 0-9 9v6a3 3 0 0 0 3 3h2v-8H5v-1a7 7 0 0 1 14 0v1h-3v8h3v1h-6v2h6a2 2 0 0 0 2-2v-9a9 9 0 0 0-9-9z'/%3E%3C/svg%3E"); }

/* Thẻ có ảnh (giải pháp / dịch vụ) */
.cw-image-cards {
	gap: 32px;
}
.cw-image-cards > .wp-block-column {
	background: #fff;
	border-radius: var(--cw-radius);
	overflow: hidden;
	box-shadow: var(--cw-shadow);
	padding-bottom: 16px;
}
.cw-image-cards .wp-block-image {
	margin: 0 0 16px;
}
.cw-image-cards .wp-block-image img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}
.cw-image-cards h3,
.cw-image-cards p {
	padding-left: 20px;
	padding-right: 20px;
}
.cw-image-cards h3 {
	margin-top: 0;
	border: 0;
	font-size: 1.1rem;
}
.cw-image-cards h3::after {
	display: none;
}

/* Thẻ link (công ty) */
.cw-link-cards {
	gap: 24px;
}
.cw-link-cards > .wp-block-column {
	padding: 28px;
	border: 1px solid var(--cw-line);
	border-radius: var(--cw-radius);
	background: #fff;
	transition: border-color 0.2s, transform 0.2s;
}
.cw-link-cards > .wp-block-column:hover {
	border-color: var(--cw-green);
	transform: translateY(-2px);
}
.cw-link-cards h3 {
	margin-top: 0;
	border: 0;
	padding: 0;
	font-size: 1.1rem;
}
.cw-link-cards h3::after {
	display: none;
}

/* Liên kết "Xem chi tiết" */
p.cw-more {
	margin-bottom: 0;
	text-align: right;
}
p.cw-more a {
	font-weight: 700;
	text-decoration: none;
	color: var(--cw-green-dark);
}
p.cw-more a::after {
	content: " →";
}

/* Nút */
.wp-block-button .wp-block-button__link,
.cw-btn {
	display: inline-block;
	padding: 0.8em 2.4em;
	border-radius: 999px;
	background: var(--cw-green);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	transition: background 0.2s;
}
.wp-block-button .wp-block-button__link:hover,
.cw-btn:hover {
	background: var(--cw-green-dark);
	color: #fff;
}
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	border: 2px solid currentColor;
	color: inherit;
}

/* Tin tức (Latest Posts) */
.cw-news.wp-block-latest-posts {
	max-width: 860px;
	margin: 0 auto;
	padding: 0;
}
.cw-news.wp-block-latest-posts li {
	display: flex;
	flex-wrap: wrap;
	gap: 0 24px;
	padding: 16px 4px;
	border-bottom: 1px solid var(--cw-line);
	margin: 0;
}
.cw-news.wp-block-latest-posts .wp-block-latest-posts__post-date {
	order: -1;
	min-width: 110px;
	color: var(--cw-green-dark);
	font-size: 0.9rem;
}

/* Dải CTA */
.cw-cta {
	padding: 64px 24px;
	background: linear-gradient(120deg, var(--cw-green-dark), var(--cw-green));
	color: #fff;
	text-align: center;
}
.cw-cta h2,
.entry-body .cw-cta h2 {
	color: #fff;
	border: 0;
	background: none;
	padding: 0;
	margin-top: 0;
}
.cw-cta h2::before,
.cw-cta h2::after {
	display: none;
}
.cw-cta .wp-block-button .wp-block-button__link {
	background: #fff;
	color: var(--cw-green-dark);
}
.cw-cta .wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: #fff;
}

/* Bảng thông tin công ty */
.cw-company-table,
.cw-spec-table table {
	width: 100%;
	border-collapse: collapse;
}
.cw-company-table th,
.cw-company-table td,
.cw-spec-table th,
.cw-spec-table td {
	padding: 14px 16px;
	border-bottom: 1px solid var(--cw-line);
	text-align: left;
	vertical-align: top;
}
.cw-company-table th,
.cw-spec-table th {
	width: 28%;
	background: var(--cw-gray);
	font-weight: 700;
}

/* FAQ (block Details) */
.cw-faq .wp-block-details {
	margin: 0 0 12px;
	padding: 16px 20px;
	border: 1px solid var(--cw-line);
	border-radius: var(--cw-radius);
	background: #fff;
}
.cw-faq .wp-block-details summary {
	font-weight: 700;
	cursor: pointer;
}
.cw-faq .wp-block-details summary::before {
	content: "Q. ";
	color: var(--cw-green);
}

/* Form liên hệ (Contact Form 7) */
.wpcf7 form p {
	margin-bottom: 1.2em;
}
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--cw-line);
	border-radius: 4px;
}
.wpcf7 input[type="submit"] {
	padding: 0.8em 3em;
	border: 0;
	border-radius: 999px;
	background: var(--cw-green);
	color: #fff;
	font-weight: 700;
	cursor: pointer;
}
.cw-required {
	margin-left: 6px;
	padding: 1px 6px;
	border-radius: 3px;
	background: #c0392b;
	color: #fff;
	font-size: 11px;
	vertical-align: middle;
}

/* ------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------ */
.cw-footer-company {
	padding: 48px 0;
	border-top: 1px solid var(--cw-line);
	background: #fff;
}
.cw-footer-company__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 32px;
	justify-content: space-between;
	align-items: center;
}
.cw-footer-company__logo {
	width: 180px;
	height: auto;
	margin-bottom: 12px;
}
.cw-footer-company p {
	margin: 0 0 4px;
	font-size: 0.92rem;
}
.cw-footer-company__name {
	font-weight: 700;
}
.cw-footer-company__cta {
	max-width: 420px;
}
.cw-footer-company__cta p {
	margin-bottom: 16px;
}
.site-footer-copyright p {
	font-size: 12px;
}

/* Trang chủ: bỏ khoảng trắng trên cùng để hero sát header */
.home .main-section > .entry-body > .cw-hero:first-child,
.home .site-body {
	padding-top: 0;
}
.home .entry-header {
	display: none;
}
