* {
	box-sizing: border-box;
}

html {
	min-height: 100%;
	scrollbar-gutter: stable;
}

body.hd-editorial,
body.hdx-theme {
	margin: 0;
	background: var(--bg);
	zoom: 0.85;
	transition: background 0.3s ease;
}

body.hd-editorial.hdx-menu-open,
body.hd-editorial.hdx-lightbox-open,
body.hd-editorial.hdx-search-open,
body.hdx-theme.hdx-menu-open,
body.hdx-theme.hdx-lightbox-open,
body.hdx-theme.hdx-search-open {
	overflow: hidden;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--accent-ink);
	outline-offset: 4px;
}

a {
	color: var(--ink);
	transition: color 0.2s ease;
}

a:hover {
	color: var(--ink);
}

.hdx-content-link {
	color: var(--ink);
	text-decoration-color: var(--faint);
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
	text-decoration-skip-ink: auto;
}

.hdx-content-link:hover {
	color: var(--ink);
	text-decoration-color: var(--muted);
}

.hdx-prose__content :is(u, span[style*="text-decoration: underline"]),
.hdx-note-prose :is(u, span[style*="text-decoration: underline"]) {
	text-underline-offset: 0.22em;
	text-decoration-thickness: 1px !important;
	text-decoration-color: color-mix(in srgb, currentColor 48%, transparent) !important;
	text-decoration-skip-ink: auto;
}

[hidden] {
	display: none !important;
}

.hdx-skip-link {
	position: fixed;
	top: 12px;
	left: 12px;
	z-index: 120;
	padding: 10px 14px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--card);
	color: var(--ink);
	font-family: 'Hanken Grotesk', sans-serif;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transform: translateY(calc(-100% - 24px));
	transition: transform 0.16s ease;
}

.hdx-skip-link:focus {
	transform: translateY(0);
}

.hdx-visually-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.hdx-site,
.hdx-shell {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--ink);
	font-family: 'Hanken Grotesk', system-ui, sans-serif;
	-webkit-font-smoothing: antialiased;
}

.hdx-main {
	width: 100%;
}

.hdx-site img,
.hdx-shell img {
	max-width: 100%;
}

.hdx-blur-media {
	position: relative;
	isolation: isolate;
	background: var(--thumb);
	overflow: hidden;
}

.hdx-blur-media::before {
	content: '';
	position: absolute;
	inset: -8px;
	z-index: 1;
	background-color: var(--thumb);
	background-image: var(--hdx-blur-image);
	background-position: center;
	background-size: cover;
	filter: blur(10px);
	transform: scale(1.04);
	opacity: 1;
	pointer-events: none;
	transition: opacity 0.34s ease;
}

.hdx-blur-media > img,
.hdx-blur-media picture,
.hdx-blur-media picture > img {
	position: relative;
	z-index: 0;
}

.hdx-blur-media.is-loaded::before {
	opacity: 0;
}

.hdx-header-wrap {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 60;
	background: color-mix(in srgb, var(--bg) 94%, transparent);
}

.hdx-progress {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 2.5px;
	overflow: hidden;
}

