/*
 * Tầng 2 — Bố cục.
 *
 * Khung trang, khoảng thở giữa các khối, đầu trang và chân trang.
 */

/* ---------- Khung ---------- */

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.wrap--narrow {
	max-width: var(--wrap-narrow);
}

.section {
	padding-block: var(--space-2xl);
	position: relative;
}

.section--tint {
	background: var(--lxe-surface, #fff);
}

.section--dark {
	background: var(--lxe-primary, #101820);
	color: rgba(255, 255, 255, 0.82);
}

.section--dark h2,
.section--dark h3 {
	color: #fff;
}

.section-note {
	margin-top: var(--space-m);
	font-size: var(--step--1);
	color: var(--lxe-muted, #6B7075);
}

.section-cta {
	margin-top: var(--space-l);
	text-align: center;
}

/* ---------- Tiêu đề khối ---------- */

.section-head {
	margin-bottom: var(--space-l);
	max-width: 62ch;
}

.section-head--center {
	margin-inline: auto;
	text-align: center;
}

.section-head__index {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0 0 var(--space-xs);
	font-size: var(--step--1);
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.section-head--center .section-head__index {
	justify-content: center;
}

/*
 * Số thứ tự khối in bằng màu nhấn, cỡ nhỏ. Đây là chi tiết nhận diện của bộ
 * giao diện: người đọc luôn biết mình đang ở đâu trong mạch thông tin.
 */
.section-head__num {
	font-family: var(--lxe-font-display, Georgia, serif);
	font-size: 0.95rem;
	color: var(--lxe-accent, #7E6130);
	letter-spacing: 0.05em;
}

.section-head__num::after {
	content: "";
	display: inline-block;
	width: 2.25rem;
	height: 1px;
	margin-left: 0.75rem;
	vertical-align: middle;
	background: var(--lxe-accent, #7E6130);
	opacity: 0.5;
}

.section-head__eyebrow {
	color: var(--lxe-muted, #6B7075);
}

.section--dark .section-head__eyebrow {
	color: rgba(255, 255, 255, 0.6);
}

.section-head__title {
	margin: 0;
}

.section-head__lead {
	margin-top: var(--space-s);
	font-size: var(--step-1);
	color: var(--lxe-muted, #6B7075);
	line-height: 1.5;
}

.section--dark .section-head__lead {
	color: rgba(255, 255, 255, 0.7);
}

/* ---------- Đầu trang ---------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: color-mix(in srgb, var(--lxe-menu-bg, #101820) 92%, transparent);
	color: var(--lxe-menu-text, #F6F3ED);
	backdrop-filter: saturate(140%) blur(10px);
	transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.site-header.is-scrolled {
	background: var(--lxe-menu-bg, #101820);
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-m);
	min-height: 72px;
}

.site-header__progress {
	height: 2px;
	background: transparent;
}

.site-header__progress span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--lxe-accent, #7E6130);
	transition: width 0.1s linear;
}

.brand {
	display: inline-flex;
	align-items: center;
	text-decoration: none;
	color: inherit;
}

.brand__img {
	max-height: 44px;
	width: auto;
	object-fit: contain;
}

.brand__text {
	font-family: var(--lxe-font-display, Georgia, serif);
	font-size: 1.25rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.site-header__actions {
	display: flex;
	align-items: center;
	gap: var(--space-s);
}

.site-header__tel {
	display: none;
	text-decoration: none;
	line-height: 1.2;
	text-align: right;
}

.site-header__tel-label {
	display: block;
	font-size: 0.7rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.6;
}

.site-header__tel-num {
	display: block;
	font-family: var(--lxe-font-display, Georgia, serif);
	font-size: 1.05rem;
	color: var(--lxe-menu-text, #F6F3ED);
}

@media (min-width: 900px) {
	.site-header__tel {
		display: block;
	}
}

/* ---------- Menu chính ---------- */

.nav {
	display: none;
}

@media (min-width: 1024px) {
	.nav {
		display: block;
	}
}

.nav__list {
	display: flex;
	gap: clamp(1rem, 2vw, 1.75rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

.nav__link {
	position: relative;
	display: block;
	padding: 0.5rem 0;
	font-size: 0.9rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--lxe-menu-text, #F6F3ED);
	opacity: 0.85;
}

.nav__link::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 0;
	height: 1px;
	background: var(--lxe-accent, #7E6130);
	transition: width var(--dur) var(--ease);
}

.nav__link:hover,
.nav li.is-current > .nav__link {
	opacity: 1;
	color: var(--lxe-menu-text, #F6F3ED);
}

.nav__link:hover::after,
.nav li.is-current > .nav__link::after {
	width: 100%;
}

/* ---------- Menu con đổ xuống ---------- */

.nav__list > li {
	position: relative;
}

/*
 * Nút mở menu con trên thanh ngang: ẩn khỏi mắt nhưng vẫn bấm được bằng phím
 * Tab. Menu con ẩn bằng visibility nên các liên kết bên trong không nhận được
 * tiêu điểm; nếu bỏ hẳn nút này, người dùng bàn phím không có cách nào mở ra.
 * Khi được chọn bằng phím, nút hiện lên để thấy mình đang ở đâu.
 */
.nav .nav__toggle {
	position: absolute;
	right: -2px;
	top: 50%;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	border: 0;
	background: none;
	color: inherit;
	clip-path: inset(50%);
}

.nav .nav__toggle:focus-visible {
	width: 22px;
	height: 22px;
	margin-top: -11px;
	overflow: visible;
	clip-path: none;
	background: var(--lxe-accent, #7E6130);
	border-radius: 50%;
	color: #fff;
	font-size: 0.7rem;
	line-height: 1;
}

/*
 * Trạng thái ẩn khai báo ngoài media query, không nằm trong.
 *
 * Nếu chỉ ẩn bên trong @media, mọi hoàn cảnh mà quy tắc đó không áp dụng —
 * màn hình hẹp hơn ngưỡng, tệp CSS tải lỗi, bộ nén CSS làm hỏng câu lệnh —
 * đều khiến toàn bộ menu con bung ra giữa trang. Mặc định phải là ẩn.
 *
 * Dùng visibility chứ không dùng display: none, vì display bị loại khỏi cây
 * hiển thị nên mất hiệu ứng chuyển và trình đọc màn hình cũng mất dấu.
 */
.nav .sub-menu {
	position: absolute;
	top: 100%;
	left: -1rem;
	z-index: 30;
	min-width: 250px;
	margin: 0;
	padding: 0.4rem 0;
	list-style: none;
	background: var(--lxe-menu-bg, #101820);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: var(--lxe-radius, 2px);
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);

	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(6px);
	transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
}

/*
 * Chỉ ba trường hợp mở ra: chuột đang ở trong vùng mục cha, có phần tử bên
 * trong đang được chọn bằng bàn phím, hoặc người dùng đã bấm nút mở.
 * Rời chuột khỏi mục cha là quay lại trạng thái ẩn ngay.
 */
.nav__list > li.has-sub:hover > .sub-menu,
.nav__list > li.has-sub:focus-within > .sub-menu,
.nav__list > li.has-sub.is-open > .sub-menu {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: none;
}

.nav__list > li.has-sub > .nav__link {
	padding-right: 0.9rem;
}

.nav__list > li.has-sub > .nav__link::before {
	content: "";
	position: absolute;
	right: 0;
	top: 50%;
	width: 5px;
	height: 5px;
	margin-top: -3px;
	border-right: 1px solid currentColor;
	border-bottom: 1px solid currentColor;
	transform: rotate(45deg);
	opacity: 0.7;
}

/*
 * Cầu nối vô hình giữa mục cha và bảng con. Không có nó, chuột đi qua khe hở
 * là menu đóng sập giữa chừng.
 */
.nav__list > li.has-sub::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	height: 12px;
}

.nav .sub-menu .nav__link {
	padding: 0.6rem 1.25rem;
	font-size: 0.82rem;
	letter-spacing: 0.04em;
	text-transform: none;
	white-space: nowrap;
}

.nav .sub-menu .nav__link::after {
	display: none;
}

.nav .sub-menu li:hover > .nav__link,
.nav .sub-menu li.is-current > .nav__link {
	background: rgba(255, 255, 255, 0.07);
	opacity: 1;
}

/* ---------- Menu con trong menu điện thoại ---------- */

.mobile-nav__list li {
	position: relative;
}

.mobile-nav__list .nav__toggle {
	display: block;
	position: absolute;
	right: 0;
	top: 0;
	width: 52px;
	height: 52px;
	border: 0;
	background: none;
	color: inherit;
	font-size: 0.9rem;
	transition: transform var(--dur) var(--ease);
}

.mobile-nav__list .nav__toggle[aria-expanded="true"] {
	transform: rotate(180deg);
}

.mobile-nav__list .sub-menu {
	display: none;
	margin: 0 0 0.5rem;
	padding: 0 0 0 1rem;
	list-style: none;
	border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.mobile-nav__list li.is-open > .sub-menu {
	display: block;
}

.mobile-nav__list .sub-menu .nav__link {
	padding: 0.7rem 0;
	font-size: 0.9rem;
	text-transform: none;
	opacity: 0.8;
}

/* ---------- Nút mở menu ---------- */

.burger {
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: none;
}

@media (min-width: 1024px) {
	.burger {
		display: none;
	}
}

.burger__bar {
	display: block;
	height: 1px;
	width: 24px;
	margin-inline: auto;
	background: var(--lxe-menu-text, #F6F3ED);
	transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.burger[aria-expanded="true"] .burger__bar:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
}

.burger[aria-expanded="true"] .burger__bar:nth-child(2) {
	opacity: 0;
}

.burger[aria-expanded="true"] .burger__bar:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
}

/* ---------- Menu điện thoại ---------- */

.mobile-nav {
	position: fixed;
	inset: 0;
	z-index: 200;
	background: rgba(16, 24, 32, 0.6);
}

.mobile-nav[hidden] {
	display: none;
}

.mobile-nav__panel {
	position: absolute;
	inset-block: 0;
	right: 0;
	width: min(92vw, 420px);
	padding: var(--space-m) var(--gutter) var(--space-xl);
	background: var(--lxe-menu-bg, #101820);
	color: var(--lxe-menu-text, #F6F3ED);
	overflow-y: auto;
	transform: translateX(100%);
	transition: transform var(--dur) var(--ease);
}

.mobile-nav.is-open .mobile-nav__panel {
	transform: translateX(0);
}

.mobile-nav__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: var(--space-m);
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.mobile-nav__close {
	width: 44px;
	height: 44px;
	border: 0;
	background: none;
	color: inherit;
	font-size: 2rem;
	line-height: 1;
}

.mobile-nav__list {
	margin: var(--space-m) 0;
	padding: 0;
	list-style: none;
}

.mobile-nav__list li {
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-nav__list .nav__link {
	padding: 1rem 0;
	font-size: 1rem;
	letter-spacing: 0.04em;
}

.mobile-nav__actions {
	display: grid;
	gap: var(--space-xs);
	margin-top: var(--space-m);
}

/* ---------- Thanh nút dưới màn hình ---------- */

.mobile-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 90;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	background: var(--lxe-primary, #101820);
	border-top: 1px solid rgba(255, 255, 255, 0.1);

	/* Chừa chỗ cho thanh cử chỉ của iPhone. */
	padding-bottom: env(safe-area-inset-bottom, 0);
}

@media (min-width: 1024px) {
	.mobile-bar {
		display: none;
	}
}

.mobile-bar__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	min-height: 56px;
	padding: 0.4rem;
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.72rem;
	letter-spacing: 0.04em;
	text-decoration: none;
}

.mobile-bar__item--primary {
	background: var(--lxe-button-bg, #1F5E52);
	color: var(--lxe-button-text, #fff);
}

.mobile-bar__icon {
	font-size: 1.1rem;
	line-height: 1;
}

@media (max-width: 1023px) {
	body {
		padding-bottom: 56px;
	}
}

/* ---------- Chân trang ---------- */

.site-footer {
	padding-block: var(--space-xl) var(--space-m);
	background: var(--lxe-footer-bg, #101820);
	color: var(--lxe-footer-text, #C9C4BA);
	font-size: var(--step--1);
}

.site-footer__top {
	display: grid;
	gap: var(--space-l);
	padding-bottom: var(--space-l);
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 768px) {
	.site-footer__top {
		grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
	}
}

.site-footer__tagline {
	margin-top: var(--space-xs);
	max-width: 34ch;
	opacity: 0.75;
}

.site-footer__heading {
	margin-bottom: var(--space-xs);
	font-family: var(--lxe-font-body, sans-serif);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #fff;
}

.site-footer__list,
.site-footer__social,
.site-footer__legal-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer__list li + li {
	margin-top: 0.4rem;
}

.site-footer__list a {
	text-decoration: none;
}

.site-footer__list a:hover {
	color: #fff;
	text-decoration: underline;
}

.site-footer__social {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-s);
	margin-top: var(--space-s);
}

.site-footer__map iframe {
	width: 100%;
	aspect-ratio: 4 / 3;
	border: 0;
	filter: grayscale(1) contrast(0.9);
}

.site-footer__disclaimer {
	margin-top: var(--space-m);
	max-width: 90ch;
	font-size: 0.78rem;
	line-height: 1.6;
	opacity: 0.6;
}

.site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-s);
	margin-top: var(--space-m);
}

.site-footer__copy {
	margin: 0;
	opacity: 0.7;
}

.site-footer__legal-list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-s);
}

.site-footer__legal-list a {
	text-decoration: none;
	opacity: 0.7;
}

.site-footer__legal-list a:hover {
	opacity: 1;
	color: #fff;
}

/* ---------- Đầu trang phụ ---------- */

.page-head {
	padding-block: var(--space-xl) var(--space-m);
	background: var(--lxe-surface, #fff);
	border-bottom: 1px solid var(--lxe-line);
}

.page-head__title {
	margin: var(--space-xs) 0 0;
	font-size: var(--step-4);
}

.page-head__desc {
	margin-top: var(--space-s);
}

.page-head__lead {
	max-width: 62ch;
	margin-top: var(--space-s);
	font-size: var(--step-1);
	color: var(--lxe-muted, #6B7075);
}

.page-head--image {
	padding-block: var(--space-2xl) var(--space-xl);
	background-size: cover;
	background-position: center;
	border-bottom: 0;
	color: rgba(255, 255, 255, 0.85);
}

.page-head--image .page-head__title {
	color: #fff;
}

.page-head--image .page-head__lead {
	color: rgba(255, 255, 255, 0.78);
}

.page-head--image .crumbs__list {
	color: rgba(255, 255, 255, 0.65);
}

.page-body {
	padding-block: var(--space-xl);
}

/* ---------- Lưới bài viết ---------- */

.blog-layout {
	display: grid;
	gap: var(--space-xl);
	padding-block: var(--space-xl);
}

@media (min-width: 900px) {
	.blog-layout {
		grid-template-columns: minmax(0, 1fr) 300px;
	}
}

.post-grid {
	display: grid;
	gap: var(--space-m);
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.error-page {
	padding-block: var(--space-2xl);
	text-align: center;
}

.error-page__code {
	margin: 0;
	font-family: var(--lxe-font-display, Georgia, serif);
	font-size: clamp(5rem, 18vw, 10rem);
	line-height: 1;
	color: var(--lxe-accent, #7E6130);
	opacity: 0.25;
}

.error-page__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-xs);
	justify-content: center;
	margin-block: var(--space-m);
}
