/* ==============================================
   BLOG.CSS v3.1 — Blog layout, sidebar, post
   ============================================== */

/* ══════════════════════════════════════
   BLOG LAYOUT (index.php)
══════════════════════════════════════ */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}
.blog-main  {}
.blog-sidebar { position: sticky; top: 84px; }

/* ── Blog Row Card ── */
.blog-list { display: flex; flex-direction: column; gap: 20px; }

.blog-row-card {
  background: var(--white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 200px 1fr;
  transition: all var(--transition);
}
.blog-row-card:hover {
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(59,130,246,0.2);
  transform: translateY(-2px);
}
.blog-row-thumb {
  background: linear-gradient(135deg, var(--accent-light), #DBEAFE);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
  min-height: 150px;
  overflow: hidden;
  flex-shrink: 0;
}
.blog-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.blog-thumb-emoji  { font-size: 36px; }

.blog-row-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.blog-row-cats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
}
.blog-row-cat   { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); text-decoration: none; }
.blog-row-date, .blog-row-read-time { font-size: 12px; color: var(--text-muted); }
.blog-meta-dot  { color: var(--border); }
.blog-row-title { font-size: 17px; font-weight: 700; line-height: 1.35; color: var(--text-primary); margin: 0; }
.blog-row-title a { color: var(--text-primary); text-decoration: none; transition: color var(--transition); }
.blog-row-title a:hover { color: var(--accent); }
.blog-row-excerpt { font-size: 13px; color: var(--text-secondary); line-height: 1.65; margin: 0; }
.blog-row-read {
  font-size: 13px; font-weight: 700; color: var(--accent);
  text-decoration: none; display: inline-flex; align-items: center;
  gap: 4px; transition: gap var(--transition); margin-top: 2px;
  align-self: flex-start;
}
.blog-row-read:hover { gap: 8px; }

/* ── Blog Empty ── */
.blog-empty { text-align: center; padding: 64px 0; }
.blog-empty-icon { font-size: 48px; margin-bottom: 16px; }
.blog-empty h3 { font-size: 20px; margin-bottom: 8px; }
.blog-empty p  { color: var(--text-secondary); margin-bottom: 24px; }

/* ══════════════════════════════════════
   SIDEBAR
══════════════════════════════════════ */
.blog-sidebar { display: flex; flex-direction: column; gap: 18px; }

.sidebar-widget {
  background: var(--white);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.sidebar-widget-title {
  font-size: 14px; font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-light);
}

/* About widget */
.sidebar-about { text-align: center; }
.sidebar-about-avatar {
  width: 56px; height: 56px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: white; font-weight: 700;
  margin: 0 auto 12px;
  overflow: hidden;
}
.sidebar-about-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-about-name { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.sidebar-about-bio  { font-size: 12px; color: var(--text-secondary); line-height: 1.65; margin-bottom: 12px; }

/* Categories */
.sidebar-cats { display: flex; flex-direction: column; gap: 2px; }
.sidebar-cat-link {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--text-secondary);
  text-decoration: none; transition: all .2s;
}
.sidebar-cat-link:hover, .sidebar-cat-link.active { background: var(--accent-light); color: var(--accent); }
.sidebar-cat-count { font-size: 11px; font-weight: 600; color: var(--text-muted); }

/* Recent posts */
.sidebar-recent-post {
  display: flex; gap: 10px; margin-bottom: 12px;
  align-items: flex-start; text-decoration: none;
}
.sidebar-recent-post:last-child { margin-bottom: 0; }
.sidebar-recent-thumb {
  width: 48px; height: 42px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0; overflow: hidden;
}
.sidebar-recent-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-recent-title { font-size: 12px; font-weight: 600; color: var(--text-primary); line-height: 1.4; margin-bottom: 2px; transition: color var(--transition); }
.sidebar-recent-post:hover .sidebar-recent-title { color: var(--accent); }
.sidebar-recent-date  { font-size: 11px; color: var(--text-muted); }

