:root {
  --green: #0f9d6c;
  --green-dark: #0b7d57;
  --green-light: #e6f6ef;
  --ink: #1f2d2a;
  --muted: #5c6f6a;
  --line: #e4ede9;
  --bg: #ffffff;
  --bg-soft: #f6faf8;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(15, 157, 108, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Sarabun", "Noto Sans Thai", "Tahoma", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  font-size: 17px;
}

.container {
  width: min(1080px, 92%);
  margin-inline: auto;
}

img { max-width: 100%; height: auto; }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Header ===== */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}
.brand {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.brand span { color: var(--green); }
.site-nav ul {
  display: flex;
  gap: 22px;
  list-style: none;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--ink);
  font-weight: 600;
  padding: 6px 4px;
}
.site-nav a:hover { color: var(--green); text-decoration: none; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--green) 0%, #0a7d61 100%);
  color: #fff;
  padding: 56px 0;
}
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.35; margin-bottom: 12px; }
.hero p { font-size: 1.05rem; max-width: 680px; color: #eafaf4; }

/* ===== Sections & cards ===== */
.section { padding: 48px 0; }
.section-title {
  font-size: 1.5rem;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: "";
  width: 8px;
  height: 26px;
  border-radius: 4px;
  background: var(--green);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(15, 157, 108, 0.14); }
.card-body { padding: 20px; }
.card h3 { font-size: 1.12rem; margin-bottom: 8px; line-height: 1.5; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--green); }
.card p { color: var(--muted); font-size: 0.98rem; }
.card-meta {
  font-size: 0.85rem;
  color: var(--green);
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}
.card .readmore { font-weight: 700; }

/* ===== Article page ===== */
.article {
  padding: 40px 0 60px;
}
.article-wrap {
  max-width: 780px;
  margin-inline: auto;
}
.breadcrumb { font-size: 0.9rem; color: var(--muted); margin-bottom: 18px; }
.article h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); line-height: 1.4; margin-bottom: 10px; }
.article .post-date { color: var(--muted); font-size: 0.92rem; margin-bottom: 24px; display: block; }
.article h2 { font-size: 1.35rem; margin: 32px 0 12px; }
.article h3 { font-size: 1.15rem; margin: 24px 0 10px; }
.article p { margin-bottom: 16px; }
.article ul, .article ol { margin: 0 0 16px 24px; }
.article li { margin-bottom: 8px; }
.article blockquote {
  border-left: 4px solid var(--green);
  background: var(--green-light);
  padding: 14px 18px;
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
  font-style: italic;
}
.article .tip {
  background: var(--green-light);
  border: 1px solid #cfeadd;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin: 20px 0;
}
.article .tip strong { color: var(--green-dark); }

.related { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line); }

/* ===== Tools / calculator ===== */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.tool-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.tool-card h2 { font-size: 1.25rem; margin-bottom: 6px; color: var(--green-dark); }
.tool-card p { color: var(--muted); font-size: 0.95rem; margin-bottom: 16px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.95rem; }
.field input, .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}
.field input:focus, .field select:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.btn {
  display: inline-block;
  background: var(--green);
  color: #fff;
  border: none;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.btn:hover { background: var(--green-dark); }
.result {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--green-light);
  border-radius: 8px;
  min-height: 20px;
}
.result strong { color: var(--green-dark); }
.hint { font-size: 0.85rem; color: var(--muted); }

/* ===== Footer ===== */
.site-footer {
  background: var(--ink);
  color: #cfe0da;
  padding: 32px 0;
  margin-top: 40px;
  font-size: 0.92rem;
}
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: #fff; }
.site-footer .brand { color: #fff; font-size: 1.1rem; }
.disclaimer { margin-top: 14px; font-size: 0.82rem; color: #9db5ad; max-width: 760px; }

/* ===== Error page ===== */
.error {
  text-align: center;
  padding: 90px 0;
}
.error .code { font-size: 5rem; font-weight: 800; color: var(--green); }
.error h1 { margin: 8px 0 12px; }

@media (max-width: 640px) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .site-nav ul { gap: 14px; row-gap: 6px; }
}
