/* ── Blog Module CSS ──────────────────────────────────────────────────────── */

/* Buttons */
.pi-btn {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.5rem 1rem; border-radius: 0.5rem;
  font-size: 0.8125rem; font-weight: 700; cursor: pointer;
  border: none; transition: opacity 0.15s;
}
.pi-btn:hover { opacity: 0.85; }
.pi-btn-primary { background: #2563eb; color: #fff; }
.pi-btn-ghost   { background: #f1f5f9; color: #374151; }
.dark .pi-btn-ghost { background: #1e293b; color: #cbd5e1; }

/* Tabs */
.pi-tabs { display: flex; gap: 0.25rem; overflow-x: auto; }
.pi-tab {
  padding: 0.5rem 1.125rem; border-radius: 9999px;
  font-size: 0.8125rem; font-weight: 700;
  color: #64748b; background: #f1f5f9;
  border: none; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.pi-tab:hover { background: #e2e8f0; color: #374151; }
.pi-tab.active { background: #2563eb; color: #fff; }
.pi-tab.type-event.active    { background: #f97316; color: #fff; }
.pi-tab.type-visit.active    { background: #ec4899; color: #fff; }
.pi-tab.type-pr.active       { background: #10b981; color: #fff; }
.pi-tab.type-news.active     { background: #0ea5e9; color: #fff; }
.pi-tab.type-aio.active      { background: #f59e0b; color: #fff; }
.pi-tab.type-projectx.active { background: #8b5cf6; color: #fff; }
.dark .pi-tab { background: #1e293b; color: #94a3b8; }
.dark .pi-tab:hover { background: #334155; color: #e2e8f0; }

/* Blog type badges */
.blog-badge {
  display: inline-block; padding: 0.15rem 0.5rem;
  border-radius: 999px; font-size: 0.625rem; font-weight: 700;
}
.badge-all      { background: #e0e7ff; color: #3730a3; }
.badge-event    { background: #ffedd5; color: #c2410c; }
.badge-visit    { background: #fce7f3; color: #9d174d; }
.badge-pr       { background: #d1fae5; color: #065f46; }
.badge-news     { background: #e0f2fe; color: #0369a1; }
.badge-aio      { background: #fef3c7; color: #92400e; }
.badge-projectx { background: #ede9fe; color: #7c3aed; }
.badge-article  { background: #ede9fe; color: #7c3aed; }

/* Blog card */
.blog-card {
  background: white; border-radius: 1rem; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex; flex-direction: column;
  border: 1px solid #f1f5f9;
}
.blog-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.dark .blog-card { background: #1e293b; border-color: #334155; }
.blog-card-img {
  width: 100%; aspect-ratio: 16/9; object-fit: cover;
  background: #f1f5f9;
}
.dark .blog-card-img { background: #334155; }
.blog-card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }
.blog-card-title {
  font-size: 0.9375rem; font-weight: 800; color: #1e293b;
  line-height: 1.4; margin-bottom: 0.5rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dark .blog-card-title { color: #e2e8f0; }
.blog-card-desc {
  font-size: 0.8125rem; color: #64748b; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  flex: 1;
}
.blog-card-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 0.875rem; font-size: 0.6875rem; color: #94a3b8; font-weight: 600;
}

/* Pin card */
.pin-card {
  background: white; border-radius: 1.25rem; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border: 1px solid #f1f5f9;
  display: flex; flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
.pin-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}
.dark .pin-card { background: #1e293b; border-color: #334155; }
.pin-card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #f1f5f9; }
.dark .pin-card-img { background: #334155; }
.pin-card-body { padding: 1.125rem; flex: 1; display: flex; flex-direction: column; }
.pin-card-title {
  font-size: 1.0625rem; font-weight: 800; color: #1e293b; line-height: 1.35;
  margin-bottom: 0.5rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dark .pin-card-title { color: #e2e8f0; }
.pin-card-desc {
  font-size: 0.8125rem; color: #64748b; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  flex: 1;
}

/* Avatar stack */
.avatar-stack { display: flex; align-items: center; }
.avatar-item {
  width: 22px; height: 22px; min-width: 22px; border-radius: 50%;
  border: 2px solid white; margin-left: -6px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.55rem;
  overflow: hidden; flex-shrink: 0;
}
.avatar-item img {
  width: 22px; height: 22px; min-width: 22px;
  border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.avatar-item:first-child { margin-left: 0; }
.dark .avatar-item { border-color: #1e293b; }
.avatar-more {
  width: 22px; height: 22px; border-radius: 50%;
  background: #e2e8f0; color: #475569;
  font-size: 0.5rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin-left: -6px; border: 2px solid white; flex-shrink: 0;
}
.dark .avatar-more { background: #334155; color: #94a3b8; border-color: #1e293b; }

/* Share buttons */
.share-btn {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.25rem 0.625rem; border-radius: 999px;
  font-size: 0.625rem; font-weight: 700; cursor: pointer;
  border: 1px solid transparent; transition: opacity 0.15s;
  text-decoration: none;
}
.share-btn:hover { opacity: 0.8; }
.share-fb   { background: #1877F2; color: white; }
.share-x    { background: #000; color: white; }
.share-line { background: #06C755; color: white; }

/* Blog detail */
.blog-detail-body { font-size: 0.9375rem; line-height: 1.85; color: #374151; }
.dark .blog-detail-body { color: #cbd5e1; }
.blog-detail-body p { margin-bottom: 1rem; }
.blog-detail-body img { max-width: 100%; border-radius: 0.75rem; }
.blog-detail-body h2 { font-size: 1.25rem; font-weight: 800; margin: 1.5rem 0 0.75rem; color: #1e293b; }
.dark .blog-detail-body h2 { color: #e2e8f0; }
.blog-detail-body a { color: #2563eb; text-decoration: underline; }
.blog-detail-body b, .blog-detail-body strong { font-weight: 800; color: #111827; }
.dark .blog-detail-body b, .dark .blog-detail-body strong { color: #f8fafc; }
.blog-detail-body h1, .blog-detail-body h2, .blog-detail-body h3,
.blog-detail-body h4, .blog-detail-body h5, .blog-detail-body h6 {
  font-weight: 800; color: #1e293b; margin: 1.5rem 0 0.75rem; line-height: 1.35;
}
.dark .blog-detail-body h1, .dark .blog-detail-body h2, .dark .blog-detail-body h3,
.dark .blog-detail-body h4, .dark .blog-detail-body h5, .dark .blog-detail-body h6 {
  color: #f1f5f9;
}
.blog-detail-body ul, .blog-detail-body ol { padding-left: 1.5rem; margin: 1rem 0; list-style: revert; }
.blog-detail-body li { margin: 0.35rem 0; }
.blog-detail-body blockquote { border-left: 4px solid #e2e8f0; padding-left: 1rem; color: #64748b; font-style: italic; }
.dark .blog-detail-body blockquote { border-color: #334155; color: #94a3b8; }

/* Stock pill */
.stock-pill {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.3rem 0.75rem; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 700; cursor: pointer;
  transition: opacity 0.15s; text-decoration: none;
}
.stock-pill:hover { opacity: 0.85; }

/* Recent sidebar */
.recent-item {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.75rem 0;
}
.recent-item + .recent-item { border-top: 1px solid #f1f5f9; }
.dark .recent-item + .recent-item { border-color: #334155; }
.recent-thumb {
  width: 64px; height: 48px; border-radius: 0.5rem;
  object-fit: cover; flex-shrink: 0; background: #f1f5f9;
}
.dark .recent-thumb { background: #334155; }

/* Comments */
.cmt-item { padding: 1rem 0; }
.cmt-item + .cmt-item { border-top: 1px solid #f1f5f9; }
.dark .cmt-item + .cmt-item { border-color: #334155; }
.cmt-reply { margin-left: 2.5rem; margin-top: 0.5rem; }
.cmt-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #e0e7ff; color: #4338ca;
  font-size: 0.8125rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  overflow: hidden;
}
.cmt-reply .cmt-avatar { width: 28px; height: 28px; font-size: 0.6875rem; }

/* View toggle */
.view-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 0.5rem;
  border: 1px solid #e2e8f0; background: white; color: #94a3b8;
  cursor: pointer; transition: all 0.15s;
}
.view-toggle.active { background: #2563eb; border-color: #2563eb; color: white; }
.dark .view-toggle { background: #1e293b; border-color: #334155; color: #64748b; }
.dark .view-toggle.active { background: #2563eb; border-color: #2563eb; color: white; }

/* Pagination */
.pg-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 0.5rem;
  font-size: 0.8125rem; font-weight: 700; cursor: pointer;
  border: 1px solid #e2e8f0; background: white; color: #374151;
  transition: background 0.15s;
}
.pg-btn:hover { background: #f1f5f9; }
.pg-btn.active { background: #2563eb; color: white; border-color: #2563eb; }
.dark .pg-btn { background: #1e293b; border-color: #334155; color: #cbd5e1; }
.dark .pg-btn:hover { background: #334155; }

/* Admin hide button */
.admin-hide-btn { transition: color 0.15s, border-color 0.15s; }

/* Comment modal animation */
#modal-comment > div {
  animation: slideUp 0.2s ease-out;
}
@keyframes slideUp {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
