/* ==========================================================================
   Typography Hierarchy & Readability Overhaul
   Modern CJK Web Typography Standards (Tailwind Typography / GitHub Markdown)
   ========================================================================== */

/* 1. Single Article Main Title & Custom Page Main Title */
h1.article-title-regular,
.article-title h1,
.article-title-regular,
.article-title,
.page-template-content > h1:first-child {
  font-size: 1.95rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  letter-spacing: -0.015em !important;
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

.page-template-content > h1:first-child {
  margin-top: 0.5rem !important;
  margin-bottom: 1.6rem !important;
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

@media (max-width: 768px) {
  h1.article-title-regular,
  .article-title h1,
  .article-title-regular,
  .article-title,
  .page-template-content > h1:first-child {
    font-size: 1.5rem !important;
    line-height: 1.35 !important;
  }
}

/* 2. In-Article & Custom Page Headings Proportional Scale */
.article-content h1:not(.not-markdown),
.page-template-content h1:not(.not-markdown):not(:first-child) {
  font-size: 1.7rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  letter-spacing: -0.015em !important;
  margin-top: 1.8rem !important;
  margin-bottom: 0.8rem !important;
  padding-bottom: 0.35rem !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.article-content h2:not(.not-markdown),
.page-template-content h2:not(.not-markdown) {
  font-size: 1.45rem !important;
  font-weight: 650 !important;
  line-height: 1.4 !important;
  letter-spacing: -0.015em !important;
  margin-top: 1.6rem !important;
  margin-bottom: 0.75rem !important;
  padding-bottom: 0.3rem !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.article-content h3:not(.not-markdown),
.page-template-content h3:not(.not-markdown) {
  font-size: 1.25rem !important;
  font-weight: 600 !important;
  line-height: 1.45 !important;
  letter-spacing: -0.01em !important;
  margin-top: 1.4rem !important;
  margin-bottom: 0.65rem !important;
  border-bottom: none !important;
}

.article-content h4:not(.not-markdown),
.page-template-content h4:not(.not-markdown) {
  font-size: 1.12rem !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  margin-top: 1.2rem !important;
  margin-bottom: 0.5rem !important;
  border-bottom: none !important;
}

.article-content h5:not(.not-markdown),
.page-template-content h5:not(.not-markdown) {
  font-size: 1.02rem !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  margin-top: 1rem !important;
  margin-bottom: 0.5rem !important;
}

.article-content h6:not(.not-markdown),
.page-template-content h6:not(.not-markdown) {
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  margin-top: 0.9rem !important;
  margin-bottom: 0.5rem !important;
}

@media (max-width: 768px) {
  .article-content h1:not(.not-markdown),
  .page-template-content h1:not(.not-markdown):not(:first-child) { font-size: 1.45rem !important; }
  .article-content h2:not(.not-markdown),
  .page-template-content h2:not(.not-markdown) { font-size: 1.3rem !important; }
  .article-content h3:not(.not-markdown),
  .page-template-content h3:not(.not-markdown) { font-size: 1.18rem !important; }
  .article-content h4:not(.not-markdown),
  .page-template-content h4:not(.not-markdown) { font-size: 1.05rem !important; }
}

/* 3. Body Text & Paragraph Spacing for CJK Reading */
.article-content p,
.page-template-content p {
  font-size: 1rem !important;
  line-height: 1.75 !important;
  margin-top: 0.8rem !important;
  margin-bottom: 1.1rem !important;
  letter-spacing: 0.01em !important;
}

.article-content li,
.page-template-content li {
  font-size: 1rem !important;
  line-height: 1.75 !important;
}

.article-content blockquote,
.page-template-content blockquote {
  font-size: 0.98rem !important;
  line-height: 1.75 !important;
  margin: 1.2rem 0 !important;
  padding: 0.6rem 1.2rem !important;
}

.article-content blockquote p,
.page-template-content blockquote p {
  margin: 0.4rem 0 !important;
  line-height: 1.7 !important;
}

/* 4. Home Page Article Card Hierarchy (Fix Title vs Excerpt Headings) */
.home-article-title,
.home-article-title a {
  font-size: 1.48rem !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  color: var(--second-text-color) !important;
}

@media (max-width: 768px) {
  .home-article-title,
  .home-article-title a {
    font-size: 1.25rem !important;
  }
}

/* Subdue any headings inside excerpt on home page so they don't fight card title */
.home-article-content h1,
.home-article-content h2,
.home-article-content h3,
.home-article-content h4,
.home-article-content h5,
.home-article-content h6 {
  font-size: 1.05rem !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  border-bottom: none !important;
  margin: 0.6rem 0 0.35rem 0 !important;
  padding: 0 !important;
  color: var(--default-text-color) !important;
  opacity: 0.92 !important;
}

.home-article-content p {
  font-size: 0.95rem !important;
  line-height: 1.65 !important;
  color: var(--default-text-color) !important;
  margin: 0.5rem 0 !important;
}

/* 5. Archives & Tag Timeline Item Sizing */
.archive-item-header .archive-year {
  font-size: 1.45rem !important;
  font-weight: 600 !important;
}

.archive-item-header .archive-year-post-count {
  font-size: 0.78rem !important;
  padding: 1px 8px !important;
}

.article-list {
  font-size: 1rem !important;
}

.article-list .article-item {
  font-size: 1rem !important;
  padding-top: 1.5rem !important;
  padding-bottom: 0.4rem !important;
}

.article-list .article-item::before {
  font-size: 0.85rem !important;
}

/* Archive & Tag Detail Article Titles */
.article-list .article-title,
.archive-list-container span.article-title {
  font-size: 1.05rem !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
  letter-spacing: 0 !important;
  margin: 0 !important;
  display: inline-block !important;
}

/* 6. Tags & Categories Page Headers & Chips */
.page-template-container .page-title-header {
  font-size: 1.6rem !important;
  margin-bottom: 1.2rem !important;
  font-weight: 600 !important;
}

.tag-name {
  font-size: 1.3rem !important;
  margin-bottom: 1rem !important;
}

.tagcloud-content .tag-list li a,
.tag-list li a {
  font-size: 0.92rem !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
}

/* ==========================================================================
   Mermaid Diagram Dark Theme Styling
   ========================================================================== */
pre.mermaid,
.mermaid {
  background-color: #1e1e24 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 10px !important;
  padding: 20px 14px !important;
  margin: 1.6rem 0 !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
  display: flex !important;
  justify-content: center !important;
  overflow-x: auto !important;
}

.mermaid text,
.mermaid .label,
.mermaid .edgeLabel,
.mermaid .node text {
  font-family: inherit !important;
}

/* ==========================================================================
   About Page Profile Card Component
   ========================================================================== */
.about-profile-card {
  max-width: 440px;
  margin: 1rem auto 2.5rem auto;
  padding: 1.8rem 1.5rem 1.4rem 1.5rem;
  background-color: var(--second-background-color);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  box-shadow: var(--redefine-box-shadow-flat);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-profile-card:hover {
  box-shadow: var(--redefine-box-shadow);
  transform: translateY(-2px);
}

.about-avatar-container {
  display: flex;
  justify-content: center;
  margin-bottom: 0.8rem;
}

.about-avatar-img {
  width: 90px !important;
  height: 90px !important;
  border-radius: 20px !important;
  object-fit: cover !important;
  border: 2px solid var(--border-color) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  transition: transform 0.3s ease !important;
}

.about-avatar-img:hover {
  transform: scale(1.06) rotate(1deg) !important;
}

.about-author-name {
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: var(--second-text-color) !important;
  margin: 0.2rem 0 !important;
  border-bottom: none !important;
  padding: 0 !important;
}

.about-author-level {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--third-text-color);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 1px 9px;
  border-radius: 12px;
  margin-top: 0.2rem;
  margin-bottom: 0.6rem;
}

.about-stats-grid {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.about-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none !important;
  padding: 0.4rem 1rem;
  border-radius: 10px;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.about-stat-box:hover {
  background-color: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}

.about-stat-box .stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--second-text-color);
  line-height: 1.2;
}

.about-stat-box .stat-name {
  font-size: 0.82rem;
  color: var(--third-text-color);
  margin-top: 0.25rem;
}

