/* ========================================
   Blog-specific styles — extends style.css
   ======================================== */

/* ---- Blog Layout ---- */
.blog-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 2rem;
}
.blog-page-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* ---- Article Hero ---- */
.article-hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}
.article-hero .meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.article-hero .meta .chip { font-size: 0.72rem; }
.article-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1rem;
}
.article-hero .excerpt {
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 680px;
  margin-bottom: 1.25rem;
}
.article-hero .author-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-2);
}
.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-grd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* ---- Article Body ---- */
.article-body {
  font-size: 1rem;
  line-height: 1.85;
  color: var(--text);
}
.article-body h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 2.5rem 0 1rem;
  color: var(--text);
  scroll-margin-top: 80px;
}
.article-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.75rem 0 0.75rem;
  color: var(--text);
}
.article-body p { margin-bottom: 1.1rem; color: var(--text-2); }
.article-body ul, .article-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-2);
}
.article-body li { margin-bottom: 0.4rem; }
.article-body strong { color: var(--text); }
.article-body a { color: var(--accent); }
.article-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 0.75rem 1.25rem;
  background: hsla(213,100%,60%,0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
  color: var(--text-2);
  font-style: italic;
}

/* ---- TOC ---- */
.toc {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  backdrop-filter: blur(12px);
}
.toc-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 0.75rem;
}
.toc ol {
  padding-left: 1.25rem;
  color: var(--text-2);
  font-size: 0.88rem;
  line-height: 2;
}
.toc ol li a { color: var(--accent); }
.toc ol li a:hover { text-decoration: underline; }

/* ---- Tool CTA Banner ---- */
.tool-cta {
  background: linear-gradient(135deg, hsla(213,100%,60%,0.12), hsla(265,90%,65%,0.12));
  border: 1px solid hsla(213,100%,60%,0.25);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin: 2.5rem 0;
  backdrop-filter: blur(12px);
}
.tool-cta h3 { font-size: 1.25rem; font-weight: 800; margin-bottom: 0.5rem; }
.tool-cta p  { color: var(--text-2); font-size: 0.9rem; margin-bottom: 1.25rem; }

/* ---- Comparison Table ---- */
.comp-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; overflow: hidden; border-radius: var(--radius); }
.comp-table th {
  background: var(--bg-3);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.comp-table td {
  padding: 0.85rem 1rem;
  font-size: 0.87rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  vertical-align: top;
}
.comp-table tr:last-child td { border-bottom:none; }
.comp-table tr:hover td { background: hsla(213,100%,60%,0.04); }
.comp-table .highlight td { background: hsla(213,100%,60%,0.07); }
.comp-table .check { color: var(--success); font-size: 1rem; }
.comp-table .cross  { color: var(--danger);  font-size: 1rem; }

/* ---- Rating Stars ---- */
.stars { color: hsl(38,100%,60%); letter-spacing:0.05em; }

/* ---- Blog Card (for index) ---- */
.blog-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: var(--trans);
  text-decoration: none;
  color: var(--text);
}
.blog-card:hover {
  border-color: var(--border-h);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  color: var(--text);
}
.blog-card .bc-cat {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
}
.blog-card .bc-title { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.blog-card .bc-excerpt { font-size: 0.83rem; color: var(--text-2); line-height: 1.55; }
.blog-card .bc-meta { font-size: 0.75rem; color: var(--text-3); margin-top:auto; }

/* ---- Sidebar ---- */
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}
.sidebar .panel { margin-bottom: 1.25rem; }
.sidebar h4 { font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 1rem; }
.sidebar ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.sidebar ul li a { font-size: 0.85rem; color: var(--text-2); transition: var(--trans); display: flex; gap:0.5rem; align-items:baseline; }
.sidebar ul li a:hover { color: var(--accent); }
.sidebar ul li a::before { content: '→'; font-size:0.75rem; color: var(--text-3); flex-shrink:0; }

/* ---- Related Posts ---- */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

/* ---- Progress reading bar ---- */
#reading-progress {
  position: fixed;
  top: 64px;
  left: 0;
  height: 3px;
  background: var(--accent-grd);
  z-index: 200;
  width: 0%;
  transition: width 0.1s linear;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .blog-layout { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
}
@media (max-width: 600px) {
  .blog-page { padding: 1.25rem; }
  .sidebar { grid-template-columns: 1fr; }
}
