/* =========================================================
   ARB KHAO — main.css (loaded on every page)
   1. Design tokens   2. Typography   3. Base
   4. Layout          5. Buttons      6. Hero
   7. Motion          8. Shared sections
   Header → header.css · Footer → footer.css · Page parts → home/rooms/reviews/contact.css
   ========================================================= */

/* ---------- 1. Design tokens ---------- */
:root {
  /* palette: white · natural green · brown / cream */
  --forest: #2f3829;
  --moss: #7d8b6a;
  --sage: #a9b39a;
  --cream: #ece7df;
  --cream-2: #f5f2ec;
  --white: #fbfaf7;
  --sand: #c8b597;
  --brown: #5d3a14;
  --ink: #1e231b;
  --muted: #5f6259;
  --line: rgba(30, 35, 27, .16);
  --line-light: rgba(251, 250, 247, .28);

  /* font */
  --font: "Kanit", system-ui, sans-serif;

  /* type scale */
  --fs-h1: clamp(44px, 7.6vw, 120px);
  --fs-h2: clamp(36px, 5.4vw, 84px);
  --fs-h3: clamp(26px, 2.4vw, 36px);
  --fs-h4: clamp(20px, 2vw, 26px);
  --fs-h5: 18px;
  --fs-h6: var(--fs-label);
  --fs-p: 16px;
  --fs-small: 13px;
  --fs-label: 11px;      /* small uppercase labels, buttons */
  --fs-label-sm: 10px;   /* smallest labels */

  /* text colors (light backgrounds) */
  --c-heading: var(--ink);
  --c-text: var(--ink);
  --c-muted: var(--muted);
  --c-strong: var(--brown);

  /* layout */
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1440px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* text colors on dark backgrounds */
.hero, .section--forest, .site-footer, .map-card, .error-page {
  --c-heading: var(--white);
  --c-text: var(--white);
  --c-strong: var(--sand);
}

/* ---------- 2. Typography ---------- */
h1, h2, h3, h4, h5, h6 { margin: 0; color: var(--c-heading); }

h1, h2, h3, .h1, .h2, .h3 { font-weight: 200; text-transform: uppercase; line-height: .92; }
h1, h2, .h1, .h2 { letter-spacing: .01em; }
h1, .h1 { font-size: var(--fs-h1); }
h2, .h2 { font-size: var(--fs-h2); }
h3, .h3 { font-size: var(--fs-h3); line-height: 1; }
h4, .h4 { font-size: var(--fs-h4); font-weight: 400; line-height: 1.45; text-transform: none; letter-spacing: 0; margin: 0; }
h5, .h5 { font-size: var(--fs-h5); font-weight: 400; line-height: 1.7; text-transform: none; letter-spacing: 0; }
h6, .h6, .meta { font-size: var(--fs-h6); font-weight: 500; line-height: 1.5; letter-spacing: .08em; text-transform: uppercase; }
html[lang="th"] .meta { font-size: 12px; letter-spacing: .04em; }

p { font-size: var(--fs-p); color: var(--c-text); }
strong, b { font-weight: 500; color: var(--c-strong); }
.lead { font-size: clamp(17px, 1.6vw, 21px); line-height: 1.75; }
.small { font-size: var(--fs-small); line-height: 1.65; }

/* headline lines: <h2><span class="line line--strong">…</span><span class="line">…</span></h2> */
.line { display: block; }
.line--strong { font-weight: 300; letter-spacing: -.02em; }
.fs-xl { font-size: clamp(54px, 10.5vw, 168px); }
.fs-lg { font-size: var(--fs-h1); }
.fs-md { font-size: var(--fs-h2); }
.fs-sm { font-size: clamp(28px, 3.6vw, 52px); }

/* ---------- 3. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--c-text);
  font-family: var(--font);
  font-weight: 300;
  font-size: var(--fs-p);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.sr-only { position: absolute; 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: 200; background: var(--ink); color: var(--white); padding: 10px 16px; }
.skip-link:focus { top: 16px; }

/* ---------- 4. Layout ---------- */
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { position: relative; padding: clamp(80px, 11vw, 160px) 0; overflow: hidden; }
.section--cream { background: var(--cream); }
.section--forest { background: var(--forest); color: var(--white); }
.section--white { background: var(--white); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 110px); align-items: center; }
.split__img { aspect-ratio: 4 / 5; overflow: hidden; }
.split__img img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 5. Buttons ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 26px;
  border: 1px solid currentColor; border-radius: 999px;
  font-size: var(--fs-label); font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
  background: transparent; cursor: pointer; white-space: nowrap;
  transition: background .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease);
}
html[lang="th"] .pill { font-size: 13px; letter-spacing: .04em; }
.pill:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.section--forest .pill:hover, .hero .pill:hover, .on-dark .pill:hover { background: var(--white); color: var(--forest); border-color: var(--white); }
.pill--solid { background: var(--forest); color: var(--white); border-color: var(--forest); }
.pill--solid:hover { background: var(--brown); border-color: var(--brown); }
.pill .arrow { width: 18px; height: 10px; }
.btn-group { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.icon-btn { background: none; border: 0; padding: 6px; cursor: pointer; color: inherit; }
.arrow-btn { background: none; border: 0; padding: 10px; cursor: pointer; color: inherit; transition: transform .3s; }
.arrow-btn:hover { transform: translateX(3px); }
.arrow-btn--prev:hover { transform: translateX(-3px); }
.arrow-btn svg { width: 26px; height: 12px; display: block; }

/* ---------- 6. Hero ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; color: var(--white); display: grid; align-items: center; overflow: hidden; background: var(--forest); }
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.12); animation: heroZoom 2.6s var(--ease) forwards; }
.hero__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 24, 18, .55) 0%, rgba(20, 24, 18, .25) 40%, rgba(20, 24, 18, .7) 100%); }
@keyframes heroZoom { to { transform: scale(1); } }
.hero__content { position: relative; text-align: center; padding-top: 76px; }
.hero h1 { margin: 21px 0; }
.hero__kicker { margin-bottom: 22px; opacity: .85; }
.hero__sub { max-width: 640px; margin: 22px auto 0; font-size: clamp(15px, 1.4vw, 18px); opacity: .92; }
.hero--page { min-height: 72vh; min-height: 72svh; }
.hero--page .hero__content { padding-bottom: 40px; }
.breadcrumb { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; margin: 0 0 22px; padding: 0; list-style: none; opacity: .8; }
.breadcrumb li { display: flex; align-items: center; }
.breadcrumb li + li::before { content: "/"; margin-right: 10px; opacity: .6; }

/* ---------- 7. Motion ---------- */
.reveal { opacity: 0; transform: translateY(36px); transition: opacity 1.1s var(--ease), transform 1.1s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.reveal-img { clip-path: inset(12% 12% 12% 12%); transition: clip-path 1.4s var(--ease); }
.reveal-img img { transform: scale(1.18); transition: transform 1.6s var(--ease); }
.reveal-img.is-in { clip-path: inset(0 0 0 0); }
.reveal-img.is-in img { transform: scale(1); }
.split-line { overflow: hidden; }
.split-line > span { display: block; transform: translateY(105%); transition: transform 1.1s var(--ease); }
.is-in .split-line > span, .split-line.is-in > span { transform: none; }
.is-in .split-line:nth-child(2) > span { transition-delay: .12s; }
.is-in .split-line:nth-child(3) > span { transition-delay: .24s; }
.no-js .reveal, .no-js .reveal-img { opacity: 1; transform: none; clip-path: none; }
.no-js .split-line > span { transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal, .reveal-img, .split-line > span { opacity: 1; transform: none; clip-path: none; }
}
.curve { position: absolute; pointer-events: none; z-index: 0; }
.curve path { fill: none; stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; }
.curve--draw path { stroke-dasharray: var(--len, 3000); stroke-dashoffset: var(--len, 3000); transition: stroke-dashoffset 3s var(--ease); }
.curve--draw.is-in path { stroke-dashoffset: 0; }

/* ---------- 8. Shared sections ---------- */
/* room slider (home + rooms) */
.room { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(28px, 4vw, 60px); position: relative; z-index: 1; }
.room__media { position: relative; }
.room__frame { aspect-ratio: 1 / 1.02; overflow: hidden; position: relative; }
.room__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.08); transition: opacity 1s var(--ease), transform 1.6s var(--ease); }
.room__frame img.is-active { opacity: 1; transform: scale(1); }
.room__nav { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.room__body { display: flex; flex-direction: column; position: relative; }
.room__title { position: relative; margin: clamp(10px, 4vw, 60px) 0 0 clamp(-260px, -16vw, -80px); z-index: 2; pointer-events: none; }
.room__title .line:not(.line--strong) { padding-left: clamp(80px, 16vw, 260px); }
.room__bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; margin-top: auto; padding-top: 40px; flex-wrap: wrap; }
.features { list-style: none; margin: 0; padding: 0; font-size: var(--fs-label); letter-spacing: .06em; text-transform: uppercase; line-height: 1.85; }
.features li::before { content: "•"; margin-right: 8px; }
.features--th { text-transform: none; font-size: var(--fs-small); letter-spacing: 0; }

