/* Research Inspire styles */
:root{
  --bg:#f6f8fb;
  --card:#ffffff;
  --text:#14213d;
  --muted:#5c6b8a;
  --primary:#1e88e5;
  --accent:#00c853;
  --border:#e6eaf2;
  --shadow:0 8px 24px rgba(20,33,61,0.06);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Prompt", "Kanit", Arial, sans-serif;
  background:var(--bg);
  color:var(--text);
}

/* ---------- Topbar & Menu ---------- */
.topbar{
  position:sticky;top:0;z-index:10;
  background:linear-gradient(90deg,var(--primary),#673ab7);
  color:#fff;
  padding:14px 20px;
  display:flex;align-items:center;justify-content:space-between;
  box-shadow:var(--shadow);
}
.topbar .brand{font-weight:700;letter-spacing:.3px}
.topbar .brand a{color:#fff;text-decoration:none;opacity:.95}
.topbar .brand a:hover{opacity:1}

/* เมนูด้านขวา */
.menu{display:flex;align-items:center;gap:8px}
/* ลิงก์ธรรมดาในเมนู (ที่ไม่ใช่ปุ่ม) ให้เป็นสีขาว */
.menu a:not(.btn){color:#fff;text-decoration:none;opacity:.95}
.menu a:not(.btn):hover{opacity:1}

/* ปุ่มใน topbar ให้ตัดกันชัดเจน */
.topbar a.btn{
  background:#fff;
  color:var(--text) !important;
  border-color:transparent;
}
.topbar a.btn.primary{
  background:var(--primary);
  color:#fff !important;
}

/* ---------- Layout ---------- */
.container{max-width:1100px;margin:24px auto;padding:0 16px}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}

/* ---------- Grid ---------- */
.grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:18px;
}
@media (max-width: 980px){
  .grid{grid-template-columns: repeat(2, 1fr);}
}
@media (max-width: 640px){
  .grid{grid-template-columns: 1fr;}
}

/* ---------- Cards ---------- */
.card .cover{
  width:100%;aspect-ratio:16/10;object-fit:cover;background:#ddd;display:block;
}
.card .content{padding:14px 14px 16px 14px}
.card h3{margin:0 0 8px 0;font-size:1.05rem;line-height:1.25}
.card p{margin:0;color:var(--muted);font-size:.95rem;line-height:1.45;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}

.card .meta{
  margin-top:10px;
  display:flex;align-items:center;justify-content:space-between;gap:10px;
}

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex;align-items:center;gap:8px;
  padding:10px 12px;border:1px solid var(--border);
  border-radius:12px;background:#fff;color:var(--text);
  text-decoration:none;font-weight:700;
  transition:transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.btn.primary{background:var(--primary);color:#fff;border-color:transparent}
.btn:hover{transform:translateY(-1px);box-shadow:var(--shadow)}
.btn:focus-visible{
  outline:2px solid #fff; outline-offset:2px;
  box-shadow:0 0 0 3px rgba(30,136,229,.35);
}

/* ---------- Hero / Banner ---------- */
header.hero{
  margin:8px 0 18px 0;
  padding:18px;
  border-radius:var(--radius);
  background:linear-gradient(180deg, #e3f2fd, #f9fafe);
  border:1px solid var(--border);
}
.hero h1{margin:4px 0 6px 0;font-size:1.6rem}
.hero p{margin:0;color:var(--muted)}

/* เวอร์ชันมีรูปภาพหัวเว็บ */
.hero.banner{padding:0;overflow:hidden}
.hero-img{width:100%;display:block;aspect-ratio:21/7;object-fit:cover}
@media (max-width:640px){ .hero-img{aspect-ratio:16/9} }
.hero .hero-inner{padding:16px}

/* ---------- Detail Page ---------- */
.detail .cover{width:100%;max-height:420px;object-fit:cover;border-radius:12px;border:1px solid var(--border)}
.detail .gallery{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-top:14px}
@media (max-width:980px){.detail .gallery{grid-template-columns:repeat(3,1fr)}}
@media (max-width:640px){.detail .gallery{grid-template-columns:repeat(2,1fr)}}
.detail .gallery img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:10px;border:1px solid var(--border)}

/* ---------- Footer & Pagination ---------- */
footer{margin:36px 0 24px 0;text-align:center;color:var(--muted);font-size:.9rem}

.pagination{display:flex;gap:8px;justify-content:center;margin:18px 0}
.pagination a{
  padding:8px 12px;border:1px solid var(--border);border-radius:10px;
  background:#fff;color:var(--text);text-decoration:none;transition:filter .12s ease;
}
.pagination a:hover{filter:brightness(.96)}
.pagination a.active{background:var(--primary);border-color:transparent;color:#fff}





/* ==== Footer ==== */
.site-footer{
  margin-top: 36px;
  color:#fff;
  background:
    radial-gradient(900px 300px at 15% -10%, rgba(255,255,255,.18), transparent),
    linear-gradient(90deg, #673ab7, var(--primary));
}
.site-footer a{ color:#fff; text-decoration:none; opacity:.95 }
.site-footer a:hover{ opacity:1; text-decoration:underline }

.site-footer .footer-inner{
  max-width:1100px; margin:0 auto; padding:28px 16px 22px 16px;
}

.footer-grid{
  display:grid; gap:22px;
  grid-template-columns: 2fr 1fr 1fr 1fr;
}
@media (max-width:980px){
  .footer-grid{ grid-template-columns: 1fr 1fr; }
}
@media (max-width:640px){
  .footer-grid{ grid-template-columns: 1fr; }
}

.footer-brand .logo-row{ display:flex; gap:12px; align-items:center; }
.footer-brand img{
  width:44px; height:44px; object-fit:contain; border-radius:10px; background:rgba(255,255,255,.15);
  border:1px solid rgba(255,255,255,.25);
}
.footer-brand .brand-name{ font-weight:800; letter-spacing:.2px; font-size:1.1rem }
.footer-brand .tagline{ opacity:.85; margin-top:2px }

.col-title{
  font-weight:700; margin-bottom:8px; letter-spacing:.2px;
  text-transform:uppercase; font-size:.85rem; opacity:.9
}

.link-list{ list-style:none; padding:0; margin:0; display:grid; gap:8px; }
.link-list li{ opacity:.95 }
.link-list li a{ text-decoration:none; }
.link-list li a:hover{ text-decoration:underline; }

.social{ display:flex; gap:8px; margin-top:10px; }
.social a{
  width:36px; height:36px; display:grid; place-items:center;
  border-radius:10px; background:rgba(255,255,255,.12);
  border:1px solid rgba(255,255,255,.18);
}
.social a:hover{ background:rgba(255,255,255,.18) }

.footer-bottom{
  margin-top:18px; padding-top:12px;
  border-top:1px solid rgba(255,255,255,.18);
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  font-size:.95rem; opacity:.95;
}
.footer-bottom .legal{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.footer-bottom .dot{ opacity:.7 }

.to-top{
  position:fixed; right:18px; bottom:96px; /* กันชน popup แบบสอบถามมุมขวาล่าง */
  width:42px; height:42px; border-radius:50%; border:1px solid rgba(255,255,255,.2);
  background:rgba(0,0,0,.35); color:#fff; cursor:pointer; display:none;
  box-shadow:0 8px 24px rgba(0,0,0,.18);
  font-size:18px; line-height:1;
}
.to-top:hover{ background:rgba(0,0,0,.5) }



/* ยกเว้นบางองค์ประกอบไม่ให้ซีด (เช่น โลโก้/กราฟที่ต้องเห็นสีชัด) */
.no-mourning, .no-mourning *{
  filter: none !important;
}

