/*
 * Tầng 3 — Thành phần dùng lại.
 */

/* ---------- Nút ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;

	/* Tối thiểu 48px để ngón tay bấm trúng — chuẩn của WCAG cho thiết bị cảm ứng. */
	min-height: 48px;
	padding: 0.75rem 1.75rem;
	border: 1px solid transparent;
	border-radius: var(--lxe-radius, 2px);
	font-size: 0.85rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	text-align: center;
	transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

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

.btn--solid:hover {
	background: var(--lxe-button-hover, #173F38);
	color: var(--lxe-button-text, #fff);
}

.btn--line {
	border-color: currentColor;
	color: var(--lxe-heading, #101820);
}

.btn--line:hover {
	background: var(--lxe-primary, #101820);
	border-color: var(--lxe-primary, #101820);
	color: #fff;
}

.btn--ghost {
	border-color: rgba(255, 255, 255, 0.55);
	color: #fff;
	background: rgba(255, 255, 255, 0.06);
}

.btn--ghost:hover {
	background: #fff;
	border-color: #fff;
	color: var(--lxe-primary, #101820);
}

.btn--sm {
	min-height: 40px;
	padding: 0.5rem 1.1rem;
	font-size: 0.75rem;
}

.btn--block {
	width: 100%;
}

.section--dark .btn--line {
	color: #fff;
}

.section--dark .btn--line:hover {
	background: #fff;
	color: var(--lxe-primary, #101820);
}

/* ---------- Đường dẫn phân cấp ---------- */

.crumbs__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 0.78rem;
	color: var(--lxe-muted, #6B7075);
}

.crumbs__item + .crumbs__item::before {
	content: "/";
	margin-right: 0.5rem;
	opacity: 0.45;
}

.crumbs__item a {
	text-decoration: none;
}

.crumbs__item a:hover {
	text-decoration: underline;
}

/* ---------- Biểu mẫu ---------- */

.lead-form {
	padding: var(--space-m);
	background: var(--lxe-surface, #fff);
	border: 1px solid var(--lxe-line);
	border-radius: var(--lxe-radius, 2px);
	color: var(--lxe-body, #3A4147);
}

.lead-form--compact {
	padding: var(--space-s) var(--space-m);
}

.lead-form__title {
	margin-bottom: var(--space-2xs);
	font-size: var(--step-1);
}

.lead-form__desc {
	margin-bottom: var(--space-m);
	font-size: var(--step--1);
	color: var(--lxe-muted, #6B7075);
}

.lead-form__grid {
	display: grid;
	gap: var(--space-s);
}

@media (min-width: 640px) {
	.lead-form__grid {
		grid-template-columns: 1fr 1fr;
	}

	.field--full {
		grid-column: 1 / -1;
	}
}

.field {
	margin: 0;
}

.field label {
	display: block;
	margin-bottom: 0.3rem;
	font-size: 0.78rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--lxe-muted, #6B7075);
}

.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field select,
.field textarea {
	width: 100%;

	/*
	 * 16px là ngưỡng Safari trên iOS ngừng tự phóng to trang khi người dùng
	 * chạm vào ô nhập. Nhỏ hơn con số này là trang bị nhảy, hỏng trải nghiệm.
	 */
	font-size: 16px;
	min-height: 48px;
	padding: 0.7rem 0.85rem;
	background: var(--lxe-background, #F6F3ED);
	border: 1px solid var(--lxe-line);
	border-radius: var(--lxe-radius, 2px);
	transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.field textarea {
	min-height: 90px;
	resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
	background: #fff;
	border-color: var(--lxe-secondary, #1F5E52);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
	border-color: #B3261E;
}

.field--consent {
	margin-top: var(--space-s);
}

.field--consent label {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	font-size: 0.8rem;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
	line-height: 1.5;
	color: var(--lxe-muted, #6B7075);
}

.field--consent input {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin-top: 0.15rem;
	accent-color: var(--lxe-secondary, #1F5E52);
}

/*
 * Bẫy chống bot. Dùng position tuyệt đối thay vì display:none — một số bot bỏ
 * qua trường bị ẩn hoàn toàn, nhưng vẫn điền vào trường chỉ bị đẩy ra ngoài
 * khung nhìn.
 */
.lead-form__trap {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.lead-form__actions {
	margin: var(--space-m) 0 0;
}

.lead-form__note {
	margin: var(--space-xs) 0 0;
	min-height: 1.4em;
	font-size: 0.82rem;
}

.lead-form__note.is-error {
	color: #B3261E;
}

.lead-form__note.is-success {
	color: var(--lxe-secondary, #1F5E52);
}

.lead-form.is-sending {
	opacity: 0.65;
	pointer-events: none;
}

.searchform {
	display: flex;
	gap: 0.5rem;
	margin-top: var(--space-s);
}

.searchform input {
	flex: 1;
	min-height: 48px;
	padding: 0.7rem 0.85rem;
	font-size: 16px;
	background: var(--lxe-background, #F6F3ED);
	border: 1px solid var(--lxe-line);
	border-radius: var(--lxe-radius, 2px);
}

/* ---------- Thẻ bài viết ---------- */

.post-card {
	background: var(--lxe-surface, #fff);
	border: 1px solid var(--lxe-line);
	border-radius: var(--lxe-radius, 2px);
	overflow: hidden;
	transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.post-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 32px rgba(var(--lxe-primary-rgb, 16, 24, 32), 0.1);
}

.post-card__link {
	display: block;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

.post-card__media {
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: var(--lxe-background, #F6F3ED);
}

.post-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.7s var(--ease);
}

.post-card:hover .post-card__media img {
	transform: scale(1.04);
}

.post-card__body {
	padding: var(--space-s) var(--space-m) var(--space-m);
}

.post-card__cat {
	margin: 0 0 0.4rem;
	font-size: 0.7rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--lxe-accent, #7E6130);
}

.post-card__title {
	margin: 0 0 0.5rem;
	font-size: var(--step-1);
	line-height: 1.25;
}

.post-card__excerpt {
	margin: 0 0 0.75rem;
	font-size: var(--step--1);
	color: var(--lxe-muted, #6B7075);
}

.post-card__meta {
	margin: 0;
	font-size: 0.75rem;
	color: var(--lxe-muted, #6B7075);
}

/* ---------- Bộ lọc và tab ---------- */

.filters {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: var(--space-m);
}

.filters__btn,
.tabs__btn {
	min-height: 44px;
	padding: 0.55rem 1.1rem;
	background: transparent;
	border: 1px solid var(--lxe-line);
	border-radius: var(--lxe-radius, 2px);
	font-size: 0.8rem;
	letter-spacing: 0.06em;
	color: var(--lxe-muted, #6B7075);
	transition: all var(--dur) var(--ease);
}

.filters__btn:hover,
.tabs__btn:hover {
	border-color: var(--lxe-primary, #101820);
	color: var(--lxe-heading, #101820);
}

.filters__btn.is-active,
.tabs__btn.is-active {
	background: var(--lxe-primary, #101820);
	border-color: var(--lxe-primary, #101820);
	color: #fff;
}

.tabs__nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: var(--space-m);
}

.tabs__panel {
	display: none;
}

.tabs__panel.is-active {
	display: block;
	animation: lxe-fade 0.35s var(--ease);
}

@keyframes lxe-fade {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: none; }
}

/* ---------- Hộp xem ảnh ---------- */

.lightbox {
	position: fixed;
	inset: 0;
	z-index: 300;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-m);
	background: rgba(10, 14, 18, 0.94);
	opacity: 0;
	transition: opacity var(--dur) var(--ease);
}

.lightbox.is-open {
	opacity: 1;
}

.lightbox[hidden] {
	display: none;
}

.lightbox__img {
	max-width: 100%;
	max-height: 82vh;
	object-fit: contain;
	cursor: zoom-in;
	transition: transform 0.3s var(--ease);
}

.lightbox__img.is-zoomed {
	cursor: zoom-out;
	transform: scale(2);
}

.lightbox__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: var(--space-m);
	text-align: center;
	color: rgba(255, 255, 255, 0.8);
	font-size: 0.85rem;
}

.lightbox__close,
.lightbox__nav {
	position: absolute;
	width: 48px;
	height: 48px;
	border: 1px solid rgba(255, 255, 255, 0.3);
	background: rgba(0, 0, 0, 0.3);
	color: #fff;
	font-size: 1.4rem;
	line-height: 1;
	border-radius: 50%;
}

.lightbox__close {
	top: var(--space-m);
	right: var(--space-m);
}

.lightbox__nav--prev { left: var(--space-m); top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: var(--space-m); top: 50%; transform: translateY(-50%); }

/* ---------- Hộp cookie ---------- */

.consent {
	position: fixed;
	left: var(--gutter);
	right: var(--gutter);
	bottom: var(--gutter);
	z-index: 150;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-s);
	max-width: 720px;
	margin-inline: auto;
	padding: var(--space-s) var(--space-m);
	background: var(--lxe-surface, #fff);
	border: 1px solid var(--lxe-line);
	border-radius: var(--lxe-radius, 2px);
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
	font-size: 0.82rem;
}

@media (max-width: 1279px) {
	.consent {
		bottom: calc(56px + var(--space-xs));
	}
}

.consent[hidden] {
	display: none;
}

.consent__text {
	flex: 1 1 260px;
	margin: 0;
}

.consent__actions {
	display: flex;
	gap: 0.5rem;
}

/* ---------- Hiệu ứng xuất hiện ---------- */

.reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal.is-visible {
	opacity: 1;
	transform: none;
}

/* ---------- Phân trang ---------- */

.pagination {
	margin-top: var(--space-l);
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	justify-content: center;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 0.75rem;
	border: 1px solid var(--lxe-line);
	text-decoration: none;
	font-size: 0.85rem;
}

.pagination .page-numbers.current {
	background: var(--lxe-primary, #101820);
	border-color: var(--lxe-primary, #101820);
	color: #fff;
}

/* ---------- Lối tắt sửa nội dung (chỉ quản trị viên thấy) ---------- */

.lxe-editable {
	position: relative;
}

.lxe-edit-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 20;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	background: rgba(16, 24, 32, 0.82);
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 999px;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-decoration: none;
	backdrop-filter: blur(6px);

	/*
	 * Mờ đi khi không dùng tới. Nút sửa là công cụ, không phải nội dung —
	 * không được che mất chính thứ mình đang xem.
	 */
	opacity: 0.25;
	transition: opacity var(--dur) var(--ease), background var(--dur) var(--ease);
}

.lxe-editable:hover .lxe-edit-badge,
.lxe-edit-badge:focus-visible {
	opacity: 1;
}

.lxe-edit-badge:hover {
	background: var(--lxe-secondary, #1F5E52);
	color: #fff;
}

.lxe-edit-badge__pen {
	font-size: 13px;
	line-height: 1;
}

/*
 * Khối đầu tiên nằm ngay dưới menu dính. Đẩy nút xuống để menu không che mất.
 */
.site-main > .lxe-editable:first-child .lxe-edit-badge {
	top: 88px;
}

@media (max-width: 767px) {
	/* Màn hình hẹp: nút sửa tranh chỗ với nội dung, ẩn đi. */
	.lxe-edit-badge {
		display: none;
	}
}

/* ---------- Ô nhắc khối trống ---------- */

.lxe-placeholder {
	padding-block: var(--space-l);
}

.lxe-placeholder__box {
	padding: var(--space-m);
	border: 1px dashed var(--lxe-line);
	border-radius: var(--lxe-radius, 2px);
	background: rgba(var(--lxe-accent-rgb, 126, 97, 48), 0.05);
	text-align: center;
}

.lxe-placeholder__eyebrow {
	margin: 0 0 0.35rem;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--lxe-accent, #7E6130);
}

.lxe-placeholder__text {
	max-width: 52ch;
	margin-inline: auto;
	font-size: var(--step--1);
	color: var(--lxe-muted, #6B7075);
}

/* 3.0 — language switcher (Blocker 02) */
.lang-switch { position: relative; font-size: .875rem; }
.lang-switch__toggle { display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: 0 .6rem; background: transparent; border: 1px solid currentColor; border-radius: var(--lxe-radius, 999px); color: inherit; cursor: pointer; }
.lang-switch__toggle:focus-visible, .lang-switch__link:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.lang-switch__caret { font-size: .7em; }
.lang-switch__list { list-style: none; margin: 0; padding: .25rem 0; }
.lang-switch--desktop .lang-switch__list { position: absolute; right: 0; top: calc(100% + .35rem); min-width: 12rem; background: #fff; color: #1a1a1a; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.15); z-index: 60; }
.lang-switch__link { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 1rem; color: inherit; text-decoration: none; flex-wrap: wrap; }
a.lang-switch__link:hover { background: rgba(0,0,0,.05); }
.lang-switch__link.is-current { font-weight: 600; }
.lang-switch__link.is-unavailable { opacity: .55; cursor: not-allowed; }
.lang-switch__note { flex-basis: 100%; font-size: .75em; line-height: 1.2; padding-bottom: .4rem; }
.lang-switch--mobile { margin: 1rem 0; }
.lang-switch--mobile .lang-switch__list { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; }
.lang-switch--mobile .lang-switch__link { border: 1px solid currentColor; border-radius: 999px; }
@media (max-width: 1279px) { .site-header__actions .lang-switch--desktop { display: none; } }

/* 3.0 — translated labels can be longer than the Vietnamese originals: never push the header off-screen. */
@media (max-width: 767px) {
	.site-header__actions .btn { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.hero__fact, .hero__fact dt, .hero__fact dd { min-width: 0; overflow-wrap: anywhere; }
.nearby__place, .nearby__note { min-width: 0; overflow-wrap: anywhere; }
/* 3.0 — desktop header with language switcher + longer translated CTA labels (found at 1440px, EN). */
.site-header__actions .btn { max-width: 13rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 3.0 — English menu labels are ~70% wider than Korean/Vietnamese ones (measured 792px vs 462px at 1440px). */
@media (min-width: 1280px) {
	.nav__list { gap: 0.75rem; }
	.nav__link { letter-spacing: 0.02em; }
	.site-header__actions { flex-shrink: 0; }
}
@media (min-width: 1280px) {
	/* Without JS a long menu wraps instead of overflowing; with JS the header switches to compact mode. */
	.site-header nav.nav, .site-header .site-header__nav { min-width: 0; flex: 1 1 auto; }
	.site-header .nav__list { flex-wrap: wrap; justify-content: center; row-gap: 0.15rem; }
	/* Compact mode: the menu does not fit on one row in this language, so it moves into the panel. */
	.site-header--compact nav.nav { display: none; }
	.site-header--compact .burger { display: inline-flex; }
}
@media (max-width: 1279px) {
	.site-header__actions, .site-header__brand { min-width: 0; }
}

/* 3.1 — SVG flags (identical on every OS, no external emoji images). */
.lxe-flag-svg { display: inline-block; vertical-align: -3px; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }

/* 3.1 — horizontal language switcher (flags in a row on desktop). */
.lang-switch--inline .lang-switch__row { display: flex; align-items: center; gap: 0.35rem; list-style: none; margin: 0; padding: 0; }
.lang-switch__chip { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 36px; padding: 0 0.4rem; color: inherit; text-decoration: none; font-size: 0.75rem; letter-spacing: 0.06em; opacity: 0.7; border-bottom: 1px solid transparent; transition: opacity 0.2s; }
a.lang-switch__chip:hover, a.lang-switch__chip:focus-visible { opacity: 1; }
a.lang-switch__chip:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.lang-switch__chip.is-current { opacity: 1; border-bottom-color: currentColor; }
.lang-switch__chip.is-unavailable { opacity: 0.3; cursor: not-allowed; }
@media (max-width: 1279px) { .site-header__actions .lang-switch--inline { display: none; } }

/* 3.1.2 — two-row desktop header: logo + flags + hotline + CTA on top, the main menu as a horizontal
   bar underneath (right-aligned under the language flags). No slide-out panel on desktop. */
@media (min-width: 1280px) {
	.site-header__inner {
		display: grid;
		grid-template-columns: auto 1fr;
		grid-template-areas: "brand actions" "nav nav";
		align-items: center;
		column-gap: var(--space-m, 1.5rem);
		row-gap: 0;
	}
	.site-header__brand { grid-area: brand; }
	.site-header__actions { grid-area: actions; justify-self: end; }
	.site-header .nav,
	.site-header--compact nav.nav {
		grid-area: nav;
		display: block !important;
		border-top: 1px solid rgba(255, 255, 255, 0.12);
		padding: 0.15rem 0 0.25rem;
	}
	.site-header .nav__list {
		flex-wrap: wrap;
		justify-content: flex-end;
		gap: 0.25rem clamp(1rem, 1.6vw, 2rem);
	}
	.site-header .burger,
	.site-header--compact .burger { display: none !important; }
	.site-header__actions .lang-switch--inline { display: block; }
}
