:root {
  --primary: #a50034;
  --primary-dark: #7f0128;
  --text: #111111;
  --muted: #5f6368;
  --line: #e6e7eb;
  --surface: #ffffff;
  --surface-soft: #f6f7f9;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Noto Sans Thai", sans-serif;
  color: var(--text);
  background: var(--surface);
  line-height: 1.75;
}

.container { width: min(1140px, 92%); margin: 0 auto; }
.narrow { width: min(760px, 92%); margin: 0 auto; }
.section { padding: 56px 0; }
.section-soft { background: var(--surface-soft); }

/* ============ Topbar ============ */
.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.98);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(8px);
}
.topbar-inner {
  min-height: 64px;
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 1.18rem;
}
.brand-logo { flex-shrink: 0; display: block; }
.top-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.top-actions a {
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
}
.top-actions a:hover { color: var(--primary); }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  transition: 0.2s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-outline:hover { background: rgba(165,0,52,0.06); }

/* ============ Breadcrumb ============ */
.breadcrumb {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 24px 0 8px;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 600; }

/* ============ Article hero ============ */
.article-hero {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--line);
}
.article-hero .kicker {
  font-size: 0.78rem;
  letter-spacing: 1.4px;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.article-hero h1 {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  line-height: 1.25;
  margin: 0 0 16px;
  font-weight: 800;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
}
.article-meta .dot { color: #ccc; }
.article-author { font-weight: 700; color: var(--text); }
.article-read-time { display: inline-flex; align-items: center; gap: 6px; }

/* ============ Article body ============ */
.article-body {
  padding: 36px 0 60px;
  font-size: 1.06rem;
  color: #222;
}
.article-body p { margin: 0 0 20px; }
.article-body h2 {
  font-size: 1.55rem;
  margin: 40px 0 14px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
}
.article-body h3 {
  font-size: 1.18rem;
  margin: 28px 0 12px;
  font-weight: 700;
  color: var(--text);
}
.article-body ul, .article-body ol {
  margin: 0 0 20px;
  padding-left: 22px;
}
.article-body li { margin-bottom: 8px; }
.article-body strong { color: var(--primary); font-weight: 800; }
.article-body a { color: var(--primary); font-weight: 700; }
.article-body a:hover { text-decoration: underline; }
.article-body blockquote {
  border-left: 4px solid var(--primary);
  background: rgba(165,0,52,0.05);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 0 12px 12px 0;
  font-size: 1.02rem;
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  font-size: 0.96rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.article-body th, .article-body td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.article-body thead { background: #fafafc; }
.article-body th { font-weight: 800; }
.article-body tbody tr:last-child td { border-bottom: 0; }
.article-body .tldr {
  background: linear-gradient(180deg, rgba(165,0,52,0.05), rgba(165,0,52,0.02));
  border: 1px solid rgba(165,0,52,0.18);
  border-radius: 14px;
  padding: 18px 22px;
  margin: 0 0 28px;
}
.article-body .tldr h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.article-body .tldr p { margin: 0; font-size: 0.98rem; }
.article-body figure { margin: 24px 0; }
.article-body figcaption {
  font-size: 0.86rem;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
}

/* ============ CTA inline ============ */
.article-cta {
  background: linear-gradient(135deg, var(--primary) 0%, #c4003d 100%);
  color: #fff;
  border-radius: 18px;
  padding: 28px;
  margin: 32px 0;
  text-align: center;
}
.article-cta h3 { color: #fff; margin: 0 0 8px; font-size: 1.3rem; }
.article-cta p { margin: 0 0 16px; color: rgba(255,255,255,0.94); }
.article-cta .btn {
  background: #fff;
  color: var(--primary);
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 800;
}
.article-cta .btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,0.2); }

/* ============ Related articles ============ */
.related {
  background: var(--surface-soft);
  padding: 56px 0;
}
.related h2 {
  font-size: 1.5rem;
  margin: 0 0 24px;
  font-weight: 800;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 18px;
}
.related-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.related-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(17,17,17,0.06); }
.related-card .tag {
  font-size: 0.74rem;
  letter-spacing: 1.2px;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
}
.related-card h3 {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.45;
}
.related-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}
@media (max-width: 900px) { .related-grid { grid-template-columns: 1fr; } }

/* ============ Blog index page ============ */
.blog-hero {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a0010 100%);
  color: #fff;
  padding: 64px 0 48px;
}
.blog-hero h1 {
  color: #fff;
  font-size: clamp(2rem, 4vw, 2.8rem);
  margin: 0 0 12px;
  line-height: 1.2;
  font-weight: 800;
}
.blog-hero p {
  color: rgba(255,255,255,0.85);
  margin: 0;
  font-size: 1.08rem;
  max-width: 640px;
}
.blog-hero .kicker {
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  letter-spacing: 1.6px;
  font-weight: 700;
  margin-bottom: 8px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 22px;
  margin-top: 32px;
}
.post-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(17,17,17,0.07);
  border-color: rgba(165,0,52,0.3);
}
.post-card .tag {
  font-size: 0.75rem;
  letter-spacing: 1.4px;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
}
.post-card h2 {
  margin: 0;
  font-size: 1.32rem;
  font-weight: 800;
  line-height: 1.35;
}
.post-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.7;
}
.post-card .post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 6px;
}
.post-card .read-more {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: auto;
}
@media (max-width: 740px) { .posts-grid { grid-template-columns: 1fr; } }

/* ============ Footer ============ */
.site-footer {
  background: #111;
  color: #eee;
  padding: 40px 16px 56px;
  text-align: center;
  font-size: 14px;
  line-height: 1.8;
}
.site-footer a { color: #fff; text-decoration: underline; }
.site-footer small { color: #aaa; }

/* ============ LINE FAB ============ */
.line-fab {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  background: #06c755;
  color: #fff;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(6,199,85,0.45);
  font-weight: 800;
  text-decoration: none;
  font-size: 0.95rem;
  transition: transform .15s ease, box-shadow .15s ease;
}
.line-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(6,199,85,0.55); }
@media (max-width: 680px) {
  .line-fab { padding: 11px 14px; font-size: 0.9rem; }
  .line-fab .line-fab-label { display: none; }
}
