/* Refinery Asset — site styles.
   Every colour, size, radius and shadow comes from tokens.css (Option B · Verified Advisory).
   Do not hard-code values here; add a token instead. (Breakpoints are the exception:
   custom properties can't be used in media queries — 1023px / 719px match tokens.css.)

   Homepage sections follow docs/homepage-final/index.html (Final v1.0):
   S01 A · S02 A · S03 A · S04 A · S05 A · S06 B · S07 A · S08 B · S09 C · S10 A · S11 A · S12 A · S13 C · S14 B */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--space-2)); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: var(--text-body); line-height: var(--leading-body);
  font-weight: var(--weight-regular);
}
img { max-width: 100%; height: auto; display: block; }
figure { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--link); text-decoration-color: var(--link-underline); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
p { margin: 0 0 1em; }

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); margin: 0 0 .5em; text-wrap: balance; }
h1 { font-size: var(--text-h1); line-height: var(--leading-h1); letter-spacing: var(--tracking-h1); font-weight: var(--weight-bold); }
h2 { font-size: var(--text-h2); line-height: var(--leading-h2); letter-spacing: var(--tracking-h2); font-weight: var(--weight-bold); }
h3 { font-size: var(--text-h4); line-height: var(--leading-h4); font-weight: var(--weight-semibold); }
h1 mark, h2 mark { background: none; color: var(--text-highlight); }
.lead { font-size: var(--text-lead); line-height: var(--leading-lead); max-width: var(--measure); color: var(--text-muted); }
.eyebrow {
  font-family: var(--font-display); font-size: var(--text-h6); font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--text-highlight); margin: 0 0 var(--space-3);
}
:lang(th) .eyebrow { text-transform: none; font-size: var(--text-small); }
.muted { color: var(--text-muted); }
.small { font-size: var(--text-small); line-height: var(--leading-small); }
.nowrap { white-space: nowrap; }

.container { width: 100%; max-width: var(--content); margin: 0 auto; padding-inline: var(--page-margin); }
.narrow { max-width: var(--container-narrow); }
.center { text-align: center; }
.sr-only, .hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--primary); color: var(--on-primary); padding: var(--space-2) var(--space-4); z-index: 100; border-radius: var(--r-sm); }
.skip-link:focus { left: var(--space-2); }
:focus-visible { outline: var(--focus-outline); outline-offset: var(--focus-offset); }
.ico { width: var(--icon); height: var(--icon); flex: none; }

/* ---------- Sections ---------- */
.section { padding-block: var(--section-y); }
.section-alt { background: var(--surface); }
.page-head { padding-top: var(--space-7); padding-bottom: var(--space-2); }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-6); flex-wrap: wrap; margin-bottom: var(--space-8); }
.sec-head h2 { margin: 0; }
.sec-head .lead { margin: var(--space-3) 0 0; }
.note { font-size: var(--text-caption); color: var(--text-muted); margin-top: var(--space-4); }
.grid-3 { display: grid; gap: var(--gutter); grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--btn-h); padding: 0 var(--btn-px); border: 1px solid transparent; border-radius: var(--btn-radius);
  font-family: var(--font-display); font-size: var(--btn-fs); font-weight: var(--btn-weight); line-height: var(--leading-tight);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--surface-2); color: var(--text); }
