/* Sigma DataTech — stylesheet เดียวของเว็บ (ไม่ใช้ CSS framework)
   สีหลักตามเว็บเดิม: น้ำเงินเข้ม hero #0a1777 · น้ำเงิน #3f52e3 · เขียวน้ำทะเล #00a29d */

:root {
  --navy: #0a1777;
  --navy-2: #13238f;
  --blue: #3f52e3;
  --blue-dark: #2d3fc4;
  --teal: #00a29d;
  --line: #06c755;
  --ink: #1d2139;
  --text: #4a4f66;
  --muted: #7a7f95;
  --border: #e3e6f0;
  --soft: #f5f7fc;
  --white: #fff;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(16, 28, 94, .08);
  --font: "Work Sans", "Kanit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-head: "Kanit", "Work Sans", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-weight: 300; font-size: 17px; line-height: 1.75; color: var(--text); background: var(--white); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.35; margin: 0 0 .5em; font-weight: 500; }
h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
strong, b { font-weight: 600; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--white); padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }
.center { text-align: center; justify-content: center; }
.icon { width: 24px; height: 24px; flex: none; }
.icon-sm { width: 18px; height: 18px; }
.icon-xs { width: 15px; height: 15px; }

/* ---------- ปุ่ม ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: 999px; font-family: var(--font-head); font-weight: 400; font-size: 1rem; line-height: 1.2; border: 2px solid transparent; transition: transform .15s, background-color .15s, box-shadow .15s; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-outline { border-color: var(--blue); color: var(--blue); }
.btn-line { background: var(--line); color: var(--white); box-shadow: 0 6px 18px rgba(6, 199, 85, .3); }
.btn-line:hover { background: #05b04b; }
.btn-ghost { border-color: rgba(255, 255, 255, .5); color: var(--white); }
.btn-ghost:hover { background: rgba(255, 255, 255, .1); }
.btn-light { background: var(--white); color: var(--navy); }

/* ---------- เมนูบน ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--navy); transition: box-shadow .2s; }
.topbar.scrolled { box-shadow: 0 4px 20px rgba(0, 0, 0, .25); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 16px; }
.brand img { width: 150px; height: auto; }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a { color: rgba(255, 255, 255, .85); font-family: var(--font-head); font-weight: 400; padding: 8px 14px; border-radius: 999px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--white); background: rgba(255, 255, 255, .1); text-decoration: none; }
.nav .nav-cta { background: var(--blue); color: var(--white); margin-left: 6px; }
.nav .nav-cta:hover, .nav .nav-cta[aria-current="page"] { background: var(--blue-dark); }
.nav-toggle { display: none; background: none; border: 0; color: var(--white); padding: 8px; cursor: pointer; border-radius: 8px; }

@media (max-width: 860px) {
  .js .nav-toggle { display: inline-flex; }
  .js .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--navy); flex-direction: column; align-items: stretch; padding: 8px 16px 18px; box-shadow: 0 12px 20px rgba(0, 0, 0, .25); }
  .js .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
  .nav .nav-cta { margin: 6px 0 0; text-align: center; }
  .topbar-in { position: relative; }
}

/* ---------- hero หน้าแรก ---------- */
.hero { position: relative; overflow: hidden; background: radial-gradient(ellipse at 80% 20%, var(--navy-2), var(--navy) 60%); color: var(--white); }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-in { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 40px; padding-top: 72px; padding-bottom: 88px; min-height: min(640px, calc(100vh - 72px)); }
.hero-text { max-width: 560px; }
.eyebrow { font-family: var(--font-head); letter-spacing: .25em; font-size: .85rem; color: #8fd8ff; margin-bottom: .8em; }
.hero h1 { color: var(--white); font-size: clamp(2rem, 4.6vw, 3.1rem); font-weight: 600; margin-bottom: .45em; }
.hero h1 span { display: block; }
.hero h1 span + span { color: #9fb0ff; }
.hero .lead { font-size: 1.1rem; color: rgba(255, 255, 255, .85); margin-bottom: 1.6em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.hero-img { width: 100%; max-width: 500px; justify-self: center; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .25)); }

@media (max-width: 860px) {
  .hero-in { grid-template-columns: 1fr; padding-top: 48px; padding-bottom: 56px; min-height: 0; text-align: center; }
  .hero-text { margin: 0 auto; }
  .hero-actions { justify-content: center; }
  .hero-img { max-width: 320px; order: -1; }
}

/* ---------- section ทั่วไป ---------- */
.section { padding: 80px 0; }
.bg-soft { background: var(--soft); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head.center { flex-direction: column; align-items: center; text-align: center; }
.section-head.center p { max-width: 620px; margin: 0; }
@media (max-width: 640px) { .section { padding: 56px 0; } }

/* ---------- การ์ดบทความ ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 28px; }
.card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(16, 28, 94, .14); }
.card-img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card-body { padding: 20px 22px 24px; }
.card h3 { font-size: 1.12rem; margin-bottom: .4em; }
.card h3 a { color: var(--ink); }
.card-desc { font-size: .95rem; color: var(--muted); margin: 0; }
.meta { display: flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--muted); margin-bottom: .5em; }

/* ---------- บริการ ---------- */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service { padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); transition: border-color .2s, box-shadow .2s; }
.service:hover { border-color: transparent; box-shadow: var(--shadow); }
.service p { margin: 0; font-size: .97rem; }
.service-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, var(--blue), var(--teal)); color: var(--white); margin-bottom: 16px; }
.service-icon .icon { width: 28px; height: 28px; }
.service-icon-line { background: var(--line); font-family: var(--font-head); font-weight: 600; font-size: .85rem; }
@media (max-width: 960px) { .services { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .services { grid-template-columns: 1fr; } }

/* ---------- เราช่วยอะไรคุณได้บ้าง ---------- */
.help { display: grid; grid-template-columns: 1fr 1.2fr; gap: 48px; align-items: center; }
.help-img { width: 100%; max-width: 440px; justify-self: center; position: sticky; top: 100px; }
.help-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.help-list li { display: flex; gap: 16px; padding: 18px 20px; background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); }
.help-list h3 { font-size: 1.05rem; margin-bottom: .25em; }
.help-list p { margin: 0; font-size: .95rem; }
.help-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: #eaeefe; color: var(--blue); flex: none; }
@media (max-width: 860px) { .help { grid-template-columns: 1fr; } .help-img { position: static; max-width: 300px; } }

