
.single-post-page {
  padding: 20px 0 60px 0;
  background: #f7f9fd;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Two-column layout: content + ToC */
.post-layout {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.post-content {
  flex: 1;
  min-width: 0;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.1);
  padding: 40px;
  margin-bottom: 40px;
  overflow: visible;
}

/* Table of Contents sidebar */
.toc-sidebar {
  width: 260px;
  flex-shrink: 0;
  align-self: flex-start;
  position: sticky;
  top: 130px;
}

.toc-wrapper {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.1);
  padding: 24px;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
}

.toc-title {
  font-size: .85rem;
  font-weight: 700;
  color: #017BFE;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e8f0fe;
}

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

.toc-list li {
  margin-bottom: 0;
}

.toc-list a {
  display: block;
  padding: 8px 12px;
  font-size: .82rem;
  line-height: 1.4;
  color: #4b5563;
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  transition: all .2s;
}

.toc-list a:hover {
  color: #017BFE;
  background: #f0f7ff;
  border-left-color: #017BFE;
}

.toc-list a.active {
  color: #017BFE;
  background: #e8f0fe;
  border-left-color: #017BFE;
  font-weight: 600;
}

/* Scrollbar for ToC */
.toc-wrapper::-webkit-scrollbar {
  width: 3px;
}
.toc-wrapper::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.post-content h1 {
  font-size: 2.2em;
  font-weight: 700;
  color: #333;
  margin-bottom: 20px;
  line-height: 1.2;
}

.post-meta {
  margin-bottom: 25px;
  color: #666;
  font-size: 16px;
}

.post-meta span {
  margin-right: 20px;
}
.post-meta .read-time {
  background: #f0f4f8;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.85em;
  color: #555;
  font-weight: 500;
}

.post-meta a {
  color: #1877ff;
  text-decoration: none;
}

.post-image {
  margin: 25px 0;
  text-align: center;
}

.post-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.post-text {
  font-size: 18px;
  line-height: 1.7;
  color: #333;
  margin: 30px 0;
}

.post-text p {
  margin-bottom: 20px;
}

.post-text h2,
.post-text h3,
.post-text h4 {
  color: #333;
  margin: 30px 0 15px 0;
}

.post-text h2 {
  scroll-margin-top: 105px;
}

.post-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #eee;
}

.nav-prev,
.nav-next {
  display: inline-block;
  padding: 12px 20px;
  background: #f8f9fa;
  color: #1877ff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.2s;
  max-width: 45%;
}

.nav-prev:hover,
.nav-next:hover {
  background: #1877ff;
  color: #fff;
}

.related-posts {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.1);
  padding: 40px;
}

.related-posts h2 {
  font-size: 1.8em;
  font-weight: 700;
  color: #333;
  margin-bottom: 30px;
  text-align: center;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.related-post {
  background: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s;
}

.related-post:hover {
  transform: translateY(-4px);
}

.related-post a {
  text-decoration: none;
  color: inherit;
  display: block;
  padding: 20px;
}

.related-post img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 15px;
}

.related-post h3 {
  font-size: 1.2em;
  font-weight: 600;
  color: #333;
  margin: 0 0 10px 0;
}

.related-post p {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

/* Mobile: ToC above content */
@media (max-width: 1024px) {
  .post-layout {
    flex-direction: column;
  }

  .toc-sidebar {
    display: none;
  }
}

@media (max-width: 768px) {
  .single-post-page {
    padding: 15px 0 40px 0;
  }

  .container {
    padding: 0 15px;
  }

  .post-content,
  .related-posts {
    padding: 25px;
  }

  .post-content h1 {
    font-size: 1.8em;
  }

  .post-text {
    font-size: 16px;
  }

  .post-navigation {
    flex-direction: column;
    gap: 15px;
  }

  .nav-prev,
  .nav-next {
    max-width: 100%;
    text-align: center;
  }

  .posts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .related-post img {
    height: 150px;
  }

  .toc-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .post-content,
  .related-posts {
    padding: 20px;
  }

  .post-content h1 {
    font-size: 1.5em;
  }

  .post-text {
    font-size: 15px;
  }
}

/* Author Box */
.author-box {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: #fff;
  border: 1px solid #e3eaf3;
  border-radius: 14px;
  padding: 24px;
  margin: 32px 0 40px 0;
  max-width: 820px;
}
.author-box-img {
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.author-box-info {
  flex: 1;
  min-width: 0;
}
.author-box-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #111;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.author-box-linkedin {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.author-box-linkedin:hover {
  opacity: 1;
}
.author-box-role {
  font-size: 0.9rem;
  color: #017BFE;
  font-weight: 600;
  margin-bottom: 8px;
}
.author-box-bio {
  font-size: 0.88rem;
  color: #555;
  line-height: 1.5;
}
@media(max-width:700px) {
  .author-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
    gap: 12px;
  }
  .author-box-name {
    justify-content: center;
  }
}