.btn-tonal { background: var(--tonal); color: var(--on-tonal); }
.btn-tonal:hover { background: var(--tonal-hover); color: var(--on-tonal); }
.btn-ivory { background: var(--color-ivory-50); color: var(--primary); }
.btn-ivory:hover { background: var(--color-white); color: var(--primary); }
.btn-ghost { background: var(--glass-bg); color: var(--text-on-media); border: var(--border-glass); backdrop-filter: var(--blur-glass); -webkit-backdrop-filter: var(--blur-glass); }
.btn-ghost:hover { background: var(--color-white); color: var(--text); }
.btn[disabled], .btn[aria-disabled="true"] { background: var(--disabled-bg); color: var(--disabled-fg); border-color: transparent; cursor: not-allowed; }
.btn-sm { min-height: var(--btn-h-sm); padding: 0 var(--btn-px-sm); font-size: var(--btn-fs-sm); }
.btn-block { width: 100%; }
.btn-icon { width: var(--btn-icon); min-height: var(--btn-icon); padding: 0; border-radius: var(--r-sm); background: var(--surface); border-color: var(--border-input); color: var(--text); }
.btn-icon:hover { border-color: var(--border-strong); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.center .actions { justify-content: center; }
.link-arrow { font-family: var(--font-display); font-weight: var(--weight-semibold); text-decoration: none; border-bottom: 1px solid var(--link-underline); padding-bottom: 2px; white-space: nowrap; }
.link-arrow:hover { border-bottom-color: currentColor; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: var(--dot); background: var(--surface-2); color: var(--text); font-family: var(--font-display); font-size: var(--badge-fs); font-weight: var(--weight-semibold); padding: var(--space-1) var(--badge-px); border-radius: var(--badge-radius); }
.badge-ok { background: var(--badge-ok-bg); color: var(--badge-ok-fg); }
.badge-warn { background: var(--badge-warn-bg); color: var(--badge-warn-fg); }
.badge-dot::before { content: ""; width: var(--dot); height: var(--dot); border-radius: 50%; background: currentColor; }

/* ---------- S01 Header (A: logo left · nav centre · CTA right) ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: var(--border-1); }
.header-inner { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--space-6); min-height: var(--header-h); }
.logo img { height: var(--logo-h); width: auto; }
.site-nav ul { display: flex; justify-content: center; gap: var(--space-7); list-style: none; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; color: var(--text-muted); font-size: var(--text-small); font-weight: var(--weight-medium); white-space: nowrap; }
.site-nav a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: var(--space-3); justify-self: end; }
.header-tel { font-family: var(--font-data); font-weight: var(--weight-semibold); font-size: var(--text-small); text-decoration: none; color: var(--text); white-space: nowrap; }
.lang-switch { font-size: var(--text-caption); font-weight: var(--weight-medium); text-decoration: none; color: var(--text-muted); border: var(--border-1); border-radius: var(--r-pill); padding: var(--space-1) var(--space-3); white-space: nowrap; }
.lang-switch:hover { color: var(--text); border-color: var(--border-strong); }
.nav-toggle { display: none; width: var(--btn-icon); height: var(--btn-icon); border: var(--border-1); border-radius: var(--r-sm); background: var(--surface); color: var(--text); cursor: pointer; align-items: center; justify-content: center; }
.mobile-nav { display: none; border-top: var(--border-1); padding: var(--space-2) var(--page-margin) var(--space-5); }
.mobile-nav a.nl { display: block; padding: var(--space-4) 0; border-bottom: var(--border-1); text-decoration: none; color: var(--text); font-weight: var(--weight-medium); }
.mobile-nav .btn { margin-top: var(--space-4); }
.menu-open .mobile-nav { display: block; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-5) 0 0; margin: 0; font-size: var(--text-small); color: var(--text-muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: var(--space-2); color: var(--border-strong); }
.breadcrumbs a { color: inherit; }

/* ---------- S02 Hero (A: full-bleed image + search, inset rounded frame) ---------- */
.hero { position: relative; margin: var(--hero-inset); border-radius: var(--r-lg); overflow: hidden; min-height: var(--hero-min-h); display: flex; align-items: flex-end; color: var(--text-on-media); }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 72% 50%; }  /* keep the people in frame on narrow screens */
.hero-scrim { position: absolute; inset: 0; background: var(--scrim-hero); }
.hero-content { position: relative; width: 100%; padding-top: var(--hero-pad-top); padding-bottom: var(--space-8); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-8); align-items: end; }
.hero h1 { color: var(--text-on-media); max-width: var(--hero-h1-max); margin-bottom: var(--space-4); }
.hero h1 mark, .hero .eyebrow { color: var(--text-on-media-accent); }
.hero .lead { color: var(--text-on-media-muted); max-width: var(--hero-copy-max); }
.search { margin-top: var(--space-6); background: var(--surface); border-radius: var(--r-pill); padding: var(--search-pad); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: center; box-shadow: var(--shadow-2); max-width: var(--search-max-w); color: var(--text); }
.search .f { display: grid; padding: var(--search-pad) var(--search-field-px); border-right: var(--border-1); min-width: 0; }
.search .f:nth-child(3) { border-right: 0; }
.search label { font-size: var(--text-caption); color: var(--text-muted); font-weight: var(--weight-medium); }
.search select {
  border: 0; background: transparent; font: inherit; font-weight: var(--weight-semibold); color: var(--text); padding: 2px 0;
  appearance: none; -webkit-appearance: none; cursor: pointer; width: 100%;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 10px) 55%, calc(100% - 5px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
.search select:focus { outline: none; }
.search .f:focus-within { background: var(--surface-2); border-radius: var(--r-pill); }
.hero-alt { margin: var(--space-4) 0 0; font-size: var(--text-small); color: var(--text-on-media-muted); }
.hero-alt a { color: var(--text-on-media); text-decoration-color: var(--underline-on-media); }
.glass { background: var(--glass-bg); border: var(--border-glass); backdrop-filter: var(--blur-glass); -webkit-backdrop-filter: var(--blur-glass); border-radius: var(--r-md); padding: var(--space-3); display: flex; gap: var(--space-3); align-items: center; color: var(--text-on-media); max-width: var(--glass-max-w); text-decoration: none; }
.glass img { width: var(--glass-thumb-w); height: var(--glass-thumb-h); object-fit: cover; border-radius: var(--r-sm); flex: none; }
.glass b { display: block; font-family: var(--font-display); font-size: var(--text-small); }
.glass span { font-size: var(--text-caption); color: var(--text-on-media-muted); }
.glass span b { color: var(--text-on-media); }

/* ---------- S03 Trust (A: developer names) ---------- */
.trust { padding-block: var(--space-7) var(--space-6); }
.trust-inner { display: flex; align-items: center; gap: var(--space-8); flex-wrap: wrap; justify-content: center; }
.trust-label { font-size: var(--text-small); color: var(--text-muted); max-width: var(--trust-label-max); margin: 0; }
.dev-logos { display: flex; gap: var(--space-4); flex-wrap: wrap; align-items: center; }
.dev-logo { height: var(--dev-logo-h); min-width: var(--dev-logo-min-w); padding: 0 var(--space-6); display: flex; align-items: center; justify-content: center; border: var(--border-1); border-radius: var(--r-md); background: var(--surface); font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-wordmark); color: var(--text-muted); letter-spacing: var(--tracking-h3); }
.dev-logo.more { border-style: dashed; font-family: var(--font-body); font-weight: var(--weight-medium); font-size: var(--text-small); }

