/* ============================================================================
   web-11 · เรือนทะเล พร็อพเพอร์ตี้

   Concept: every beach-property listing in the country says "ใกล้ทะเล", which
   covers everything from 80 metres to four kilometres. The single number a
   second-home buyer actually wants is how long it takes to walk to the sand. So
   the site answers that visually, everywhere a property appears. Slate blue and
   fog grey — the default palette of the category — is replaced by the bleached
   colours of a Thai coast at midday.

   Signature: the distance meter (.meter). Shared 0–3,000 m scale everywhere, so
   two houses can be compared by eye. Anything past 3,000 m runs to the end and
   is torn off with the true figure beside it — the scale is never stretched to
   make a listing look closer than it is.
   ============================================================================ */

:root {
  --salt: #F7F4EC;
  --salt-2: #ECE7DA;
  --deep: #0E2E35;
  --gulf: #1F5F6B;
  --sun: #F2A65A;
  --sand: #E9C9A8;
  --grey: #7E8887;

  --container: 1180px;
  --pad: clamp(20px, 5vw, 48px);
  --gap: clamp(72px, 9vw, 120px);
}

body {
  background: var(--salt);
  color: var(--deep);
  font-family: 'Sarabun', system-ui, sans-serif;
  line-height: 1.8;
}

.mono, .num { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
h1, h2, h3 { font-family: 'Niramit', system-ui, sans-serif; font-weight: 600; line-height: 1.3; }
h1 { font-size: clamp(2.25rem, 5vw, 3.375rem); }
h2 { font-size: clamp(1.625rem, 3vw, 2.125rem); }
h3 { font-size: 1.0625rem; }

.wrap { max-width: var(--container); margin-inline: auto; padding-inline: var(--pad); }
.section { padding-block: var(--gap); }
.section--alt { background: var(--salt-2); }
.section--deep { background: var(--deep); color: var(--salt); }
.lede { color: var(--grey); max-width: 56ch; }
.section--deep .lede { color: rgba(247,244,236,.76); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--gulf); outline-offset: 3px; }

