/* Luxury Escape Thailand — Modern Tropical Luxury
   Palette from the brand brief; contour-line ridges are the one signature motif. */

:root {
	--midnight: #111820;
	--midnight-2: #1B252F;
	--gold: #C7A66B;
	--gold-deep: #8C6F3D;   /* gold dark enough for text on ivory (AA) */
	--ivory: #F5F0E7;
	--ivory-2: #ECE4D6;
	--emerald: #42645B;
	--emerald-deep: #2F4A43;
	--ink: #111820;
	--ink-soft: #46515B;
	--line: #D9CFBE;

	--f-display: "Cormorant Garamond", "Times New Roman", serif;
	--f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

	--step--1: clamp(.84rem, .82rem + .1vw, .9rem);
	--step-0: clamp(1rem, .97rem + .15vw, 1.0625rem);
	--step-1: clamp(1.2rem, 1.12rem + .35vw, 1.4rem);
	--step-2: clamp(1.5rem, 1.32rem + .8vw, 2rem);
	--step-3: clamp(1.9rem, 1.55rem + 1.6vw, 2.9rem);
	--step-4: clamp(2.4rem, 1.7rem + 3.2vw, 4.6rem);

	--gutter: clamp(16px, 4vw, 48px);
	--measure: 68ch;
	--wide: 1180px;
	--radius: 2px;
	--header-h: 72px;
}

/* Script-specific type. Thai: Trirong (looped serif) for headings, Plex Sans Thai for reading. */
.lang-th {
	--f-display: "Trirong", "Cormorant Garamond", serif;
	--f-body: "IBM Plex Sans Thai", "IBM Plex Sans", system-ui, sans-serif;
	--measure: 62ch;
}
.lang-zh-cn {
	--f-display: "Cormorant Garamond", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
	--f-body: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
	--measure: 38em;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
	margin: 0;
	background: var(--ivory);
	color: var(--ink);
	font-family: var(--f-body);
	font-size: var(--step-0);
	line-height: 1.65;
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
.lang-th body, body.lang-th { line-height: 1.8; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: .22em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--f-display); font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: -.005em; text-wrap: balance; }
.lang-th h1, .lang-th h2, .lang-th h3 { line-height: 1.4; font-weight: 500; letter-spacing: 0; }
.lang-zh-cn h1, .lang-zh-cn h2, .lang-zh-cn h3 { line-height: 1.35; font-weight: 500; letter-spacing: .02em; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--gold); color: var(--midnight); padding: .6em 1em; }
.skip-link:focus { top: 12px; }

/* Buttons */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .5em;
	min-height: 48px; padding: .7em 1.4em;
	font: 500 var(--step--1)/1.2 var(--f-body); letter-spacing: .02em;
	text-decoration: none; border: 1px solid transparent; border-radius: var(--radius);
	cursor: pointer; transition: background-color .2s, color .2s, border-color .2s;
}
.btn--gold { background: var(--gold); color: var(--midnight); }
.btn--gold:hover { background: #D6B984; }
.btn--ghost { border-color: rgba(245,240,231,.55); color: var(--ivory); }
.btn--ghost:hover { border-color: var(--ivory); background: rgba(245,240,231,.08); }
.btn--dark { background: var(--midnight); color: var(--ivory); }
.btn--dark:hover { background: var(--emerald-deep); }
.btn--line { border-color: var(--midnight); color: var(--midnight); }
.btn--line:hover { background: var(--midnight); color: var(--ivory); }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(245,240,231,.94);
	backdrop-filter: saturate(1.2) blur(8px);
	border-bottom: 1px solid var(--line);
	color: var(--ink);
}
.site-header--over { position: absolute; left: 0; right: 0; background: transparent; border-bottom-color: rgba(199,166,107,.25); color: var(--ivory); backdrop-filter: none; }
.site-header__inner { max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; margin: 0; flex-shrink: 0; }
.brand__mark { width: 40px; height: 24px; }
.brand__name { font-family: "Cormorant Garamond", serif; font-size: 1.3rem; font-weight: 600; letter-spacing: .01em; line-height: 1; white-space: nowrap; }
.brand__name span { color: var(--gold-deep); font-style: italic; font-weight: 500; }
.site-header--over .brand__name span, .site-footer .brand__name span { color: var(--gold); }
.brand__logo { max-height: 44px; width: auto; }

.site-nav { margin-left: auto; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; gap: clamp(14px, 1.8vw, 28px); }
.nav-list a { text-decoration: none; font-size: var(--step--1); padding: 8px 0; border-bottom: 1px solid transparent; white-space: nowrap; }
.nav-list a:hover, .nav-list a[aria-current] { border-bottom-color: var(--gold); }
.site-header__tools { display: flex; align-items: center; gap: 12px; }

