/*
 * Tầng 1 — Nền.
 *
 * Chỉ chứa reset, thang đo và kiểu chữ mặc định. Không có tên lớp thành phần.
 * Mọi màu đều đọc từ biến --lxe-* do PHP in ra ở thẻ <head>, nên không có mã
 * màu cứng nào trong tệp này ngoài các giá trị dự phòng.
 */

/* ---------- Thang đo ---------- */

:root {
	--step--1: clamp(0.83rem, 0.79rem + 0.20vw, 0.94rem);
	--step-0:  clamp(1.00rem, 0.95rem + 0.25vw, 1.13rem);
	--step-1:  clamp(1.20rem, 1.11rem + 0.44vw, 1.44rem);
	--step-2:  clamp(1.44rem, 1.29rem + 0.74vw, 1.84rem);
	--step-3:  clamp(1.73rem, 1.49rem + 1.19vw, 2.36rem);
	--step-4:  clamp(2.07rem, 1.71rem + 1.83vw, 3.02rem);
	--step-5:  clamp(2.49rem, 1.94rem + 2.75vw, 3.86rem);

	--space-2xs: 0.5rem;
	--space-xs:  0.75rem;
	--space-s:   1rem;
	--space-m:   1.5rem;
	--space-l:   2.5rem;
	--space-xl:  4rem;
	--space-2xl: clamp(4rem, 3rem + 5vw, 7rem);

	--wrap: 1180px;
	--wrap-narrow: 760px;
	--gutter: clamp(1.25rem, 4vw, 2.5rem);

	--ease: cubic-bezier(0.22, 0.61, 0.36, 1);
	--dur: 0.4s;
}

/* ---------- Reset ---------- */

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;

	/*
	 * Menu dính che mất tiêu đề khi nhảy tới neo. Khai báo ở đây thay vì bù
	 * bằng JavaScript để không phụ thuộc script và không gây giật hình.
	 */
	scroll-padding-top: 88px;
}

body {
	margin: 0;
	background: var(--lxe-background, #F6F3ED);
	color: var(--lxe-body, #3A4147);
	font-family: var(--lxe-font-body, system-ui, sans-serif);
	font-size: var(--step-0);
	line-height: 1.65;
	font-synthesis-weight: none;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	overflow-wrap: break-word;
}

body.is-locked {
	overflow: hidden;
}

h1, h2, h3, h4 {
	margin: 0 0 var(--space-s);
	font-family: var(--lxe-font-display, Georgia, serif);
	font-weight: 500;
	line-height: 1.15;
	color: var(--lxe-heading, #101820);
	letter-spacing: -0.015em;

	/*
	 * Tiếng Việt có dấu chồng hai tầng (ế, ộ, ữ). Dòng quá sát nhau làm dấu
	 * đâm vào chân chữ dòng trên, nên line-height không được xuống dưới 1.15
	 * và cần cho phép trình duyệt nới thêm không gian trên.
	 */
	text-wrap: balance;
}

h1 { font-size: var(--step-5); }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p {
	margin: 0 0 var(--space-s);
	text-wrap: pretty;
}

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color var(--dur) var(--ease);
}

a:hover {
	color: var(--lxe-secondary, #1F5E52);
}

img,
picture,
video,
svg {
	max-width: 100%;
	height: auto;
	display: block;
}

ul, ol {
	margin: 0 0 var(--space-s);
	padding-left: 1.2em;
}

table {
	border-collapse: collapse;
	width: 100%;
}

button {
	font: inherit;
	color: inherit;
	cursor: pointer;
}

input,
select,
textarea {
	font: inherit;
	color: inherit;
}

figure {
	margin: 0;
}

hr {
	border: 0;
	border-top: 1px solid var(--lxe-line);
	margin: var(--space-l) 0;
}

blockquote {
	margin: var(--space-m) 0;
	padding-left: var(--space-m);
	border-left: 2px solid var(--lxe-accent, #7E6130);
	font-family: var(--lxe-font-display, Georgia, serif);
	font-size: var(--step-1);
	font-style: italic;
}

::selection {
	background: var(--lxe-accent, #7E6130);
	color: #fff;
}

/* ---------- Truy cập ---------- */

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--lxe-secondary, #1F5E52);
	outline-offset: 3px;
	border-radius: 2px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	top: -100px;
	left: var(--gutter);
	z-index: 999;
	padding: 0.75rem 1.25rem;
	background: var(--lxe-primary, #101820);
	color: #fff;
	text-decoration: none;
	transition: top 0.2s var(--ease);
}

.skip-link:focus {
	top: 1rem;
	color: #fff;
}

/*
 * Tôn trọng lựa chọn giảm chuyển động của hệ điều hành. Không tắt hẳn
 * transition — chỉ rút ngắn để giao diện vẫn phản hồi rõ ràng.
 */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}

	.reveal {
		opacity: 1 !important;
		transform: none !important;
	}
}

/* ---------- Nội dung do biên tập viên nhập ---------- */

.prose {
	max-width: 68ch;
}

.prose > * + * {
	margin-top: var(--space-s);
}

.prose h2 {
	margin-top: var(--space-l);
	font-size: var(--step-2);
}

.prose h3 {
	margin-top: var(--space-m);
	font-size: var(--step-1);
}

.prose img {
	margin: var(--space-m) 0;
}

.prose ul,
.prose ol {
	padding-left: 1.4em;
}

.prose li + li {
	margin-top: 0.4em;
}

.prose a {
	color: var(--lxe-secondary, #1F5E52);
}

.measure {
	max-width: 68ch;
}

@media print {
	.site-header,
	.mobile-bar,
	.mobile-nav,
	.consent,
	.lead-form,
	.section--cta {
		display: none !important;
	}

	body {
		background: #fff;
		color: #000;
		font-size: 11pt;
	}
}