/* ---------- S04 Listings (A: grid + filter) ---------- */
.chips { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-6); }
.chip { border: 1px solid var(--border-input); background: var(--surface); color: var(--text); border-radius: var(--r-pill); padding: var(--space-2) var(--space-4); font: inherit; font-size: var(--text-small); font-weight: var(--weight-medium); cursor: pointer; min-height: var(--chip-h); }
.chip:hover { border-color: var(--border-strong); }
.chip[aria-pressed="true"] { background: var(--tonal); color: var(--on-tonal); border-color: var(--primary); }
html:not(.js) .chips { display: none; }   /* filtering needs JS; without it all cards show */
.p-card { background: var(--surface); border: var(--border-1); border-radius: var(--card-radius); overflow: hidden; box-shadow: var(--shadow-1); display: flex; flex-direction: column; transition: box-shadow var(--dur-base) var(--ease), transform var(--dur-base) var(--ease); }
.p-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.p-media { position: relative; }
.p-media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.p-media .badge { position: absolute; top: var(--space-3); left: var(--space-3); background: var(--surface-on-media); }
.p-body { padding: var(--space-4) var(--space-5) var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }
.p-body h3 { font-size: var(--text-h5); line-height: var(--leading-h5); margin: 0; }
.p-body h3 a { color: inherit; text-decoration: none; }
.p-body h3 a:hover { text-decoration: underline; text-decoration-color: var(--link-underline); }
.p-loc { font-size: var(--text-small); color: var(--text-muted); display: flex; gap: var(--dot); align-items: center; margin: 0; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block: var(--border-1); padding-block: var(--space-3); }
.metrics div + div { border-left: var(--border-1); padding-left: var(--space-3); }
.metrics b { display: block; font-family: var(--font-data); font-variant-numeric: tabular-nums; font-size: var(--text-data-sm); }
.metrics small { font-size: var(--text-caption); color: var(--text-muted); }
.p-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: auto; }
.p-price small { display: block; font-size: var(--text-caption); color: var(--text-muted); }
.p-price b { font-family: var(--font-data); font-size: var(--text-data-md); font-variant-numeric: tabular-nums; }
.p-actions { display: flex; gap: var(--space-2); }

/* ---------- S05 Price tiers (A) ---------- */
.tier { --ico-bg: var(--tonal); --ico-fg: var(--on-tonal); background: var(--surface); border: var(--border-1); border-radius: var(--card-radius); padding: var(--card-pad); display: flex; flex-direction: column; gap: var(--space-4); }
.tier .top { display: flex; justify-content: space-between; align-items: center; }
.tier .amt { margin: 0; font-family: var(--font-data); font-weight: var(--weight-bold); font-size: var(--text-data); line-height: var(--leading-tight); font-variant-numeric: tabular-nums; }
.tier .amt small { font-family: var(--font-body); font-size: var(--text-body); font-weight: var(--weight-medium); color: var(--text-muted); }
.tier ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.tier li { display: flex; gap: var(--space-2); font-size: var(--text-small); }
.tick { width: var(--icon-tick); height: var(--icon-tick); flex: none; margin-top: var(--tick-offset); }
.tier .t-foot { margin-top: auto; display: grid; gap: var(--space-3); justify-items: start; }
.tier.feat { --ico-bg: var(--tint-on-brand); --ico-fg: var(--text-on-brand); background: var(--surface-brand); color: var(--text-on-brand); border-color: var(--surface-brand); }
.tier.feat .amt small, .tier.feat .muted { color: var(--text-on-brand-muted); }
.tier.feat .link-arrow { color: var(--text-on-brand); }
.tier.feat .badge { background: var(--badge-feature-bg); color: var(--badge-feature-fg); }

/* ---------- S06 Process (B: 3-step timeline) ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gutter); list-style: none; margin: 0; padding: 0; }
.step { position: relative; padding-right: var(--space-6); }
.step .num { width: var(--step-num); height: var(--step-num); border-radius: 50%; background: var(--tonal); color: var(--on-tonal); display: flex; align-items: center; justify-content: center; font-family: var(--font-data); font-weight: var(--weight-bold); font-size: var(--text-data-md); position: relative; z-index: 1; }
.step::before { content: ""; position: absolute; top: calc(var(--step-num) / 2); left: calc(var(--step-num) + var(--space-3)); right: 0; border-top: 1px dashed var(--border-strong); }
.step:last-child::before { display: none; }
.step h3 { margin: var(--space-5) 0 var(--space-2); }
.step p { color: var(--text-muted); margin: 0; }
.process-cta { display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; margin-top: var(--space-8); padding-top: var(--space-6); border-top: var(--border-1); }

/* ---------- S07 Areas (A: map + list) ---------- */
.areas { display: grid; grid-template-columns: 7fr 5fr; gap: var(--space-8); align-items: stretch; }
.map-col { display: flex; flex-direction: column; gap: var(--space-3); }
.map { border-radius: var(--r-md); overflow: hidden; background: var(--map-land); position: relative; min-height: var(--map-min-h); border: var(--border-1); flex: 1; }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); flex-wrap: wrap; margin: 0; }
.map-foot a { font-family: var(--font-display); font-weight: var(--weight-semibold); }
.area-list { list-style: none; margin: 0; padding: 0; border-top: var(--border-1); }
.area-list li { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); border-bottom: var(--border-1); }
.area-pick { flex: 1; display: block; padding: var(--space-4) 0 var(--space-4) var(--space-4); border-left: 3px solid transparent; text-decoration: none; color: var(--text); transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease); }
.area-pick:hover { background: var(--surface-2); }
.area-pick:hover h3 { color: var(--primary-hover); }
.area-pick[aria-current="true"] { border-left-color: var(--primary); background: var(--tonal); }
.area-pick[aria-current="true"] h3 { color: var(--on-tonal); }
.area-list h3 { font-size: var(--text-h5); line-height: var(--leading-h5); margin: 0 0 2px; }
.area-list .ex { font-size: var(--text-small); color: var(--text-muted); }
.area-list .count { flex: none; text-decoration: none; margin-right: var(--space-2); }

