/*
Theme Name: KTXD Binh Dinh
Theme URI: https://ktxdbinhdinh.vn
Author: KTXD Binh Dinh
Description: Theme code sach cho website Cong ty TNHH Ky thuat Xay dung Binh Dinh - khong phu thuoc Elementor hay page builder nao.
Requires at least: 6.7
Tested up to: 7.0
Requires PHP: 7.4
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: ktxd-binhdinh
*/

/* ===== 1. RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	font-family: 'Be Vietnam Pro', -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--ink-soft);
	line-height: 1.7;
	background: #fff;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; color: var(--ink); font-weight: 800; letter-spacing: -.02em; text-wrap: balance; }
p { margin: 0 0 1em; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--orange); color: #fff; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
	outline: 2px solid var(--orange); outline-offset: 2px;
}

/* ===== 2. TOKENS — Cam (Orange) & Trắng (White) ===== */
:root {
	--orange: #E8890C;
	--orange-dark: #C06B05;
	--orange-light: #FDEAC7;
	--cream: #FFF8EF;
	--ink: #211B14;
	--ink-soft: #47402F;
	--text-gray: #6B6355;
	--border: #EEE2D0;
	--container: 1180px;
	--radius: 16px;
	--radius-sm: 10px;
	--shadow-orange: 0 18px 34px -14px rgba(232,137,12,.4);
	--shadow-ink: 0 16px 32px -14px rgba(33,27,20,.2);
	--green: #1B8A4A;
	--green-dark: #146836;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.section { padding: 72px 0; }
.section-alt { background: var(--cream); }
.section-title { text-align: center; margin-bottom: 44px; }
.section-title .eyebrow { display: block; color: var(--orange-dark); font-weight: 700; letter-spacing: .1em; font-size: .8rem; text-transform: uppercase; margin-bottom: 10px; }
.section-title h2 { font-size: 2.1rem; }

.btn { display: inline-block; padding: 14px 30px; border-radius: 999px; font-weight: 700; border: 2px solid transparent; transition: .25s cubic-bezier(.2,.8,.2,1); cursor: pointer; }
.btn-primary { background: var(--orange); color: #fff; box-shadow: var(--shadow-orange); }
.btn-primary:hover { background: var(--orange-dark); transform: translateY(-2px); }
.btn-primary:active { transform: translateY(0) scale(.97); }
.btn-white { background: #fff; color: var(--orange-dark); }
.btn-white:hover { background: var(--orange-light); transform: translateY(-2px); }
.btn-white:active { transform: translateY(0) scale(.97); }
.btn-outline { border-color: #fff; color: #fff; }
.btn-outline:hover { background: #fff; color: var(--orange-dark); }
.btn-outline:active { transform: scale(.97); }
.btn-ink-outline { border-color: var(--ink); color: var(--ink); }
.btn-ink-outline:hover { background: var(--ink); color: #fff; transform: translateY(-2px); }
.btn-ink-outline:active { transform: scale(.97); }
.btn-cta { background: var(--orange); color: #fff; }
.btn-cta:hover { background: var(--orange-dark); }

/* ===== 3. HEADER ===== */
.site-header { position: sticky; top: 0; z-index: 100; background: #fff; box-shadow: 0 2px 10px rgba(33,27,20,.06); }
.site-header .inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 12px 20px; max-width: var(--container); margin: 0 auto; flex-wrap: nowrap; }
.site-branding { display: flex; align-items: center; gap: 10px; flex: none; }
.site-branding img { max-height: 52px; width: auto; flex: none; }
.main-nav { flex: 1; display: flex; justify-content: center; }

.main-nav ul { display: flex; align-items: center; gap: 6px; }
.main-nav li { position: relative; }
.main-nav a { display: block; padding: 10px 14px; font-weight: 700; color: var(--green); border-radius: 8px; transition: .2s; }
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--orange-dark); background: var(--orange-light); }
.main-nav .sub-menu { display: none; position: absolute; top: 100%; left: 0; background: #fff; box-shadow: var(--shadow-ink); border-radius: var(--radius-sm); padding: 8px; min-width: 220px; }
.main-nav li:hover > .sub-menu { display: block; }
.main-nav .sub-menu a { white-space: nowrap; }

.header-cta { display: flex; align-items: center; gap: 14px; }
.header-phone { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--orange-dark); }
.header-phone svg { flex: none; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--ink); }

@media (max-width: 900px) {
	.main-nav { position: fixed; inset: 64px 0 0 0; background: #fff; transform: translateX(100%); transition: .25s; overflow-y: auto; padding: 20px; }
	.main-nav.is-open { transform: translateX(0); }
	.main-nav ul { flex-direction: column; align-items: stretch; }
	.main-nav .sub-menu { position: static; box-shadow: none; padding-left: 12px; display: block; }
	.nav-toggle { display: block; }
	.header-phone span.label { display: none; }
}

/* ===== 4. HERO ===== */
.hero {
	position: relative;
	background:
		linear-gradient(115deg, rgba(232,137,12,.94) 0%, rgba(232,137,12,.75) 40%, rgba(245,185,66,.55) 100%),
		url('https://staging.ktxdbinhdinh.vn/wp-content/uploads/2026/07/Cong-trinh-6.jpg') center/cover no-repeat;
	color: #fff;
	overflow: hidden;
}
.hero .sparkle { position: absolute; z-index: 1; pointer-events: none; opacity: .9; }
.hero .sparkle-1 { top: 14%; right: 22%; width: 34px; height: 34px; color: var(--green); }
.hero .sparkle-2 { top: 62%; right: 6%; width: 22px; height: 22px; color: #fff; }
.hero .sparkle-3 { bottom: 10%; left: 4%; width: 18px; height: 18px; color: rgba(255,255,255,.7); display: none; }
.hero .inner { max-width: var(--container); margin: 0 auto; padding: 100px 20px 112px; position: relative; z-index: 2; }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .14em; font-weight: 700; margin-bottom: 16px; font-size: .82rem; color: var(--green); background: #fff; display: inline-block; padding: 6px 14px; border-radius: 999px; }
.hero h1 { color: var(--ink); font-size: clamp(2.3rem, 5.2vw, 3.7rem); max-width: 660px; }
.hero p { max-width: 540px; font-size: 1.08rem; color: var(--ink-soft); font-weight: 500; }
.hero .hero-actions { display: flex; gap: 16px; margin-top: 28px; flex-wrap: wrap; }
@media (max-width: 700px) { .hero .sparkle-1, .hero .sparkle-2 { display: none; } }

/* ===== 5. SERVICE CARDS ===== */
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 20px; }
.service-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 30px 24px; text-align: left; transition: .3s cubic-bezier(.2,.8,.2,1); position: relative; overflow: hidden; }
.service-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--orange); transform: scaleX(0); transform-origin: left; transition: .3s; }
.service-card:hover::before { transform: scaleX(1); }
.service-card:hover { box-shadow: var(--shadow-ink); transform: translateY(-6px); }
.service-card .icon { width: 56px; height: 56px; margin: 0 auto 18px; color: var(--orange); }
.service-card h3 { font-size: 1.05rem; color: var(--ink); }
.service-card p { color: var(--text-gray); font-size: .92rem; margin: 0; }

@media (max-width: 900px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .services-grid { grid-template-columns: 1fr; } }

/* ===== 6. ABOUT / TWO COLUMN ===== */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 52px; align-items: center; }
.about-grid > div:first-child { position: relative; }
.about-grid > div:first-child::before {
	content: ""; position: absolute; inset: 18px -18px -18px 18px; background: var(--orange-light);
	border-radius: var(--radius); z-index: -1;
}
.about-grid img { border-radius: var(--radius); }
.stat-badge { display: inline-flex; align-items: center; gap: 12px; background: var(--orange); color: #fff; padding: 16px 22px; border-radius: var(--radius-sm); font-weight: 700; margin-top: -40px; margin-left: 20px; position: relative; box-shadow: var(--shadow-orange); }
.stat-badge .num { font-size: 2rem; }
@media (max-width: 800px) { .about-grid { grid-template-columns: 1fr; } .about-grid > div:first-child::before { display: none; } }

/* ===== 7. PROJECTS GRID (masonry-style, breaks perfect symmetry) ===== */
.projects-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 150px; grid-auto-flow: dense; gap: 18px; }
.project-card { border-radius: var(--radius); overflow: hidden; position: relative; }
.project-card:nth-child(1), .project-card:nth-child(6) { grid-column: span 2; grid-row: span 2; }
.project-card img { width: 100%; height: 100%; object-fit: cover; transition: .5s cubic-bezier(.2,.8,.2,1); }
.project-card:hover img { transform: scale(1.07); }
.project-card:hover { box-shadow: var(--shadow-ink); }
.project-card .caption { position: absolute; inset: auto 0 0 0; background: linear-gradient(to top, rgba(33,27,20,.85), transparent); color: #fff; padding: 30px 16px 14px; font-weight: 700; font-size: .9rem; }
@media (max-width: 900px) {
	.projects-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 170px; }
}
@media (max-width: 560px) {
	.projects-grid { grid-template-columns: 1fr; }
	.project-card:nth-child(1), .project-card:nth-child(6) { grid-column: span 1; grid-row: span 1; }
}

/* ===== 8. BLOG ===== */
.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.post-card { background: #fff; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); transition: .3s; }
.post-card:hover { box-shadow: var(--shadow-ink); transform: translateY(-4px); }
.post-card img { aspect-ratio: 16/10; object-fit: cover; }
.post-card img.post-thumb-fallback { object-fit: contain; background: var(--orange-light); padding: 34px 44px; }
.post-card .post-body { padding: 20px; }
.post-card .meta { font-size: .8rem; color: var(--text-gray); margin-bottom: 8px; }
.post-card h3 { font-size: 1.05rem; }
.post-card h3 a:hover { color: var(--orange-dark); }
.post-card .excerpt { color: var(--text-gray); font-size: .92rem; }
@media (max-width: 900px) { .posts-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .posts-grid { grid-template-columns: 1fr; } }

/* ===== 9. FOOTER ===== */
.site-footer { background: var(--ink); color: #fff; }
.footer-top { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; background: rgba(255,255,255,.06); padding: 24px 0; }
.footer-top .item { display: flex; align-items: center; gap: 10px; font-size: .92rem; }
.footer-cols { display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: 40px; padding: 52px 0 28px; }
.footer-cols h4 { color: #fff; font-size: 1.05rem; margin-bottom: 18px; position: relative; padding-bottom: 12px; }
.footer-cols h4::after { content: ""; position: absolute; left: 0; bottom: 0; width: 32px; height: 2px; background: var(--orange); }
.footer-cols p, .footer-cols a { color: rgba(255,255,255,.78); font-size: .92rem; }
.footer-cols li { margin-bottom: 8px; }
.footer-cols a:hover { color: var(--orange-light); }
.footer-social a { display: inline-flex; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.12); align-items: center; justify-content: center; margin-top: 10px; transition: .2s; }
.footer-social a:hover { background: var(--orange); }
.footer-bottom { text-align: center; padding: 16px 0; border-top: 1px solid rgba(255,255,255,.12); font-size: .82rem; color: rgba(255,255,255,.6); }
@media (max-width: 800px) { .footer-cols { grid-template-columns: 1fr; } }

/* ===== 10. GENERIC PAGE CONTENT ===== */
.page-hero { background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%); color: #fff; padding: 60px 0; text-align: center; }
.page-hero h1 { color: #fff; margin: 0; }
.page-hero .breadcrumb { opacity: .9; font-size: .9rem; margin-top: 10px; }
.entry-content { max-width: 860px; margin: 0 auto; padding: 56px 20px; }
.entry-content h2 { color: var(--ink); margin-top: 1.4em; }
.entry-content img { border-radius: var(--radius); margin: 1em 0; }
.entry-content ul { list-style: disc; padding-left: 1.4em; margin-bottom: 1em; }
.entry-content table { margin: 1.5em 0; font-size: .92rem; }
.entry-content table th, .entry-content table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.entry-content table th { background: var(--orange-light); color: var(--ink); }
.entry-content table caption { font-weight: 700; text-align: left; margin-bottom: 8px; color: var(--ink); }
.table-scroll { overflow-x: auto; margin: 1.5em 0; }

/* Contact page */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; max-width: var(--container); margin: 0 auto; padding: 56px 20px; }
.contact-card { display: flex; gap: 14px; align-items: flex-start; background: var(--cream); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.contact-card .ic { width: 42px; height: 42px; flex: none; background: var(--orange); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.contact-form label { display: block; font-weight: 700; margin-bottom: 6px; font-size: .92rem; }
.contact-form input, .contact-form select, .contact-form textarea { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 16px; font-family: inherit; font-size: .95rem; transition: .2s; }
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-light); outline: none; }
.contact-form button { width: 100%; }
.form-msg { padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .92rem; }
.form-msg.success { background: #E8F5E9; color: #1B5E20; }
.form-msg.error { background: #FDEAEA; color: #A33; }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }

/* Org chart */
.org-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 30px 0; }
.org-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; transition: .2s; }
.org-card:hover { box-shadow: var(--shadow-ink); transform: translateY(-4px); }
.org-card .role { color: var(--orange-dark); font-weight: 700; font-size: .82rem; text-transform: uppercase; }
.org-card h4 { margin: 4px 0; }
.org-card .spec { color: var(--text-gray); font-size: .85rem; }
@media (max-width: 800px) { .org-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .org-grid { grid-template-columns: 1fr; } }

/* Legal docs table */
.legal-list { display: grid; gap: 10px; margin: 20px 0; }
.legal-list a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--cream); border-radius: var(--radius-sm); border: 1px solid var(--border); transition: .2s; }
.legal-list a:hover { background: var(--orange-light); }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 10px 16px; z-index: 999; }
.skip-link:focus { left: 10px; top: 10px; }

