/* ==========================================================================
   TENGLONG TH — Thai B2B marketing theme
   Single stylesheet. High-end Euro-American industrial language:
   large white space, hairline rules, numbered labels, monospace figures,
   restrained dark blocks, no gradient stacks, no shadow stacks.
   Zero external fonts / zero third-party assets.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
	/* Brand / surface */
	--ink:        #12161a;   /* ink black   */
	--ink-soft:   #1b2228;
	--steel:      #2b333b;   /* steel grey  */
	--steel-2:    #3d474f;
	--muted:      #5f6972;
	--line:       #dde1e5;
	--paper:      #ffffff;
	--sand:       #f5f2ec;   /* warm sand   */
	--sand-2:     #ece7dd;
	--amber:      #c9a227;   /* logo gold leaf */
	--ember:      #e8621c;   /* industrial orange — CTA / focus only */
	--amber-soft: #f0e6c8;

	/* Geometry */
	--radius:     14px;
	--radius-sm:  8px;
	--wrap:       1240px;
	--gutter:     24px;
	--rule:       1px solid var(--line);
	--rule-dark:  1px solid rgba(255, 255, 255, .14);

	/* Thai-first system font stack — no webfont files, no remote fonts */
	--font-thai: "Noto Sans Thai", "Sarabun", "Leelawadee UI", "Thonburi",
		-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
	--font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
		"Liberation Mono", monospace;

	--fs-body:   17px;   /* Thai tone marks need a generous body size */
	--lh-body:   1.8;    /* Thai tone marks need a generous line height */
	--lh-head:   1.35;
	--fs-xs:     13px;
	--fs-sm:     15px;
	--fs-lg:     19px;
	--fs-h3:     22px;
	--fs-h2:     clamp(26px, 3.2vw, 38px);
	--fs-h1:     clamp(32px, 4.6vw, 58px);

	/* Spacing scale */
	--sp-1: 4px;
	--sp-2: 8px;
	--sp-3: 12px;
	--sp-4: 16px;
	--sp-5: 24px;
	--sp-6: 32px;
	--sp-7: 48px;
	--sp-8: 72px;
	--sp-9: 104px;

	--focus: var(--ember);
}

/* --------------------------------------------------------------------------
   2. Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-thai);
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	/* Thai has no inter-word spaces: allow safe breaking of long tokens */
	overflow-wrap: break-word;
	word-wrap: break-word;
	hyphens: none;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, table, blockquote {
	margin: 0;
	padding: 0;
}

h1, h2, h3, h4 {
	line-height: var(--lh-head);
	font-weight: 700;
	letter-spacing: -.01em;
}

ul, ol { list-style: none; }

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

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

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

button { cursor: pointer; }

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

caption { text-align: start; }

details > summary { cursor: pointer; }

/* Focus: one obvious, high-contrast ring everywhere */
:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 3px;
	border-radius: 2px;
}
/* Fallback for browsers without :focus-visible */
a:focus, summary:focus, button:focus, input:focus, select:focus, textarea:focus {
	outline: 3px solid var(--focus);
	outline-offset: 3px;
}
a:focus:not(:focus-visible),
summary:focus:not(:focus-visible),
button:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--amber); color: var(--ink); }

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.section { padding-block: var(--sp-8); }
.section--tight { padding-block: var(--sp-7); }
.section--paper { background: var(--sand); }
.section--dark {
	background: var(--ink);
	color: var(--sand);
}
.section--dark a { color: inherit; }

.grid { display: grid; gap: var(--sp-5); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.split {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--sp-6);
}

.section-head {
	display: grid;
	grid-template-columns: 84px minmax(0, 1fr);
	gap: var(--sp-5);
	align-items: start;
	margin-bottom: var(--sp-7);
	padding-top: var(--sp-5);
	border-top: var(--rule);
}
.section-index {
	font-family: var(--font-mono);
	font-size: var(--fs-sm);
	letter-spacing: .12em;
	color: var(--amber);
	padding-top: 6px;
}
.section-head-text { min-width: 0; }
.section-head--dark,
.section--dark .section-head { border-top-color: rgba(255,255,255,.18); }

.eyebrow {
	font-size: var(--fs-xs);
	letter-spacing: .18em;
	text-transform: uppercase;
	color: var(--muted);
	margin-bottom: var(--sp-3);
}
.section--dark .eyebrow { color: var(--amber); }

.h2 { font-size: var(--fs-h2); margin-bottom: var(--sp-4); }
.h3 { font-size: var(--fs-h3); margin-bottom: var(--sp-3); }
.display { font-size: var(--fs-h1); }
.display--sm { font-size: clamp(28px, 3.6vw, 44px); }