.hdx-progress-fill {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(
		90deg,
		color-mix(in srgb, var(--accent) 82%, #fff) 0%,
		var(--accent) 52%,
		color-mix(in srgb, var(--accent) 78%, #000) 100%
	);
	box-shadow: 0 1px 4px color-mix(in srgb, var(--accent) 55%, transparent);
	transform: scaleX(0);
	transform-origin: left center;
	will-change: transform;
}

.hdx-header {
	width: 100%;
	max-width: 1240px;
	margin: 0 auto;
	--hdx-header-pad-y: clamp(14px, 1.8vw, 20px);
	padding: var(--hdx-header-pad-y) clamp(24px, 4vw, 56px);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
}

.hdx-brand {
	font-weight: 700;
	font-size: 15px;
	line-height: 20px;
	letter-spacing: 0.02em;
	color: var(--ink);
	text-decoration: none;
}

.hdx-brand-accent,
.hdx-title-accent {
	color: var(--accent);
}

.hdx-desktop-nav {
	display: flex;
	align-items: center;
	gap: clamp(16px, 2.6vw, 28px);
}

.hdx-nav {
	--hdx-nav-gap: clamp(16px, 2.6vw, 28px);
	--hdx-nav-hit-x: clamp(8px, 1.3vw, 14px);
	display: flex;
	align-items: center;
	gap: 0;
	margin-inline: calc(0px - var(--hdx-nav-hit-x));
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.hdx-nav-link {
	position: relative;
	color: var(--muted);
	text-decoration: none;
	padding: var(--hdx-header-pad-y) var(--hdx-nav-hit-x) calc(4px + var(--hdx-header-pad-y));
	margin-block: calc(0px - var(--hdx-header-pad-y));
	border-bottom: 2px solid transparent;
	transition: color 0.18s ease;
	cursor: default;
}

/*
	* The anchor itself owns the full hit box. Horizontal padding is exactly half
	* the reference gap, while the nav's negative outer margins cancel the extra
	* half-gap at both ends. Text positions therefore stay identical to the design
	* while adjacent clickable boxes touch with no generated overlay or dead zone.
	* The inherited header padding expands the real anchor vertically to the
	* header edges; matching negative margins keep the label and header geometry
	* at their reference positions.
	*/
.hdx-nav-link::after {
	content: '';
	position: absolute;
	left: var(--hdx-nav-hit-x);
	right: var(--hdx-nav-hit-x);
	bottom: var(--hdx-header-pad-y);
	height: 2px;
	background: currentColor;
	opacity: 0;
	pointer-events: none;
}

.hdx-nav-link:hover {
	color: var(--ink);
}

.hdx-nav-link.is-active,
.hdx-nav-link[aria-current="page"] {
	color: var(--ink);
}

.hdx-nav-link.is-active::after,
.hdx-nav-link[aria-current="page"]::after {
	opacity: 1;
}

.hdx-tools {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-bottom: 4px;
}

.hdx-language-switch {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--card);
	padding: 2px;
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	font-size: 11px;
	letter-spacing: 0.08em;
}

.hdx-language-switch button,
.hdx-language-switch a {
	appearance: none;
	border: 0;
	border-radius: 999px;
	background: transparent;
	padding: 4px 9px;
	font: inherit;
	letter-spacing: inherit;
	color: var(--muted);
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease;
}

.hdx-language-switch button:hover,
.hdx-language-switch a:hover {
	color: var(--ink);
}

.hdx-language-switch button[aria-pressed="true"],
.hdx-language-switch a[aria-current="page"] {
	background: var(--ink);
	color: var(--bg);
}

.hdx-language-switch--mobile button,
.hdx-language-switch--mobile a {
	padding: 5px 11px;
}

.hdx-icon {
	opacity: 0.7;
	transition: opacity 0.18s ease;
}

.hdx-icon:hover {
	opacity: 1;
}

.hdx-icon-button {
	appearance: none;
	border: 0;
	background: none;
	padding: 0;
	color: var(--ink);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.hdx-search-link {
	display: flex;
	color: var(--ink);
	text-decoration: none;
}

.hdx-tool-divider {
	width: 1px;
	height: 15px;
	background: var(--line);
}

.hdx-header-divider {
	width: 100%;
	padding: 0 clamp(24px, 4vw, 56px);
}

.hdx-header-divider::after {
	content: '';
	display: block;
	height: 1px;
	background: var(--line);
}

.hdx-share {
	position: relative;
	display: flex;
	align-items: center;
}

.hdx-menu,
.hdx-share-menu {
	position: absolute;
	right: 0;
	top: calc(100% + 16px);
	min-width: 190px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: 12px;
	box-shadow: 0 20px 44px rgba(35, 40, 47, 0.16);
	padding: 7px;
	z-index: 70;
	animation: menuIn 0.16s ease;
}

.hdx-share-item,
.hdx-menu-item {
	width: 100%;
	appearance: none;
	border: 0;
	background: transparent;
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 13.5px;
	color: var(--ink);
	cursor: pointer;
	text-align: left;
	text-decoration: none;
	transition: background 0.14s ease;
}

.hdx-share-item:hover,
.hdx-menu-item:hover {
	background: var(--tint);
	color: var(--ink);
}

.hdx-mobile-toggle {
	display: none;
	appearance: none;
	background: none;
	border: none;
	color: var(--ink);
	cursor: pointer;
	padding: 4px;
	align-items: center;
}

.hdx-mobile-menu {
	position: fixed;
	inset: var(--wp-admin--admin-bar--height, 0px) 0 0;
	z-index: 90;
	background: var(--bg);
	display: flex;
	flex-direction: column;
	padding: clamp(18px, 2.5vw, 28px) clamp(24px, 6vw, 40px) 40px;
	animation: softIn 0.22s ease;
}

.hdx-mobile-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.hdx-mobile-close {
	appearance: none;
	background: none;
	border: none;
	color: var(--ink);
	cursor: pointer;
	padding: 4px;
	display: flex;
}

.hdx-mobile-nav {
	margin: auto 0;
	display: flex;
	flex-direction: column;
	gap: clamp(14px, 2.4vw, 22px);
	font-family: 'Newsreader', Georgia, serif;
}

.hdx-mobile-link {
	font-size: clamp(34px, 11vw, 48px);
	line-height: 1;
	font-weight: 600;
	color: var(--ink);
	text-decoration: none;
}

.hdx-mobile-link.is-active,
.hdx-mobile-link[aria-current="page"] {
	color: var(--accent-ink);
}

.hdx-mobile-foot {
	display: flex;
	align-items: center;
	gap: 22px;
	padding-top: 24px;
	border-top: 1px solid var(--line);
	color: var(--faint);
}

.hdx-mobile-foot a {
	color: var(--faint);
	text-decoration: none;
}

.hdx-mobile-theme {
	appearance: none;
	border: 0;
	background: none;
	padding: 0;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 9px;
	color: var(--faint);
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.hdx-mobile-spacer {
	flex: 1;
}

.hdx-search-panel {
	position: fixed;
	inset: 0;
	z-index: 95;
	background: var(--bg);
	color: var(--ink);
	animation: softIn 0.24s ease;
}

.hdx-search-inner {
	width: min(760px, 100%);
	height: 100%;
	margin: 0 auto;
	padding: clamp(24px, 5vw, 56px) clamp(20px, 4vw, 44px) 40px;
	display: flex;
	flex-direction: column;
}

.hdx-search-form {
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.hdx-search-field {
	display: flex;
	align-items: center;
	gap: 16px;
	border-bottom: 2px solid var(--ink);
	padding-bottom: 14px;
	transition: border-color 0.18s ease;
}

.hdx-search-field:focus-within {
	border-bottom-color: var(--accent-ink);
}

.hdx-search-field > svg {
	flex: 0 0 auto;
	color: var(--faint);
}

.hdx-search-form .hdx-search-status {
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	font-size: 11px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--faint);
	margin: 18px 0 6px;
}

.hdx-search-form input {
	flex: 1;
	min-width: 0;
	appearance: none;
	border: 0;
	border-radius: 0;
	background: transparent;
	padding: 0;
	font-family: 'Newsreader', Georgia, serif;
	font-size: clamp(22px, 3vw, 32px);
	line-height: 1.25;
	color: var(--ink);
}

.hdx-search-form input:focus,
.hdx-search-form input:focus-visible {
	outline: none;
	box-shadow: none;
}

.hdx-search-form input::placeholder {
	color: var(--faint);
	opacity: 0.6;
}

.hdx-search-close {
	appearance: none;
	border: 0;
	background: none;
	color: var(--faint);
	cursor: pointer;
	padding: 4px;
	display: flex;
	flex: 0 0 auto;
}

.hdx-search-close:hover {
	color: var(--ink);
}

.hdx-search-results {
	min-height: 0;
	overflow: auto;
	overscroll-behavior: contain;
}

.hdx-search-result {
	display: grid;
	grid-template-columns: 70px minmax(0, 1fr) auto;
	gap: clamp(10px, 2vw, 18px);
	align-items: baseline;
	padding: 14px 2px;
	border-bottom: 1px solid var(--line);
	color: var(--ink);
	text-decoration: none;
}

.hdx-search-result-kind {
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	font-size: 10px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--faint);
}

.hdx-search-result-title {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-family: 'Newsreader', Georgia, serif;
	font-size: clamp(16px, 1.6vw, 18px);
	font-weight: 600;
}

.hdx-search-result-meta {
	font-size: 12px;
	color: var(--faint);
	white-space: nowrap;
}

.hdx-search-empty {
	padding: 40px 2px;
	font-family: 'Newsreader', Georgia, serif;
	font-style: italic;
	font-size: clamp(17px, 1.7vw, 20px);
	color: var(--muted);
}

.hdx-page-title {
	font-family: 'Newsreader', Georgia, serif;
	font-weight: 700;
	font-size: clamp(36px, 4.6vw, 54px);
	line-height: 1;
	margin: 0 0 12px;
}

.hdx-page-tagline {
	font-size: clamp(14.5px, 1.3vw, 16.5px);
	color: var(--muted);
}

.hdx-back-to-top {
	position: fixed;
	right: clamp(16px, 2.4vw, 30px);
	bottom: clamp(16px, 2.4vw, 30px);
	z-index: 70;
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
	border-radius: 50%;
	background: color-mix(in srgb, var(--bg) 92%, transparent);
	box-shadow: 0 4px 18px color-mix(in srgb, var(--ink) 8%, transparent);
	color: var(--muted);
	opacity: 0;
	transform: translateY(8px);
	pointer-events: none;
	cursor: pointer;
	transition: opacity 0.18s ease, transform 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.hdx-back-to-top.is-visible {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.hdx-back-to-top:hover,
.hdx-back-to-top:focus-visible {
	border-color: color-mix(in srgb, var(--ink) 28%, transparent);
	color: var(--ink);
}

@media (max-width: 720px) {
	.hdx-back-to-top {
		right: 14px;
		bottom: 14px;
		width: 40px;
		height: 40px;
	}
}

.hdx-section-label {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 4px;
	color: var(--faint);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.hdx-back-link {
	display: flex;
	align-items: center;
	gap: 8px;
	width: fit-content;
	appearance: none;
	background: none;
	border: none;
	cursor: pointer;
	font-family: 'Hanken Grotesk', sans-serif;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--faint);
	text-decoration: none;
	padding: 0;
}

.hdx-back-link:hover {
	color: var(--ink);
}

.hdx-footer {
	margin-top: auto;
	border-top: 1px solid var(--line);
	padding: clamp(24px, 3vw, 34px) clamp(24px, 4vw, 56px) clamp(34px, 4vw, 46px);
}

.hdx-footer-inner {
	width: 100%;
	max-width: 1240px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	flex-wrap: wrap;
}

.hdx-footer-copy {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	font-size: 12.5px;
	color: var(--faint);
}

.hdx-footer-owner {
	font-weight: 600;
	color: var(--muted);
}

.hdx-footer-dot {
	color: var(--line);
}

.hdx-footer-since {
	font-family: 'JetBrains Mono', ui-monospace, monospace;
	font-size: 11px;
	letter-spacing: 0.1em;
}

.hdx-footer-social {
	display: flex;
	align-items: center;
	gap: 18px;
}

.hdx-footer-social a {
	color: #8B897B;
	display: block;
}

.hdx-empty {
	font-family: 'Newsreader', Georgia, serif;
	font-size: clamp(16.5px, 1.5vw, 18.5px);
	line-height: 1.8;
	color: var(--muted);
}

main {
	transition: opacity 0.19s ease, transform 0.19s ease;
}

html.hdx-lang-fade main {
	opacity: 0;
	transform: translateY(5px);
}

html[data-hdx-lang="en"] [data-hdx-language-panel="vi"],
html[data-hdx-lang="vi"] [data-hdx-language-panel="en"] {
	display: none;
}

.hdx-empty-state {
	padding: clamp(38px, 5.5vw, 68px) 0;
	border-top: 1px solid var(--line);
}

.hdx-empty-state > i {
	display: block;
	width: 32px;
	height: 2px;
	margin-bottom: 22px;
	background: var(--accent);
}

.hdx-empty-state > p {
	max-width: 34ch;
	margin: 0 0 10px;
	font-family: 'Newsreader', Georgia, serif;
	font-size: clamp(19px, 2vw, 24px);
	font-style: italic;
	line-height: 1.5;
	color: var(--ink);
}

.hdx-empty-state > span {
	display: block;
	max-width: 46ch;
	font-size: clamp(13.5px, 1.25vw, 15px);
	line-height: 1.65;
	color: var(--muted);
}

.hdx-visually-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

@keyframes fadeUp {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes softIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

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

@media (max-width: 782px) {
	body.admin-bar.hd-editorial .hdx-header-wrap,
	body.admin-bar.hdx-theme .hdx-header-wrap {
		top: 0;
	}

	.hdx-mobile-menu {
		inset: 0;
	}
}

@media (max-width: 720px) {
	.hdx-desktop-nav {
		display: none !important;
	}

	.hdx-mobile-toggle {
		display: flex !important;
	}

	.hdx-search-panel {
		padding: 0;
	}

	.hdx-search-inner {
		padding-top: 24px;
	}

	.hdx-search-result {
		grid-template-columns: 58px minmax(0, 1fr);
	}

	.hdx-search-result-meta {
		grid-column: 2;
		font-size: 11px;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}

	.hdx-progress-fill {
		will-change: auto;
	}

	.hdx-blur-media::before {
		transition: none;
	}

	main {
		transition: none;
	}

	html.hdx-lang-fade main {
		opacity: 1;
		transform: none;
	}
}

.hdx-language-switch a { text-decoration: none; }
.hdx-language-switch button:disabled { cursor: default; opacity: .45; }
