/* =============================================
   CHANGATH CLINIC — BLOG STYLESHEET
   Uses the same design tokens as style.css
   ============================================= */

/* =============================================
   BLOG HERO / PAGE HEADER
   ============================================= */
.blog-hero {
  background:
    radial-gradient(ellipse at 70% 0%, rgba(200,159,92,0.12), transparent 50%),
    radial-gradient(ellipse at 10% 100%, rgba(44,62,45,0.07), transparent 50%),
    var(--cream);
  padding: 160px 0 96px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.blog-hero-inner { position: relative; z-index: 2; }
.blog-hero .eyebrow { justify-content: center; margin-bottom: 20px; }
.blog-hero .eyebrow::before { display: none; }
.blog-hero .h-display { margin: 0 auto 24px; max-width: 640px; }
.blog-hero .body-lg { color: var(--ink-soft); max-width: 480px; margin: 0 auto; }

.blog-hero-leaf {
  position: absolute;
  bottom: -60px; right: -60px;
  pointer-events: none; z-index: 1;
}

/* =============================================
   BLOG LAYOUT (listing page)
   ============================================= */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 288px;
  gap: 64px;
  padding: 72px 0 96px;
  align-items: start;
}
.blog-main { min-width: 0; }

/* =============================================
   SEARCH / FILTER BAR
   ============================================= */
.blog-filter-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.blog-search-form {
  display: flex;
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  background: var(--paper);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.blog-search-form:focus-within {
  border-color: var(--forest-soft);
  box-shadow: 0 0 0 3px rgba(44,62,45,0.08);
}
.blog-search-form input {
  flex: 1;
  border: none;
  padding: 12px 20px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: transparent;
  outline: none;
}
.blog-search-form input::placeholder { color: var(--muted); }
.blog-search-form button {
  background: var(--forest);
  color: var(--cream);
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.blog-search-form button:hover { background: var(--terracotta); }

.clear-filter {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: all 0.2s;
}
.clear-filter:hover { color: var(--terracotta); border-color: var(--terracotta); }

.filter-result-info {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}
.filter-result-info strong { color: var(--forest-deep); }

/* =============================================
   BLOG LISTING GRID
   ============================================= */
.blog-listing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* ── Blog listing card (blc) ── */
.blc {
  display: flex;
  flex-direction: column;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.2,0.8,0.2,1);
}
.blc:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 48px -16px rgba(31,26,20,0.16);
  border-color: var(--terracotta);
}
.blc:hover .blc-img img { transform: scale(1.04); }
.blc:hover .blc-read { color: var(--terracotta); gap: 10px; }

/* Featured first card spans full width */
.blc-featured {
  grid-column: 1 / -1;
  flex-direction: row;
}
.blc-featured .blc-img {
  width: 48%;
  flex-shrink: 0;
  height: 100%;
  min-height: 280px;
}
.blc-featured .blc-img img { height: 100%; min-height: 280px; }
.blc-featured .blc-body { padding: 36px 32px; }
.blc-featured .blc-title { font-size: clamp(22px, 2.8vw, 30px); margin-bottom: 14px; }
.blc-featured .blc-excerpt { font-size: 15px; -webkit-line-clamp: 4; }

.blc-img {
  position: relative;
  overflow: hidden;
  background: var(--cream-deep);
}
.blc-img img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.blc-img-placeholder {
  width: 100%; height: 200px;
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--cream-deep), var(--cream));
}
.blc-cat {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--forest-deep);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
}
.blc-body {
  padding: 22px 22px 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.blc-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 12px;
  text-transform: uppercase;
}
.blc-sep { color: var(--line-strong); }
.blc-title {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--forest-deep);
  line-height: 1.2;
  margin-bottom: 10px;
  transition: color 0.2s;
}
.blc:hover .blc-title { color: var(--terracotta); }
.blc-excerpt {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 18px;
}
.blc-read {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--forest-soft);
  transition: all 0.25s;
  margin-top: auto;
}

/* =============================================
   EMPTY STATE
   ============================================= */
.blog-empty {
  text-align: center;
  padding: 72px 24px;
  background: var(--cream);
  border-radius: 6px;
  border: 1px dashed var(--line-strong);
}
.blog-empty-icon { font-size: 3rem; margin-bottom: 16px; }
.blog-empty-title {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
  color: var(--forest-deep);
  margin-bottom: 10px;
}
.blog-empty p { font-size: 15px; color: var(--muted); }

