/* =========================================================
   TỈNH THÀNH VN — THEME STYLES
   Font: Be Vietnam Pro (nội dung) + Baloo 2 (tiêu đề)
   ========================================================= */

:root {
	--font-body: 'Be Vietnam Pro', system-ui, sans-serif;
	--font-display: 'Baloo 2', 'Be Vietnam Pro', system-ui, sans-serif;

	--c-blue: #2563eb;
	--c-sky: #0ea5e9;
	--c-cyan: #06b6d4;
	--c-green: #16a34a;
	--c-orange: #ea580c;
	--c-amber: #f59e0b;
	--c-pink: #db2777;
	--c-red: #dc2626;
	--c-purple: #9333ea;
	--c-gray-700: #374151;
	--c-gray-500: #6b7280;
	--container-max: 1280px;
}

html { scroll-behavior: smooth; }
body {
	font-family: var(--font-body);
	color: #1f2937;
	background: #f4f6f9;
	line-height: 1.5;
}
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 16px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* Gradient chữ động — chữ ký thị giác của trang: dải màu chạy ngang qua các từ khoá quan trọng */
.text-gradient {
	background: linear-gradient(90deg, var(--c-cyan), var(--c-blue), var(--c-green), var(--c-cyan));
	background-size: 300% auto;
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
	animation: ttvn-gradient-move 6s linear infinite;
}
@keyframes ttvn-gradient-move {
	0% { background-position: 0% 50%; }
	100% { background-position: 300% 50%; }
}
@media (prefers-reduced-motion: reduce) {
	.text-gradient { animation: none; }
}
.text-gradient-static {
	background: linear-gradient(90deg, var(--c-blue), var(--c-green));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255,255,255,.85);
	backdrop-filter: blur(6px);
	box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.site-header .container {
	display: flex; align-items: center; justify-content: space-between;
	gap: 16px; padding-top: 10px; padding-bottom: 10px;
}
.site-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.site-logo img { width: 36px; height: 36px; border-radius: 8px; }
.site-logo span {
	font-family: var(--font-display); font-weight: 700; font-size: 22px;
}

.primary-nav { display: none; flex: 1; align-items: center; justify-content: center; gap: 28px; }
.primary-nav > a {
	font-weight: 700; text-decoration: none; color: var(--c-gray-700);
	white-space: nowrap; transition: color .2s;
}
.primary-nav > a.is-accent { color: var(--c-blue); }
.primary-nav > a:hover { color: var(--c-blue); }

.header-cta { display: none; }
.btn-search-header {
	display: flex; align-items: center; gap: 6px;
	background: var(--c-blue); color: #fff; border: none; border-radius: 8px;
	padding: 9px 16px; font-weight: 600; text-decoration: none; font-size: 14px;
}

.mobile-menu-btn {
	background: none; border: none; padding: 8px; color: var(--c-gray-700); display: block;
}
@media (min-width: 1024px) {
	.mobile-menu-btn { display: none; }
	.primary-nav { display: flex; }
	.header-cta { display: block; }
}

/* Mega menu (dropdown desktop) */
.mega-menu-wrap { position: relative; }
.mega-menu-trigger {
	display: flex; align-items: center; gap: 4px; background: none; border: none;
	font-weight: 700; color: var(--c-gray-700); font-size: 16px; padding: 4px 0;
}
.mega-menu-panel {
	position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
	width: 880px; max-width: 90vw; background: #fff; border: 1px solid #e5e7eb;
	border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,.12);
	padding: 24px; display: none; z-index: 60; margin-top: 10px;
}
.mega-menu-wrap:hover .mega-menu-panel,
.mega-menu-wrap:focus-within .mega-menu-panel { display: block; }
.mega-menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.mega-menu-col h3 {
	font-size: 14px; font-weight: 700; color: #1f2937; padding-bottom: 8px;
	margin-bottom: 8px; border-bottom: 1px solid #e5e7eb;
	display: flex; align-items: center; gap: 6px;
}
.mega-menu-col h3 svg { width: 16px; height: 16px; color: var(--c-green); flex-shrink: 0; }
.mega-menu-col a {
	display: block; padding: 4px 0; text-decoration: none; color: var(--c-orange);
	font-weight: 600; font-size: 14px;
}
.mega-menu-col a:hover { text-decoration: underline; }