.lang-switch { position: relative; }
.lang-switch__toggle {
	display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px;
	background: none; color: inherit; border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 35%, transparent);
	border-radius: var(--radius); font: 500 var(--step--1)/1 var(--f-body); cursor: pointer;
}
.lang-switch__menu {
	position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px; margin: 0; padding: 6px 0; list-style: none;
	background: var(--midnight); color: var(--ivory); border: 1px solid rgba(199,166,107,.4); box-shadow: 0 18px 40px rgba(17,24,32,.28);
}
.lang-switch__menu a { display: block; padding: 10px 16px; text-decoration: none; font-family: system-ui, sans-serif; font-size: .95rem; }
.lang-switch__menu a:hover { background: var(--midnight-2); }
.lang-switch__menu a[aria-current] { color: var(--gold); }
.lang-switch__menu a[aria-current]::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 10px; border-radius: 50%; background: var(--gold); vertical-align: middle; }

.nav-toggle { display: none; min-height: 40px; padding: 0 14px; background: none; color: inherit; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: var(--radius); font: 500 var(--step--1)/1 var(--f-body); cursor: pointer; }
.nav-toggle__close { display: none; }

@media (max-width: 1060px) {
	.nav-toggle { display: inline-flex; align-items: center; }
	.site-header__tools { margin-left: auto; }
	.site-nav {
		position: fixed; inset: var(--header-h) 0 0 0; margin: 0;
		background: var(--midnight); color: var(--ivory);
		padding: 8px var(--gutter) 28px; border-top: 1px solid rgba(199,166,107,.3);
		display: none; overflow-y: auto; overscroll-behavior: contain;
	}
	.site-nav.is-open { display: block; }
	.nav-list { flex-direction: column; gap: 0; }
	.nav-list a { display: block; padding: 16px 0; font-family: var(--f-display); font-size: var(--step-2); border-bottom: 1px solid rgba(245,240,231,.12); }
	.nav-list a[aria-current] { color: var(--gold); border-bottom-color: rgba(245,240,231,.12); }
	.nav-toggle[aria-expanded="true"] .nav-toggle__open { display: none; }
	.nav-toggle[aria-expanded="true"] .nav-toggle__close { display: inline; }
}
@media (max-width: 420px) {
	.brand__name { font-size: 1.1rem; }
	.brand__mark { display: none; }
}

/* ---------- Home hero ---------- */
.hero {
	position: relative; isolation: isolate;
	min-height: min(92vh, 860px);
	display: flex; align-items: flex-end;
	background: var(--midnight); color: var(--ivory);
	padding: calc(var(--header-h) + 48px) var(--gutter) clamp(48px, 9vh, 104px);
	overflow: hidden;
}
.hero__media { position: absolute; inset: 0; z-index: -1; }
.hero__img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 100%; }
.hero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(17,24,32,.55) 0%, rgba(17,24,32,0) 35%, rgba(17,24,32,.15) 60%, rgba(17,24,32,.82) 100%); }
.hero__content { width: 100%; max-width: var(--wide); margin: 0 auto; }
.hero__title { font-size: var(--step-4); max-width: 17ch; font-weight: 500; }
.lang-th .hero__title { max-width: 20ch; font-size: clamp(2rem, 1.4rem + 2.6vw, 3.8rem); }
.lang-ru .hero__title, .lang-fr .hero__title, .lang-es .hero__title { max-width: 20ch; }
.hero__dek { max-width: 54ch; margin: 1.1em 0 0; font-size: var(--step-1); line-height: 1.55; color: rgba(245,240,231,.86); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 2em 0 0; }

/* ---------- Inner page head ---------- */
.page-head { background: var(--midnight); color: var(--ivory); position: relative; overflow: hidden; }
.page-head::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 56px;
	background: url("../img/hero-ridges.svg") center bottom / 1600px auto no-repeat;
	opacity: .55; pointer-events: none;
}
.page-head__inner { position: relative; z-index: 1; max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(36px, 6vw, 72px) var(--gutter) clamp(64px, 8vw, 104px); }
.page-head__title { font-size: var(--step-4); max-width: 22ch; }
.lang-th .page-head__title { font-size: clamp(1.9rem, 1.4rem + 2.2vw, 3.4rem); }
.page-head__dek { max-width: 60ch; margin: 1em 0 0; font-size: var(--step-1); line-height: 1.55; color: rgba(245,240,231,.84); }
.page-head__meta { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 1.6em 0 0; font-size: var(--step--1); color: rgba(245,240,231,.7); }
.page-head__media { margin: 0; }
.page-head__media img { width: 100%; max-height: 62vh; object-fit: cover; }
.page-head--404 { min-height: 60vh; }
.page-head--404 .btn--line { border-color: var(--ivory); color: var(--ivory); }