.section-intro {
	max-width: 68ch;
	color: var(--muted);
	font-size: var(--fs-lg);
}
.section--dark .section-intro { color: #b9c0c6; }

.lede {
	font-size: var(--fs-lg);
	color: var(--steel);
	max-width: 62ch;
}
.lede--sm { font-size: var(--fs-body); }
.section--dark .lede,
.hero .lede { color: #c8ced3; }

.body-copy {
	max-width: 76ch;
	margin-bottom: var(--sp-5);
	color: var(--steel);
}
.section--dark .body-copy { color: #c8ced3; }

.mono, .section-index, .step-no, .cluster-no, .stat-value,
.card-kicker, .fig-code, .cell-code, .error-code {
	font-family: var(--font-mono);
	font-variant-numeric: tabular-nums;
}

/* Utilities */
.mt-6 { margin-top: var(--sp-6); }
.sr-only {
	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 {
	position: absolute;
	left: var(--sp-4);
	top: -100px;
	z-index: 200;
	background: var(--ink);
	color: var(--paper);
	padding: 12px 20px;
	font-size: var(--fs-sm);
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}
.skip-link:focus { top: var(--sp-4); }

.icon { flex: none; display: inline-block; vertical-align: middle; }

.dot {
	width: 7px; height: 7px;
	display: inline-block;
	border-radius: 50%;
	background: var(--amber);
	margin-inline-end: 10px;
	vertical-align: middle;
}

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 48px;
	padding: 12px 24px;
	font-size: var(--fs-sm);
	font-weight: 700;
	line-height: 1.4;
	border: 1px solid transparent;
	border-radius: var(--radius-sm);
	transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.btn .icon { transition: transform .18s ease; }
.btn:hover .icon--arrow { transform: translateX(3px); }
.btn--solid { background: var(--ember); color: #fff; border-color: var(--ember); }
.btn--solid:hover { background: #cf5113; border-color: #cf5113; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--steel-2); }
.btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--light { background: transparent; color: var(--paper); border-color: rgba(255,255,255,.55); }
.btn--light:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--small { min-height: 44px; padding: 9px 18px; font-size: var(--fs-xs); }
.btn--block { display: flex; width: 100%; }
.section--dark .btn--ghost,
.cta-band .btn--ghost { color: var(--paper); border-color: rgba(255,255,255,.55); }
.section--dark .btn--ghost:hover,
.cta-band .btn--ghost:hover { background: var(--paper); color: var(--ink); }

.link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: var(--fs-sm);
	font-weight: 700;
	color: var(--ember);
	border-bottom: 1px solid currentColor;
	padding-bottom: 2px;
}
.link-arrow .icon { transition: transform .18s ease; }
.link-arrow:hover .icon { transform: translateX(4px); }

.chip-list { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip-list li {
	border: var(--rule);
	border-radius: var(--radius-sm);
	padding: 8px 14px;
	font-size: var(--fs-sm);
	background: var(--paper);
}
.chip-list--outline li { background: transparent; }

.check-list { display: grid; gap: 12px; margin-bottom: var(--sp-6); }
.check-list--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.check-list li { display: flex; gap: 12px; align-items: flex-start; color: var(--steel); }
.check-list .icon { color: var(--amber); margin-top: 6px; }
.section--dark .check-list li { color: #c8ced3; }

.section-foot-link { margin-top: var(--sp-6); text-align: center; }

/* --------------------------------------------------------------------------
   4. Topbar
   -------------------------------------------------------------------------- */
.topbar {
	background: var(--ink);
	color: #c9d0d5;
	font-size: var(--fs-xs);
	border-bottom: var(--rule-dark);
}
.topbar-inner {
	min-height: 44px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-5);
}
.topbar-note { display: flex; align-items: center; }
.topbar-links { display: flex; align-items: center; gap: var(--sp-5); }
.topbar-links > a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	color: #e4e8eb;
}
.topbar-links > a:hover { color: var(--amber); }
.topbar-links .icon { color: var(--amber); }
.topbar-mail { display: none; }

/* --------------------------------------------------------------------------
   5. Language switcher — <details> based, zero-JS functional (docs/02 §6.2)
   -------------------------------------------------------------------------- */
.lang-switch { position: relative; display: inline-block; }
.lang-switch > summary {
	list-style: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 12px;
	color: #e4e8eb;
	font-size: var(--fs-xs);
	font-weight: 700;
	border-inline: 1px solid rgba(255,255,255,.14);
}
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch > summary::marker { content: ""; }
.lang-switch > summary:hover,
.lang-switch[open] > summary { color: var(--amber); }
.lang-switch__chevron {
	display: inline-block;
	font-size: 11px;
	line-height: 1;
	transition: transform .18s ease;
}
.lang-switch[open] .lang-switch__chevron { transform: rotate(180deg); }

.lang-menu {
	position: absolute;
	inset-inline-end: 0;
	top: calc(100% + 6px);
	z-index: 120;
	width: 268px;
	max-height: min(70vh, 520px);
	overflow-y: auto;
	background: var(--paper);
	color: var(--ink);
	border: var(--rule);
	border-top: 3px solid var(--amber);
	border-radius: var(--radius-sm);
	padding: 6px;
	box-shadow: 0 12px 32px rgba(18, 22, 26, .16);
}
.lang-menu li + li { border-top: var(--rule); }
.lang-menu a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	min-height: 44px;          /* min touch target */
	padding: 9px 12px;
	font-size: var(--fs-sm);
	border-radius: 4px;
}
.lang-menu a:hover { background: var(--sand); }
.lang-menu__name { min-width: 0; }
.lang-menu__now,
.lang-menu__soon {
	flex: none;
	font-size: 11px;
	line-height: 1.4;
	padding: 2px 7px;
	border-radius: 3px;
	white-space: nowrap;
}
.lang-menu__now { color: var(--ink); background: var(--amber-soft); }
.lang-menu__soon { color: var(--muted); background: var(--sand-2); }
.lang-menu .is-current > a { color: var(--ink); font-weight: 700; }
.lang-menu .is-current > a::before {
	content: "";
	position: absolute;
	inset-inline-start: 6px;
	width: 3px;
	height: 26px;
	background: var(--amber);
}
.lang-menu .is-current > a { padding-inline-start: 18px; }
.lang-menu .is-planned > a { color: var(--muted); }
.lang-menu .is-planned > a:hover { color: var(--ink); }
/* RTL fallback: the Arabic entry is right-aligned inside the LTR site */
.lang-menu a[dir="rtl"] { text-align: right; }
.lang-menu a[dir="rtl"] .lang-menu__name { direction: rtl; unicode-bidi: isolate; }
[dir="rtl"] .lang-menu a { text-align: right; }
[dir="rtl"] .lang-menu__name { direction: rtl; unicode-bidi: isolate; }

/* --------------------------------------------------------------------------
   6. Header / brand / navigation
   -------------------------------------------------------------------------- */
.site-header {
	position: relative;
	z-index: 60;
	background: var(--paper);
	border-bottom: var(--rule);
}
.header-inner {
	display: flex;
	align-items: center;
	gap: var(--sp-6);
	min-height: 84px;
}
.brand { display: inline-flex; align-items: center; gap: 14px; flex: none; }
.brand-mark {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	background: var(--ink);
	border-radius: var(--radius-sm);
	padding: 6px;
}
.brand-logo { width: 100%; height: 100%; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong {
	font-family: var(--font-mono);
	font-size: 21px;
	letter-spacing: .12em;
}
.brand-text small { font-size: 12px; color: var(--muted); }

.nav { margin-inline-start: auto; }
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-links a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 13px;
	font-size: var(--fs-sm);
	color: var(--steel);
	white-space: nowrap;
	border-bottom: 2px solid transparent;
}
.nav-links a:hover { color: var(--ink); border-bottom-color: var(--amber); }
.nav-links a[aria-current="page"] {
	color: var(--ink);
	font-weight: 700;
	border-bottom-color: var(--amber);
}

.header-actions { display: flex; align-items: center; gap: var(--sp-3); flex: none; }
.header-quote { white-space: nowrap; }

/* Mobile navigation — also a <details>, usable with zero JavaScript */
.mobile-nav { display: none; position: relative; }
.mobile-nav > summary {
	list-style: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: var(--rule);
	border-radius: var(--radius-sm);
	background: var(--paper);
	color: var(--ink);
}
.mobile-nav > summary::-webkit-details-marker { display: none; }
.mobile-nav > summary::marker { content: ""; }
.mobile-nav .menu-close { display: none; }
.mobile-nav[open] .menu-open { display: none; }
.mobile-nav[open] .menu-close { display: inline-flex; }
.mobile-nav__panel {
	position: absolute;
	inset-inline-end: 0;
	top: calc(100% + 10px);
	z-index: 90;
	width: min(340px, 88vw);
	background: var(--paper);
	border: var(--rule);
	border-top: 3px solid var(--amber);
	border-radius: var(--radius-sm);
	padding: var(--sp-5);
	box-shadow: 0 14px 36px rgba(18, 22, 26, .16);
}
.mobile-nav__links { margin-bottom: var(--sp-5); }
.mobile-nav__links li + li { border-top: var(--rule); }
.mobile-nav__links a {
	display: block;
	min-height: 44px;
	padding: 10px 4px;
	font-size: var(--fs-sm);
}
.mobile-nav__links a[aria-current="page"] { color: var(--ember); font-weight: 700; }
.mobile-nav__phone {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: var(--sp-4);
	font-size: var(--fs-sm);
	color: var(--muted);
}

.site-main { min-height: 60vh; }

/* View states — normal / empty / loading / error / (public = no auth).
   SSR pages have no client "loading" state; the only async interaction is
   the quote form, whose busy state is covered by form[aria-busy="true"]. */
.view { min-width: 0; }
.view[data-state="empty"] .empty-state,
.view[data-state="degraded"] .empty-state,
.view[data-state="error"] .no-results {
	border-inline-start-color: var(--steel-2);
}
.view[data-state="empty"] .empty-state::before,
.view[data-state="degraded"] .empty-state::before {
	content: "ข้อมูล / DATA";
	display: block;
	font-family: var(--font-mono);
	font-size: 11px;
	letter-spacing: .14em;
	color: var(--muted);
	margin-bottom: 8px;
}
.view[data-state="ok"] .empty-state { border-inline-start-color: var(--amber); }

/* --------------------------------------------------------------------------
   7. Breadcrumbs
   -------------------------------------------------------------------------- */
.breadcrumbs { font-size: var(--fs-xs); color: var(--muted); padding-block: var(--sp-5); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 8px; min-height: 24px; }
.breadcrumbs li + li::before {
	content: "/";
	font-family: var(--font-mono);
	color: var(--line);
}
.breadcrumbs a:hover { color: var(--ember); text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 700; }

/* --------------------------------------------------------------------------
   8. Hero (LCP: plasticRecycling (40).webp, preload handled in head)
   -------------------------------------------------------------------------- */
.hero {
	position: relative;
	background: var(--ink);
	color: var(--paper);
	overflow: hidden;
}
/* Industrial grid rule — hard-stop 1px lines, not a decorative gradient */
.hero::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background-image: linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px);
	background-size: 124px 100%;
}
.hero > * { position: relative; }
.hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
	gap: var(--sp-7);
	align-items: center;
	padding-block: var(--sp-8) var(--sp-7);
}
.hero .eyebrow { color: var(--amber); }
.hero .display { margin-bottom: var(--sp-5); max-width: 20ch; }
.hero .lede { margin-bottom: var(--sp-6); }
.badge-row { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); margin-bottom: var(--sp-6); }
.badge-row li {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: var(--fs-sm);
	color: #cdd3d8;
}
.badge-row .icon { color: var(--amber); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.hero-media { min-width: 0; }
.hero-img {
	width: 100%;
	height: auto;
	border-radius: var(--radius);
	background: var(--paper);
}
.hero-media figcaption {
	font-size: var(--fs-xs);
	color: #9aa3aa;
	margin-top: var(--sp-3);
	border-inline-start: 2px solid var(--amber);
	padding-inline-start: 12px;
}

.stat-strip {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	border-top: var(--rule-dark);
}
.stat {
	padding: var(--sp-5) var(--sp-4);
	border-inline-end: var(--rule-dark);
}
.stat:first-child { padding-inline-start: 0; }
.stat:last-child { border-inline-end: 0; }
.stat-label { font-size: var(--fs-xs); color: #9aa3aa; margin-bottom: 6px; }
.stat-value {
	font-size: clamp(22px, 2.4vw, 30px);
	font-weight: 700;
	color: var(--paper);
	letter-spacing: -.02em;
}
.stat-value span { font-family: var(--font-thai); font-size: var(--fs-sm); margin-inline-start: 4px; color: var(--amber); }

/* --------------------------------------------------------------------------
   9. Answer-first block (AEO)
   -------------------------------------------------------------------------- */
.answer-wrap { max-width: 940px; }
.answer-box {
	background: var(--paper);
	border: var(--rule);
	border-inline-start: 4px solid var(--amber);
	border-radius: var(--radius-sm);
	padding: var(--sp-6);
}
.section--dark .answer-box { background: var(--ink-soft); border-color: rgba(255,255,255,.18); }
.answer-label {
	font-size: var(--fs-xs);
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--amber);
	margin-bottom: var(--sp-3);
}
.answer-q {
	font-size: var(--fs-lg);
	font-weight: 700;
	margin-bottom: var(--sp-3);
}
.answer-text { font-size: var(--fs-lg); color: var(--steel); max-width: 82ch; }
.section--dark .answer-text { color: #cdd3d8; }

/* --------------------------------------------------------------------------
   10. Cards & cluster grid
   -------------------------------------------------------------------------- */
.card {
	display: flex;
	flex-direction: column;
	background: var(--paper);
	border: var(--rule);
	border-radius: var(--radius-sm);
	overflow: hidden;
	transition: border-color .18s ease, transform .18s ease;
}
.card:hover { border-color: var(--amber); transform: translateY(-2px); }
.card-media { display: block; aspect-ratio: 16 / 10; background: var(--sand); overflow: hidden; }
.card-img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-img { transform: scale(1.03); }
.card-body { padding: var(--sp-5); display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card-kicker { font-size: var(--fs-xs); letter-spacing: .1em; color: var(--muted); }
.card-title { font-size: var(--fs-lg); line-height: var(--lh-head); }
.card-title a:hover { color: var(--ember); }
.card-text { font-size: var(--fs-sm); color: var(--muted); flex: 1; }
.card-body .link-arrow { margin-top: auto; }
.section--dark .card { background: var(--ink-soft); border-color: rgba(255,255,255,.18); }
.section--dark .card:hover { border-color: var(--amber); }
.section--dark .card-media { background: #222a31; }
.section--dark .card-title,
.section--dark .card-text { color: var(--sand); }
.section--dark .card-kicker { color: #9aa3aa; }

.cluster-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: var(--rule); border-inline-start: var(--rule); }
.cluster-card {
	padding: var(--sp-5);
	border-inline-end: var(--rule);
	border-bottom: var(--rule);
	min-height: 180px;
	display: flex;
	flex-direction: column;
}
.cluster-card:hover { background: var(--sand); }
.cluster-no { font-size: var(--fs-xs); color: var(--amber); margin-bottom: var(--sp-4); letter-spacing: .1em; }
.cluster-title { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.cluster-text { font-size: var(--fs-sm); color: var(--muted); flex: 1; }
.cluster-card .link-arrow { margin-top: var(--sp-4); }

/* Six hub clusters: slugs cover all 36 routed keys (internal link graph). */
.hub-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); margin-top: var(--sp-5); }
.hub-card { border: var(--rule); border-radius: var(--radius-sm); padding: var(--sp-5); background: var(--paper); }
.hub-title { font-size: var(--fs-lg); line-height: var(--lh-head); margin-bottom: var(--sp-2); }
.hub-intro { font-size: var(--fs-xs); color: var(--muted); margin-bottom: var(--sp-4); }
.hub-list { display: grid; gap: 0; }
.hub-list li { border-top: var(--rule); }
.hub-list a { display: block; padding: 10px 0; font-size: var(--fs-sm); color: var(--steel); min-height: 44px; }
.hub-list a:hover { color: var(--ember); }
@media (max-width: 1023px) { .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .hub-grid { grid-template-columns: 1fr; } }

/* Technical-note cards (author + dates visible for E-E-A-T). */
.card-meta { display: flex; flex-wrap: wrap; gap: 8px var(--sp-4); font-size: var(--fs-xs); color: var(--muted); font-family: var(--font-mono); }

/* --------------------------------------------------------------------------
   11. Tables (parameters & comparisons)
   -------------------------------------------------------------------------- */
.table-scroll { overflow-x: auto; margin-block: var(--sp-5) var(--sp-6); border: var(--rule); border-radius: var(--radius-sm); }
.spec-table, .data-table { font-size: var(--fs-sm); min-width: 560px; }
.spec-table th, .spec-table td,
.data-table th, .data-table td {
	padding: 13px 16px;
	text-align: start;
	vertical-align: top;
	border-bottom: var(--rule);
}
.spec-table thead th, .data-table thead th {
	background: var(--ink);
	color: var(--paper);
	font-size: var(--fs-xs);
	letter-spacing: .08em;
	text-transform: uppercase;
	border-bottom: 0;
}
.spec-table tbody th, .data-table tbody th {
	font-weight: 700;
	color: var(--ink);
	background: var(--sand);
	width: 34%;
}
.spec-table tbody tr:last-child th,
.spec-table tbody tr:last-child td,
.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td { border-bottom: 0; }
.spec-table tbody tr:hover td, .data-table tbody tr:hover td { background: #faf8f4; }
.table-caption {
	caption-side: top;
	font-size: var(--fs-xs);
	color: var(--muted);
	padding: 12px 16px;
	border-bottom: var(--rule);
	background: var(--sand-2);
}
.spec-note { font-size: var(--fs-xs); color: var(--muted); margin-top: calc(-1 * var(--sp-4)); margin-bottom: var(--sp-6); }
.cell-code, .fig-code { font-size: var(--fs-xs); color: var(--muted); margin-inline-start: 8px; }

/* --------------------------------------------------------------------------
   12. FAQ (independent <details>)
   -------------------------------------------------------------------------- */
.faq-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: var(--sp-7); align-items: start; }
.faq-intro .link-arrow { margin-top: var(--sp-4); }
.faq-list { border-top: var(--rule); }
.faq-item { border-bottom: var(--rule); }
.faq-q {
	list-style: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--sp-4);
	min-height: 56px;
	padding: 14px 4px;
	font-size: var(--fs-lg);
	font-weight: 700;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::marker { content: ""; }
.faq-q-text { min-width: 0; }
.faq-q-icon {
	flex: none;
	width: 30px; height: 30px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: var(--rule);
	border-radius: 50%;
	color: var(--ember);
	transition: transform .18s ease, background-color .18s ease;
}
.faq-item[open] .faq-q-icon { transform: rotate(45deg); background: var(--sand); }
.faq-a { padding: 0 48px var(--sp-5) 4px; color: var(--steel); }
.faq-a p { max-width: 78ch; }

/* --------------------------------------------------------------------------
   13. Step flow
   -------------------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: var(--rule); }
.step {
	padding: var(--sp-5) var(--sp-5) var(--sp-6) 0;
	border-inline-end: var(--rule);
	padding-inline-start: var(--sp-5);
}
.step:first-child { padding-inline-start: 0; }
.step:last-child { border-inline-end: 0; }
.step-no { display: block; font-size: var(--fs-sm); color: var(--amber); margin-bottom: var(--sp-4); }
.step-title { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.step-text { font-size: var(--fs-sm); color: var(--muted); }

/* --------------------------------------------------------------------------
   14. Quote form (progressive enhancement; native POST always works)
   -------------------------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }
.field-label { font-size: var(--fs-sm); font-weight: 700; }
.field-label .req { color: var(--ember); margin-inline-start: 4px; }
.field-input {
	width: 100%;
	min-height: 48px;
	padding: 11px 14px;
	background: var(--paper);
	border: var(--rule);
	border-radius: var(--radius-sm);
	font-size: var(--fs-body);
}
textarea.field-input { min-height: 140px; resize: vertical; }
.field-input:hover { border-color: var(--steel-2); }
.field-input:focus-visible { border-color: var(--ember); }
.form-foot { margin-top: var(--sp-5); display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); }
.form-privacy { font-size: var(--fs-xs); color: var(--muted); max-width: 52ch; }
.form-note {
	margin-top: var(--sp-4);
	padding: 12px 16px;
	font-size: var(--fs-sm);
	border-inline-start: 3px solid var(--steel-2);
	background: var(--sand);
}
.form-note--ok { border-inline-start-color: #2e7d4f; background: #eef6f0; }
.form-note--err { border-inline-start-color: var(--ember); background: #fdf0e9; }
form[aria-busy="true"] .btn--solid { opacity: .8; }
.form-privacy-box {
	margin-top: var(--sp-7);
	padding: var(--sp-5);
	background: var(--sand);
	border: var(--rule);
	border-radius: var(--radius-sm);
	font-size: var(--fs-sm);
	color: var(--steel);
}
.form-privacy-box h2 { font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.form-privacy-box .h2 { font-size: var(--fs-h3); margin-top: var(--sp-4); }
.form-privacy-box .body-copy { max-width: 78ch; }
.form-privacy-box .check-list { margin-top: var(--sp-3); }
.privacy-link { margin-top: var(--sp-4); font-size: var(--fs-sm); }
.privacy-link a { color: var(--steel); text-decoration: underline; text-underline-offset: 3px; }
.privacy-link a:hover { color: var(--ember); }

/* --------------------------------------------------------------------------
   15. Article
   -------------------------------------------------------------------------- */
.article-header { border-bottom: var(--rule); padding-bottom: var(--sp-5); margin-bottom: var(--sp-6); }
.article-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px var(--sp-4);
	font-size: var(--fs-xs);
	color: var(--muted);
	margin-top: var(--sp-4);
}
.article-byline { display: inline-flex; align-items: center; gap: 8px; }
.article-time { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.article-body { max-width: 78ch; }
.article-body h2 { margin-top: var(--sp-7); }
.article-body h3 { margin-top: var(--sp-6); }
.article-footer { margin-top: var(--sp-7); padding-top: var(--sp-5); border-top: var(--rule); }

.international { margin-block: var(--sp-7); }
.international h2 { font-size: var(--fs-h3); margin-bottom: var(--sp-3); }
.international-note { font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--sp-4); }
/* Bilingual term anchor: English source words stay verbatim (mixed case,
   internal spaces) and Thai counterparts sit in the adjacent column. */
.term-table th:first-child,
.term-table td:first-child { font-family: var(--font-mono); font-size: var(--fs-sm); }
.term-links { margin-top: var(--sp-5); }
.term-links ul { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); }
.term-links a { font-size: var(--fs-sm); color: var(--steel); border-bottom: 1px solid var(--line); }
.term-links a:hover { color: var(--ember); border-bottom-color: var(--ember); }

/* --------------------------------------------------------------------------
   16. Related links
   -------------------------------------------------------------------------- */
.related-links { margin-top: var(--sp-7); padding-top: var(--sp-5); border-top: var(--rule); }
.related-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--sp-5); }
.related-list li { border-bottom: var(--rule); }
.related-list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 48px;
	font-size: var(--fs-sm);
}
.related-list a:hover { color: var(--ember); }
.related-list .icon { color: var(--amber); }

