/* =========================================================================
   Single Blog Post Page — Premium Extension Styles for Null Bugs
   Built on top of style.css design tokens
   ========================================================================= */

/* -------- Top Reading Progress Bar -------- */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary), var(--accent-sky));
  width: 0%;
  z-index: 1000;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* -------- Post Header & Meta -------- */
.post-header {
  padding: 8.5rem 0 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  transition: var(--transition-normal);
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.back-link i {
  font-size: 1.2rem;
  color: var(--accent);
  transition: var(--transition-fast);
}

.back-link:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(-3px);
  border-color: rgba(0, 211, 148, 0.3);
}

.post-tag {
  display: inline-block;
  color: #fff !important;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 1.2rem;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary)) !important;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.post-title {
  font-size: clamp(2.2rem, 4.5vw, 3.4rem);
  margin: 0.8rem 0 1.2rem;
  line-height: 1.18;
  color: var(--text-main);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.post-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.post-meta .meta-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.post-meta .meta-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.post-meta .meta-name {
  font-weight: 700;
  color: var(--text-main);
}

.post-meta .meta-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* -------- Post Hero Cover -------- */
.post-cover {
  height: 380px;
  border-radius: var(--radius-xl);
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 6rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

.post-cover-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.post-cover .cover-shimmer {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.12) 0%, transparent 70%);
  animation: shimmer 10s infinite linear;
  z-index: 1;
}

.post-cover i {
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.5));
}

@keyframes shimmer {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* -------- Post Two-Column Layout -------- */
.post-layout {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 3rem;
  align-items: start;
  position: relative;
}

/* -------- Sticky Table of Contents Sidebar -------- */
.post-toc-sidebar {
  position: sticky;
  top: 100px;
}

.toc-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.toc-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.toc-header i {
  color: var(--accent);
  font-size: 1.3rem;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toc-link {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition: var(--transition-fast);
  line-height: 1.4;
}

.toc-link:hover {
  color: var(--accent);
  background: rgba(0, 211, 148, 0.06);
}

.toc-link.active {
  color: var(--accent-secondary);
  font-weight: 700;
  background: rgba(0, 211, 148, 0.1);
  border-left-color: var(--accent);
}

.toc-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 1.2rem 0;
}

.toc-share {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.toc-share span {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.share-buttons {
  display: flex;
  gap: 0.5rem;
}

.share-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.share-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* -------- Main Article Typography & Elements -------- */
.post-body-wrap {
  min-width: 0;
}

.post-body-wrap .lead {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.8;
  padding: 1.5rem 1.8rem;
  background: linear-gradient(135deg, rgba(0, 211, 148, 0.06), rgba(5, 150, 105, 0.06));
  border-radius: var(--radius-md);
  border-left: 4px solid var(--accent);
  margin-bottom: 2rem;
}

.post-body-wrap h2 {
  font-size: 1.8rem;
  margin: 2.5rem 0 1rem;
  color: var(--text-main);
  scroll-margin-top: 100px;
}

.post-body-wrap h3 {
  font-size: 1.4rem;
  margin: 2rem 0 0.8rem;
}

.post-body-wrap p {
  font-size: 1.08rem;
  line-height: 1.85;
  color: var(--text-main);
  margin-bottom: 1.6rem;
}

.post-body-wrap ul,
.post-body-wrap ol {
  margin-bottom: 1.8rem;
  padding-left: 1.5rem;
}

.post-body-wrap li {
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 0.6rem;
  color: var(--text-main);
}

/* Callout Box */
.blog-callout {
  display: flex;
  gap: 1.2rem;
  padding: 1.5rem 1.8rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 211, 148, 0.25);
  border-radius: var(--radius-md);
  margin: 2rem 0;
  box-shadow: 0 4px 20px rgba(0, 211, 148, 0.05);
}

.blog-callout i {
  font-size: 1.8rem;
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.blog-callout div {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-main);
}

/* Quote Box */
.blog-quote {
  margin: 2.5rem 0;
  padding: 1.8rem 2.2rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.4));
  backdrop-filter: blur(16px);
  border-radius: var(--radius-lg);
  border-left: 5px solid var(--accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.blog-quote p {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  font-style: italic;
  color: var(--text-main);
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

.blog-quote cite {
  font-size: 0.95rem;
  font-style: normal;
  font-weight: 700;
  color: var(--accent-secondary);
}

/* Code Formatting */
.post-body-wrap code {
  font-family: 'Fira Code', 'Courier New', monospace;
  background: rgba(0, 211, 148, 0.08);
  color: var(--accent-secondary);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-body-wrap pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 1.5rem 1.8rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 2rem 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.post-body-wrap pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: 0.92rem;
  line-height: 1.6;
}

/* -------- Author Profile Bio Card -------- */
.author-bio-card {
  margin-top: 3.5rem;
  padding: 2rem 2.2rem;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  display: flex;
  gap: 1.5rem;
  align-items: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.03);
}

.author-bio-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 20px var(--accent-glow);
}

.author-bio-details h3 {
  font-size: 1.2rem;
  margin: 0 0 0.2rem;
}

.author-bio-details .author-role {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-secondary);
  margin-bottom: 0.5rem;
}

