/* ==========================================================================
   prasitalawconsultant.com — สไตล์หลักของเว็บใหม่ (คงโทนสีและฟอนต์ของเว็บเดิม)
   ========================================================================== */
:root {
  --primary: #1f3064;
  --primary-dark: #16234a;
  --secondary: #343c5c;
  --accent: #ff8100;
  --accent-dark: #e06f00;
  --line: #06c755;
  --text: #3a3a3a;
  --muted: #6b6b6b;
  --border: #e5e6e8;
  --bg: #ffffff;
  --bg-alt: #f5f6f8;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(31, 48, 100, .08);
  --font: "Prompt", "Sarabun", Tahoma, Arial, sans-serif;
  --container: 1140px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.75; color: var(--text); background: var(--bg); }
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent-dark); }
h1, h2, h3, h4 { color: var(--primary); line-height: 1.35; margin: 0 0 .6em; font-weight: 600; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }
.icon { vertical-align: -3px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 999px; font-weight: 500; border: 2px solid transparent; cursor: pointer; font-family: inherit; font-size: 1rem; line-height: 1.3; transition: .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { border-color: var(--primary); color: var(--primary); background: #fff; }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-line { background: var(--line); color: #fff; }
.btn-line:hover { background: #05a847; color: #fff; }
.badge { display: inline-block; font-size: .78rem; padding: 2px 10px; border-radius: 999px; background: #eef0f5; color: var(--secondary); line-height: 1.5; }
.badge-admin { background: var(--primary); color: #fff; }
.badge-answered { background: #e6f7ec; color: #0b7a3b; }
.empty { color: var(--muted); padding: 30px 0; text-align: center; }
.lead { font-size: 1.05rem; color: var(--muted); }

/* ---------- แถบบน + header ---------- */
.topbar { background: var(--primary); color: #fff; font-size: .9rem; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 36px; }
.topbar-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-line { color: #fff; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.topbar-line:hover { color: #ffd9b3; }
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 6px rgba(0,0,0,.05); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--primary); }
.brand-logo { width: 56px; height: 56px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 600; font-size: 1.15rem; }
.brand-sub { font-size: .78rem; color: var(--muted); letter-spacing: .02em; }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; padding: 8px; cursor: pointer; }
.nav-toggle span { display: block; height: 3px; background: var(--primary); margin: 6px 0; border-radius: 2px; transition: .2s; }
.site-nav { display: flex; align-items: center; gap: 12px; flex: 1; justify-content: flex-end; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 4px; justify-content: flex-end; }
.site-nav a { display: block; padding: 8px 10px; font-size: .93rem; font-weight: 500; border-radius: 6px; color: var(--secondary); }
.site-nav a:hover, .site-nav a.active { color: var(--accent-dark); background: #fff5eb; }
.nav-search { display: flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.nav-search input { border: 0; padding: 7px 12px; width: 130px; font-family: inherit; font-size: .9rem; outline: none; }
.nav-search button { border: 0; background: var(--bg-alt); color: var(--primary); padding: 0 12px; cursor: pointer; }
@media (max-width: 1024px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; flex: 0 0 100%; flex-direction: column; align-items: stretch; width: 100%; padding: 8px 0 12px; }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { padding: 10px 8px; border-bottom: 1px solid var(--border); border-radius: 0; }
  .nav-search { margin-top: 10px; }
  .nav-search input { width: 100%; }
  .nav-search { width: 100%; }
}

/* ---------- hero ---------- */
.hero { background: #f8f8f8; }
.hero img { display: block; width: 100%; max-width: 1920px; margin: 0 auto; }
.hero-secondary { display: none; }

/* ---------- section ---------- */
.section { padding: 36px 16px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; border-bottom: 2px solid var(--accent); padding-bottom: 8px; }
.section-head h2 { margin: 0; }
.section-head .more { font-weight: 500; white-space: nowrap; }
.section-more { text-align: center; margin-top: 24px; }

/* ---------- cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-media { display: block; aspect-ratio: 1 / 1; background: var(--bg-alt); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-placeholder { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #e9ecf3, #f7f8fb); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-size: 1.02rem; margin: 0; }
.card-title a { color: var(--primary); }
.card-title a:hover { color: var(--accent-dark); }
.card-text { font-size: .9rem; color: var(--muted); margin: 0; }
.card-meta { font-size: .8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: auto; }
.card-cat { color: var(--accent-dark); }
.card-more { font-size: .9rem; font-weight: 500; }

/* ---------- split (รูป + ข้อความ) ---------- */
.split { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
.split-media img { border-radius: var(--radius); display: block; margin: 0 auto; }
@media (min-width: 768px) { .split:has(.split-media) { grid-template-columns: 5fr 7fr; } }

/* ---------- prose (เนื้อหาจาก editor ของเว็บเดิม) ---------- */
.prose { font-size: 1.02rem; line-height: 1.85; overflow-wrap: anywhere; }
.prose img { display: block; margin: 12px auto; border-radius: 6px; }
.prose p { margin: 0 0 1em; }
.prose h2, .prose h3 { margin-top: 1.4em; }
.prose table { border-collapse: collapse; width: 100%; margin: 1em 0; display: block; overflow-x: auto; }
.prose td, .prose th { border: 1px solid var(--border); padding: 6px 10px; }
.prose iframe { max-width: 100%; }
.prose blockquote { border-left: 4px solid var(--accent); margin: 1em 0; padding: 4px 16px; color: var(--muted); background: var(--bg-alt); }
.prose [style*="font-family"] { font-family: inherit !important; }
.prose .col-12, .prose .row { display: block; }

/* ---------- FAQ ---------- */
.faq-item { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; background: #fff; }
.faq-item summary { cursor: pointer; padding: 12px 16px; font-weight: 500; color: var(--primary); list-style: none; display: flex; gap: 10px; }
.faq-item summary::before { content: "+"; color: var(--accent); font-weight: 700; width: 14px; }
.faq-item[open] summary::before { content: "–"; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-answer { padding: 0 16px 12px 40px; }

/* ---------- breadcrumb ---------- */
.breadcrumb { font-size: .86rem; margin: 18px 0 10px; color: var(--muted); }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb li + li::before { content: "›"; margin: 0 6px; color: #aaa; }
.breadcrumb span { color: var(--muted); }

/* ---------- article ---------- */
.article { max-width: 860px; padding-bottom: 40px; }
.article-head { margin: 8px 0 20px; }
.article-head h1 { font-size: 1.9rem; }
.article-meta { font-size: .88rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }
.meta-cat { color: var(--accent-dark); font-weight: 500; }
.article-cover { margin: 0 0 24px; }
.article-cover img { width: 100%; border-radius: var(--radius); display: block; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.tag { font-size: .82rem; background: var(--bg-alt); border: 1px solid var(--border); padding: 3px 12px; border-radius: 999px; color: var(--secondary); }
.tag:hover { border-color: var(--accent); color: var(--accent-dark); }
.related { margin-top: 36px; }
.related h2 { border-bottom: 2px solid var(--accent); padding-bottom: 8px; }

/* ---------- CTA ---------- */
.cta-box { background: var(--bg-alt); border-radius: var(--radius); padding: 24px; margin: 32px 0; border-left: 5px solid var(--accent); }
.cta-box h2 { font-size: 1.25rem; margin-bottom: 6px; }
.cta-box p { color: var(--muted); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- listing / category ---------- */
.listing { padding-bottom: 40px; }
.listing-head { margin: 8px 0 22px; }
.listing-head h1 small { font-size: .6em; color: var(--muted); font-weight: 400; }
.listing-count { color: var(--muted); font-size: .9rem; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip { border: 1px solid var(--primary); color: var(--primary); border-radius: 999px; padding: 4px 14px; font-size: .9rem; }
.chip span { color: var(--muted); }
.chip:hover { background: var(--primary); color: #fff; }
.chip:hover span { color: #dfe4f5; }
.pagination { margin: 30px 0 10px; }
.pagination ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pagination a, .pagination span { display: inline-block; min-width: 40px; text-align: center; padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; }
.pagination a:hover { border-color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination .disabled { color: #bbb; }

/* ---------- forum ---------- */
.forum { padding-bottom: 40px; }
.topic-list, .room-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.topic-row, .room-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: #fff; }
.topic-row:last-child, .room-row:last-child { border-bottom: 0; }
.topic-row:hover, .room-row:hover { background: #fbfbfd; }
.topic-title, .room-title { font-weight: 500; font-size: 1.02rem; }
.topic-meta { font-size: .82rem; color: var(--muted); }
.topic-stats, .room-stats { font-size: .85rem; color: var(--muted); white-space: nowrap; text-align: right; display: flex; flex-direction: column; justify-content: center; }
.room-main p { margin: 4px 0 0; font-size: .9rem; color: var(--muted); }
.rooms { margin-bottom: 30px; }
.topic-head { margin: 8px 0 20px; }
.topic-head h1 { font-size: 1.6rem; }
.topic-info { font-size: .88rem; color: var(--muted); }
.post { display: grid; grid-template-columns: 150px 1fr; gap: 16px; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; background: #fff; }
.post-admin { border-color: #c9d2ec; background: #f8f9fd; }
.post-author { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; font-size: .9rem; }
.post-author img { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; }
.avatar-initial { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: #e9ecf3; color: var(--primary); font-weight: 600; font-size: 1.4rem; }
.avatar-admin { background: var(--primary); color: #fff; }
.page-h1 { margin-top: 28px; }
.post-meta { font-size: .82rem; color: var(--muted); display: flex; gap: 10px; margin-bottom: 8px; }
.post-num { font-weight: 600; }
@media (max-width: 640px) {
  .post { grid-template-columns: 1fr; }
  .post-author { flex-direction: row; text-align: left; }
  .post-author img { width: 44px; height: 44px; }
  .topic-row, .room-row { flex-direction: column; gap: 4px; }
  .topic-stats, .room-stats { flex-direction: row; gap: 12px; text-align: left; }
}

/* ---------- static pages ---------- */
.page-text { max-width: 900px; }
.hero-page img { display: block; width: 100%; }
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 28px; margin-top: 20px; }
@media (min-width: 800px) { .contact-grid { grid-template-columns: 1fr 1.4fr; } }
.contact-channels { background: var(--bg-alt); border-radius: var(--radius); padding: 22px; }
.contact-form label { display: block; margin-bottom: 14px; font-weight: 500; font-size: .95rem; }
.contact-form input, .contact-form select, .contact-form textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 1rem; }
.contact-form .req { color: #d33; }
.form-note { font-size: .85rem; color: var(--muted); margin-top: 12px; }
.form-status { margin-top: 10px; color: var(--primary); }

/* ---------- search ---------- */
.search, .notfound { padding-bottom: 40px; }
.search-form { display: flex; gap: 8px; margin-bottom: 18px; }
.search-form input { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: 999px; font-family: inherit; font-size: 1rem; }
.search-status { color: var(--muted); font-size: .9rem; }
.search-results { list-style: none; margin: 0; padding: 0; }
.search-results li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.search-results a { font-weight: 500; font-size: 1.05rem; }
.search-results .kind { font-size: .78rem; background: var(--bg-alt); border-radius: 999px; padding: 2px 10px; margin-right: 8px; color: var(--secondary); }
.search-results p { margin: 4px 0 0; font-size: .9rem; color: var(--muted); }

/* ---------- footer ---------- */
.site-footer { background: var(--primary); color: #dfe4f5; margin-top: 30px; font-size: .92rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #ffcf99; }
.footer-inner { display: grid; grid-template-columns: 1fr; gap: 28px; padding: 40px 16px 30px; }
@media (min-width: 800px) { .footer-inner { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.footer-brand img { background: #fff; border-radius: 12px; padding: 6px; margin-bottom: 12px; }
.footer-col h3 { color: #fff; font-size: 1rem; margin-bottom: 10px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 6px; }
.footer-bottom { background: var(--primary-dark); padding: 12px 0; font-size: .82rem; text-align: center; color: #b9c2e0; }