/* ---------- S08 Reviews (B) — rendered only when site.features.reviews is on ---------- */
.rating { display: flex; align-items: center; gap: var(--space-5); flex-wrap: wrap; background: var(--surface); border: var(--border-1); border-radius: var(--r-md); padding: var(--space-5) var(--space-6); margin-bottom: var(--gutter); }
.rating .score { font-family: var(--font-data); font-weight: var(--weight-bold); font-size: var(--text-score); line-height: 1; }
.stars { color: var(--rating-star); letter-spacing: 2px; font-size: var(--text-wordmark); }
.review { background: var(--surface); border: var(--border-1); border-radius: var(--card-radius); padding: var(--card-pad); display: flex; flex-direction: column; gap: var(--space-4); }
.review blockquote { margin: 0; font-size: var(--text-body); }
.review .who { display: flex; gap: var(--space-3); align-items: center; margin-top: auto; }
.avatar { width: var(--icon-disc); height: var(--icon-disc); border-radius: 50%; background: var(--tonal); color: var(--on-tonal); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: var(--weight-bold); flex: none; }
.review .who b { display: block; font-size: var(--text-small); }
.review .who span span { font-size: var(--text-caption); color: var(--text-muted); }

/* ---------- S09 Mid CTA (C: LINE QR + callback) ---------- */
.cta-band .inner { background: var(--surface-brand); color: var(--text-on-brand); border-radius: var(--r-lg); padding: var(--space-9) var(--space-8); display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-8); align-items: center; }
.cta-band h2 { color: var(--text-on-brand); }
.cta-band .eyebrow { color: var(--accent-on-brand); }
.line-box { display: flex; gap: var(--space-6); align-items: center; }
.line-box p { color: var(--text-on-brand-muted); }
.qr { display: block; width: var(--qr-size); height: var(--qr-size); flex: none; border-radius: var(--r-md); background: var(--qr-bg); padding: var(--space-3); }
.qr svg { width: 100%; height: 100%; fill: var(--qr-fg); }
.callback { background: var(--surface); color: var(--text); border-radius: var(--r-md); padding: var(--space-7); box-shadow: var(--shadow-2); }
.callback h3 { margin-bottom: var(--space-2); }

/* ---------- Forms ---------- */
.lead-form { display: block; }
.field { display: grid; gap: var(--dot); margin-bottom: var(--space-4); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-4); }
.field label { font-size: var(--text-small); font-weight: var(--weight-medium); }
.field abbr { color: var(--error); text-decoration: none; }
.field input, .field select, .field textarea {
  width: 100%; min-height: var(--input-h); padding: 0 var(--input-px); border: 1px solid var(--border-input); border-radius: var(--input-radius);
  background: var(--surface); color: var(--text); font: inherit; font-size: var(--text-body);
}
.field textarea { padding-block: var(--space-3); }
.field input::placeholder { color: var(--text-muted); }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring); }
.field input:user-invalid, .field textarea:user-invalid { border-color: var(--error); }
.consent { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--text-caption); line-height: var(--leading-caption); color: var(--text-muted); margin: var(--space-2) 0 var(--space-4); }
.consent input { margin-top: var(--tick-offset); accent-color: var(--primary); width: var(--icon-tick); height: var(--icon-tick); flex: none; }
.form-meta { font-size: var(--text-caption); color: var(--text-muted); margin: var(--space-3) 0 0; text-align: center; }
.form-status:empty { display: none; }
.form-status { font-size: var(--text-small); margin: var(--space-3) 0 0; }

/* ---------- S10 Guides (A) ---------- */
.article { display: flex; flex-direction: column; gap: var(--space-3); align-items: flex-start; }
.article img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-md); }
.article h3 { font-size: var(--text-h5); line-height: var(--leading-h5); margin: var(--space-2) 0 0; }
.article h3 a { color: inherit; text-decoration: none; }
.article h3 a:hover { text-decoration: underline; text-decoration-color: var(--link-underline); }
.article p { color: var(--text-muted); font-size: var(--text-small); margin: 0; }