/* =============================================
   PAGINATION
   ============================================= */
.blog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 52px;
  flex-wrap: wrap;
}
.pag-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px;
  padding: 0 10px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 14px;
  font-family: var(--sans);
  text-decoration: none;
  transition: all 0.2s;
}
.pag-btn:hover { background: var(--cream-deep); color: var(--forest-deep); border-color: var(--forest-soft); }
.pag-btn.active { background: var(--forest-deep); color: var(--cream); border-color: var(--forest-deep); }
.pag-btn.pag-prev,
.pag-btn.pag-next {
  border-radius: 999px;
  padding: 0 16px;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

/* =============================================
   SIDEBAR
   ============================================= */
.blog-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 90px;
}

.sw {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 22px 20px;
}
.sw-title {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

/* Category list */
.cat-list { display: flex; flex-direction: column; gap: 3px; }
.cat-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
}
.cat-list a:hover { background: var(--paper); color: var(--forest-deep); }
.cat-list a.active { background: var(--paper); color: var(--forest-deep); font-weight: 500; }
.cat-list a span {
  font-size: 11px;
  color: var(--muted);
  background: var(--paper);
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.cat-list a.active span { background: var(--forest-deep); color: var(--cream); border-color: var(--forest-deep); }

/* Recent list */
.recent-list { display: flex; flex-direction: column; gap: 0; }
.recent-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.recent-list li:last-child { border-bottom: none; padding-bottom: 0; }
.rl-title {
  display: block;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--forest-deep);
  line-height: 1.3;
  margin-bottom: 4px;
  text-decoration: none;
  transition: color 0.2s;
}
.rl-title:hover { color: var(--terracotta); }
.rl-date { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }

/* CTA widget */
.sw-cta {
  background: var(--forest-deep);
  color: var(--cream);
  text-align: center;
  padding: 32px 20px;
}
.sw-cta-leaf { font-size: 2rem; margin-bottom: 12px; }
.sw-cta h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--cream);
  margin-bottom: 10px;
  line-height: 1.2;
}
.sw-cta p { font-size: 13px; color: rgba(245,239,224,0.72); line-height: 1.6; margin-bottom: 20px; }
.sw-cta-btn {
  background: var(--ochre) !important;
  color: var(--forest-deep) !important;
  border-color: var(--ochre) !important;
  display: block !important;
  text-align: center;
  justify-content: center;
}
.sw-cta-btn:hover { background: var(--ochre-soft) !important; border-color: var(--ochre-soft) !important; }

/* =============================================
   SINGLE POST PAGE
   ============================================= */
.post-breadcrumb {
  background: var(--cream);
  padding: 14px 0;
  font-size: 13px;
  color: var(--muted);
  margin-top: 72px;
  border-bottom: 1px solid var(--line);
}
.post-breadcrumb .container { display: flex; align-items: center; gap: 8px; }
.post-breadcrumb a { color: var(--forest-soft); text-decoration: none; }
.post-breadcrumb a:hover { color: var(--terracotta); text-decoration: underline; }
.post-breadcrumb .bc-sep { color: var(--line-strong); }

.post-layout {
  display: grid;
  grid-template-columns: 1fr 288px;
  gap: 64px;
  padding: 56px 0 96px;
  align-items: start;
}
.post-article { min-width: 0; }

.post-featured-img {
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 36px;
  box-shadow: 0 16px 40px -16px rgba(31,26,20,0.14);
}
.post-featured-img img { width: 100%; max-height: 480px; object-fit: cover; display: block; }

.post-content-wrap {
  background: var(--cream);
  border-radius: 6px;
  padding: 48px;
  border: 1px solid var(--line);
}

.post-cat-badge {
  display: inline-block;
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 5px 14px;
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--terracotta);
  margin-bottom: 18px;
}

.post-title {
  font-family: var(--serif);
  font-size: clamp(28px, 3.5vw, 42px);
  font-weight: 500;
  color: var(--forest-deep);
  line-height: 1.15;
  margin-bottom: 20px;
}

.post-meta {
  display: flex;
  gap: 14px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  align-items: center;
}
.post-meta-author { color: var(--forest-soft); font-weight: 500; }
.post-meta-sep { color: var(--line-strong); }