/* --------------------------------------------------------------------------
   17. Evidence, first-party data & CTA
   -------------------------------------------------------------------------- */
.evidence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5); }
.evidence-figure { border: var(--rule); border-radius: var(--radius-sm); overflow: hidden; background: var(--sand); }
.evidence-img { width: 100%; height: 320px; object-fit: cover; }
.evidence-caption { padding: var(--sp-4); font-size: var(--fs-sm); color: var(--muted); }

.fact-band { background: var(--sand-2); border-block: var(--rule); }
.fact-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.fact-list div { padding: var(--sp-5); border-inline-end: var(--rule); }
.fact-list div:last-child { border-inline-end: 0; }
.fact-list dt { font-size: var(--fs-xs); color: var(--muted); margin-bottom: 6px; }
.fact-list dd { font-size: var(--fs-lg); font-weight: 700; }

.cta-band { background: var(--ink); color: var(--paper); padding-block: var(--sp-7); }
.cta-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--sp-6); align-items: center; }
.cta-band .eyebrow { color: var(--amber); }
.cta-band .h2 { margin-bottom: var(--sp-3); }
.cta-band .lede { color: #b9c0c6; }
.cta-actions { display: flex; flex-direction: column; gap: var(--sp-3); align-items: stretch; }
.cta-actions .btn { width: 100%; }

/* --------------------------------------------------------------------------
   18. Search / empty / 404 states
   -------------------------------------------------------------------------- */
.search-form { display: flex; gap: var(--sp-3); max-width: 640px; margin-block: var(--sp-5) var(--sp-7); }
.search-form--center { margin-inline: auto; }
.search-field { flex: 1; min-width: 0; min-height: 48px; padding: 11px 14px; border: var(--rule); border-radius: var(--radius-sm); background: var(--paper); }
.search-form .btn { flex: none; }
.search-results { display: grid; gap: 0; border-top: var(--rule); }
.search-result { padding: var(--sp-5) 0; border-bottom: var(--rule); }
.search-result h2 { font-size: var(--fs-lg); margin-bottom: 6px; }
.search-result h2 a:hover { color: var(--ember); }
.search-result p { font-size: var(--fs-sm); color: var(--muted); max-width: 76ch; }
.search-result__meta { font-size: var(--fs-xs); color: var(--muted); margin-top: 8px; }

.empty-state, .no-results {
	padding: var(--sp-6);
	background: var(--sand);
	border: var(--rule);
	border-inline-start: 4px solid var(--amber);
	border-radius: var(--radius-sm);
	margin-block: var(--sp-5);
}
.empty-state p, .no-results p { color: var(--steel); margin-bottom: var(--sp-4); }

.error-404 { padding-block: var(--sp-9); text-align: center; }
.error-code { font-size: clamp(72px, 14vw, 160px); font-weight: 700; color: var(--sand-2); line-height: 1; letter-spacing: -.04em; }
.error-404 h1 { font-size: var(--fs-h2); margin-bottom: var(--sp-4); }
.error-404 .lede { margin-inline: auto; margin-bottom: var(--sp-6); }
.error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-3); }
.error-actions--start { justify-content: flex-start; }