/* ---------- S11 FAQ (A: accordion) ---------- */
.faq details { border-bottom: var(--border-1); }
.faq details:first-of-type { border-top: var(--border-1); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: var(--space-5) 0; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { font-size: var(--text-h5); line-height: var(--leading-h5); margin: 0; }
.faq-ico { --ico-bg: var(--surface-2); --ico-fg: var(--text); width: var(--icon-faq); height: var(--icon-faq); flex: none; transition: transform var(--dur-base) var(--ease); }
.faq details[open] .faq-ico { transform: rotate(45deg); }
.faq details p { color: var(--text-muted); margin: 0 0 var(--space-5); max-width: var(--measure); }
.faq-cta { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); flex-wrap: wrap; background: var(--tonal); border-radius: var(--r-md); padding: var(--space-5) var(--space-6); margin-top: var(--space-8); }
.faq-cta .acts { display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* ---------- S12 Contact (A: form + info) ---------- */
.contact { display: grid; grid-template-columns: 5fr 7fr; gap: var(--space-8); align-items: start; }
.info-list { list-style: none; margin: var(--space-6) 0; padding: 0; display: grid; gap: var(--space-4); }
.info-list li { display: flex; gap: var(--space-4); align-items: flex-start; }
.info-list .ic { width: var(--icon-disc); height: var(--icon-disc); border-radius: var(--r-sm); background: var(--tonal); color: var(--on-tonal); display: flex; align-items: center; justify-content: center; flex: none; }
.info-list small { display: block; color: var(--text-muted); font-size: var(--text-caption); }
.info-list b, .info-list a { font-family: var(--font-display); font-weight: var(--weight-semibold); color: var(--text); }
.form-card { background: var(--surface); border: var(--border-1); border-radius: var(--r-lg); padding: var(--space-8); box-shadow: var(--shadow-2); }
.form-card h3 { font-size: var(--text-h3); line-height: var(--leading-h3); margin-bottom: var(--space-2); }

/* ---------- Inner pages: cards, listing, contact ---------- */
.card { background: var(--surface); border: var(--border-1); border-radius: var(--card-radius); overflow: hidden; box-shadow: var(--shadow-1); transition: box-shadow var(--dur-base) var(--ease), transform var(--dur-base) var(--ease); }
.card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.card-link { display: block; color: inherit; text-decoration: none; }
.card-media img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; }
.card-body { padding: var(--space-4) var(--space-5) var(--space-5); }
.card-title { font-size: var(--text-h4); line-height: var(--leading-h4); margin-bottom: var(--space-1); }
.card-meta { color: var(--text-muted); font-size: var(--text-small); margin-bottom: var(--space-2); }
.card-price { font-family: var(--font-data); font-variant-numeric: tabular-nums; font-weight: var(--weight-bold); color: var(--text); }
.card-cta { font-size: var(--text-small); font-weight: var(--weight-semibold); color: var(--link); border-bottom: 1px solid var(--link-underline); }

.listing-price { font-family: var(--font-data); font-variant-numeric: tabular-nums; font-size: var(--text-h4); font-weight: var(--weight-bold); }
.gallery { display: grid; gap: var(--space-3); margin-bottom: var(--space-8); grid-template-columns: repeat(2, 1fr); }
.gallery figure:first-child { grid-column: 1 / -1; }
.gallery img { width: 100%; border-radius: var(--r-md); object-fit: cover; aspect-ratio: 3 / 2; }
.gallery figure:first-child img { aspect-ratio: 16 / 9; border-radius: var(--r-lg); }
.listing-body { display: grid; gap: var(--space-8); padding-bottom: var(--section-y); }
.booking { background: var(--surface); border: var(--border-1); padding: var(--card-pad); border-radius: var(--r-md); box-shadow: var(--shadow-2); }
.booking h2 { font-size: var(--text-h4); line-height: var(--leading-h4); }
.booking > .btn-block { margin-bottom: var(--space-5); }
.booking .field-row { grid-template-columns: 1fr; }
.ticks { padding-left: 1.2em; }
.ticks li::marker { color: var(--decor); }
.specs { display: grid; grid-template-columns: max-content 1fr; margin: 0; border: var(--border-1); border-radius: var(--r-md); background: var(--surface); overflow: hidden; }
.specs dt, .specs dd { padding: var(--space-3) var(--space-4); border-bottom: var(--border-1); margin: 0; }
.specs dt { color: var(--text-muted); font-size: var(--text-small); }
.specs dd { font-family: var(--font-data); font-variant-numeric: tabular-nums; font-weight: var(--weight-semibold); }
.specs dt:last-of-type, .specs dd:last-of-type { border-bottom: 0; }

.contact-grid { display: grid; gap: var(--space-8); padding-bottom: var(--section-y); }
.contact-grid > section:last-child { background: var(--surface); border: var(--border-1); border-radius: var(--r-md); padding: var(--card-pad); box-shadow: var(--shadow-1); }
.big-phone { font-family: var(--font-data); font-size: var(--text-data); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; line-height: var(--leading-h3); }
.big-phone a { text-decoration: none; }
.contact-call figure { margin-top: var(--space-6); }
.contact-call figure img { border-radius: var(--r-md); }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1fr 1.25fr; } }
@media (max-width: 899px) { .contact-call figure { display: none; } }
@media (min-width: 960px) { .listing-body { grid-template-columns: 1fr 400px; } .booking { position: sticky; top: calc(var(--header-h) + var(--space-6)); align-self: start; } }