/* Tags */
.sidebar-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sidebar-tag {
  padding: 4px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 500;
  border: 1px solid var(--border-light);
  color: var(--text-secondary); text-decoration: none;
  transition: all .2s;
}
.sidebar-tag:hover, .sidebar-tag.active { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* CTA widget */
.sidebar-cta {
  background: var(--primary);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  text-align: center;
}
.sidebar-cta-icon  { font-size: 28px; margin-bottom: 8px; }
.sidebar-cta-title { font-size: 15px; font-weight: 700; color: white; margin-bottom: 6px; }
.sidebar-cta-desc  { font-size: 12px; color: #64748B; line-height: 1.6; margin-bottom: 14px; }
.sidebar-wa-link   { display: block; font-size: 12px; color: #25D366; margin-top: 8px; text-decoration: none; }

/* ══════════════════════════════════════
   SINGLE POST
══════════════════════════════════════ */
.post-featured-image { border-radius: var(--radius-xl); overflow: hidden; margin-bottom: 36px; box-shadow: var(--card-shadow); }
.post-categories     { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.post-category       { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); text-decoration: none; }
.post-category:hover { text-decoration: underline; }
.post-title          { font-size: clamp(24px,4vw,40px); font-weight: 800; line-height: 1.15; letter-spacing: -.025em; margin-bottom: 14px; }
.post-meta           { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-muted); font-weight: 500; flex-wrap: wrap; margin-bottom: 32px; }

.post-content        { font-size: 16px; line-height: 1.85; color: var(--text-secondary); }
.post-content h2     { font-size: 24px; font-weight: 700; color: var(--text-primary); margin: 36px 0 12px; }
.post-content h3     { font-size: 20px; font-weight: 700; color: var(--text-primary); margin: 28px 0 10px; }
.post-content h4     { font-size: 17px; font-weight: 700; color: var(--text-primary); margin: 22px 0 8px; }
.post-content p      { margin-bottom: 20px; }
.post-content ul, .post-content ol { margin: 0 0 20px 22px; }
.post-content li     { margin-bottom: 7px; }
.post-content a      { color: var(--accent); text-decoration: underline; }
.post-content strong { color: var(--text-primary); font-weight: 700; }
.post-content code   { background: var(--off-white-bg); border: 1px solid var(--border-light); padding: 2px 6px; border-radius: 4px; font-family: var(--font-mono); font-size: .88em; color: var(--text-primary); }
.post-content pre    { background: var(--primary); border-radius: var(--radius-md); padding: 20px; overflow-x: auto; margin-bottom: 22px; }
.post-content pre code { background: none; border: none; color: #E2E8F0; font-size: .88em; padding: 0; }
.post-content blockquote { border-left: 4px solid var(--accent); padding: 4px 0 4px 20px; margin: 24px 0; font-style: italic; color: var(--text-secondary); }
.post-content img    { border-radius: var(--radius-md); margin: 22px 0; }
.post-content table  { width: 100%; border-collapse: collapse; margin-bottom: 22px; }
.post-content th     { background: var(--primary); color: white; padding: 10px 14px; font-size: 13px; text-align: left; }
.post-content td     { padding: 10px 14px; border-bottom: 1px solid var(--border-light); font-size: 14px; }

.post-tags           { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border-light); }
.post-tags-label     { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.post-tag            { padding: 4px 10px; border: 1px solid var(--border); border-radius: 100px; font-size: 11px; font-weight: 500; color: var(--text-secondary); text-decoration: none; transition: all .2s; }
.post-tag:hover      { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* Author Box */
.post-author-box     { display: flex; gap: 18px; align-items: flex-start; margin-top: 36px; padding: 24px; background: var(--off-white-bg); border-radius: var(--radius-xl); border: 1px solid var(--border-light); }
.post-author-avatar  { width: 52px; height: 52px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; color: white; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.post-author-avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-author-label   { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 3px; }
.post-author-name    { font-size: 15px; font-weight: 700; margin-bottom: 5px; }
.post-author-bio     { font-size: 13px; color: var(--text-secondary); line-height: 1.65; margin-bottom: 8px; }

/* Post Nav */
.post-nav            { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 28px; }
.post-nav-item       { padding: 16px; border: 1px solid var(--border-light); border-radius: var(--radius-lg); text-decoration: none; transition: all .2s; display: block; }
.post-nav-item:hover { border-color: var(--accent); box-shadow: var(--card-shadow); }
.post-nav-item.next  { text-align: right; }
.post-nav-dir        { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 5px; }
.post-nav-title      { font-size: 13px; font-weight: 600; color: var(--text-primary); line-height: 1.35; }

/* ══════════════════════════════════════
   COMMENTS
══════════════════════════════════════ */
.comments-section    { margin-top: 44px; padding-top: 36px; border-top: 1px solid var(--border-light); }
.comments-title      { font-size: 20px; font-weight: 700; margin-bottom: 24px; }
.comment-item        { display: flex; gap: 12px; padding: 18px 0; border-bottom: 1px solid var(--border-light); }
.comment-item:last-child { border-bottom: none; }
.comment-avatar      { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-light); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; color: var(--accent); flex-shrink: 0; overflow: hidden; }
.comment-avatar img  { width: 100%; height: 100%; object-fit: cover; }
.comment-name        { font-size: 14px; font-weight: 700; color: var(--text-primary); }
.comment-date        { font-size: 12px; color: var(--text-muted); }
.comment-text        { font-size: 14px; color: var(--text-secondary); line-height: 1.75; margin-top: 5px; }
.comment-reply-link  { font-size: 12px; font-weight: 600; color: var(--accent); text-decoration: none; margin-top: 6px; display: inline-block; }

.comment-form-wrapper { margin-top: 36px; background: var(--off-white-bg); border: 1px solid var(--border-light); border-radius: var(--radius-xl); padding: 28px; }
.comment-form-title   { font-size: 18px; font-weight: 700; margin-bottom: 5px; }
.comment-form-subtitle { font-size: 13px; color: var(--text-secondary); margin-bottom: 22px; }

/* ══════════════════════════════════════
   SEARCH PAGE
══════════════════════════════════════ */
.search-results-list { display: flex; flex-direction: column; gap: 14px; }
.search-result-card  { background: var(--white); border: 1.5px solid var(--border-light); border-radius: var(--radius-lg); padding: 20px; display: flex; gap: 14px; align-items: flex-start; transition: all .2s; }
.search-result-card:hover { box-shadow: var(--card-shadow); border-color: rgba(59,130,246,0.2); }
.search-result-icon  { width: 46px; height: 46px; background: var(--accent-light); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.search-result-body  { flex: 1; min-width: 0; }
.search-result-title { font-size: 15px; font-weight: 700; margin-bottom: 5px; }
.search-result-title a { color: var(--text-primary); text-decoration: none; }
.search-result-title a:hover { color: var(--accent); }
.search-result-excerpt { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* ══════════════════════════════════════
   404 PAGE
══════════════════════════════════════ */
.error-404          { min-height: 65vh; display: flex; align-items: center; justify-content: center; padding: 60px 24px; }
.error-404-inner    { text-align: center; max-width: 520px; margin: 0 auto; }
.error-404-num      { font-size: clamp(72px,15vw,130px); font-weight: 800; font-family: var(--font-heading); color: var(--accent); line-height: 1; opacity: .12; user-select: none; }
.error-404-content  { margin-top: -36px; position: relative; z-index: 1; }
.error-404-title    { font-size: clamp(20px,4vw,30px); font-weight: 800; margin-bottom: 10px; }
.error-404-desc     { font-size: 15px; color: var(--text-secondary); line-height: 1.75; margin-bottom: 28px; }
.error-404-search   { display: flex; gap: 8px; max-width: 400px; margin: 0 auto 24px; }
.error-404-links    { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 32px; }
.error-404-link     { padding: 7px 14px; border: 1px solid var(--border); border-radius: 100px; font-size: 13px; font-weight: 500; color: var(--text-secondary); background: var(--white); text-decoration: none; transition: all .2s; }
.error-404-link:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.error-404-cta      { background: var(--primary); border-radius: var(--radius-xl); padding: 24px; }
.error-404-cta p    { color: #94A3B8; margin-bottom: 14px; }