/* ---------- ถาม-ตอบ ---------- */
.faq { display: grid; grid-template-columns: 1fr 1.3fr; gap: 56px; align-items: center; }
.faq-img { width: 100%; max-width: 380px; justify-self: center; }
.faq-list { display: grid; gap: 12px; margin-top: 24px; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; cursor: pointer; font-family: var(--font-head); font-weight: 400; color: var(--ink); list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { transition: transform .2s; color: var(--blue); }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq details[open] summary { color: var(--blue); }
.faq details p { padding: 0 20px 18px; margin: 0; }
@media (max-width: 860px) { .faq { grid-template-columns: 1fr; gap: 24px; } .faq-img { max-width: 240px; } }

/* ---------- แถบชวนติดต่อ ---------- */
.cta { background: linear-gradient(120deg, var(--navy), var(--blue)); color: var(--white); padding: 56px 0; }
.cta-in { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.cta h2 { color: var(--white); font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
.cta p { margin: 0; color: rgba(255, 255, 255, .85); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- หัวหน้า (หน้าที่ไม่ใช่หน้าแรก) ---------- */
.page-head { background: radial-gradient(ellipse at 80% 0%, var(--navy-2), var(--navy) 70%); color: rgba(255, 255, 255, .85); padding: 36px 0 44px; }
.page-head h1 { color: var(--white); margin: .2em 0 .2em; }
.page-head p { margin: 0; }
.page-head-post { padding: 20px 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; font-size: .9rem; }
.crumbs li { color: rgba(255, 255, 255, .7); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: rgba(255, 255, 255, .45); }
.crumbs a { color: #b9c4ff; }

/* ---------- tag ---------- */
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.tags a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 999px; background: var(--white); border: 1px solid var(--border); color: var(--text); font-size: .9rem; }
.tags a:hover, .tags a[aria-current="page"] { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.tags span { font-size: .78rem; color: var(--muted); }
.tag-box { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); }
.tag-box h2 { font-size: 1.2rem; }

/* ---------- บทความ ---------- */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; }
.post-header h1 { font-size: clamp(1.7rem, 3.6vw, 2.3rem); }
.post-cover { width: 100%; border-radius: var(--radius); margin: 18px 0 32px; }
.prose { color: #3a3f55; font-size: 1.05rem; overflow-wrap: anywhere; }
.prose h2 { font-size: 1.4rem; margin-top: 1.6em; }
.prose ol, .prose ul { padding-left: 1.4em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .3em; }
.prose li > ol, .prose li > ul { margin: .4em 0 .2em; }
.prose img { border-radius: 10px; margin: 1em auto; }
.post-footer { margin-top: 40px; display: grid; gap: 24px; }
.share { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-family: var(--font-head); color: var(--ink); }
.share span { margin-right: 4px; }
.share a, .share button { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--white); color: var(--ink); font: 500 .8rem var(--font-head); cursor: pointer; }
.share a:hover, .share button:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.share .share-line { color: var(--line); }
.share button.copied { border-color: var(--teal); color: var(--teal); }
.author { display: flex; gap: 18px; align-items: center; padding: 22px; background: var(--soft); border-radius: var(--radius); }
.author img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.author p { margin: 0; font-size: .95rem; }
.author-name { font-family: var(--font-head); color: var(--ink); font-weight: 500; }
.sidebar { position: sticky; top: 96px; }
.sidebar h2 { font-size: 1.15rem; margin-top: 8px; }
.mini-posts { list-style: none; margin: 0 0 32px; padding: 0; display: grid; gap: 14px; }
.mini-posts a { display: flex; gap: 12px; color: var(--ink); font-size: .95rem; line-height: 1.5; }
.mini-posts a:hover { color: var(--blue); text-decoration: none; }
.mini-posts img { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }
.mini-posts small { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px; }
@media (max-width: 960px) { .post-layout { grid-template-columns: 1fr; } .sidebar { position: static; } }

/* ---------- ติดต่อเรา ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 32px; }
.contact-card { padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); }
.contact-card h2 { font-size: 1.15rem; margin-bottom: .2em; }
.contact-card p { margin: 0; overflow-wrap: anywhere; }
.contact-card .muted { font-size: .92rem; margin-top: 4px; }
.company-box { display: flex; gap: 22px; padding: 32px; border-radius: var(--radius); background: var(--soft); }
.company-box h2 { font-size: 1.35rem; margin: 0; }
.company-box dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; margin: 16px 0 0; }
.company-box dt { color: var(--ink); font-weight: 500; }
.company-box dd { margin: 0; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .company-box { flex-direction: column; padding: 24px; } .company-box dl { grid-template-columns: 1fr; } .company-box dd { margin-bottom: 8px; } }

/* ---------- 404 ---------- */
.notfound { text-align: center; }
.nf-code { font-family: var(--font-head); font-size: 5rem; font-weight: 600; line-height: 1; color: var(--blue); margin: 0 0 .2em; }

/* ---------- footer ---------- */
.footer { background: #070f52; color: rgba(255, 255, 255, .72); padding: 64px 0 0; font-size: .95rem; }
.footer a { color: rgba(255, 255, 255, .9); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1.4fr; gap: 40px; }
.footer-grid img { width: 150px; margin-bottom: 14px; }
.footer-h { color: var(--white); font-size: 1.05rem; margin-bottom: .8em; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-contact { font-style: normal; line-height: 1.9; }
.footer-contact strong { color: var(--white); font-weight: 500; }
.social { display: flex; gap: 10px; }
.social a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.social a:hover { background: var(--blue); text-decoration: none; }
.social .social-line { font: 600 .7rem var(--font-head); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 44px; padding: 20px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .85rem; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
