/*
Theme Name: Nguyễn Hà Bằng Theme
Theme URI: https://tnnt.vn
Author: TNNT Software
Author URI: https://tnnt.vn
Description: Theme chính thức cho TS. Nguyễn Hà Bằng. Thiết kế bởi TNNT Software.
Version: 1.0.2
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nguyen-ha-bang
Tags: custom-menu, custom-logo, featured-images, translation-ready
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
	--nhb-gold: #2e1758;
	--nhb-gold-light: #e0a326;
	--nhb-gold-text: #d9a53a;
	--nhb-brand: #2e1758;
	--nhb-ink: #0b0416;
	--nhb-violet-900: #2e1758;
	--nhb-violet-800: #2e1758;
	--nhb-violet-700: #2e1758;
	--nhb-violet-600: #2e1758;
	--nhb-white: #ffffff;
	--nhb-muted: rgba(255, 255, 255, .78);
	--nhb-header-h: 92px;
	--nhb-shell: 1366px;
	--nhb-font: "Montserrat", "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* ==========================================================================
   Base
   ========================================================================== */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--nhb-ink);
	color: var(--nhb-white);
	font-family: var(--nhb-font);
	font-size: 16px;
	line-height: 1.6;
	overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

.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:focus {
	position: fixed;
	top: 8px; left: 8px;
	z-index: 999;
	width: auto; height: auto;
	clip: auto;
	margin: 0;
	padding: 12px 20px;
	background: var(--nhb-gold);
	color: #fff;
	font-weight: 700;
	border-radius: 6px;
}

.nhb-shell {
	width: 100%;
	max-width: var(--nhb-shell);
	margin-inline: auto;
	padding-inline: 68px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.nhb-btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 14px 26px;
	background: #f3edfc;
	color: #2e1758;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	white-space: nowrap;
	border: 0;
	border-radius: 999px;
	cursor: pointer;
	transition: background .2s ease, color .2s ease, transform .2s ease;
}

.nhb-btn:hover,
.nhb-btn:focus-visible {
	background: #2e1758;
	color: var(--nhb-white);
	transform: translateY(-1px);
}

.nhb-btn .nhb-btn__arrow { font-size: 15px; line-height: 1; }

/* ==========================================================================
   Header
   ========================================================================== */
.nhb-header {
	position: absolute;
	inset: 0 0 auto 0;
	z-index: 20;
}

.nhb-header__inner {
	display: flex;
	align-items: center;
	gap: 24px;
	min-height: var(--nhb-header-h);
}

.nhb-brand {
	flex: 0 0 auto;
	font-size: 21px;
	font-weight: 800;
	letter-spacing: .01em;
	text-transform: uppercase;
	color: var(--nhb-white);
	line-height: 1.1;
}

.nhb-brand__logo { max-height: 46px; width: auto; }

/* --- Dynamic menu ------------------------------------------------------- */
.nhb-nav { margin-inline: auto; }

.nhb-nav ul {
	display: flex;
	align-items: center;
	gap: 44px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.nhb-nav li { position: relative; }

.nhb-nav a {
	display: block;
	padding: 6px 0;
	font-size: 15px;
	font-weight: 500;
	color: var(--nhb-white);
	white-space: nowrap;
}

.nhb-nav a::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 2px;
	background: var(--nhb-gold);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform .22s ease;
}

.nhb-nav a:hover::after,
.nhb-nav a:focus-visible::after,
.nhb-nav .current-menu-item > a::after,
.nhb-nav .current_page_item > a::after,
.nhb-nav .current-menu-ancestor > a::after { transform: scaleX(1); }

/* Dấu mũi tên cho mục có menu con */
.nhb-nav .menu-item-has-children > a { position: relative; padding-right: 18px; }
.nhb-nav .menu-item-has-children > a::before {
	content: "";
	position: absolute;
	right: 4px;
	top: 50%;
	width: 6px;
	height: 6px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-70%) rotate(45deg);
	pointer-events: none;
}

