:root {
  --blue: #1d4ed8;
  --blue-light: #3b82f6;
  --blue-pale: #eff6ff;
  --dark: #0f172a;
  --gray: #64748b;
  --gray-light: #f8fafc;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(30,64,175,.10);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Bai Jamjuree', 'Sarabun', sans-serif;
  color: var(--dark);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 { font-family: 'Bai Jamjuree', sans-serif; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* ── HEADER ── */
header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e2e8f0;
}
.header-inner {
  display: flex; align-items: center;
  justify-content: space-between; height: 60px;
}
.brand {
  font-size: 1.35rem; font-weight: 800; color: var(--blue);
  letter-spacing: -.5px; text-decoration: none;
}
.header-nav { display: flex; align-items: center; gap: 1.5rem; }
.nav-link {
  font-size: .9rem; font-weight: 600; color: var(--gray);
  text-decoration: none; transition: color .2s;
}
.nav-link:hover, .nav-link.active { color: var(--blue); }
.nav-login {
  font-size: .9rem; font-weight: 600; color: var(--blue);
  text-decoration: none; padding: .45rem 1.1rem;
  border: 2px solid var(--blue); border-radius: 8px;
  transition: background .2s, color .2s;
}
.nav-login:hover { background: var(--blue); color: #fff; }

/* ── FOOTER ── */
footer {
  margin-top: auto;
  background: var(--gray-light);
  border-top: 1px solid #e2e8f0;
  padding: 1.5rem 0;
  font-size: .875rem; color: var(--gray);
}
.footer-inner {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 1rem;
}
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.footer-links a { color: var(--gray); text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--blue); }

/* ── BLOG INDEX ── */
.blog-hero {
  padding: 3.5rem 0 2rem;
  border-bottom: 1px solid #e2e8f0;
  background: var(--gray-light);
}
.blog-hero .section-label {
  display: inline-block;
  font-size: .75rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--blue);
  background: var(--blue-pale); border: 1px solid #bfdbfe;
  border-radius: 100px; padding: .25rem .85rem; margin-bottom: 1rem;
}
.blog-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 800; color: var(--dark); margin-bottom: .75rem;
}
.blog-hero p { font-size: 1.05rem; color: var(--gray); max-width: 520px; }

.blog-grid-section { padding: 3rem 0 4rem; }
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.blog-card {
  display: block;
  background: var(--white);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  padding: 1.75rem;
  text-decoration: none;
  color: inherit;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.blog-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: #bfdbfe;
}
.blog-tag {
  display: inline-block;
  font-size: .72rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--blue);
  background: var(--blue-pale); border: 1px solid #bfdbfe;
  border-radius: 100px; padding: .2rem .75rem; margin-bottom: 1rem;
}
.blog-card h2 {
  font-size: 1.1rem; font-weight: 700; color: var(--dark);
  line-height: 1.4; margin-bottom: .6rem; transition: color .2s;
}
.blog-card:hover h2 { color: var(--blue); }
.blog-card p { font-size: .9rem; color: var(--gray); line-height: 1.6; margin-bottom: 1rem; }
.read-time { font-size: .8rem; color: #94a3b8; }

/* ── POST ── */
.post-hero {
  background: var(--gray-light);
  border-bottom: 1px solid #e2e8f0;
  padding: 3rem 0 2.5rem;
}
.post-tag {
  display: inline-block;
  font-size: .72rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--blue);
  background: var(--blue-pale); border: 1px solid #bfdbfe;
  border-radius: 100px; padding: .2rem .75rem; margin-bottom: 1.25rem;
}
.post-hero h1 {
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 800; line-height: 1.3; color: var(--dark);
  max-width: 760px; margin-bottom: 1rem;
}
.post-meta {
  display: flex; align-items: center; gap: 1rem;
  flex-wrap: wrap; font-size: .875rem; color: var(--gray);
}
.post-meta .read-time { color: #94a3b8; }

/* ── PROSE ── */
.post-body { padding: 3rem 0 4rem; }
.prose {
  max-width: 760px;
  font-size: 1rem; line-height: 1.85; color: #1e293b;
}
.prose h1 {
  font-size: 1.65rem; font-weight: 800; color: var(--dark);
  margin: 2.5rem 0 .75rem; line-height: 1.3;
}
.prose h2 {
  font-size: 1.35rem; font-weight: 700; color: var(--dark);
  margin: 2.25rem 0 .7rem; padding-bottom: .4rem;
  border-bottom: 2px solid #e2e8f0;
}
.prose h3 {
  font-size: 1.1rem; font-weight: 700; color: var(--dark);
  margin: 1.75rem 0 .5rem;
}
.prose p { margin-bottom: 1.25rem; }
.prose ul, .prose ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.prose li { margin-bottom: .4rem; }
.prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: #1e40af; }
.prose strong { font-weight: 700; color: var(--dark); }
.prose hr { border: none; border-top: 1px solid #e2e8f0; margin: 2rem 0; }
.prose blockquote {
  border-left: 3px solid var(--blue-light);
  padding: .75rem 1.25rem; margin: 1.5rem 0;
  background: var(--blue-pale); border-radius: 0 8px 8px 0;
  color: var(--gray);
}
.prose table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .95rem; }
.prose th, .prose td { border: 1px solid #e2e8f0; padding: .6rem .9rem; text-align: left; }
.prose th { background: var(--gray-light); font-weight: 700; color: var(--dark); }
.prose code {
  font-family: ui-monospace, monospace; font-size: .875em;
  background: #f1f5f9; border-radius: 4px; padding: .15rem .4rem;
}

/* ── CTA BOX ── */
.cta-box {
  max-width: 760px;
  margin-top: 3rem; padding: 2rem;
  background: var(--blue-pale); border: 1px solid #bfdbfe;
  border-radius: var(--radius); text-align: center;
}
.cta-box h3 { font-size: 1.15rem; color: var(--dark); margin-bottom: .5rem; }
.cta-box p { font-size: .9rem; color: var(--gray); margin-bottom: 1.25rem; }
.btn-cta {
  display: inline-block;
  background: var(--blue); color: #fff;
  font-weight: 700; font-size: .95rem;
  padding: .65rem 1.75rem; border-radius: 8px;
  text-decoration: none; transition: background .2s;
}
.btn-cta:hover { background: #1e40af; color: #fff; }

/* ── BREADCRUMB ── */
.breadcrumb { font-size: .8rem; color: var(--gray); margin-bottom: 1rem; }
.breadcrumb a { color: var(--gray); text-decoration: none; }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb span { margin: 0 .4rem; }