/* ---------- S13 Footer (C: SEO links + NAP) ---------- */
.site-footer { background: var(--surface-brand); color: var(--text-on-brand); padding-block: var(--space-9) var(--space-7); margin-top: var(--section-y); }
.page-home .site-footer { margin-top: 0; }
.site-footer a { color: var(--text-on-brand); text-decoration: none; opacity: var(--opacity-soft); }
.site-footer a:hover { opacity: 1; text-decoration: underline; text-decoration-color: var(--accent-on-brand); }
.footer-h { font-family: var(--font-display); font-size: var(--text-small); line-height: var(--leading-small); font-weight: var(--weight-bold); color: var(--accent-on-brand); margin: 0 0 var(--space-4); letter-spacing: 0; }
.footer-h-gap { margin-top: var(--space-7); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 var(--space-2); font-size: var(--text-small); }
.seo-links { columns: 4; column-gap: var(--gutter); }
.seo-links li { break-inside: avoid; }
.seo-links span { opacity: var(--opacity-soft); }
.budget-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--gutter); margin-top: var(--space-8); padding-top: var(--space-8); border-top: 1px solid var(--tint-on-brand); }
.foot-grid img { height: var(--logo-h-footer); width: auto; margin-bottom: var(--space-4); }
.nap { font-size: var(--text-small); font-style: normal; opacity: var(--opacity-soft); line-height: var(--leading-small); }
.nap a { opacity: 1; }
.copy { display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-8); padding-top: var(--space-5); border-top: 1px solid var(--tint-on-brand); font-size: var(--text-caption); opacity: var(--opacity-faint); }

/* ---------- S14 Floating buttons (B) ---------- */
.fab { position: fixed; right: var(--fab-offset); bottom: var(--fab-offset); z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); }
.fab .btn { box-shadow: var(--shadow-2); }
.fab .btn-primary { border-color: var(--border-on-primary); }
.fab .btn-line { background: var(--surface); color: var(--text); border-color: var(--border); }
.fab .btn-line:hover { background: var(--surface-2); }