/* Quill / rich-text content */
.ql-content { color: var(--ink); line-height: 1.8; font-size: 16px; }
.ql-content h1, .ql-content h2, .ql-content h3, .ql-content h4 {
  font-family: var(--serif);
  color: var(--forest-deep);
  line-height: 1.2;
  margin: 2em 0 0.75em;
  font-weight: 500;
}
.ql-content h1 { font-size: 2rem; }
.ql-content h2 { font-size: 1.65rem; }
.ql-content h3 { font-size: 1.3rem; }
.ql-content h4 { font-size: 1.1rem; }
.ql-content p { margin-bottom: 1.2em; }
.ql-content ul, .ql-content ol { padding-left: 26px; margin-bottom: 1.2em; }
.ql-content li { margin-bottom: 6px; }
.ql-content blockquote {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-style: italic;
  border-left: 3px solid var(--terracotta);
  padding: 16px 24px;
  margin: 28px 0;
  background: var(--paper);
  border-radius: 0 6px 6px 0;
  color: var(--forest-deep);
}
.ql-content img { max-width: 100%; border-radius: 6px; margin: 20px 0; display: block; }
.ql-content strong { color: var(--forest-deep); font-weight: 600; }
.ql-content em { font-style: italic; }
.ql-content a { color: var(--terracotta); text-decoration: underline; text-underline-offset: 3px; }
.ql-content a:hover { color: var(--terra-deep); }
.ql-content hr { border: none; border-top: 1px solid var(--line); margin: 36px 0; }

/* Share bar */
.post-share {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.post-share-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.share-btn.wa { background: #e7f9ef; color: #128c7e; border-color: #c3efd9; }
.share-btn.fb { background: #e8f0fe; color: #1877f2; border-color: #c7d7fc; }
.share-btn.tw { background: #e8f5fd; color: #1da1f2; border-color: #bde4fa; }
.share-btn:hover { opacity: 0.85; transform: translateY(-1px); }

/* Post prev/next nav */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
}
.post-nav-link {
  display: flex;
  flex-direction: column;
  padding: 18px 20px;
  background: var(--paper);
  border-radius: 6px;
  border: 1px solid var(--line);
  text-decoration: none;
  transition: all 0.2s;
}
.post-nav-link:hover { background: var(--cream); border-color: var(--terracotta); }
.post-nav-link.next { text-align: right; }
.post-nav-link .pnl-dir { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.post-nav-link .pnl-title { font-family: var(--serif); font-size: 16px; color: var(--forest-deep); line-height: 1.3; font-weight: 500; }

/* =============================================
   RESPONSIVE — BLOG PAGES
   ============================================= */
@media (max-width: 1100px) {
  .blog-layout,
  .post-layout {
    grid-template-columns: 1fr 260px;
    gap: 40px;
  }
  .blog-sidebar { position: static; }
}

@media (max-width: 900px) {
  .blog-layout,
  .post-layout {
    grid-template-columns: 1fr;
    gap: 48px;
    padding-bottom: 72px;
  }
  .blog-sidebar {
    order: -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .sw-cta { grid-column: 1 / -1; }

  /* Featured card goes vertical on tablet */
  .blc-featured { flex-direction: column; }
  .blc-featured .blc-img { width: 100%; height: auto; min-height: 0; }
  .blc-featured .blc-img img { height: 240px; min-height: 0; }
  .blc-featured .blc-body { padding: 22px; }
  .blc-featured .blc-title { font-size: 22px; }
}

@media (max-width: 640px) {
  .blog-hero { padding: 130px 0 64px; }
  .blog-layout { padding: 48px 0 64px; }

  .blog-listing-grid { grid-template-columns: 1fr; }
  .blog-sidebar { grid-template-columns: 1fr; }

  .post-content-wrap { padding: 28px 20px; }
  .post-title { font-size: 26px; }
  .post-nav { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .blog-hero { padding: 110px 0 52px; }
  .blog-filter-bar { gap: 10px; }
  .blog-search-form { min-width: 0; }
  .blog-listing-grid { gap: 16px; }
  .blc-body { padding: 16px; }
  .blc-title { font-size: 18px; }
  .post-content-wrap { padding: 22px 14px; }
}