/* FAQ (rooms + contact) */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; padding: 24px 0; font-size: 17px; font-weight: 400; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary { overflow: hidden; }
.faq summary::after { content: "+"; width: 24px; text-align: center; font-weight: 300; font-size: 24px; line-height: 1; transition: transform .4s var(--ease); }
.faq details[open]:not(.is-closing) summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 24px; color: var(--c-muted); max-width: 760px; }

/* call to action band */
.cta { text-align: center; position: relative; }
.cta h2 { margin: 0 0 20px; }
.cta .line { margin-bottom: 26px; }
.cta p { max-width: 560px; margin: 0 auto 34px; }

/* legal text */
.prose { max-width: 820px; }
.prose h2 { font-size: 22px; font-weight: 400; line-height: 1.7; text-transform: none; letter-spacing: 0; margin: 44px 0 12px; }
.prose p, .prose li { color: #3e4239; }

/* 404 / 500 */
.error-page { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; text-align: center; background: var(--forest); color: var(--white); position: relative; overflow: hidden; padding: 120px var(--gutter) 60px; }
.error-page h1 { font-size: clamp(110px, 24vw, 340px); }
.error-page__brand { display: inline-flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 30px; font-size: 16px; font-weight: 500; letter-spacing: .26em; line-height: 1.5; }

/* ---------- Responsive ----------
   ≥1200 desktop (base styles) · ≤1199 laptop / tablet landscape · ≤991 tablet portrait
   ≤767 large phones · ≤575 phones · ≤375 small phones
   ------------------------------------------------------------- */
@media (max-width: 991px) {
  :root { --gutter: 16px; --fs-label: 12px; --fs-label-sm: 12px; }
  .hero__content { padding-top: 102px; }
  .split { grid-template-columns: 1fr; }
  .split__img { aspect-ratio: 4 / 3; }
  .room { grid-template-columns: 1fr; }
  .room__title { margin: -14px 0 0; }
  .room__title .line:not(.line--strong) { padding-left: 0; }
  .room__body { gap: 22px; }
  .room__bottom { padding-top: 10px; }
}

/* touch screens: every control at least 44 × 44px */
@media (max-width: 991px), (pointer: coarse) {
  .pill { min-height: 44px; }
  .arrow-btn { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0; }
  .breadcrumb a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
  .icon-btn { min-width: 44px; min-height: 44px; }
}

@media (max-width: 767px) {
  .hero__content { padding-top: 64px; }
  .error-page__brand { font-size: 13px; letter-spacing: .24em; }
}

@media (max-width: 575px) {
  :root {
    --fs-h1: clamp(36px, 11vw, 44px);
    --fs-h2: clamp(30px, 9vw, 36px);
  }
  .fs-xl { font-size: clamp(48px, 15vw, 64px); }
  .section { padding: 72px 0; }
  .lead { font-size: 17px; }
  .btn-group { flex-direction: column; align-items: stretch; max-width: 360px; margin-inline: auto; }
  .btn-group .pill { justify-content: center; }
}

@media (max-width: 375px) {
  :root { --gutter: 12px; }
}