/* -- buttons ---------------------------------------------------------------- */
.btn { display: inline-block; padding: 15px 30px; border-radius: 2px; text-decoration: none; font-weight: 600; transition: background .2s, color .2s; }
.btn--primary { background: var(--gulf); color: var(--salt); }
.btn--primary:hover { background: #2a7480; }
.btn--ghost { border: 1px solid var(--deep); }
.btn--ghost:hover { background: var(--deep); color: var(--salt); }
.section--deep .btn--primary { background: var(--salt); color: var(--gulf); }
.section--deep .btn--ghost { border-color: var(--salt); color: var(--salt); }
.section--deep .btn--ghost:hover { background: var(--salt); color: var(--deep); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* -- header ------------------------------------------------------------------ */
.header { position: sticky; top: 0; z-index: 30; background: var(--salt); border-bottom: 1px solid transparent; transition: border-color .2s; }
.header.is-stuck { border-bottom-color: rgba(14,46,53,.14); }
.header__inner { max-width: var(--container); margin-inline: auto; padding: 12px var(--pad); display: flex; align-items: center; gap: 24px; }
.brand { font-family: 'Niramit', sans-serif; font-weight: 600; font-size: 1.25rem; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand__wave { width: 24px; height: 10px; overflow: visible; }
.brand__wave path { fill: none; stroke: var(--gulf); stroke-width: 1.6; stroke-linecap: round; }
.nav { display: flex; gap: 20px; margin-left: auto; }
.nav__link { text-decoration: none; font-size: .9375rem; padding-block: 3px; border-bottom: 2px solid transparent; }
.nav__link.is-active { color: var(--gulf); border-bottom-color: var(--gulf); }
.nav__link:hover { color: var(--gulf); }
.burger { display: none; flex-direction: column; gap: 5px; padding: 8px; margin-left: auto; }
.burger span { display: block; width: 22px; height: 2px; background: var(--deep); }
@media (max-width: 860px) {
  .burger { display: flex; }
  .nav { position: fixed; inset: 0; z-index: 40; flex-direction: column; justify-content: center; align-items: center; gap: 26px; margin: 0; background: var(--salt); transform: translateY(-100%); transition: transform .3s; }
  .nav.is-open { transform: none; }
  .nav__link { font-size: 1.25rem; }
  body.nav-open { overflow: hidden; }
}

/* -- SIGNATURE: the distance meter --------------------------------------------- */
/* --w is the distance as a percentage of the shared 3,000 m scale, computed in the markup
   so the meter is correct with CSS alone. */
.meter { --w: 50%; margin: 12px 0 10px; }
.meter__track { position: relative; height: 3px; background: var(--sand); }
.meter__fill { position: absolute; left: 0; top: 0; height: 3px; width: var(--w); background: var(--gulf); }
/* the house sits at the far end of the walked distance */
.meter__home { position: absolute; left: var(--w); top: -5px; transform: translateX(-50%); width: 13px; height: 13px; }
.meter__home path { fill: var(--gulf); }
/* the sea is always at the end of the scale, never moved to suit a listing */
.meter__sea { position: absolute; right: -2px; top: -5px; width: 16px; height: 13px; overflow: visible; }
.meter__sea path { fill: none; stroke: var(--gulf); stroke-width: 1.6; stroke-linecap: round; }
.meter__num { display: block; margin-top: 6px; font-family: 'IBM Plex Mono', monospace; font-size: .8125rem; color: var(--gulf); }

/* on the sand: a different colour, because it is a different kind of fact */
.meter--onsand .meter__fill, .meter--onsand .meter__home path { background: var(--sun); fill: var(--sun); }
.meter--onsand .meter__num { color: #C77C2A; }

/* past the scale: run to the end and tear it off rather than rescaling */
.meter--over .meter__fill { width: 100%; }
.meter--over .meter__track::after {
  content: ''; position: absolute; right: 0; top: -2px; bottom: -2px; width: 9px;
  background: linear-gradient(-45deg, var(--salt) 25%, transparent 25% 50%, var(--salt) 50% 75%, transparent 75%);
  background-size: 5px 5px;
}
.section--alt .meter--over .meter__track::after { background-color: var(--salt-2); }
.meter--over .meter__home { display: none; }

.meter--mini .meter__track { height: 2px; }
.meter--mini .meter__home, .meter--mini .meter__sea { display: none; }

/* -- hero -------------------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px,4vw,56px); align-items: center; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } .hero__img { order: -1; } }
.hero__text { padding-block: clamp(48px,7vw,96px); }
.hero h1 { max-width: 16ch; }
.hero__img img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
@media (max-width: 900px) { .hero__img img { aspect-ratio: 3/2; } }
.hero__meters { margin-top: 32px; max-width: 420px; }
.hero__meters > div { margin-bottom: 18px; }
.hero__meters p { font-size: .875rem; color: var(--grey); }

/* -- listing cards --------------------------------------------------------------------- */
.props { display: grid; grid-template-columns: repeat(3,1fr); gap: 32px 24px; margin-top: 44px; }
@media (max-width: 1024px) { .props { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px) { .props { grid-template-columns: 1fr; } }
.prop { display: flex; flex-direction: column; }
.prop__shot { position: relative; overflow: hidden; border-radius: 2px; }
.prop__shot img { width: 100%; aspect-ratio: 3/2; object-fit: cover; transition: transform .3s ease-out; }
.prop:hover .prop__shot img { transform: scale(1.03); }
.prop__flag { position: absolute; top: 10px; left: 10px; background: var(--sun); color: var(--deep); font-family: 'IBM Plex Mono', monospace; font-size: .6875rem; padding: 3px 8px; border-radius: 2px; }
.prop h3 { margin-top: 4px; }
.prop__type { font-family: 'IBM Plex Mono', monospace; font-size: .8125rem; color: var(--gulf); }
.prop__spec { font-family: 'IBM Plex Mono', monospace; font-size: .8125rem; color: var(--grey); }
.prop__amen { font-size: .9375rem; margin-top: 6px; }
.prop__price { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--sand); font-family: 'IBM Plex Mono', monospace; font-size: 1.25rem; }
.prop__price span { display: block; font-size: .8125rem; color: var(--grey); }
/* the line that separates this agency from a listings portal: it has to say a downside */
.prop__note { background: var(--salt-2); border-left: 3px solid var(--gulf); padding: 12px 14px; margin-top: 12px; font-size: .875rem; color: var(--deep); }
.section--alt .prop__note { background: var(--salt); }
.is-hidden { display: none; }

/* -- filters ------------------------------------------------------------------------------ */
.filters { margin-top: 28px; }
.filters__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.filters__label { font-family: 'IBM Plex Mono', monospace; font-size: .75rem; color: var(--grey); min-width: 68px; }
.filter { padding: 7px 16px; border: 1px solid var(--deep); background: none; font-family: inherit; font-size: .875rem; border-radius: 2px; }
.filter[aria-pressed="true"] { background: var(--gulf); border-color: var(--gulf); color: var(--salt); }
.filters select { padding: 7px 12px; border: 1px solid var(--deep); background: var(--salt); font-family: inherit; font-size: .875rem; border-radius: 2px; }

/* -- why-local grid ------------------------------------------------------------------------ */
.why { display: grid; grid-template-columns: repeat(2,1fr); gap: 0; margin-top: 40px; border-top: 1px solid rgba(14,46,53,.14); }
@media (max-width: 760px) { .why { grid-template-columns: 1fr; } }
.why > div { padding: 28px 32px 28px 0; border-bottom: 1px solid rgba(14,46,53,.14); }
.why > div:nth-child(odd) { border-right: 1px solid rgba(14,46,53,.14); padding-right: 32px; }
@media (max-width: 760px) { .why > div:nth-child(odd) { border-right: 0; } }
.why h3 { display: flex; gap: 10px; align-items: center; }
.why h3 svg { flex: none; width: 20px; height: 9px; overflow: visible; }
.why h3 svg path { fill: none; stroke: var(--gulf); stroke-width: 1.6; stroke-linecap: round; }
.why p { color: var(--grey); font-size: .9375rem; margin-top: 6px; max-width: 38ch; }

/* -- area table ---------------------------------------------------------------------------- */
.areas { width: 100%; max-width: 1000px; margin-top: 36px; }
.areas th, .areas td { padding: 18px 20px 18px 0; border-top: 1px solid rgba(14,46,53,.14); text-align: left; font-weight: 400; vertical-align: top; }
.areas tr:last-child td, .areas tr:last-child th { border-bottom: 1px solid rgba(14,46,53,.14); }
.areas tr:hover { background: var(--salt-2); }
.section--alt .areas tr:hover { background: var(--salt); }
.areas .is-area { font-family: 'Niramit', sans-serif; font-weight: 600; white-space: nowrap; }
.areas .is-land { font-family: 'IBM Plex Mono', monospace; white-space: nowrap; }
.areas .is-desc { color: var(--grey); font-size: .9375rem; }
.areas__bar { height: 4px; background: var(--gulf); margin-top: 6px; width: var(--w); }
@media (max-width: 820px) {
  .areas, .areas tbody, .areas tr, .areas th, .areas td { display: block; width: auto; }
  .areas tr { padding: 16px 0; border-top: 1px solid rgba(14,46,53,.14); }
  .areas th, .areas td { padding: 0; border: 0; }
}

/* -- sell / fee rows ------------------------------------------------------------------------ */
.two-col { display: grid; grid-template-columns: 45fr 55fr; gap: clamp(28px,4vw,56px); align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } .two-col > .is-map { order: -1; } }
.dl { width: 100%; margin-top: 8px; }
.dl th, .dl td { padding: 14px 20px 14px 0; border-top: 1px solid rgba(247,244,236,.18); text-align: left; font-weight: 400; vertical-align: top; }
.dl tr:last-child td, .dl tr:last-child th { border-bottom: 1px solid rgba(247,244,236,.18); }
.dl .is-k { font-weight: 600; white-space: nowrap; }
.dl .is-v { color: rgba(247,244,236,.82); }
.dl .num { color: var(--sun); }
.section:not(.section--deep) .dl th, .section:not(.section--deep) .dl td { border-color: rgba(14,46,53,.14); }
.section:not(.section--deep) .dl .is-v { color: var(--grey); }
.section:not(.section--deep) .dl .num { color: var(--gulf); }
@media (max-width: 700px) {
  .dl, .dl tbody, .dl tr, .dl th, .dl td { display: block; width: auto; }
  .dl tr { padding: 12px 0; border-top: 1px solid rgba(14,46,53,.14); }
  .dl th, .dl td { padding: 0; border: 0; }
}

/* -- sold table ------------------------------------------------------------------------------ */
.sold { width: 100%; max-width: 1000px; margin-top: 32px; color: var(--grey); }
.sold th, .sold td { padding: 16px 20px 16px 0; border-top: 1px solid rgba(14,46,53,.14); text-align: left; font-weight: 400; vertical-align: top; }
.sold tr:last-child td, .sold tr:last-child th { border-bottom: 1px solid rgba(14,46,53,.14); }
.sold .is-name { font-weight: 600; }
.sold .is-close { font-family: 'IBM Plex Mono', monospace; color: var(--deep); }
.sold .is-days { font-family: 'IBM Plex Mono', monospace; }
.sold__bar { height: 4px; background: var(--gulf); opacity: .55; margin-top: 6px; width: var(--w); }
@media (max-width: 780px) {
  .sold, .sold tbody, .sold tr, .sold th, .sold td { display: block; width: auto; }
  .sold tr { padding: 14px 0; border-top: 1px solid rgba(14,46,53,.14); }
  .sold th, .sold td { padding: 0; border: 0; }
}

/* -- steps / people ---------------------------------------------------------------------------- */
.steps { max-width: 820px; margin-top: 36px; border-left: 1px solid rgba(14,46,53,.18); }
.step { position: relative; padding: 20px 0 20px 28px; }
.step + .step { border-top: 1px solid rgba(14,46,53,.12); }
.step::before { content: ''; position: absolute; left: -4.5px; top: 30px; width: 9px; height: 9px; border-radius: 50%; background: var(--gulf); }
.step__n { font-family: 'IBM Plex Mono', monospace; font-size: .8125rem; color: var(--grey); }
.step p { color: var(--grey); max-width: 54ch; }

.callout { background: var(--deep); color: var(--salt); padding: 26px; margin-top: 28px; }
.callout p { color: rgba(247,244,236,.9); max-width: 64ch; }

.locator { width: 100%; display: block; border: 1px solid rgba(14,46,53,.14); border-radius: 2px; }
.hours { max-width: 600px; margin-top: 20px; }
.hours tr { border-top: 1px solid rgba(14,46,53,.14); }
.hours tr:last-child { border-bottom: 1px solid rgba(14,46,53,.14); }
.hours th, .hours td { padding: 12px 0; font-weight: 400; text-align: left; }
.hours td { text-align: right; font-family: 'IBM Plex Mono', monospace; }
.hours tr.is-today th { font-weight: 600; }
.hours tr.is-extra th, .hours tr.is-extra td { background: var(--salt-2); }

/* -- CTA band ------------------------------------------------------------------------------------ */
.band { background: var(--gulf); color: var(--salt); padding-block: clamp(56px,7vw,88px); text-align: center; }
.band p { color: rgba(247,244,236,.86); max-width: 62ch; margin-inline: auto; }
.band .btn-row { justify-content: center; }
.band .btn--primary { background: var(--salt); color: var(--gulf); }
.band .btn--ghost { border-color: var(--salt); color: var(--salt); }
.band .btn--ghost:hover { background: var(--salt); color: var(--gulf); }

/* -- footer --------------------------------------------------------------------------------------- */
.footer { background: var(--deep); color: var(--salt); padding-block: 56px 28px; }
.footer__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 32px; font-size: .9375rem; color: rgba(247,244,236,.72); }
@media (max-width: 800px) { .footer__grid { grid-template-columns: 1fr; } }
.footer__brand { font-family: 'Niramit', sans-serif; font-weight: 600; color: var(--salt); margin-bottom: 8px; }
.footer__label { font-size: .8125rem; color: var(--sun); margin-bottom: 6px; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }
/* the meter is only trustworthy if how it is measured is stated — so it is, on every page */
.footer__meternote { margin-top: 32px; padding-top: 18px; border-top: 1px solid rgba(247,244,236,.18); font-size: .8125rem; color: rgba(247,244,236,.6); }
.footer__note { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 20px; font-size: .8125rem; color: rgba(247,244,236,.6); }

/* -- mobile bar ------------------------------------------------------------------------------------- */
.mobilebar { display: none; }
@media (max-width: 640px) {
  .mobilebar { display: grid; grid-template-columns: 1fr auto; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--gulf); }
  .mobilebar .btn { padding: 12px 18px; text-align: center; font-size: .9375rem; }
  .mobilebar .btn--ghost { border-color: var(--salt); color: var(--salt); }
  body { padding-bottom: 72px; }
}