/* Sub-menus */
.nhb-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	display: block;
	min-width: 220px;
	padding: 10px 0;
	background: rgba(16, 4, 32, .97);
	border: 1px solid rgba(255, 255, 255, .1);
	border-radius: 10px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.nhb-nav li:hover > .sub-menu,
.nhb-nav li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.nhb-nav .sub-menu a { padding: 9px 20px; font-size: 14px; }
.nhb-nav .sub-menu a::after { display: none; }
.nhb-nav .sub-menu a:hover { background: rgba(255, 255, 255, .07); }

.nhb-header__cta { flex: 0 0 auto; }

/* Burger (mobile) */
.nhb-burger {
	display: none;
	width: 44px;
	height: 44px;
	margin-left: auto;
	padding: 0;
	background: transparent;
	border: 0;
	cursor: pointer;
}

.nhb-burger span,
.nhb-burger span::before,
.nhb-burger span::after {
	display: block;
	width: 24px;
	height: 2px;
	margin-inline: auto;
	background: var(--nhb-white);
	transition: transform .2s ease, opacity .2s ease;
}

.nhb-burger span { position: relative; }
.nhb-burger span::before,
.nhb-burger span::after { content: ""; position: absolute; left: 0; }
.nhb-burger span::before { top: -7px; }
.nhb-burger span::after { top: 7px; }

.nhb-burger[aria-expanded="true"] span { background: transparent; }
.nhb-burger[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.nhb-burger[aria-expanded="true"] span::after { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   Hero — Section 1
   Ảnh nền lấy từ Thư viện Media (Customizer > Ảnh section 1).
   ========================================================================== */
.nhb-hero {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	background-color: #150527;
	background-image: var(--nhb-hero-bg);
	background-size: cover;
	background-position: right center;
	background-repeat: no-repeat;
	/* 1143/644 = tỉ lệ ảnh nền -> không bị crop ở hầu hết kích thước màn hình */
	min-height: clamp(560px, 46.1vw, 800px);
}

.nhb-hero__inner {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: end;
	min-height: inherit;
	padding-top: var(--nhb-header-h);
}

.nhb-hero__content {
	align-self: center;
	padding-block: 40px;
	max-width: 620px;
}

.nhb-hero__eyebrow {
	margin: 0 0 18px;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--nhb-gold-text);
}

.nhb-hero__title {
	margin: 0;
	font-size: clamp(34px, 3.6vw, 56px);
	font-weight: 800;
	line-height: 1.42;
	letter-spacing: -.01em;
	text-transform: uppercase;
}

.nhb-hero__title span { display: block; color: var(--nhb-gold-text); }
.nhb-hero__title > span:first-child { color: inherit; }

@media (min-width: 601px) {
	.nhb-hero__title span { white-space: nowrap; }
}

.nhb-hero__subtitle {
	margin: 22px 0 34px;
	font-size: clamp(17px, 1.5vw, 21px);
	font-weight: 500;
	color: var(--nhb-muted);
}

.nhb-hero__media {
	position: relative;
	align-self: end;
	justify-self: end;
	line-height: 0;
}

/* Ảnh chân dung là PNG nền trong suốt -> canh đáy, cao theo bề rộng màn hình. */
.nhb-hero__portrait {
	width: auto;
	max-width: none;
	height: clamp(340px, 46vw, 640px);
	filter: drop-shadow(0 24px 48px rgba(0, 0, 0, .45));
}

/* ==========================================================================
   Footer
   ========================================================================== */
.nhb-footer {
	background: var(--nhb-ink);
	border-top: 1px solid rgba(255, 255, 255, .08);
}

.nhb-footer__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px 32px;
	padding-block: 26px;
}

.nhb-footer__nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
}

.nhb-footer__nav a:hover { color: var(--nhb-gold-text); }

.nhb-footer__credit {
	margin: 0;
	font-size: 13px;
	color: rgba(255, 255, 255, .6);
}

.nhb-footer__credit a {
	color: var(--nhb-gold-text);
	font-weight: 600;
}

/* ==========================================================================
   Trang / bài viết mặc định
   ========================================================================== */
