/* ============================================================
   BLOG-POST.CSS — Professional Article / Post Layout
   ============================================================ */

/* ── Reading Progress Bar ── */
#reading-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--accent-blue), #38bdf8);
  z-index: 10000;
  transition: width 0.08s linear;
  border-radius: 0 2px 2px 0;
}

/* ── Back link ── */
.post-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: none;
  padding: 2rem 0 0;
}
.post-back:hover { color: var(--accent-blue); text-decoration: none; }
.post-back svg { width: 15px; height: 15px; }

/* ── Article Header ── */
.article-header {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 2rem 2.5rem;
}

.article-kicker {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.article-category {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
}

.article-date,
.article-read-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-divider {
  display: inline-block;
  width: 2px;
  height: 12px;
  background: var(--border-strong);
  border-radius: 1px;
  vertical-align: middle;
}

/* ── Inline view count in kicker ── */
.article-views {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.article-views svg { width: 13px; height: 13px; flex-shrink: 0; }

.article-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--text-heading);
  line-height: 1.18;
  letter-spacing: -0.025em;
  margin-bottom: 1.25rem;
}

.article-subtitle {
  font-size: 1.12rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.article-tags-line {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.article-byline {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.article-byline-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-blue-soft);
  flex-shrink: 0;
}

.article-byline-name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-heading);
}

.article-byline-role {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

.article-byline-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Cover Image ── */
.article-cover {
  max-width: 900px;
  margin: 0 auto 0;
  padding: 0 2rem;
}

.article-cover img {
  width: 100%;
  height: 420px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 20px 60px var(--shadow-color);
  display: block;
}

.article-cover-full img {
  height: auto;
  max-height: 760px;
  object-fit: contain;
  background: var(--bg-secondary);
}

.article-cover figcaption {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  font-style: italic;
}

/* ── Article Layout: 2-col content + TOC ── */
.article-layout {
  max-width: 1120px;
  margin: 3.5rem auto 5rem;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 248px;
  gap: 4rem;
  align-items: start;
}

/* ── Share Bar ── */
.share-bar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 2.5rem;
  padding: 0.8rem 1.1rem;
  background: var(--bg-secondary);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.share-bar-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-right: 0.2rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.33rem 0.82rem;
  border-radius: 6px;
  font-size: 0.775rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  font-family: inherit;
}

.share-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  text-decoration: none;
}

.share-btn svg { width: 13px; height: 13px; flex-shrink: 0; }

/* ── Post Content Typography ── */
.post-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-primary);
}

.post-content p { margin-bottom: 1.5rem; }

.post-content h2 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-heading);
  margin: 3rem 0 1rem;
  letter-spacing: -0.015em;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--accent-blue-soft);
}

.post-content h3 {
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--text-heading);
  margin: 2.25rem 0 0.75rem;
}

.post-content h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 1.75rem 0 0.5rem;
}

.post-content ul,
.post-content ol { padding-left: 1.75rem; margin-bottom: 1.5rem; }
.post-content ul  { list-style: disc; }
.post-content ol  { list-style: decimal; }
.post-content li  { margin-bottom: 0.5rem; line-height: 1.75; }

.post-content a {
  color: var(--accent-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
.post-content a:hover { text-decoration-thickness: 2px; }

/* ── Blockquote ── */
.post-content blockquote {
  position: relative;
  margin: 2.5rem 0;
  padding: 1.25rem 1.75rem 1.25rem 2.25rem;
  background: var(--accent-blue-soft);
  border-left: 4px solid var(--accent-blue);
  border-radius: 0 12px 12px 0;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

.post-content blockquote::before {
  content: '\201C';
  position: absolute;
  top: -0.5rem;
  left: 0.6rem;
  font-size: 4.5rem;
  color: var(--accent-blue);
  opacity: 0.2;
  line-height: 1;
  font-style: normal;
}

/* ── Pull Quote ── */
.pull-quote {
  margin: 3rem -1rem;
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-heading);
  border-top: 3px solid var(--accent-blue);
  border-bottom: 3px solid var(--accent-blue);
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* ── Code ── */
.post-content code {
  background: var(--bg-code);
  padding: 0.15rem 0.42rem;
  border-radius: 5px;
  font-size: 0.87rem;
  font-family: 'Fira Code', 'Cascadia Code', ui-monospace, monospace;
  color: var(--accent-blue);
  border: 1px solid var(--border-color);
}

.post-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.75rem 0;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 0.875rem;
}

/* ── Figures ── */
.post-content figure { margin: 2.5rem 0; }
.post-content figure img {
  width: 100%;
  height: auto;
  max-height: 760px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 8px 32px var(--shadow-color);
  display: block;
  background: var(--bg-secondary);
}
.post-content figcaption {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  font-style: italic;
}

/* ── Info / Note Box ── */
.info-box {
  background: var(--accent-blue-soft);
  border: 1px solid var(--accent-blue-light);
  border-radius: 10px;
  padding: 1.1rem 1.4rem;
  margin: 1.75rem 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
.info-box strong { color: var(--accent-blue); }

/* ── Article Tags Section ── */
.article-tags-section {
  margin: 1.5rem 0 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.article-tags-section-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}

/* ── Author Card (expanded) ── */
.author-card {
  margin-top: 2.5rem;
  padding: 1.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  display: flex;
  gap: 1.5rem;
}

.author-card-photo {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--accent-blue-soft);
}

.author-card-info { flex: 1; min-width: 0; }

.author-card-label {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.author-card-name {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 0.15rem;
}

.author-card-title {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.author-card-bio {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 0.875rem;
}

.author-card-links {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.author-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.28rem 0.68rem;
  border-radius: 6px;
  font-size: 0.73rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.author-card-link:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  text-decoration: none;
}

.author-card-link svg { width: 12px; height: 12px; flex-shrink: 0; }

/* ── TOC Sidebar ── */
.article-toc {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.toc-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.15rem;
}

.toc-title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

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

.toc-item a {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.28rem 0.55rem;
  border-radius: 5px;
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: all 0.15s;
}

.toc-item a:hover,
.toc-item a.toc-active {
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  border-left-color: var(--accent-blue);
  text-decoration: none;
}

.toc-item.toc-h3 a {
  padding-left: 1.2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Responsive ── */
@media (max-width: 920px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .article-toc { display: none; }
}

@media (max-width: 640px) {
  .article-header { padding: 1.25rem 1.25rem 1.75rem; }
  .article-cover  { padding: 0 1.25rem; }
  .article-cover img { height: 240px; }
  .article-cover-full img {
    height: auto;
    max-height: none;
  }
  .article-layout { padding: 0 1.25rem; margin-top: 2rem; }
  .pull-quote { margin: 2rem -0.25rem; font-size: 1.1rem; }
  .author-card { flex-direction: column; align-items: center; text-align: center; }
  .author-card-links { justify-content: center; }
}
