/* ---------- Blog ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.post-card {
  background: var(--white);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex;
  flex-direction: column;
}
.post-card:hover { transform: translateY(-6px); box-shadow: 0 20px 40px rgba(20, 39, 62, 0.15); }
.post-card .post-thumb { height: 200px; overflow: hidden; background: linear-gradient(160deg, var(--sand), #f8fafc); }
.post-card .post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .post-info { padding: 22px 22px 26px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card .post-date { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.post-card h3 { font-family: var(--serif); font-size: 1.15rem; line-height: 1.35; }
.post-card p { font-size: 0.84rem; color: var(--brown-soft); flex: 1; }
.post-card .view { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent-dark); font-weight: 600; }
.post-card:hover .view { text-decoration: underline; }
.blog-empty { color: var(--brown-soft); }

/* ---------- Article ---------- */
.article { max-width: 760px; margin: 0 auto; font-size: 1.02rem; }
.article-meta { font-size: 0.78rem; color: var(--brown-soft); letter-spacing: 0.06em; margin-bottom: 30px; text-transform: uppercase; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.article .article-meta .post-date { color: var(--accent); font-weight: 700; }
.article h2 {
  font-family: var(--serif);
  font-size: 1.55rem;
  margin: 40px 0 16px;
  padding-left: 14px;
  border-left: 4px solid var(--accent);
  line-height: 1.3;
}
.article h3 { font-family: var(--serif); font-size: 1.25rem; margin: 30px 0 12px; }
.article h4 { font-size: 1.05rem; margin: 24px 0 10px; }
.article p { margin-bottom: 18px; color: #2c3e57; font-size: 1.02rem; line-height: 1.85; }
.article ul { margin: 0 0 20px 22px; }
.article li { margin-bottom: 10px; color: #2c3e57; line-height: 1.7; }
.article li::marker { color: var(--accent); }
.article a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
.article strong { color: #14273e; }

/* standalone article images: centered figure cards with captions */
.article-figure { margin: 30px 0 34px; text-align: center; }
.article-figure img {
  display: block;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(20, 39, 62, 0.16);
}
.article-figure figcaption {
  font-size: 0.78rem;
  color: var(--brown-soft);
  letter-spacing: 0.05em;
  margin-top: 12px;
}
/* inline images that are not standalone */
.article img { border-radius: 14px; margin: 10px auto 18px; box-shadow: var(--shadow); }
.article a { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }

/* FAQ question paragraphs start with bold "Qn:" — give them breathing room */
.article-cta {
  margin-top: 48px;
  background: linear-gradient(160deg, var(--sand), #f8fafc);
  border-radius: 20px;
  padding: 36px 34px;
  text-align: center;
}
.article-cta h3 { margin: 0 0 10px; font-size: 1.35rem; }
.article-cta p { font-size: 0.92rem; color: var(--brown-soft); margin-bottom: 20px; }

/* ---------- Admin ---------- */
.admin-body { background: var(--cream); padding: 40px 0; }
.admin-box {
  max-width: 380px;
  margin: 60px auto;
  background: var(--white);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 38px 34px;
  text-align: center;
}
.admin-box input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 14px 0;
  font-size: 0.95rem;
}
.admin-msg { background: #e9f7ef; color: #178a4c; border-radius: 10px; padding: 10px 14px; font-size: 0.9rem; }
.admin-wrap { max-width: 1020px; margin: 0 auto; padding: 10px 20px 60px; }
.admin-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.admin-head h2 { font-family: var(--serif); }
.btn-mini {
  display: inline-block;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 0.78rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--brown);
}
.btn-mini:hover { border-color: var(--accent); color: var(--accent-dark); }
.btn-danger { color: #b3392e; border-color: #e8c5c0; }
.btn-export { background: var(--accent); color: #fff; border-color: var(--accent); }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 34px;
}
.admin-table th, .admin-table td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 0.9rem; vertical-align: top; }
.admin-table th { background: var(--sand); font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
.admin-table small { color: var(--brown-soft); }
.admin-actions { white-space: nowrap; }
.admin-actions .btn-mini { margin-right: 6px; }
.admin-form {
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 26px 28px 30px;
  display: grid;
  gap: 14px;
}
.admin-form label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--brown-soft); }
.admin-form input, .admin-form textarea, .admin-form select {
  width: 100%;
  margin-top: 6px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
}
.admin-form input:focus, .admin-form textarea:focus { border-color: var(--accent); }
.admin-form-actions { display: flex; gap: 12px; align-items: center; }

@media (max-width: 960px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .blog-grid { grid-template-columns: 1fr; } }

/* ---------- markdown tables ---------- */
.md-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 26px;
  font-size: 0.92rem;
  box-shadow: var(--shadow);
  border-radius: 12px;
  overflow: hidden;
}
.md-table th { background: #14273e; color: #f0f5fb; text-align: left; padding: 12px 16px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.md-table td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: #2c3e57; background: var(--white); }
.md-table tr:nth-child(even) td { background: #f8fafc; }
.md-table tr:last-child td { border-bottom: none; }
