:root {
  /* โทนหรูหรา ดำ/เทาเข้ม + ทอง สำหรับแบรนด์ Thai Asset */
  --green-900: #17171b;   /* ดำ/เทาเข้ม — header, footer, ตัวอักษรหัวข้อ */
  --green-700: #a3831c;   /* ทองเข้ม — hover, ราคา, ลิงก์เน้น */
  --green-600: #c9a227;   /* ทอง — ปุ่มหลัก, จุดเน้น */
  --green-100: #f6efd9;   /* ทองอ่อน — พื้นหลังส่วนเน้นบางๆ */
  --earth-700: #8a6d2e;   /* น้ำตาลทอง — ข้อความรอง */
  --earth-100: #f1ece0;   /* ครีม — พื้นหลังรูป/การ์ดอ่อนๆ */
  --bg: #f8f6f1;
  --ink: #1c1b18;
  --ink-soft: #625c4e;
  --card: #ffffff;
  --border: #e4ded2;
  --danger: #b3452f;
  --gold: #c9a227;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(23, 23, 27, 0.08);
  --shadow-lg: 0 10px 30px rgba(23, 23, 27, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans Thai", "Sarabun", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: var(--green-900);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 0;
  min-height: 68px;
  padding-top: 10px;
  padding-bottom: 10px;
}
.site-header nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-end;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.2px;
}
.brand .logo-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #201a08;
}
.site-header nav a {
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.95rem;
}
.site-header nav a:hover { background: rgba(255,255,255,0.1); }
.site-header nav a.admin-link {
  background: var(--gold);
  color: #2a2100;
}
.site-header nav a.admin-link:hover { background: #dba934; }

.lang-switcher { display: inline-flex; gap: 2px; background: rgba(255,255,255,0.1); border-radius: 999px; padding: 3px; margin: 0 4px; }
.lang-switcher button {
  border: none; background: transparent; color: rgba(255,255,255,0.75);
  font-size: 0.8rem; font-weight: 700; padding: 6px 11px; border-radius: 999px;
}
.lang-switcher button:hover { color: #fff; }
.lang-switcher button.active { background: #fff; color: var(--green-900); }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--green-900), var(--green-700));
  color: #fff;
  padding: 46px 0 34px;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: 1.9rem;
  font-weight: 800;
}
.hero p {
  margin: 0 0 22px;
  color: rgba(255,255,255,0.85);
  font-size: 1.02rem;
}

/* Search / filter panel */
.filter-panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr auto;
  gap: 10px;
}
.filter-panel .field { display: flex; flex-direction: column; gap: 4px; }
.filter-panel label { font-size: 0.78rem; color: var(--ink-soft); font-weight: 600; }
.filter-panel input,
.filter-panel select {
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 11px;
  font-size: 0.92rem;
  color: var(--ink);
  background: #fff;
}
.filter-panel input:focus,
.filter-panel select:focus { outline: 2px solid var(--green-600); outline-offset: 1px; }
.btn {
  border: none;
  border-radius: 9px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.92rem;
}
.btn-primary { background: var(--green-600); color: #201a08; }
.btn-primary:hover { background: #dab63a; color: #201a08; }
.btn-ghost { background: var(--earth-100); color: var(--earth-700); }
.btn-ghost:hover { background: #ecdfc9; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #96381f; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--ink);
}
.filter-panel .field.actions { align-self: end; }

/* Listing grid */
.results-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 28px 0 14px;
}
.results-bar h2 { font-size: 1.1rem; margin: 0; color: var(--ink); }
.results-bar span { color: var(--ink-soft); font-size: 0.9rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 18px;
  padding-bottom: 50px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card .thumb {
  aspect-ratio: 4 / 3;
  background: var(--earth-100) center/cover no-repeat;
  position: relative;
}
.card .thumb .no-image {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--earth-700); font-size: 0.85rem; background: var(--earth-100);
}
.badge {
  position: absolute;
  top: 10px; left: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}
.badge.available { background: #2f7a4f; }
.badge.reserved { background: var(--gold); color: #2a2100; }
.badge.sold { background: #5c5c62; }
.badge.pending { background: #b3261e; }

.card .body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .price { font-size: 1.15rem; font-weight: 800; color: var(--green-700); }
.card .title { font-weight: 700; font-size: 0.98rem; color: var(--ink); }
.card .meta { font-size: 0.85rem; color: var(--ink-soft); display: flex; gap: 6px; flex-wrap: wrap; }
.card .meta span:not(:last-child)::after { content: "•"; margin-left: 6px; color: var(--border); }
.card .location { font-size: 0.85rem; color: var(--ink-soft); margin-top: auto; }

.empty-state, .loading-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}
.empty-state h3 { color: var(--ink); margin-bottom: 6px; }

footer.site-footer {
  background: var(--green-900);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 22px 0;
  font-size: 0.85rem;
  margin-top: 40px;
}

/* Detail page */
.detail-wrap { padding: 26px 0 60px; }
.breadcrumb { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 16px; }
.breadcrumb a { color: var(--green-700); font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 26px; align-items: start; }
.gallery-main {
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--earth-100);
  box-shadow: var(--shadow);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery-thumbs img {
  width: 74px; height: 56px; object-fit: cover; border-radius: 8px;
  border: 2px solid transparent; cursor: pointer;
}
.gallery-thumbs img.active { border-color: var(--green-600); }

.detail-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.detail-card .price-lg { font-size: 1.8rem; font-weight: 800; color: var(--green-700); margin-bottom: 4px; }
.detail-card h1 { font-size: 1.25rem; margin: 0 0 10px; }
.spec-list { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 8px; }
.spec-list li { display: flex; justify-content: space-between; font-size: 0.92rem; border-bottom: 1px dashed var(--border); padding-bottom: 8px; }
.spec-list li span:first-child { color: var(--ink-soft); }
.spec-list li span:last-child { font-weight: 600; }

.contact-box { margin-top: 16px; display: grid; gap: 8px; }
.contact-box .btn { width: 100%; text-align: center; display: block; }

.description-block { margin-top: 24px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.description-block h2 { font-size: 1.05rem; margin: 0 0 10px; }
.description-block p { white-space: pre-wrap; color: var(--ink); }

/* Articles / static content pages */
.article-wrap { padding: 30px 0 60px; max-width: 820px; margin: 0 auto; }
.article-cover { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 24px; max-height: 420px; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-body { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 30px; box-shadow: var(--shadow); }
.article-body h1 { font-size: 1.5rem; margin: 0 0 8px; }
.article-date { color: var(--ink-soft); font-size: 0.88rem; margin-bottom: 20px; }
.article-content { white-space: pre-wrap; line-height: 1.75; color: var(--ink); font-size: 1rem; }

/* หน้าฝากขายที่ดิน (ฟอร์มสาธารณะ /submit.html) */
.submit-wrap { padding: 30px 0 70px; max-width: 820px; margin: 0 auto; }
.submit-intro { margin-bottom: 24px; }
.submit-intro h1 { font-size: 1.5rem; margin: 0 0 8px; }
.submit-intro p { color: var(--ink-soft); }

.submit-form {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 28px; box-shadow: var(--shadow);
}
.form-section-title { font-weight: 700; font-size: 1rem; margin: 22px 0 12px; color: var(--green-900); }
.form-section-title:first-child { margin-top: 0; }

.submit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 14px; }
.submit-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.submit-field { display: flex; flex-direction: column; gap: 5px; }
.submit-field.full { grid-column: 1 / -1; }
.submit-field label { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.submit-field input, .submit-field textarea {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; font: inherit; background: #fff;
}
.submit-field textarea { resize: vertical; min-height: 90px; }
.submit-hint { font-size: 0.82rem; color: var(--ink-soft); margin: -6px 0 6px; }

.honeypot-field { position: absolute; left: -9999px; top: -9999px; opacity: 0; pointer-events: none; }

.photo-upload-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 2px dashed var(--border); border-radius: 9px; padding: 14px 20px;
  cursor: pointer; color: var(--ink-soft); font-weight: 600; font-size: 0.9rem; width: fit-content;
}
.photo-upload-btn:hover { border-color: var(--gold); color: var(--green-700); }
.photo-preview { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.photo-thumb { position: relative; width: 90px; height: 90px; border-radius: 9px; overflow: hidden; border: 1px solid var(--border); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .remove-btn {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.65); color: #fff; font-size: 0.7rem; line-height: 1; border: none;
}

.error-msg { color: #b3261e; font-size: 0.85rem; min-height: 18px; }
.form-actions { display: flex; gap: 10px; margin-top: 24px; justify-content: flex-end; }

.submit-success {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 40px 30px; text-align: center; box-shadow: var(--shadow);
}
.submit-success h2 { color: var(--green-700); margin: 0 0 10px; }
.submit-success p { color: var(--ink-soft); }

@media (max-width: 860px) {
  .filter-panel { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .submit-grid, .submit-grid.cols-3 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .filter-panel { grid-template-columns: 1fr; }
  .site-header nav a span.label { display: none; }
  .site-header .container { justify-content: center; padding-top: 12px; padding-bottom: 12px; }
  .site-header .brand { flex: 1 0 100%; justify-content: center; margin-bottom: 4px; }
  .site-header nav { flex: 1 0 100%; justify-content: center; gap: 4px 6px; }
  .site-header nav a { padding: 6px 10px; font-size: 0.82rem; }
  .lang-switcher { margin: 2px; }
  .lang-switcher button { padding: 5px 9px; font-size: 0.75rem; }
}