.author-bio-details .author-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.6;
}

/* -------- Article Consultation CTA -------- */
.article-cta-box {
  margin-top: 2.5rem;
  padding: 3rem 2.5rem;
  background: linear-gradient(135deg, rgba(0, 211, 148, 0.1), rgba(5, 150, 105, 0.15));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 211, 148, 0.3);
  border-radius: var(--radius-xl);
  text-align: center;
}

.article-cta-box .cta-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3rem 1rem;
  border-radius: 50px;
  margin-bottom: 1rem;
}

.article-cta-box h3 {
  font-size: 1.8rem;
  margin-bottom: 0.8rem;
}

.article-cta-box p {
  max-width: 600px;
  margin: 0 auto 1.8rem;
  color: var(--text-muted);
}

/* -------- Sequential Article Navigation (Previous / Next) -------- */
.post-nav-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 4rem;
  margin-bottom: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.post-nav-card {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  padding: 1.2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-decoration: none;
  transition: var(--transition-normal);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.post-nav-card.empty {
  visibility: hidden;
  pointer-events: none;
}

.post-nav-card.prev {
  align-items: flex-start;
  text-align: left;
}

.post-nav-card.next {
  align-items: flex-end;
  text-align: right;
}

.post-nav-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 211, 148, 0.3);
  box-shadow: 0 8px 25px rgba(0, 211, 148, 0.08);
}

.nav-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-secondary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
}

@media (max-width: 600px) {
  .post-nav-bar {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .post-nav-card.empty {
    display: none;
  }
}

/* -------- Related Articles Section -------- */
.related-posts-section {
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */
@media (max-width: 992px) {
  .post-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .post-toc-sidebar {
    position: relative;
    top: 0;
  }

  .post-cover {
    height: 280px;
    font-size: 4rem;
  }

  .post-header {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .post-header {
    padding-top: 7rem;
    max-width: 100%;
  }

  .post-title {
    font-size: clamp(1.8rem, 6vw, 2.4rem);
  }

  .post-cover {
    height: 220px;
    font-size: 3.5rem;
    border-radius: var(--radius-lg);
  }

  .post-body-wrap {
    min-width: 0;
    overflow-x: hidden;
  }

  .post-body-wrap pre,
  .post-body-wrap code {
    font-size: 0.82rem;
    white-space: pre-wrap;
    word-break: break-word;
  }

  .author-bio-card {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem 1.2rem;
  }

  .author-bio-avatar {
    margin: 0 auto;
  }

  .article-cta-box {
    padding: 2rem 1.5rem;
  }

  .article-cta-box h3 {
    font-size: 1.5rem;
  }

  .related-posts-grid {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .post-header {
    padding-top: 6rem;
  }

  .post-title {
    font-size: 1.65rem;
    letter-spacing: -0.01em;
  }

  .post-cover {
    height: 180px;
    font-size: 2.8rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
  }

  .back-link {
    font-size: 0.82rem;
    padding: 0.35rem 0.7rem;
  }

  .toc-card {
    padding: 1.1rem;
  }

  .article-cta-box {
    padding: 1.6rem 1.1rem;
  }

  .author-bio-card {
    padding: 1.2rem 1rem;
  }

  .post-body-wrap h2 {
    font-size: 1.35rem;
  }

  .post-body-wrap h3 {
    font-size: 1.1rem;
  }
}