/* ===========================================================
   CM Agency — Real Estate site
   Design tokens
   =========================================================== */
:root{
  --paper:      #F7F4EC;
  --ink:        #1C2B3A;
  --ink-soft:   #2E3F4F;
  --text:       #2A2823;
  --text-soft:  #5B5A52;
  --brass:      #B07C33;
  --brass-deep: #8C601F;
  --sage:       #4D6B5C;
  --line:       #DCD4C0;
  --white:      #FFFFFF;

  --serif: "Noto Serif Thai", "Noto Serif", serif;
  --sans:  "Noto Sans Thai", "Noto Sans", sans-serif;

  --max: 1120px;
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img{ max-width: 100%; display: block; }

a{ color: inherit; }

h1,h2,h3,h4{
  font-family: var(--serif);
  color: var(--ink);
  margin: 0 0 0.5em 0;
  font-weight: 600;
  line-height: 1.28;
}

h1{ font-size: clamp(2.1rem, 4vw, 3.2rem); font-weight: 700; }
h2{ font-size: clamp(1.5rem, 2.6vw, 2.05rem); }
h3{ font-size: 1.2rem; }

p{ margin: 0 0 1em 0; max-width: 68ch; }

.container{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

/* -------------------- focus / a11y -------------------- */
a:focus-visible, button:focus-visible{
  outline: 2px solid var(--brass);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* -------------------- top bar -------------------- */
.topbar{
  background: var(--ink);
  color: #CBD6DD;
  font-size: 0.85rem;
}
.topbar .container{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  padding-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
}
.topbar a{ color: #E7DCC4; text-decoration: none; }
.topbar a:hover{ text-decoration: underline; }
.topbar span + span{ margin-inline-start: 18px; }

/* -------------------- header / nav -------------------- */
header.site{
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.nav-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 20px;
}
.brand{
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.1;
}
.brand .th{
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink);
  letter-spacing: 0.01em;
}
.brand .en{
  font-size: 0.72rem;
  color: var(--brass-deep);
  margin-top: 3px;
}

nav.primary{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
nav.primary a{
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 0.96rem;
  padding: 8px 14px;
  border-radius: 3px;
  border: 1px solid transparent;
}
nav.primary a:hover{ border-color: var(--line); }
nav.primary a[aria-current="page"]{
  color: var(--ink);
  font-weight: 600;
  border-bottom: 2px solid var(--brass);
  border-radius: 0;
}

.nav-cta{
  display: inline-block;
  background: var(--ink);
  color: var(--paper) !important;
  padding: 9px 18px;
  border-radius: 3px;
  text-decoration: none;
  font-size: 0.92rem;
  white-space: nowrap;
}
.nav-cta:hover{ background: var(--ink-soft); }

.nav-toggle{ display:none; }

@media (max-width: 860px){
  nav.primary{ display:none; }
  .nav-toggle{
    display:inline-flex;
    align-items:center;
    gap:8px;
    background:none;
    border:1px solid var(--line);
    padding:8px 12px;
    border-radius:3px;
    font-family: var(--sans);
    font-size: 0.9rem;
    color: var(--ink);
  }
  nav.primary.open{
    display:flex;
    flex-direction:column;
    width:100%;
    order: 3;
  }
  .nav-row{ flex-wrap: wrap; }
}

/* -------------------- hero -------------------- */
.hero{
  background: var(--ink);
  color: #E9E4D6;
  position: relative;
  overflow: hidden;
}
.hero .container{
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
  padding-top: 64px;
  padding-bottom: 64px;
}
.hero-eyebrow{
  color: var(--brass);
  font-size: 0.92rem;
  margin-bottom: 14px;
}
.hero h1{ color: var(--white); }
.hero p.lead{
  color: #C9D2D6;
  font-size: 1.08rem;
  max-width: 46ch;
}
.hero-actions{
  display:flex;
  gap: 14px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.btn{
  display:inline-block;
  text-decoration:none;
  padding: 13px 26px;
  border-radius: 3px;
  font-size: 0.98rem;
  border: 1px solid transparent;
}
.btn-brass{ background: var(--brass); color: var(--ink); font-weight:600; }
.btn-brass:hover{ background: var(--brass-deep); color: var(--white); }
.btn-outline{ border-color: #566372; color: #E9E4D6; }
.btn-outline:hover{ border-color: var(--brass); color: var(--brass); }

.hero-figure{
  border: 1px solid #3B4B5B;
  padding: 10px;
  background: #17222E;
}
.hero-figure img{ width:100%; height: 380px; object-fit: cover; }
.hero-figure figcaption{
  font-size: 0.78rem;
  color: #93A2AD;
  padding: 10px 4px 2px;
  border-top: 1px solid #2C3A48;
  margin-top: 10px;
}

/* -------------------- section shell -------------------- */
section{ padding: 64px 0; }
section.alt{ background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head{
  display:flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}
.section-head p{ margin:0; color: var(--text-soft); max-width: 52ch; }
.section-tag{
  font-size: 0.8rem;
  color: var(--sage);
  letter-spacing: 0.02em;
}

/* -------------------- deed-style field rows -------------------- */
.deed{
  border: 1px solid var(--line);
  background: var(--white);
}
.deed-row{
  display:grid;
  grid-template-columns: 200px 1fr;
  border-bottom: 1px solid var(--line);
}
.deed-row:last-child{ border-bottom: none; }
.deed-row dt{
  padding: 14px 18px;
  font-size: 0.85rem;
  color: var(--sage);
  border-right: 1px solid var(--line);
  background: #FBFAF5;
}
.deed-row dd{
  margin: 0;
  padding: 14px 18px;
  color: var(--text);
}
@media (max-width: 640px){
  .deed-row{ grid-template-columns: 1fr; }
  .deed-row dt{ border-right:none; border-bottom:1px solid var(--line); }
}

/* -------------------- services grid -------------------- */
.grid-4{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.grid-3{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.service-card{
  background: var(--white);
  padding: 26px 24px;
}
.service-card img{
  width: 100%;
  height: 150px;
  object-fit: cover;
  margin-bottom: 16px;
  filter: grayscale(8%);
}
.service-card h3{ margin-bottom: 8px; }
.service-card p{ color: var(--text-soft); font-size: 0.96rem; margin-bottom: 0;}

@media (max-width: 900px){
  .grid-4{ grid-template-columns: repeat(2,1fr); }
  .grid-3{ grid-template-columns: repeat(1,1fr); }
}
@media (max-width: 520px){
  .grid-4{ grid-template-columns: 1fr; }
}

/* -------------------- process steps (true sequence) -------------------- */
.steps{
  counter-reset: step;
  border-top: 1px solid var(--line);
}
.step{
  display:grid;
  grid-template-columns: 74px 1fr;
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.step .num{
  counter-increment: step;
  font-family: var(--serif);
  font-size: 1.6rem;
  color: var(--brass);
}
.step .num::before{ content: counter(step, decimal-leading-zero); }
.step h3{ margin-bottom: 6px; }
.step p{ color: var(--text-soft); margin: 0; }

/* -------------------- reasons list -------------------- */
.reasons{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 40px;
}
.reason{ border-left: 2px solid var(--brass); padding-left: 18px; }
.reason h3{ margin-bottom: 6px; font-size: 1.08rem; }
.reason p{ color: var(--text-soft); margin: 0; }
@media (max-width: 760px){ .reasons{ grid-template-columns: 1fr; } }

/* -------------------- two column split -------------------- */
.split{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.split img{ width:100%; height: 340px; object-fit: cover; }
@media (max-width: 820px){
  .split{ grid-template-columns: 1fr; }
  .split img{ height: 240px; }
}
.split.reverse .img-col{ order: 2; }

/* -------------------- stats strip -------------------- */
.coverage-list{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin-top: 18px;
}
.coverage-list li{
  list-style: none;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 7px 14px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

/* -------------------- cta band -------------------- */
.cta-band{
  background: var(--sage);
  color: #EAF0EA;
}
.cta-band h2{ color: var(--white); }
.cta-band p{ color: #D6E2D8; }
.cta-band .btn-brass{ color: var(--ink); }

/* -------------------- contact page bits -------------------- */
.contact-grid{
  display:grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 44px;
}
@media (max-width: 860px){ .contact-grid{ grid-template-columns: 1fr; } }

.info-block{
  border: 1px solid var(--line);
  background: var(--white);
  padding: 24px;
  margin-bottom: 18px;
}
.info-block h3{ font-size: 1rem; color: var(--sage); margin-bottom: 8px; }

.map-frame{
  border: 1px solid var(--line);
  width: 100%;
  height: 340px;
}

form.contact-form{
  display:grid;
  gap: 16px;
}
form.contact-form label{
  display:block;
  font-size: 0.88rem;
  color: var(--text-soft);
  margin-bottom: 6px;
}
form.contact-form input,
form.contact-form textarea{
  width: 100%;
  border: 1px solid var(--line);
  background: var(--white);
  padding: 11px 12px;
  font-family: var(--sans);
  font-size: 0.98rem;
  color: var(--text);
  border-radius: 2px;
}
form.contact-form input:focus,
form.contact-form textarea:focus{
  outline: 2px solid var(--brass);
  outline-offset: 1px;
  border-color: var(--brass);
}
form.contact-form button{
  justify-self: start;
  cursor: pointer;
  font-family: var(--sans);
}

/* -------------------- privacy page -------------------- */
.policy h2{ margin-top: 2em; }
.policy ol{ padding-left: 1.2em; }
.policy li{ margin-bottom: 0.6em; }
.policy .updated{
  color: var(--text-soft);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 30px;
}

/* -------------------- page hero (inner pages) -------------------- */
.page-hero{
  background: var(--ink);
  color: var(--white);
  padding: 52px 0;
}
.page-hero .section-tag{ color: var(--brass); }
.page-hero h1{ color: var(--white); margin-top: 8px; }
.page-hero p{ color: #C9D2D6; max-width: 60ch; }

/* -------------------- footer -------------------- */
footer.site{
  background: var(--ink);
  color: #B9C3CB;
  padding: 52px 0 26px;
  font-size: 0.92rem;
}
.footer-grid{
  display:grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 30px;
  border-bottom: 1px solid #33424F;
}
footer.site h4{
  color: #E7DCC4;
  font-family: var(--sans);
  font-size: 0.9rem;
  margin-bottom: 12px;
}
footer.site .brand-foot{
  font-family: var(--serif);
  color: var(--white);
  font-size: 1.2rem;
  margin-bottom: 10px;
}
footer.site ul{ list-style:none; padding:0; margin:0; }
footer.site li{ margin-bottom: 8px; }
footer.site a{ text-decoration:none; color:#B9C3CB; }
footer.site a:hover{ color: var(--brass); }
.foot-bottom{
  display:flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 20px;
  font-size: 0.82rem;
  color: #7E8C96;
}
@media (max-width: 760px){
  .footer-grid{ grid-template-columns: 1fr; }
}