/* --------------------------------------------------------------------------
   19. Footer
   -------------------------------------------------------------------------- */
.site-footer { background: var(--ink-soft); color: #c3cad0; border-top: 3px solid var(--amber); }
.footer-top {
	display: grid;
	grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr);
	gap: var(--sp-6);
	padding-block: var(--sp-8) var(--sp-7);
}
.brand--footer .brand-mark { background: var(--paper); }
.brand--footer .brand-text strong { color: var(--paper); }
.brand--footer .brand-text small { color: #9aa3aa; max-width: 44ch; line-height: 1.5; }
.footer-desc { font-size: var(--fs-sm); margin-block: var(--sp-4); max-width: 48ch; }
.footer-nap { display: grid; gap: 12px; font-size: var(--fs-sm); }
.footer-nap li { display: flex; gap: 10px; align-items: flex-start; }
.footer-nap .icon { color: var(--amber); margin-top: 5px; }
.footer-nap a:hover { color: var(--paper); text-decoration: underline; }
.footer-title { font-size: var(--fs-sm); color: var(--paper); letter-spacing: .06em; margin-bottom: var(--sp-4); }
.footer-links { display: grid; gap: 2px; font-size: var(--fs-sm); }
.footer-links a { display: inline-flex; min-height: 32px; align-items: center; }
.footer-links a:hover { color: var(--amber); }
.footer-contact .footer-desc { margin-bottom: var(--sp-4); }
.footer-facts { margin-top: var(--sp-5); border-top: var(--rule-dark); font-size: var(--fs-xs); }
.footer-facts > div { display: grid; grid-template-columns: 42% minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: var(--rule-dark); }
.footer-facts dt { color: #8e979e; }
.footer-facts dd { color: #d7dde1; }

.lex-footer-nav { padding-block: var(--sp-5); border-top: var(--rule-dark); }
.lex-footer-links { display: flex; flex-wrap: wrap; gap: 8px var(--sp-5); }
.lex-footer-links a { min-height: 32px; }

.footer-bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--sp-4) var(--sp-6);
	padding-block: var(--sp-5);
	border-top: var(--rule-dark);
	font-size: var(--fs-xs);
	color: #9aa3aa;
}
.footer-meta { display: flex; flex-wrap: wrap; gap: var(--sp-4); margin-inline-start: auto; }
.footer-meta a:hover { color: var(--amber); }
.footer-language { display: flex; align-items: center; gap: var(--sp-3); }
.footer-language__label { font-size: var(--fs-xs); }
.footer-language .lang-switch > summary { border-inline: 0; padding-inline-start: 0; }
.footer-language .lang-menu { inset-inline-end: auto; inset-inline-start: 0; }

/* --------------------------------------------------------------------------
   20. Responsive — 320 / 768 / 1024 / 1440
   -------------------------------------------------------------------------- */
@media (min-width: 1440px) {
	:root { --gutter: 32px; }
	.hero-grid { gap: var(--sp-8); }
}

@media (max-width: 1023px) {
	.nav { display: none; }
	.mobile-nav { display: inline-block; }
	.header-inner { min-height: 72px; }
	.grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cluster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.step:nth-child(2) { border-inline-end: 0; }
	.step:nth-child(3) { padding-inline-start: 0; }
	.hero-grid { grid-template-columns: 1fr; gap: var(--sp-6); padding-block: var(--sp-7) var(--sp-6); }
	.hero-media { order: -1; }
	.stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.stat:nth-child(2) { border-inline-end: 0; }
	.stat:nth-child(3) { padding-inline-start: 0; }
	.faq-wrap { grid-template-columns: 1fr; gap: var(--sp-5); }
	.footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.cta-grid { grid-template-columns: 1fr; }
	.fact-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.fact-list div:nth-child(2) { border-inline-end: 0; }
}

@media (max-width: 767px) {
	:root { --gutter: 18px; --fs-body: 16px; }
	.section { padding-block: var(--sp-7); }
	.section--tight { padding-block: var(--sp-6); }
	.topbar-note { display: none; }
	.topbar-mail { display: inline-flex; }
	.topbar-inner { justify-content: center; }
	.topbar-links { gap: var(--sp-4); flex-wrap: wrap; justify-content: center; }
	.header-inner { gap: var(--sp-3); }
	.brand-mark { width: 44px; height: 44px; }
	.brand-text strong { font-size: 18px; }
	.brand-text small { display: none; }
	.header-quote { display: none; }
	.grid--2, .grid--3, .grid--4,
	.split, .form-grid, .related-list,
	.evidence-grid, .cluster-grid, .check-list--two { grid-template-columns: 1fr; }
	.cluster-card { min-height: 0; }
	.section-head { grid-template-columns: 52px minmax(0, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-5); }
	.hero-img { border-radius: var(--radius-sm); }
	.stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.stat { padding-inline: 0 var(--sp-3); }
	.steps { grid-template-columns: 1fr; }
	.step { border-inline-end: 0; padding-inline-start: 0; border-bottom: var(--rule); }
	.step:last-child { border-bottom: 0; }
	.answer-box { padding: var(--sp-5); }
	.answer-text { font-size: var(--fs-body); }
	.faq-a { padding-inline-end: 8px; }
	.footer-top { grid-template-columns: 1fr; gap: var(--sp-6); padding-block: var(--sp-7); }
	.footer-meta { margin-inline-start: 0; }
	.footer-bottom { flex-direction: column; align-items: flex-start; }
	.footer-facts > div { grid-template-columns: 1fr; gap: 2px; }
	.fact-list { grid-template-columns: 1fr; }
	.fact-list div { border-inline-end: 0; border-bottom: var(--rule); }
	.evidence-img { height: 220px; }
	/* Language dropdown becomes a full-width floating panel on narrow screens */
	.lang-menu {
		position: absolute;
		width: min(320px, calc(100vw - 36px));
		inset-inline-end: -8px;
	}
	.lang-menu a { min-height: 48px; }
	.search-form { flex-direction: column; }
	.search-form .btn { width: 100%; }
}

@media (max-width: 379px) {
	:root { --gutter: 14px; --fs-body: 16px; }
	.topbar-links { gap: var(--sp-3); font-size: 11px; }
	.brand-text small { display: none; }
	.stat-value { font-size: 20px; }
	.btn { padding-inline: 16px; }
}

/* --------------------------------------------------------------------------
   21. Print
   -------------------------------------------------------------------------- */
@media print {
	.topbar, .site-header, .site-footer, .cta-band, .header-actions,
	.lang-switch, .mobile-nav, .skip-link, .hero-actions, .breadcrumbs a { display: none !important; }
	body { background: #fff; color: #000; font-size: 12pt; line-height: 1.6; }
	.section, .hero { background: #fff !important; color: #000 !important; padding-block: 12pt; }
	.hero::before { display: none; }
	.card, .answer-box, .spec-table, .faq-item { break-inside: avoid; border-color: #999; }
	a { text-decoration: underline; }
	a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; }
	details > summary { list-style: none; }
	details:not([open]) > details { display: block; }
}

/* --------------------------------------------------------------------------
   22. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
		scroll-behavior: auto !important;
	}
	.card:hover, .btn:hover .icon, .link-arrow:hover .icon { transform: none; }
}

/* --------------------------------------------------------------------------
   23. Global RTL fallback (this site itself is LTR; only the `ar` switcher
       entry and any future override opt into RTL)
   -------------------------------------------------------------------------- */
[dir="rtl"] { text-align: right; }
[dir="rtl"] .section-head,
[dir="rtl"] .footer-top,
[dir="rtl"] .cta-grid,
[dir="rtl"] .hero-grid { direction: rtl; }
[dir="rtl"] .section-index { text-align: right; }
[dir="rtl"] .answer-box,
[dir="rtl"] .form-note,
[dir="rtl"] .empty-state { border-inline-start: 0; border-inline-end: 4px solid var(--amber); }
[dir="rtl"] .lang-switch__chevron { transform: scaleX(-1); }
[dir="rtl"] .lang-switch[open] .lang-switch__chevron { transform: scaleX(-1) rotate(180deg); }