.nhb-page { padding-block: 140px 80px; }

.nhb-page__title {
	margin: 0 0 24px;
	font-size: clamp(30px, 3.6vw, 46px);
	font-weight: 800;
	line-height: 1.15;
	text-transform: uppercase;
}

.nhb-page__content a { color: var(--nhb-gold-text); text-decoration: underline; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
	.nhb-shell { padding-inline: 32px; }
	.nhb-nav ul { gap: 26px; }
	.nhb-nav a { font-size: 14px; }
}

@media (max-width: 1024px) {
	.nhb-header__cta { display: none; }

	.nhb-burger { display: block; }

	.nhb-nav {
		position: fixed;
		top: 0;
		right: 0;
		bottom: 0;
		width: min(320px, 85vw);
		margin: 0;
		padding: 88px 28px 28px;
		background: #17072f;
		border-left: 1px solid rgba(255, 255, 255, .1);
		box-shadow: -12px 0 32px rgba(0, 0, 0, .45);
		overflow-y: auto;
		transform: translateX(100%);
		visibility: hidden;
		transition: transform .3s ease, visibility .3s;
	}

	.nhb-nav.is-open {
		transform: translateX(0);
		visibility: visible;
	}

	.nhb-burger { position: relative; z-index: 1001; }

	.nhb-burger[aria-expanded="true"] span::before,
	.nhb-burger[aria-expanded="true"] span::after {
		background: #ffffff !important;
	}

	.nhb-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
	.nhb-nav a {
		padding: 14px 0;
		font-size: 16px;
		font-weight: 600;
		color: #ffffff;
		border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	}
	.nhb-nav a::after { display: none; }
	.nhb-nav .current-menu-item > a,
	.nhb-nav .current_page_item > a { color: var(--nhb-gold-text); }
	.nhb-nav a:hover { color: var(--nhb-gold-text); }

	.nhb-nav .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		min-width: 0;
		padding: 4px 14px;
		margin: 6px 0 10px;
		background: rgba(255, 255, 255, .06);
		border: 1px solid rgba(255, 255, 255, .08);
		border-radius: 10px;
		box-shadow: none;
	}
	.nhb-nav .sub-menu a {
		padding: 10px 4px;
		font-size: 14.5px;
		font-weight: 500;
		color: rgba(255, 255, 255, .85);
		border-bottom: 1px solid rgba(255, 255, 255, .05);
	}
	.nhb-nav .sub-menu li:last-child a {
		border-bottom: none;
	}
	.nhb-nav .sub-menu a:hover {
		color: #ffffff;
		background: transparent;
	}

	.nhb-hero {
		min-height: 0;
		background-position: 72% center;
	}

	/* Nền nhiều chi tiết -> phủ lớp tối để chữ đọc được trên màn nhỏ. */
	.nhb-hero::before {
		content: "";
		position: absolute;
		inset: 0;
		z-index: 1;
		pointer-events: none;
		background: linear-gradient(180deg, rgba(11, 4, 22, .82) 0%, rgba(11, 4, 22, .55) 46%, rgba(11, 4, 22, .1) 100%);
	}

	.nhb-hero__inner {
		grid-template-columns: 1fr;
		min-height: 0;
		padding-top: calc(var(--nhb-header-h) + 26px);
		padding-bottom: 0;
		text-align: center;
	}

	.nhb-hero__content {
		max-width: none;
		padding-block: 0 30px;
		text-align: center;
		margin-inline: auto;
	}

	.nhb-hero__eyebrow { text-align: center; }
	.nhb-hero__title { text-align: center; }
	.nhb-hero__title span { text-align: center; }
	.nhb-hero__subtitle { text-align: center; margin-inline: auto; max-width: 520px; }
	.nhb-hero__content .nhb-btn { margin-inline: auto; }

	.nhb-hero__media { justify-self: center; margin-inline: auto; text-align: center; }

	.nhb-hero__portrait {
		width: min(100%, 420px);
		height: auto;
		margin-inline: auto;
		display: block;
	}
}