/* ---------- Booking dialog ---------- */
dialog { border: 0; border-radius: var(--r-lg); padding: 0; width: min(var(--dialog-w), calc(100vw - 2 * var(--page-margin))); max-height: calc(100dvh - 2 * var(--page-margin)); box-shadow: var(--shadow-2); color: var(--text); background: var(--surface); }
dialog::backdrop { background: var(--scrim-dialog); }
.dlg-h { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: var(--space-5) var(--space-6) 0; }
.dlg-h h2 { font-size: var(--text-h3); line-height: var(--leading-h3); margin: 0; }
.dlg-b { padding: var(--space-4) var(--space-6) var(--space-6); }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
  .site-nav, .header-tel { display: none; }
  .js .nav-toggle { display: inline-flex; }
  .header-inner { grid-template-columns: 1fr auto; }
  /* No JS: the menu button can't work, so keep the nav visible as a scrollable row. */
  html:not(.js) .site-nav { display: block; grid-column: 1 / -1; overflow-x: auto; padding-bottom: var(--space-3); }
  html:not(.js) .site-nav ul { justify-content: flex-start; gap: var(--space-5); }
  .hero-content { grid-template-columns: minmax(0, 1fr); }
  .glass { display: none; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 > .tier:last-child { grid-column: 1 / -1; }
  .areas { grid-template-columns: 1fr; }
  .map { min-height: var(--map-min-h-sm); }
  .cta-band .inner { grid-template-columns: 1fr; padding: var(--space-8) var(--space-7); }
  .contact { grid-template-columns: 1fr; }
  .seo-links { columns: 3; }
  .steps { grid-template-columns: 1fr; gap: var(--space-7); }
  .step { padding: 0 0 0 var(--step-indent); min-height: var(--step-num); }
  .step .num { position: absolute; left: 0; top: 0; }
  .step h3 { margin-top: var(--space-2); }
  .step::before { top: calc(var(--step-num) + var(--space-2)); bottom: calc(-1 * var(--space-7) + var(--space-2)); left: calc(var(--step-num) / 2); right: auto; border-top: 0; border-left: 1px dashed var(--border-strong); }
}
@media (max-width: 719px) {
  .header-actions .btn-primary { display: none; }
  .hero { margin: var(--space-2); min-height: auto; border-radius: var(--r-md); }
  .hero-content { padding-bottom: var(--space-6); }
  .hero h1 .nowrap:first-child { white-space: normal; }
  .search { grid-template-columns: 1fr; border-radius: var(--r-md); padding: var(--space-2); }
  .search .f { border-right: 0; border-bottom: var(--border-1); padding: var(--space-3); }
  .search .f:focus-within { border-radius: var(--r-sm); }
  .search .btn { margin-top: var(--space-2); }
  .trust-inner { gap: var(--space-4); }
  .trust-label { max-width: none; text-align: center; }
  .dev-logos { justify-content: center; }
  .dev-logo { min-width: 0; flex: 1 1 40%; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-3 > .tier:last-child { grid-column: auto; }
  .sec-head { margin-bottom: var(--space-6); }
  .line-box { flex-direction: column; align-items: flex-start; }
  .line-box .btn { white-space: normal; }
  .cta-band .container { padding-inline: var(--space-2); }
  .cta-band .inner { padding: var(--space-7) var(--space-5); border-radius: var(--r-md); }
  .callback { padding: var(--space-5); }
  .form-card { padding: var(--space-5); border-radius: var(--r-md); }
  .field-row { grid-template-columns: 1fr; }
  .seo-links { columns: 2; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > div:first-child { grid-column: 1 / -1; }
  .rating { padding: var(--space-4); }
  .site-footer { padding-bottom: var(--fab-clearance); }
  .fab .btn { min-height: var(--btn-icon); padding: 0 var(--space-5); }
  .faq-cta { padding: var(--space-5); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Guides (blog) ---------- */
.guide-meta { font-size: var(--text-small); color: var(--text-muted); }
.guide-hero { margin-block: var(--space-6) var(--space-8); }
.guide-hero img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-lg); }
.prose { font-size: var(--text-lead); line-height: var(--leading-lead); }
.prose > * { max-width: var(--measure); }
.prose h2 { font-size: var(--text-h3); line-height: var(--leading-h3); letter-spacing: var(--tracking-h3); margin: var(--space-9) 0 var(--space-4); }
.prose h3 { margin: var(--space-7) 0 var(--space-3); }
.prose ul, .prose ol { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: var(--space-2); }
.prose li::marker { color: var(--decor); }
.prose table { width: 100%; max-width: none; border-collapse: collapse; font-size: var(--text-small); line-height: var(--leading-small); margin: var(--space-6) 0; background: var(--surface); border: var(--border-1); border-radius: var(--r-md); overflow: hidden; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: var(--space-3) var(--space-4); border-bottom: var(--border-1); vertical-align: top; }
.prose thead th { background: var(--surface-2); font-family: var(--font-display); font-weight: var(--weight-semibold); }
.prose tbody tr:last-child td { border-bottom: 0; }
.guide-cta { display: flex; justify-content: space-between; align-items: center; gap: var(--space-5); flex-wrap: wrap; background: var(--tonal); border-radius: var(--r-md); padding: var(--space-6); margin: var(--space-9) 0 var(--space-6); }
.guide-cta h2 { font-size: var(--text-h4); line-height: var(--leading-h4); margin: 0 0 var(--space-2); }
.guide-cta p { margin: 0; color: var(--text-muted); }
.guide-cta .acts { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.page-guide .site-footer, .page-guides .site-footer { margin-top: var(--section-y); }
.page-guide .breadcrumbs { max-width: var(--container-narrow); }   /* align with the article column */
@media (max-width: 719px) {
  .prose { font-size: var(--text-body); line-height: var(--leading-body); }
  .guide-cta { padding: var(--space-5); }
}

/* ---------- Listing pages: Buy / Rent tabs + price links ---------- */
.listing-nav { display: grid; gap: var(--space-4); margin-top: var(--space-5); }
.seg { display: inline-flex; justify-self: start; gap: var(--space-1); padding: var(--space-1); background: var(--surface); border: var(--border-1); border-radius: var(--r-pill); }
.seg a { padding: var(--space-2) var(--space-5); border-radius: var(--r-pill); text-decoration: none; color: var(--text-muted); font-family: var(--font-display); font-weight: var(--weight-semibold); font-size: var(--text-small); }
.seg a:hover { color: var(--text); }
.seg a[aria-current="page"] { background: var(--primary); color: var(--on-primary); }
.price-links { display: flex; flex-wrap: wrap; gap: var(--space-2); }
a.chip { display: inline-flex; align-items: center; text-decoration: none; }
.chip[aria-current="page"] { background: var(--tonal); color: var(--on-tonal); border-color: var(--primary); }
.section-tight { padding-top: var(--space-7); }
.empty-state { background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--r-md); padding: var(--space-8) var(--space-6); text-align: center; }
.empty-state h2 { font-size: var(--text-h4); line-height: var(--leading-h4); }
.empty-state p { color: var(--text-muted); max-width: var(--measure); margin-inline: auto; }
.empty-state .acts { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: center; }
.site-nav a[aria-current="page"] { color: var(--text); }

/* ---------- About us ---------- */
.about-hero img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: var(--r-lg); }
.about-story { display: grid; grid-template-columns: 5fr 7fr; gap: var(--space-8); align-items: start; }
.about-story p { font-size: var(--text-lead); line-height: var(--leading-lead); }
.feature { background: var(--surface); border: var(--border-1); border-radius: var(--card-radius); padding: var(--card-pad); }
.feature h3 { margin-bottom: var(--space-2); }
.feature p { color: var(--text-muted); margin: 0; }
.area-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.area-chips li { background: var(--surface); border: var(--border-1); border-radius: var(--r-pill); padding: var(--space-2) var(--space-4); font-size: var(--text-small); }
@media (max-width: 1023px) { .about-story { grid-template-columns: 1fr; gap: var(--space-4); } }
@media (max-width: 719px) { .about-hero img { aspect-ratio: 4 / 3; border-radius: var(--r-md); } .seg a { padding: var(--space-2) var(--space-4); } }

/* ---------- Cookie consent (PDPA) ---------- */
.consent-bar { position: fixed; left: var(--space-4); right: var(--space-4); bottom: var(--space-4); z-index: 70; max-width: var(--container-narrow); margin-inline: auto; display: flex; gap: var(--space-4); align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--surface); border: var(--border-1); border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: var(--space-4) var(--space-5); font-size: var(--text-small); line-height: var(--leading-small); }
.consent-bar p { margin: 0; flex: 1 1 20em; color: var(--text-muted); }
.consent-bar .acts { display: flex; gap: var(--space-2); }
@media (max-width: 719px) { .consent-bar { left: var(--space-2); right: var(--space-2); bottom: var(--space-2); } .consent-bar .acts { width: 100%; } .consent-bar .btn { flex: 1; } }