/* Menu mobile (off-canvas) */
.mobile-nav {
	position: fixed; inset: 0; z-index: 100; display: none;
}
.mobile-nav.is-open { display: block; }
.mobile-nav-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); }
.mobile-nav-panel {
	position: absolute; top: 0; left: 0; width: 320px; max-width: 85vw; height: 100%;
	background: #fff; overflow-y: auto; box-shadow: 4px 0 20px rgba(0,0,0,.15);
}
.mobile-nav-header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 16px; border-bottom: 1px solid #e5e7eb;
}
.mobile-nav-panel a, .mobile-nav-panel .region-toggle {
	display: block; width: 100%; text-align: left; background: none; border: none;
	padding: 12px 16px; text-decoration: none; color: #374151; font-weight: 600; font-size: 15px;
}
.mobile-nav-panel .region-toggle { display: flex; justify-content: space-between; align-items: center; }
.mobile-nav-panel .region-sub { display: none; padding-left: 12px; }
.mobile-nav-panel .region-sub.is-open { display: block; }
.mobile-nav-panel .region-sub a { padding: 8px 16px; font-weight: 500; font-size: 14px; color: #4b5563; }

/* =========================================================
   HERO
   ========================================================= */
.hero {
	position: relative; overflow: hidden;
	background: linear-gradient(120deg, #0ea5e9 0%, #22c55e 100%);
	padding: 48px 0 64px;
}
.hero::before, .hero::after {
	content: ''; position: absolute; width: 340px; height: 340px; border-radius: 50%;
	background: rgba(255,255,255,.35); filter: blur(60px);
}
.hero::before { top: -120px; right: -80px; }
.hero::after { bottom: -140px; left: -100px; background: rgba(255,255,255,.25); }

.hero-inner {
	position: relative; z-index: 1; display: flex; flex-direction: column; gap: 32px;
}
.hero-content {
	background: linear-gradient(135deg, rgba(255,255,255,.6), rgba(255,255,255,.8));
	border-radius: 16px; padding: 24px; box-shadow: 0 4px 20px rgba(0,0,0,.06);
	flex: 1;
}
.hero-badge {
	display: inline-block; background: var(--c-orange); color: #fff; font-weight: 700;
	padding: 5px 16px; border-radius: 999px; font-size: 15px; margin-bottom: 16px;
}
.hero-title {
	font-size: 32px; font-weight: 800; line-height: 1.15; margin-bottom: 10px;
}
.hero-title .lead { color: #0369a1; }
.hero-title a { text-decoration: none; }
.hero-subtitle { font-size: 16px; color: #374151; margin-bottom: 20px; }
.hero-subtitle strong { color: var(--c-blue); }

.hero-search { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.hero-search-input {
	flex: 1; min-width: 220px; position: relative;
}
.hero-search-input svg {
	position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #9ca3af;
	width: 20px; height: 20px;
}
.hero-search-input input {
	width: 100%; height: 52px; border-radius: 10px; border: 2px solid #93c5fd;
	padding: 0 16px 0 44px; font-size: 16px; background: #fff;
}
.hero-search-input input:focus { outline: none; border-color: var(--c-amber); }
.hero-select {
	height: 52px; min-width: 190px; border-radius: 10px; border: 2px solid #93c5fd;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
	padding: 0 36px 0 14px; font-size: 15px; appearance: none;
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.hero-tag {
	border: 1px solid #d1d5db; background: #fff; border-radius: 8px;
	padding: 7px 16px; font-size: 14px; font-weight: 600; text-decoration: none; color: #374151;
	transition: .2s;
}
.hero-tag:hover { background: var(--c-orange); color: #fff; border-color: var(--c-orange); }

.stats-grid {
	display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.stat-card {
	display: flex; align-items: flex-start; gap: 10px; padding: 14px;
	border-radius: 12px; border: 1px solid rgba(0,0,0,.05); box-shadow: 0 1px 4px rgba(0,0,0,.05);
	transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: 0 6px 16px rgba(0,0,0,.1); }
.stat-card svg { width: 26px; height: 26px; flex-shrink: 0; }
.stat-card .stat-label { font-size: 13px; color: #4b5563; margin-bottom: 2px; }
.stat-card .stat-value { font-size: 24px; font-weight: 800; line-height: 1; }
.stat-card .stat-unit { font-size: 13px; font-weight: 500; margin-left: 4px; }

@media (min-width: 1280px) {
	.hero-inner { flex-direction: row; align-items: stretch; }
	.hero-content { flex: 1.2; }
	.stats-grid { width: 560px; grid-template-columns: repeat(2, 1fr); align-self: center; }
}

/* =========================================================
   SECTION CHUNG
   ========================================================= */
.section { padding: 56px 0; }
.section-head {
	display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
	margin-bottom: 32px; flex-wrap: wrap;
}
.section-eyebrow {
	display: inline-flex; align-items: center; gap: 6px; background: #ffedd5; color: var(--c-orange);
	font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
	padding: 5px 14px; border-radius: 999px; margin-bottom: 10px;
}
.section-title { font-size: 28px; font-weight: 800; color: var(--c-orange); }
.section-subtitle { color: #6b7280; margin-top: 4px; }
.section-link {
	display: inline-flex; align-items: center; gap: 6px; color: var(--c-blue); font-weight: 700;
	text-decoration: none; white-space: nowrap;
}
.section-link:hover { text-decoration: underline; }

/* Swiper (carousel) tuỳ biến điều hướng để giống bản gốc */
.ttvn-swiper { padding-bottom: 44px !important; }
.ttvn-swiper .swiper-pagination-bullet-active { background: var(--c-orange); }
.ttvn-swiper-nav {
	width: 40px; height: 40px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.15);
	display: flex; align-items: center; justify-content: center; color: var(--c-blue); cursor: pointer;
}

/* Province card (carousel nổi bật) */
.province-card {
	background: rgba(255,255,255,.92); border-radius: 14px; overflow: hidden;
	box-shadow: 0 2px 10px rgba(0,0,0,.08); transition: box-shadow .3s, transform .3s; height: 100%;
	display: flex; flex-direction: column; text-decoration: none; color: inherit;
}
.province-card:hover { box-shadow: 0 14px 30px rgba(0,0,0,.15); transform: translateY(-3px); }
.province-card-media {
	position: relative; height: 190px; overflow: hidden;
	display: flex; align-items: flex-end;
}
.province-card-media .media-fallback {
	position: absolute; inset: 0;
}
.province-card-media .overlay {
	position: absolute; inset: 0; background: linear-gradient(to top, rgba(15,23,42,.85), rgba(15,23,42,.15));
}
.province-card-media .media-text { position: relative; z-index: 1; padding: 14px 16px; color: #fff; }
.province-card-media h3 { font-size: 20px; font-weight: 800; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.province-card-media p { font-size: 13px; opacity: .9; margin-top: 2px; }

.province-card-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.province-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 14px; }
.province-stats-grid .full { grid-column: 1 / -1; }
.province-stats-grid .label { font-size: 11px; color: #9ca3af; margin-bottom: 2px; }
.province-stats-grid .value { font-weight: 700; }
.province-stats-grid .grdp { color: var(--c-orange); font-weight: 700; }
.btn-detail {
	margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 6px;
	background: var(--c-blue); color: #fff; border: none; border-radius: 8px;
	padding: 10px; font-weight: 700; font-size: 14px; text-decoration: none;
}
.province-card:hover .btn-detail { background: #0369a1; }

/* Banner sáp nhập (ảnh lớn) */
.banner-section { background: linear-gradient(120deg, var(--c-cyan), var(--c-blue)); padding: 56px 0; }
.banner-frame {
	max-width: 900px; margin: 0 auto; border-radius: 16px; overflow: hidden;
	box-shadow: 0 12px 40px rgba(0,0,0,.2); display: block; border: 4px solid transparent; transition: border-color .3s;
	text-decoration: none;
}
.banner-frame:hover { border-color: #93c5fd; }
.banner-frame img { width: 100%; height: auto; display: block; }

/* Bản đồ */
.map-section { background: linear-gradient(120deg, #fce7f3, #fef9c3); padding: 64px 0; }
.map-heading { text-align: center; margin-bottom: 32px; }
.map-heading h2 { font-size: 34px; font-weight: 800; margin-bottom: 8px; }
.map-heading p { color: #4b5563; font-size: 17px; }
.map-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
.map-canvas-wrap {
	background: #fff; border-radius: 16px; box-shadow: 0 8px 30px rgba(0,0,0,.1);
	overflow: hidden; border: 1px solid #e5e7eb;
	display: flex; flex-direction: column;
}
#ttvn-leaflet-map { width: 100%; height: 480px; background: #e5e7eb; flex: none; }
.select-panel { display: flex; flex-direction: column; gap: 16px; }

.select-card {
	background: #fff; border-radius: 14px; padding: 18px; box-shadow: 0 2px 10px rgba(0,0,0,.06);
}
.select-card h4 {
	display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800;
	color: #1f2937; margin-bottom: 14px;
}
.select-card h4 svg { color: var(--c-blue); }
.select-card-label { font-size: 12px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .04em; margin: 12px 0 8px; }
.select-card-label:first-of-type { margin-top: 0; }

.quick-select-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick-select-btn {
	border: 1px solid #e5e7eb; background: #f9fafb; border-radius: 8px;
	padding: 9px 10px; font-size: 14px; font-weight: 600; color: #374151; transition: .15s;
}
.quick-select-btn:hover { border-color: var(--c-blue); color: var(--c-blue); }
.quick-select-btn.is-active { background: var(--c-blue); border-color: var(--c-blue); color: #fff; }

.province-select {
	width: 100%; height: 44px; border-radius: 8px; border: 1px solid #e5e7eb;
	padding: 0 12px; font-size: 14px; background: #fff; color: #374151;
}

/* Thẻ chi tiết tỉnh (cập nhật động qua JS khi chọn tỉnh) */
.detail-card {
	background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.06);
	min-height: 120px;
}
.detail-media {
	height: 140px; display: flex; align-items: flex-end; padding: 14px 18px; position: relative;
}
.detail-media span { color: #fff; font-weight: 800; font-size: 20px; text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.detail-body { padding: 16px 18px 18px; }
.detail-body h3 { font-size: 18px; font-weight: 800; margin-bottom: 2px; }
.detail-region { font-size: 13px; color: #6b7280; margin-bottom: 14px; }

.detail-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.detail-stat { display: flex; align-items: center; gap: 8px; border-radius: 10px; padding: 10px; }
.detail-stat .di { width: 22px; height: 22px; flex-shrink: 0; }
.detail-stat .di svg { width: 100%; height: 100%; }
.detail-stat .dl { font-size: 11px; color: #6b7280; margin-bottom: 1px; }
.detail-stat .dv { font-size: 15px; font-weight: 800; }
.detail-stat .dv small { font-size: 11px; font-weight: 500; color: #6b7280; }

.detail-footer {
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	border-top: 1px solid #f1f5f9; padding-top: 14px; flex-wrap: wrap;
}
.detail-footer .dl { font-size: 11px; color: #9ca3af; }
.detail-footer strong { font-size: 14px; }
.btn-xem-them {
	background: var(--c-blue); color: #fff; text-decoration: none; font-weight: 700;
	font-size: 13px; padding: 8px 16px; border-radius: 8px; white-space: nowrap;
}

@media (min-width: 1024px) {
	.map-grid { grid-template-columns: 2fr 1fr; }
	#ttvn-leaflet-map { height: 560px; }
}

/* Biểu đồ thống kê */
.chart-section { background: linear-gradient(120deg, #fef08a, #fcd34d); padding: 64px 0; }
.chart-title {
	text-align: center; font-size: 30px; font-weight: 800; margin-bottom: 28px;
	background: linear-gradient(90deg, var(--c-amber), var(--c-pink));
	-webkit-background-clip: text; background-clip: text; color: transparent;
}
.chart-tabs { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chart-tab {
	display: flex; align-items: center; gap: 6px; border: none; border-radius: 10px;
	padding: 10px 18px; font-weight: 700; font-size: 14px; background: #fff; color: #6b7280;
}
.chart-tab.is-active.tab-area { background: #dcfce7; color: var(--c-green); }
.chart-tab.is-active.tab-population { background: #fce7f3; color: var(--c-pink); }
.chart-tab.is-active.tab-gdp { background: #ffedd5; color: var(--c-orange); }
.chart-tab.is-active.tab-economic { background: #ede9fe; color: #7c3aed; }
.chart-card {
	background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 8px 30px rgba(0,0,0,.08);
	max-width: 900px; margin: 0 auto;
}
.chart-card-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: #1f2937; margin: 0 0 4px; }
.chart-card-sub { font-size: 13px; color: #6b7280; margin: 0 0 20px; }
#ttvn-chart-wrap { position: relative; width: 100%; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; justify-content: center; font-size: 13px; color: #374151; }
.chart-legend-item { display: flex; align-items: center; gap: 5px; }
.chart-legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer { background: #0f172a; color: #cbd5e1; padding: 48px 0 20px; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }
.footer-col h4 { color: #fff; font-size: 15px; margin-bottom: 12px; }
.footer-col p { font-size: 14px; line-height: 1.7; color: #94a3b8; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: #94a3b8; text-decoration: none; font-size: 14px; }
.footer-col a:hover { color: #fff; }
.footer-logo { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.footer-logo span { font-family: var(--font-display); font-weight: 700; font-size: 20px; color: #fff; }
.footer-bottom {
	border-top: 1px solid #1e293b; margin-top: 32px; padding-top: 18px;
	display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; font-size: 13px; color: #64748b;
}
@media (min-width: 900px) {
	.footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}

/* Utilities */
.mt-0 { margin-top: 0; }
.hidden { display: none; }
@media (min-width: 768px) { .md\:block { display: block; } }

/* Kích thước icon SVG (bắt buộc phải có — nếu thiếu, SVG sẽ render ở kích thước
   mặc định của trình duyệt, tức là RẤT to, tràn cả khối chứa). Áp dụng cho mọi
   icon dùng qua hàm ttvn_icon() trong functions.php. */
svg.w-4, svg.w-4 { width: 1rem; }
svg.h-4 { height: 1rem; }
svg.w-5 { width: 1.25rem; }
svg.h-5 { height: 1.25rem; }
svg.w-6 { width: 1.5rem; }
svg.h-6 { height: 1.5rem; }
svg.w-7 { width: 1.75rem; }
svg.h-7 { height: 1.75rem; }
/* Phòng hờ: bất kỳ SVG icon nào lọt lưới (không khớp class trên) cũng không được
   phép to hơn 32px, tránh lặp lại lỗi vỡ layout như trên. */
.mega-menu-col svg, .map-side-card svg, .chart-tab svg, .btn-detail svg,
.hero-tag svg, .stat-card svg, .province-card svg, .section-link svg,
.mobile-nav-panel svg, .primary-nav svg, .site-header svg {
	max-width: 28px; max-height: 28px; flex-shrink: 0;
}

