/* ========================================
   Blog Styles - Modern & Clean Design
   ======================================== */

/* --- Blog Index Page --- */
.blog-index-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #f0f0f0;
}

.blog-index-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.blog-index-header .blog-stats {
  color: #888;
  font-size: 0.95rem;
}

/* Year Section */
.blog-year-section {
  margin-bottom: 2.5rem;
}

.blog-year-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #eaeaea;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-year-title .year-count {
  font-size: 0.85rem;
  font-weight: 400;
  color: #999;
}

/* Blog Entry Card */
.blog-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-entry {
  display: block;
  padding: 1rem 1.2rem;
  margin-bottom: 0.6rem;
  border-radius: 8px;
  border: 1px solid #f0f0f0;
  transition: all 0.2s ease;
  background: #fff;
}

.blog-entry:hover {
  border-color: #d0d7de;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.blog-entry-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.blog-entry-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1a1a2e;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.blog-entry-link:hover .blog-entry-title {
  color: #0366d6;
}

.blog-entry-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.blog-entry-date {
  font-size: 0.85rem;
  color: #666;
}

.blog-entry-lang {
  font-size: 0.75rem;
  color: #888;
  background: #f6f8fa;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Tags */
.blog-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.blog-tag {
  font-size: 0.75rem;
  color: #586069;
  background: #f1f3f5;
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid #e1e4e8;
  transition: all 0.15s ease;
}

.blog-entry:hover .blog-tag {
  background: #e8f0fe;
  border-color: #c8daf5;
  color: #0366d6;
}

/* Sidebar Topics */
.blog-topics-section {
  margin-top: 1rem;
}

.blog-topics-section strong {
  display: block;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  color: #333;
}

.blog-topic-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  font-size: 0.85rem;
  color: #586069;
  border-bottom: 1px solid #f5f5f5;
}

.blog-topic-item:last-child {
  border-bottom: none;
}

.blog-topic-count {
  background: #f1f3f5;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  color: #888;
}

/* --- Blog Post Page --- */
.blog-post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eaeaea;
}

.blog-post-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a2e;
  margin-bottom: 0.6rem;
}

.blog-post-meta {
  color: #666;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.blog-post-meta .meta-date {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.blog-post-meta .meta-topic {
  background: #f1f3f5;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  color: #586069;
}

/* Blog Content */
.blog-content {
  line-height: 1.8;
  font-size: 1rem;
  color: #333;
}

.blog-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #eaeaea;
  color: #1a1a2e;
}

.blog-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
  color: #24292e;
}

.blog-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.6rem;
  color: #333;
}

.blog-content p {
  margin-bottom: 1.2rem;
  text-align: justify;
}

.blog-content ul,
.blog-content ol {
  margin-bottom: 1.2rem;
  padding-left: 1.5rem;
}

.blog-content li {
  margin-bottom: 0.4rem;
  line-height: 1.7;
}

/* Code Blocks */
.blog-content pre {
  background: #f6f8fa;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.88rem;
  line-height: 1.6;
}

.blog-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
}

.blog-content code {
  background: #f0f2f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88em;
  color: #d63384;
}

/* Figures & Images */
.blog-content figure {
  margin: 2rem 0;
  text-align: center;
}

.blog-content figure img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.blog-content figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: #666;
  font-style: italic;
}

/* Blockquote */
.blog-content blockquote {
  border-left: 4px solid #0366d6;
  margin: 1.5rem 0;
  padding: 0.8rem 1.2rem;
  background: #f8f9ff;
  border-radius: 0 6px 6px 0;
  color: #444;
}

.blog-content blockquote p:last-child {
  margin-bottom: 0;
}

/* Tables */
.blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}

.blog-content table th,
.blog-content table td {
  padding: 0.6rem 1rem;
  border: 1px solid #e1e4e8;
  text-align: left;
}

.blog-content table th {
  background: #f6f8fa;
  font-weight: 600;
}

.blog-content table tr:hover {
  background: #f8fafe;
}

/* TOC Sidebar */
#toc {
  padding: 0.8rem 0;
}

#toc strong {
  font-size: 0.9rem;
  color: #333;
  display: block;
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #eaeaea;
}

#toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#toc li {
  padding: 0.25rem 0;
  line-height: 1.4;
}

#toc a {
  text-decoration: none;
  font-size: 0.82rem;
  color: #586069;
  transition: color 0.15s ease;
  display: block;
  padding: 2px 0;
}

#toc a:hover {
  color: #0366d6;
}

/* Reference Section */
.blog-content .reference-section {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eaeaea;
}

/* Contact Section */
.blog-content .contact-section {
  margin-top: 2rem;
  padding: 1rem 1.2rem;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #555;
}

/* Responsive */
@media (max-width: 768px) {
  .blog-entry {
    padding: 0.8rem 1rem;
  }

  .blog-entry-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .blog-post-header h1 {
    font-size: 1.5rem;
  }

  .blog-content pre {
    font-size: 0.82rem;
    padding: 0.8rem;
  }
}