/* ---------- Product page (property) ---------- */
.listing-head { display: grid; gap: var(--space-3); padding-bottom: var(--space-5); }
.listing-head h1 { margin: 0; }
.listing-head .p-loc { font-size: var(--text-body); }
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.quick-facts { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin: 0; padding: 0; color: var(--text-muted); font-size: var(--text-small); }
.quick-facts li { display: inline-flex; align-items: center; gap: var(--space-2); }
.gallery-1 { grid-template-columns: 1fr; }
.gallery-2, .gallery-3 { grid-template-columns: 2fr 1fr; grid-auto-rows: 1fr; }
.gallery-3 figure:first-child { grid-row: span 2; grid-column: auto; }
.gallery-2 figure:first-child, .gallery-3 figure:first-child { grid-column: auto; }
.gallery-3 img, .gallery-2 img { height: 100%; aspect-ratio: auto; }
.listing-map { position: relative; border-radius: var(--r-lg); overflow: hidden; border: var(--border-1); background: var(--map-land); aspect-ratio: 21 / 8; margin-bottom: var(--space-8); }
.listing-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.listing-map-inline { aspect-ratio: 16 / 9; border-radius: var(--r-md); margin-bottom: var(--space-3); }
.map-badge { position: absolute; left: var(--space-3); bottom: var(--space-3); background: var(--surface-on-media); color: var(--text-muted); font-size: var(--text-caption); border-radius: var(--r-pill); padding: var(--space-1) var(--space-3); box-shadow: var(--shadow-1); }
.listing-main { display: grid; gap: var(--space-8); align-content: start; }
.listing-main h2 { font-size: var(--text-h4); line-height: var(--leading-h4); margin-bottom: var(--space-4); }
.price-block { display: grid; gap: var(--space-1); padding-bottom: var(--space-6); border-bottom: var(--border-1); }
.price-block p { margin: 0; }
.price-label { font-size: var(--text-small); color: var(--text-muted); }
.price-main { font-family: var(--font-data); font-variant-numeric: tabular-nums; font-weight: var(--weight-bold); font-size: var(--text-data); line-height: var(--leading-tight); color: var(--primary); }
.price-to { color: var(--text-muted); font-size: var(--text-h4); }
.price-sub { font-size: var(--text-small); color: var(--text-muted); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5) var(--space-6); margin: 0; }
.fact { display: flex; gap: var(--space-3); align-items: center; }
.fact-ico { width: var(--icon-disc); height: var(--icon-disc); flex: none; padding: var(--space-3); border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); }
.fact dt { font-size: var(--text-caption); color: var(--text-muted); }
.fact dd { margin: 0; font-family: var(--font-display); font-weight: var(--weight-semibold); }
.nearby { list-style: none; margin: 0; padding: 0; border-top: var(--border-1); }
.nearby li { display: flex; justify-content: space-between; gap: var(--space-4); padding: var(--space-3) 0; border-bottom: var(--border-1); font-size: var(--text-small); }
.nearby b { font-family: var(--font-data); font-variant-numeric: tabular-nums; white-space: nowrap; }
.source-note { font-size: var(--text-caption); color: var(--text-muted); background: var(--surface-2); border-radius: var(--r-sm); padding: var(--space-3) var(--space-4); margin: 0; }
.booking-price { font-family: var(--font-data); font-variant-numeric: tabular-nums; font-weight: var(--weight-bold); font-size: var(--text-h3); color: var(--primary); margin: 0 0 var(--space-2); }
.p-placeholder { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: var(--space-1); aspect-ratio: 16 / 10; padding: var(--space-5); background: linear-gradient(135deg, var(--surface-brand), var(--color-olive-600)); color: var(--text-on-brand); text-decoration: none; }
.p-placeholder .ico { position: absolute; top: var(--space-5); right: var(--space-5); width: var(--icon-faq); height: var(--icon-faq); opacity: var(--opacity-faint); }
.p-placeholder span { font-family: var(--font-display); font-weight: var(--weight-semibold); font-size: var(--text-h5); line-height: var(--leading-h5); }
.p-placeholder small { color: var(--text-on-brand-muted); font-size: var(--text-caption); }
@media (max-width: 719px) {
  .facts { grid-template-columns: 1fr 1fr; gap: var(--space-4); }
  .listing-map { aspect-ratio: 4 / 3; border-radius: var(--r-md); }
  .gallery-2, .gallery-3 { grid-template-columns: 1fr; }
  .gallery-3 figure:first-child { grid-row: auto; }
}

/* Illustrative stock photo label ("ภาพประกอบ") — always visible over the image */
.illus-tag { display: inline-flex; align-items: center; background: var(--surface-illus-tag); color: var(--text-on-media); font-family: var(--font-display); font-size: var(--badge-fs); font-weight: var(--weight-semibold); padding: var(--space-1) var(--badge-px); border-radius: var(--badge-radius); }
.p-media .illus-tag { position: absolute; right: var(--space-3); bottom: var(--space-3); pointer-events: none; }
.gallery .illus { position: relative; }
.illus-over { position: absolute; top: var(--space-3); left: var(--space-3); }
.gallery .illus figcaption { margin-top: var(--space-2); color: var(--text-muted); font-size: var(--text-caption); }
.gallery .illus figcaption a { color: inherit; }