@media (max-width: 600px) {
	.nhb-shell { padding-inline: 20px; }
	.nhb-brand { font-size: 17px; }
	.nhb-hero__inner { padding-top: calc(var(--nhb-header-h) + 12px); }
	.nhb-btn { padding: 12px 20px; font-size: 12px; }
}


/* footer-custom — scoped to .nhb-footer-custom (theo mau footer.pdf) */
.nhb-footer-custom {
	width: 100%;
	margin: 0;
	padding: 0;
	font-family: var(--nhb-font);
	box-sizing: border-box;
	background: #f7f5fa;
	color: #55525a;
}
.nhb-footer-custom a {
	color: inherit;
	text-decoration: none;
}
.nhb-footer-custom__top {
	background-color: #f7f5fa;
	padding: 68px 0 60px;
}
.nhb-footer-custom__inner {
	display: grid;
	grid-template-columns: 1.35fr 1fr 1fr 1.35fr;
	column-gap: 48px;
	row-gap: 36px;
	align-items: start;
}
.nhb-footer-custom__brand-title {
	margin: 0 0 20px;
	font-size: 16.5px;
	font-weight: 800;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: #2e1758;
	line-height: 1.3;
}
.nhb-footer-custom__brand-desc {
	margin: 0;
	font-size: 14.5px;
	font-weight: 500;
	line-height: 1.65;
	color: #55525a;
	max-width: 290px;
}
.nhb-footer-custom__heading {
	margin: 0 0 22px;
	font-size: 19px;
	font-weight: 700;
	color: #2e1758;
	line-height: 1.25;
}
.nhb-footer-custom__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 13px;
	font-size: 14px;
	font-weight: 400;
	color: #55525a;
	line-height: 1.5;
}
.nhb-footer-custom__list a {
	color: #55525a;
	text-decoration: none;
	transition: color .2s ease;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}
.nhb-footer-custom__list a:hover {
	color: #2e1758;
}
.nhb-footer-custom__list--contact li,
.nhb-footer-custom__addr-item {
	display: flex;
	align-items: center;
	gap: 10px;
	color: #55525a;
	font-size: 14px;
	line-height: 1.5;
}
.nhb-footer-custom__icon {
	display: inline-block;
	font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
	font-size: 16px;
	line-height: 1;
	flex-shrink: 0;
	vertical-align: middle;
}
.nhb-footer-custom__bottom {
	background-color: #2e1758;
	padding: 16px 0 18px;
	text-align: center;
}
.nhb-footer-custom__copy {
	margin: 0 0 5px;
	font-size: 14.5px;
	font-weight: 600;
	color: #f7f5fa;
	letter-spacing: .01em;
	line-height: 1.4;
	text-align: center;
}
.nhb-footer-custom__credit {
	margin: 0;
	font-size: 12.5px;
	color: rgba(247, 245, 250, .68);
	line-height: 1.4;
	text-align: center;
}
.nhb-footer-custom__credit a {
	color: #e0a326;
	font-weight: 500;
	text-decoration: none;
	transition: color .2s ease;
}
.nhb-footer-custom__credit a:hover {
	color: #ffffff;
	text-decoration: underline;
}
@media (max-width: 1024px) {
	.nhb-footer-custom__top {
		padding: 52px 0 44px;
	}
	.nhb-footer-custom__inner {
		grid-template-columns: 1fr 1fr;
		column-gap: 36px;
		row-gap: 36px;
	}
}
@media (max-width: 640px) {
	.nhb-footer-custom__top {
		padding: 40px 0 34px;
	}
	.nhb-footer-custom__inner {
		grid-template-columns: 1fr;
		row-gap: 28px;
	}
	.nhb-footer-custom__brand-desc {
		max-width: 100%;
	}
	.nhb-footer-custom__bottom {
		padding: 14px 16px 16px;
	}
	.nhb-footer-custom__copy {
		font-size: 13.5px;
		margin-bottom: 4px;
		line-height: 1.4;
	}
	.nhb-footer-custom__credit {
		font-size: 11.5px;
	}
}