.crumbs ol { list-style: none; margin: 0 0 1.4em; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: var(--step--1); color: rgba(245,240,231,.7); }
.crumbs li + li::before { content: "/"; margin: 0 .6em; color: var(--gold); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ---------- Content grid ---------- */
.entry {
	display: grid;
	grid-template-columns:
		[full-start] minmax(var(--gutter), 1fr)
		[wide-start] minmax(0, calc((var(--wide) - var(--measure)) / 2))
		[content-start] min(var(--measure), 100% - 2 * var(--gutter)) [content-end]
		minmax(0, calc((var(--wide) - var(--measure)) / 2)) [wide-end]
		minmax(var(--gutter), 1fr) [full-end];
	padding: clamp(40px, 6vw, 80px) 0 clamp(56px, 8vw, 112px);
}
.entry > * { grid-column: wide; max-width: var(--measure); }
.entry > .wide, .entry > .stays, .entry > .links, .entry > .places, .entry > .map, .entry > .facts, .entry > .contact-wrap { max-width: none; }
.entry > .band { max-width: none; }
.entry > .band { grid-column: full; }

.entry p, .entry ul, .entry ol { margin: 0 0 1.1em; }
.entry > h2, .band h2 { font-size: var(--step-3); margin: 1.9em 0 .55em; }
.entry > h2:first-child { margin-top: 0; }
.entry > h3 { font-size: var(--step-2); margin: 1.6em 0 .4em; }
.entry > ul:not([class]), .entry > ol:not([class]) { padding-left: 1.3em; }
.entry > ul:not([class]) li::marker { color: var(--gold-deep); }
.entry li + li { margin-top: .35em; }
.entry .lede { font-size: var(--step-1); line-height: 1.6; color: var(--ink); }
.entry strong { font-weight: 600; }
.entry .note { font-size: var(--step--1); color: var(--ink-soft); border-left: 2px solid var(--gold); padding: .2em 0 .2em 1em; }

/* Table of contents */
.toc { border-top: 1px solid var(--midnight); border-bottom: 1px solid var(--line); padding: 18px 0 8px; margin-bottom: 2.4em; }
.toc__title { font-family: var(--f-display); font-size: var(--step-1); margin: 0 0 .4em !important; }
.toc ol { margin: 0; padding-left: 1.4em; columns: 2 18rem; column-gap: 40px; font-size: var(--step--1); }
.toc li { break-inside: avoid; margin: 0 0 .45em; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* Facts table (park info etc.) */
.facts { width: 100%; border-collapse: collapse; margin: 1em 0 2em; font-size: var(--step--1); }
.facts th, .facts td { text-align: left; vertical-align: top; padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); }
.facts th { font-weight: 600; width: 32%; }
.facts caption { text-align: left; font-family: var(--f-display); font-size: var(--step-1); padding-bottom: .5em; }

/* ---------- Stays: field-guide rows ---------- */
.stays { margin: 1.2em 0 2.6em; border-top: 1px solid var(--midnight); }
.stay {
	display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(20px, 4vw, 56px);
	padding: clamp(24px, 3.5vw, 44px) 0; border-bottom: 1px solid var(--line);
}
.stay__art { margin: 0; align-self: start; position: relative; }
.stay__art img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.stay__name { font-size: var(--step-2); }
.stay__area { margin: .35em 0 1em !important; font-size: var(--step--1); color: var(--emerald); font-weight: 500; }
.stay__desc { margin: 0 0 1em; }
.stay__best { margin: 0 0 1em !important; padding-left: 1em; border-left: 2px solid var(--gold); }
.stay__best span { display: block; font-size: var(--step--1); color: var(--ink-soft); }
.stay__tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 1.1em !important; padding: 0; }
.stay__tags li { margin: 0 !important; font-size: .8rem; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: #FBF8F2; }
.stay__links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 !important; font-size: var(--step--1); font-weight: 500; }
.stay:nth-child(even) { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.stay:nth-child(even) .stay__art { order: 2; }
@media (max-width: 720px) {
	.stay, .stay:nth-child(even) { grid-template-columns: 1fr; }
	.stay:nth-child(even) .stay__art { order: 0; }
}

/* ---------- Places ---------- */
.places { list-style: none; padding: 0; margin: 1.2em 0 2.6em; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 0 clamp(24px, 3vw, 48px); border-top: 1px solid var(--midnight); }
.place { margin: 0 !important; padding: 24px 0 26px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; }
.place__name { font-size: var(--step-1); font-weight: 600; margin-bottom: .45em; }
.lang-th .place__name { font-weight: 500; }
.place p { margin: 0 0 .9em; font-size: var(--step--1); color: var(--ink-soft); flex: 1; }
.place__map { font-size: var(--step--1); font-weight: 500; }

/* ---------- Link grid (topic cluster) ---------- */
.links { list-style: none; padding: 0; margin: 1.2em 0 2.6em; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.link { margin: 0 !important; background: var(--ivory); }
.link a { display: flex; flex-direction: column; gap: .5em; height: 100%; padding: 24px 22px 26px; text-decoration: none; transition: background-color .2s; }
.link a:hover { background: #FBF8F2; }
.link__title { font-family: var(--f-display); font-size: var(--step-1); font-weight: 600; line-height: 1.25; }
.lang-th .link__title { font-weight: 500; }
.link a:hover .link__title { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: .2em; }
.link__teaser { font-size: var(--step--1); color: var(--ink-soft); }

/* ---------- Bands: full-width dark sections inside content ---------- */
.band { background: var(--emerald-deep); color: var(--ivory); padding: clamp(48px, 7vw, 96px) var(--gutter); margin: 2.6em 0; }
.band__inner { max-width: var(--wide); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 72px); align-items: start; }
.band h2 { margin-top: 0; }
.band p { color: rgba(245,240,231,.88); }
.band a { color: var(--ivory); }
.band .links { background: rgba(245,240,231,.16); border-color: rgba(245,240,231,.16); margin: 0; }
.band .link { background: var(--emerald-deep); }
.band .link a:hover { background: #36564E; }
.band .link__teaser { color: rgba(245,240,231,.75); }
@media (max-width: 820px) { .band__inner { grid-template-columns: 1fr; } }

/* ---------- Map ---------- */
.map { position: relative; aspect-ratio: 16 / 8; min-height: 320px; margin: 1.2em 0 2.6em; background: var(--midnight); overflow: hidden; border-radius: var(--radius); }
.map__art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.map__cta { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px; color: var(--ivory); background: linear-gradient(0deg, rgba(17,24,32,.9), rgba(17,24,32,0)); }
.map__cta p { margin: .8em 0 0 !important; font-size: var(--step--1); color: rgba(245,240,231,.8); }
.map__cta a { color: var(--gold); }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 560px) { .map { aspect-ratio: 3 / 4; } }

/* ---------- Contact ---------- */
.contact-wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 5vw, 72px); }
@media (max-width: 820px) { .contact-wrap { grid-template-columns: 1fr; } }
.contact { display: grid; gap: 4px; }
.field { margin: 0 0 14px !important; display: grid; gap: 6px; }
.field label { font-size: var(--step--1); font-weight: 500; }
.field input, .field textarea { width: 100%; font: inherit; color: var(--ink); background: #FBF8F2; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.contact__privacy { font-size: var(--step--1); color: var(--ink-soft); }
.contact__hp { position: absolute; left: -9999px; }
.contact__notice { padding: 14px 16px; border-left: 3px solid; }
.contact__notice--ok { border-color: var(--emerald); background: #E5ECE6; }
.contact__notice--err { border-color: #9B3B2E; background: #F4E3DF; }
.contact .btn { justify-self: start; }

/* ---------- Footer ---------- */
.site-footer { background: var(--midnight); color: rgba(245,240,231,.82); position: relative; margin-top: 80px; }
.site-footer__ridge { position: absolute; left: 0; right: 0; top: -79px; height: 80px; line-height: 0; }
.site-footer__ridge svg { width: 100%; height: 80px; }
.site-footer__inner { max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 40px var(--gutter) 32px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(0, 3fr); gap: 40px; }
.site-footer h2 { font-family: var(--f-display); font-size: var(--step-1); color: var(--ivory); margin: 0 0 .8em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer__nav ul { columns: 2; column-gap: 24px; }
.site-footer li { margin: 0 0 .55em; break-inside: avoid; font-size: var(--step--1); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer a[aria-current] { color: var(--gold); }
.brand--footer { color: var(--ivory); margin-bottom: 1em; }
.site-footer__about p { font-size: var(--step--1); max-width: 46ch; }
.site-footer__note { color: rgba(245,240,231,.58); }
.site-footer__legal { max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 18px var(--gutter) 32px; font-size: .8rem; color: rgba(245,240,231,.5); border-top: 1px solid rgba(245,240,231,.1); }
@media (max-width: 820px) { .site-footer__inner { grid-template-columns: 1fr; } }

/* ---------- Home-specific rhythm ---------- */
.entry--home > h2 { font-size: var(--step-3); }
.entry--home .intro { font-size: var(--step-1); line-height: 1.6; }
.lang-th .entry--home .intro { line-height: 1.75; }

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
	.site-header, .site-footer, .map, .toc { display: none; }
	.page-head { background: none; color: #000; }
}

/* Thai phrases stay whole; long phrases may still wrap on very narrow screens. */
.nw { white-space: nowrap; }
@media (max-width: 380px) { .nw { white-space: normal; } }
h1, h2, h3, .link__title, .stay__name, .toc__title { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
@media (max-width: 720px) { .hero__img { object-position: 74% 100%; } }
