﻿/* ==========================================================
   TarardProp - LAYOUT - nav, property cards, hero, header/footer
   Page structure and grid
   ========================================================== */

/* ---------- เมนูหลัก ---------- */
.nav-link { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .8rem;
  border-radius: .5rem; font-size: .9rem; color: var(--muted); transition: .15s; font-weight: 500;
  /* ไม่ให้ข้อความเมนูตัดบรรทัด (เช่น "หน้าแรก" กลายเป็น "หน้า/แรก")
     และไม่ยอมให้ถูกบีบจนหน้าจอแคบ เมนูจะเลื่อนแนวนอนแทน */
  white-space: nowrap; flex-shrink: 0; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.is-active { background: var(--brand-light); color: var(--brand-text); font-weight: 600; }

/* ---------- แผนที่ Google Maps ---------- */
.prop-map { margin: 1.25rem 0 0; }
.prop-map-head { display: flex; align-items: center; justify-content: space-between;
  gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem; }
.prop-map-frame { position: relative; width: 100%; aspect-ratio: 16 / 9;
  border: 1px solid var(--line); border-radius: .75rem; overflow: hidden; background: var(--surface-2); }
.prop-map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prop-map-note { font-size: .76rem; color: var(--muted); margin: .45rem 0 0; line-height: 1.6; }
@media (max-width: 600px) { .prop-map-frame { aspect-ratio: 4 / 3; } }

/* ---------- การ์ดประกาศ ---------- */
.prop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.prop-card { background: var(--surface); border: 1px solid var(--line); border-radius: .75rem;
  overflow: hidden; transition: .18s; display: flex; flex-direction: column; }
.prop-card:hover { box-shadow: 0 10px 24px rgba(15,23,42,.10); transform: translateY(-2px); }
.prop-thumb { position: relative; aspect-ratio: 4/3; background: var(--surface-2); overflow: hidden; }
.prop-thumb img { width: 100%; height: 100%; object-fit: cover; transition: .3s; }
.prop-card:hover .prop-thumb img { transform: scale(1.04); }
.prop-badges { position: absolute; top: .5rem; left: .5rem; display: flex; gap: .35rem; flex-wrap: wrap; }
.badge { padding: .2rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 600;
  background: rgba(255,255,255,.94); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.badge-rent { background: #d1fae5; color: #047857; }
.badge-sale { background: #dbeafe; color: #1d4ed8; }
.badge-both { background: #ede9fe; color: #6d28d9; }
.badge-hot  { background: #fde68a; color: #92400e; }
.prop-fav { position: absolute; top: .5rem; right: .5rem; width: 2rem; height: 2rem; border-radius: 999px;
  background: rgba(255,255,255,.94); display: grid; place-items: center; color: #64748b; transition: .15s; }
.prop-fav:hover, .prop-fav.on { color: #e11d48; }
.prop-body { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.prop-price { font-size: 1.05rem; font-weight: 700; color: var(--brand-text); }
.prop-title { font-size: .95rem; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prop-meta { font-size: .8rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; }
.prop-specs { display: flex; gap: .75rem; font-size: .8rem; color: var(--muted); margin-top: .2rem; flex-wrap: wrap; }

/* ---------- แบนเนอร์ (พร้อมพื้นหลังลวดลาย) ---------- */
.hero { position: relative; isolation: isolate; color: #fff; padding: 2rem 0;
  /* background: linear-gradient(135deg, var(--brand-dark) 0%, var(--brand) 70%, #10b981 100%); */ }

/* ชั้นลวดลาย: ตาข่ายเส้นบาง ๆ + จุด ไม่ใช้ไฟล์รูป */
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(255,255,255,.10) 1.2px, transparent 1.2px);
  background-size: 44px 44px, 44px 44px, 22px 22px;
  background-position: 0 0, 0 0, 11px 11px;
}
/* ประกอบไฟล์: เส้นทแยงบาง ๆ ให้พื้นผิวไม่เรียบจนดูแปลก */
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: repeating-linear-gradient(45deg,
    rgba(255,255,255,.035) 0 2px, transparent 2px 12px);
}
/* ขอบเรืองแสงด้านบน-ล่าง ให้แบนเนอร์มีมิติ */
.hero > .wrap { position: relative; z-index: 1; }

.hero h1 { font-size: 1.9rem; font-weight: 700; margin: 0 0 .5rem; }
.hero p { margin: 0; opacity: .92; }
.hero-search { background: var(--surface); border-radius: .9rem; padding: .8rem .9rem; margin-top: 1.1rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.14); color: var(--ink); }
/* บีบช่องค้นหาให้สั้นลง: ลด gap, ป้ายกำกับ และช่องกรอก */
.hero-search .form-grid { gap: .4rem .7rem; }
.hero-search .label { font-size: .75rem; margin-bottom: .15rem; }
.hero-search .input, .hero-search select.input { padding: .4rem .6rem; font-size: .85rem; }
@media (max-width: 768px) { .hero h1 { font-size: 1.6rem; } .hero { padding: 2rem 0; } }


/* ============================================================
   Site footer + site header (theme aware)
   ============================================================ */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); margin-bottom: 10px; }
/* แถบหัวกว้างกว่าเนื้อหาหน้าได้ เพื่อให้เมนู+ปุ่มพอดีในแถวเดียว */
.site-header .wrap { max-width: 1440px; }

/* ------------------------------------------------------------
   แถบหัว
     จอใหญ่ : โลโก้ ... เมนู ... ปุ่ม  (1 แถว)
     มือถือ: โลโก้ ............ [ธีม] [แฮมเบอเกอร์]  เมนูอยู่ในลิ้นชัก
   ------------------------------------------------------------ */
.hd-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding-top: .7rem;
  padding-bottom: .7rem;
}

.hd-logo {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: 1.2rem;
  color: var(--brand-dark);
  flex: 0 0 auto;            /* โลโก้ไม่ยอมถูกบีบ */
  white-space: nowrap;
}
.hd-logo-img { width: 32px; height: 32px; flex: 0 0 auto; }

/* เมนู: ยืดหยุ่นเป็นตัวกลาง — ถ้าจอไม่พอให้หดแล้วเลื่อนแนวนอน
   แต่ห้ามดันปุ่มด้านขวาออกไป */
.hd-nav {
  display: flex;
  align-items: center;
  gap: .15rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.hd-nav::-webkit-scrollbar { display: none; }

/* ปุ่มบัญชี/ลงประกาศ: ห้ามตัดบรรทัด ห้ามหด
   (เดิม flex-wrap:wrap ทำให้ปุ่ม "ลงประกาศ" ตกไปอยู่บรรทัดที่สอง) */
.hd-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex: 0 0 auto;            /* กินความกว้างเท่าที่ต้องใช้จริง */
  flex-wrap: nowrap;
}

/* ปุ่มธีม + แฮมเบอเกอร์ (อยู่ขวาสุดเสมอ) */
.hd-right {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex: 0 0 auto;
}

.hd-burger {
  display: none;                 /* จอใหญ่ไม่ต้องใช้ */
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  font-size: 1.15rem;
  cursor: pointer;
}
.hd-burger:hover { background: var(--surface-2); }
.hd-burger:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- ลิ้นชักเมนูมือถือ ---------- */
.hd-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 60;
}
.hd-overlay[hidden] { display: none; }

.hd-drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: 290px;
  max-width: 85vw;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -8px 0 30px rgba(0,0,0,.4);
  z-index: 61;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.hd-drawer.is-open { transform: translateX(0); }

.hd-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.hd-drawer-title { font-weight: 700; }
.hd-drawer-head button {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; border-radius: 8px;
  color: var(--ink); font-size: 1.05rem; cursor: pointer;
}
.hd-drawer-head button:hover { background: var(--surface-2); }

.hd-drawer-nav { padding: .5rem .6rem; }
.hd-drawer-foot {
  padding: .6rem;
  margin-top: auto;
  border-top: 1px solid var(--line);
}
.hd-drawer .nav-link {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  padding: .7rem .8rem;
  border-radius: .6rem;
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hd-drawer .nav-link i { width: 1.1rem; text-align: center; flex: 0 0 auto; }

/* กันหน้าเลื่อนทั้งหน้าเมื่อเปิดลิ้นชัก */
body.hd-lock { overflow: hidden; }

/* ============================================================
   แท็บเล็ต/มือถือ (≤ 1024px) — ซ่อนเมนู+ปุ่มยาว ใช้แฮมเบอร์เกอร์แทน
   จุดตัดนี้ทำให้จอแคบพอดีกับเมนูเต็ม+ปุ่มครบ ไม่ต้องเลื่อน/ตัดคำในแถบ
   ============================================================ */
@media (max-width: 1120px) {
  .hd-nav, .hd-actions { display: none; }
  .hd-burger { display: inline-flex; }
  .hd-right { margin-left: auto; }
  .hd-logo-txt { font-size: 1.15rem; }
}

/* ------------------------------------------------------------
   จอกว้างแต่ยังไม่กว้างมาก (1121–1300px) — ย่อให้พอดี ไม่ให้คำถูกตัด
   ลำดับความสำคัญ: เมนูหลัก + ปุ่ม "ลงประกาศ" สำคัญที่สุด
   จึงตัดคำกำกับของปุ่มรอง (หลังบ้าน / ประกาศของฉัน / TarardLand) ทิ้งก่อน
   ปุ่มเหล่านั้นยังกดได้ผ่านไอคอน + tooltip และผ่านลิ้นชักมือถือ
   ------------------------------------------------------------ */
@media (max-width: 1300px) and (min-width: 1121px) {
  .hd-row { gap: .3rem; }
  .hd-nav { gap: 0; }
  .nav-link { padding: .4rem .45rem; font-size: .84rem; }
  .hd-logo { font-size: 1.05rem; }
  .hd-logo-img { width: 26px; height: 26px; }

  .sso-switch-txt { display: none; }                    /* สลับเว็บ: เหลือไอคอน */
  .hd-actions .btn-outline .btn-txt { display: none; }  /* หลังบ้าน / ประกาศของฉัน */
  .hd-actions .btn { padding-left: .5rem; padding-right: .5rem; }
  .hd-actions .btn-primary .btn-txt { display: inline; } /* คง "ลงประกาศ" */
}


.site-footer { background: #0f172a; color: #cbd5e1; margin-top: 3rem; }
.site-footer h3 { font-size: .95rem; color: #fff; margin: 0 0 .6rem; }
.site-footer a:hover { color: #fff; }
.site-footer-brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.1rem; color: #fff; }
.site-footer-top { border-top: 1px solid #1e2d4a; }
.site-footer-bottom { font-size: .8rem; color: #94a3b8; }

/* ============================================================
   ฟุตเตอร์ TarardProp (ออกแบบตาม TarardLand — คลาส prefix tp-)
   คอลัมน์: แบรนด์ | ค้นหาและลงประกาศ | คลังความรู้ | ทีมงานและเอกสาร | ติดต่อเรา
   ============================================================ */
.tp-footer { background: #0f172a; color: #cbd5e1; margin-top: 3rem; }
.tp-foot-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem 1.6rem;
  padding: 2.5rem 1rem 1.6rem;
  align-items: start;
}
.tp-foot-col { display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.tp-foot-brand { grid-column: span 1; }

.tp-foot-logo { display: inline-flex; align-items: center; gap: .55rem; color: #fff; font-weight: 700; font-size: 1.15rem; }
.tp-foot-logo:hover { color: #fff; }
.tp-foot-logo img { border-radius: 8px; object-fit: contain; }
.tp-foot-sub { font-size: .85rem; line-height: 1.75; color: #94a3b8; margin: .6rem 0 0; max-width: 34ch; }

.tp-foot-h { font-size: .95rem; font-weight: 600; color: #fff; margin: 0 0 .7rem; }
.tp-foot-list { list-style: none; padding: 0; margin: 0; font-size: .86rem; line-height: 2; }
.tp-foot-list li { display: flex; gap: .35rem; align-items: baseline; flex-wrap: wrap; }
.tp-foot-list a { color: #cbd5e1; }
.tp-foot-list a:hover { color: #34d399; }
.tp-foot-list .is-static { color: #94a3b8; }
.tp-foot-k { color: #7f8ea3; min-width: 4.6rem; }

/* แถบป้ายความน่าเชื่อถือ */
.tp-foot-chips { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0 1rem 1.6rem; }
.tp-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .78rem; color: #cbd5e1;
  background: rgba(52, 211, 153, .1);
  border: 1px solid rgba(52, 211, 153, .28);
  border-radius: 999px; padding: .3rem .7rem;
}

/* ส่วนล่างสุด */
.tp-foot-top { border-top: 1px solid #1e2d4a; }
.tp-foot-bottom { padding: 1.1rem 1rem 1.5rem; font-size: .8rem; color: #94a3b8; }

/* ป้าย Create with AI (เหมือนเว็บหลัก) */
.tp-foot-ai {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: .5rem .75rem; margin-bottom: 1.1rem;
}
.tp-ai-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .4rem .95rem; border-radius: 999px;
  background: linear-gradient(135deg, rgba(212, 175, 55, .16), rgba(16, 185, 129, .14));
  border: 1px solid rgba(212, 175, 55, .35);
  font-size: .8rem; font-weight: 500; color: #e7d9a8; letter-spacing: .01em;
  box-shadow: 0 2px 14px rgba(212, 175, 55, .10);
}
.tp-ai-badge i { color: #d4af37; font-size: .85rem; }
.tp-ai-badge strong {
  font-weight: 700; letter-spacing: .04em;
  background: linear-gradient(90deg, #f2d98a, #34d399);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.tp-ai-note { font-size: .78rem; color: #7d8ea8; }

.tp-foot-copy {
  font-size: .86rem; color: #94a3b8; line-height: 1.9; margin: 0;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: .15rem .45rem; max-width: 52rem; margin-inline: auto;
}
.tp-foot-copy strong { color: #f1f5f9; font-weight: 600; }
.tp-foot-copy-sep { color: #3d4d66; }
.tp-foot-copy-right { color: #5a6a80; }
.tp-foot-disclaimer {
  margin: .85rem auto 0; max-width: 46rem; text-align: center;
  font-size: .78rem; line-height: 1.85; color: #5a6a80;
}
.tp-foot-legal {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: .5rem .75rem; margin-top: 1.1rem;
}
.tp-foot-legal a {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .34rem .8rem; border-radius: 999px;
  background: rgba(148, 163, 184, .06); border: 1px solid rgba(148, 163, 184, .14);
  font-size: .78rem; color: #8fa3bd; text-decoration: none;
  transition: color .15s, border-color .15s, background .15s;
}
.tp-foot-legal a i { font-size: .75rem; opacity: .8; }
.tp-foot-legal a:hover { color: #6ee7b7; border-color: rgba(52, 211, 153, .32); background: rgba(52, 211, 153, .08); }
.tp-foot-legal-dot { color: #3d4d66; font-size: .7rem; }

/* ---------- ธีมมืด: มืดลงอีกนิด อ่านสบายตา ---------- */
html.dark .tp-foot-top { border-top-color: #16223a; }
html.dark .tp-foot-copy { color: #8ea2ba; }
html.dark .tp-foot-disclaimer { color: #55657c; }
html.dark .tp-ai-note { color: #6b7d95; }
html.dark .tp-foot-legal a { background: rgba(148, 163, 184, .05); border-color: rgba(148, 163, 184, .12); }

/* ---------- มือถือ ---------- */
@media (max-width: 767px) {
  .tp-foot-inner { padding: 1.8rem var(--pad-x) 1.2rem; gap: 1.5rem; }
  .tp-foot-sub { max-width: none; }
  .tp-foot-chips { padding: 0 var(--pad-x) 1.2rem; }
}
/* ============================================================
   คลังความรู้ (knowledge.php) / ทีมงาน (team.php) / ติดต่อ (contact.php)
   ใช้คลาสร่วมกันทั้ง 3 หน้า (prefix kn-)
   ============================================================ */
.kn-page { padding: 2.5rem 1rem 4rem; max-width: 980px; }

/* เส้นทางนำทาง */
.kn-crumbs {
  display: flex; gap: .45rem; align-items: center;
  font-size: .82rem; color: var(--muted); margin-bottom: 1rem;
}
.kn-crumbs a { color: var(--brand); }
.kn-crumbs span { color: var(--muted); }

/* หัวเรื่อง */
.kn-head { margin-bottom: 1.8rem; }
.kn-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .78rem; color: var(--brand);
  background: rgba(5, 150, 105, .1);
  border: 1px solid rgba(5, 150, 105, .3);
  border-radius: 999px; padding: .3rem .75rem; margin-bottom: .8rem;
}
.kn-title { font-size: 1.85rem; line-height: 1.35; margin: 0 0 .6rem; font-weight: 700; }
.kn-lead { font-size: .96rem; line-height: 1.85; color: var(--muted); margin: 0 0 .5rem; }
.kn-meta { font-size: .8rem; color: var(--muted); margin: .5rem 0 0; }

/* กล่องเตือนเรื่องข้อมูลทั่วไป ไม่ใช่คำแนะนำทางกฎหมาย */
.kn-note {
  display: flex; gap: .7rem; align-items: flex-start;
  background: rgba(59, 130, 246, .08);
  border: 1px solid rgba(59, 130, 246, .28);
  border-radius: 12px; padding: .9rem 1rem; margin-bottom: 1.8rem;
}
.kn-note i { color: #3b82f6; margin-top: .18rem; flex-shrink: 0; }
.kn-note p { margin: 0; font-size: .84rem; line-height: 1.75; color: var(--muted); }

/* กลุ่มหัวข้อ */
.kn-group { margin-bottom: 2.4rem; }
.kn-group-h { font-size: 1.15rem; font-weight: 600; margin: 0 0 1rem; color: var(--brand); }

/* เนื้อหาบทความ */
.kn-block { margin-bottom: 1.8rem; }
.kn-block h2 { font-size: 1.05rem; font-weight: 600; margin: 0 0 .7rem; }
.kn-block ul { margin: 0; padding-left: 1.15rem; }
.kn-block li { font-size: .92rem; line-height: 1.9; color: var(--text); margin-bottom: .3rem; }

/* กริดการ์ด */
.kn-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.kn-card {
  display: flex; flex-direction: column; gap: .45rem;
  background: var(--surface); color: inherit;
  border: 1px solid var(--border, rgba(148, 163, 184, .25));
  border-radius: 12px; padding: 1.1rem;
  transition: border-color .15s, transform .15s;
}
a.kn-card:hover {
  color: inherit; text-decoration: none;
  border-color: var(--brand); transform: translateY(-2px);
}
.kn-card--plain:hover { border-color: var(--border, rgba(148, 163, 184, .25)); transform: none; }
.kn-card-ic { color: var(--brand); font-size: 1.1rem; }
.kn-card-t { font-weight: 600; font-size: .95rem; line-height: 1.5; }
.kn-card-d { font-size: .84rem; line-height: 1.75; color: var(--muted); }
.kn-card-ul { margin: .2rem 0 0; padding-left: 1.05rem; }
.kn-card-ul li { font-size: .82rem; line-height: 1.8; color: var(--muted); }

/* กล่องเรียกร้องให้ติดต่อ */
.kn-cta {
  background: var(--surface);
  border: 1px solid var(--border, rgba(148, 163, 184, .25));
  border-radius: 14px; padding: 1.4rem; margin: 2rem 0;
}
.kn-cta h2 { font-size: 1.05rem; margin: 0 0 .4rem; }
.kn-cta p { font-size: .88rem; color: var(--muted); margin: 0 0 1rem; line-height: 1.75; }
.kn-cta-btns { display: flex; flex-wrap: wrap; gap: .6rem; }

.kn-related { margin-top: 2.5rem; }
.kn-related h2 { font-size: 1.1rem; margin: 0 0 1rem; }

@media (max-width: 767px) {
  .kn-page { padding: 1.8rem var(--pad-x) 3rem; }
  .kn-title { font-size: 1.45rem; }
  .kn-grid { grid-template-columns: 1fr; }
}

.admin-sidebar-box { background: var(--surface); }