/* Lab page (LAS-XD 1749) */
.lab-hero { background: linear-gradient(135deg, var(--orange) 0%, var(--orange-dark) 100%); color: #fff; padding: 60px 0 44px; text-align: center; }
.lab-hero h1 { color: #fff; margin: 0 0 .3em; }
.lab-hero .breadcrumb { opacity: .9; font-size: .9rem; margin-bottom: 18px; }
.lab-hero .tagline { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: .95rem; }
.lab-hero .tagline span { padding: 6px 16px; border: 1px solid rgba(255,255,255,.5); border-radius: 999px; }
.quote-block { background: var(--cream); border-left: 4px solid var(--orange); border-radius: var(--radius-sm); padding: 22px 26px; margin: 1.5em 0; font-style: italic; color: var(--ink); }
.quote-block cite { display: block; margin-top: 10px; font-style: normal; font-weight: 700; color: var(--text-gray); font-size: .9rem; }
.cat-h3 { margin-top: 1.6em; padding-top: .6em; border-top: 2px solid var(--border); }
.entry-content h4 { color: var(--orange-dark); font-size: 1rem; text-transform: uppercase; letter-spacing: .03em; margin-top: 1.6em; }
.entry-content table tr.group-row td { background: var(--orange-light); color: var(--ink); font-weight: 700; }
.lab-contact-box { background: var(--cream); border-radius: var(--radius); padding: 24px; margin: 2em 0; }
.lab-contact-box h3 { margin-top: 0; }
