/* Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: #e5e7eb;
  z-index: 50;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(to right, #9333ea, #2563eb);
  transition: width 0.3s ease;
  width: 0%;
}

/* Blog Header */
.blog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.back-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #6b7280;
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

.back-button:hover {
  color: #9333ea;
}

.back-button svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.3s ease;
}

.back-button:hover svg {
  transform: translateX(-0.25rem);
}

.reading-stats {
  font-size: 0.875rem;
  color: #6b7280;
}

.share-dropdown {
  position: relative;
}

.share-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #9333ea;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.share-button:hover {
  background: #7c3aed;
}

.share-button svg {
  width: 1rem;
  height: 1rem;
}

.share-menu {
  position: absolute;
  right: 0;
  top: 3rem;
  background: white;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  padding: 0.5rem;
  min-width: 12rem;
  z-index: 10;
  animation: fadeIn 0.3s ease-in-out;
}

.share-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem;
  background: none;
  border: none;
  border-radius: 0.25rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.share-option:hover {
  background: #f3f4f6;
}

.share-option svg {
  width: 1rem;
  height: 1rem;
}

.share-menu hr {
  margin: 0.5rem 0;
  border: none;
  border-top: 1px solid #e5e7eb;
}

/* Blog Post Layout */
.blog-post-main {
  background: #f9fafb;
  min-height: 100vh;
}

.blog-post-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  padding: 2rem 0;
}

@media (min-width: 1024px) {
  .blog-post-layout {
    grid-template-columns: 1fr 3fr;
  }
}

/* Table of Contents Sidebar */
.toc-sidebar {
  display: none;
}

@media (min-width: 1024px) {
  .toc-sidebar {
    display: block;
    position: sticky;
    top: 6rem;
    height: fit-content;
  }
}

.toc-card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.toc-title {
  font-weight: 700;
  color: #111827;
}

.toc-toggle {
  padding: 0.25rem;
  background: none;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.toc-toggle:hover {
  background: #f3f4f6;
}

.toc-toggle svg {
  width: 1rem;
  height: 1rem;
}

.toc-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toc-link {
  display: block;
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  text-decoration: none;
  transition: all 0.2s ease;
  color: #6b7280;
}

.toc-link:hover {
  color: #9333ea;
  background: #f3f4f6;
}

.toc-link.active {
  color: #9333ea;
  font-weight: 500;
  background: #f3e8ff;
  border-left: 2px solid #9333ea;
}

.toc-link.level-3 {
  padding-left: 1.5rem;
}

.article-stats-card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.stats-title {
  font-weight: 600;
  color: #111827;
  margin-bottom: 1rem;
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.stats-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #6b7280;
}

.stats-item svg {
  width: 1rem;
  height: 1rem;
}

/* Blog Post Content */
.blog-post-content {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.post-article {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  overflow: hidden;
  animation: fadeIn 0.6s ease-in-out;
}

.post-featured-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.post-featured-image:hover img {
  transform: scale(1.05);
}

.post-featured-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-featured-image:hover::after {
  opacity: 1;
}

.post-content {
  padding: 2rem;
}

@media (min-width: 1024px) {
  .post-content {
    padding: 3rem;
  }
}

.post-meta-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.author-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 2px solid #f3e8ff;
}

.author-details .author-name {
  font-weight: 500;
  color: #111827;
}

.author-details .author-role {
  font-size: 0.875rem;
  color: #6b7280;
}

.meta-divider {
  height: 2rem;
  width: 1px;
  background: #e5e7eb;
}

.post-meta-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.meta-info-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.meta-info-item svg {
  width: 1rem;
  height: 1rem;
}

.post-tags-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.post-category-tag {
  background: #f3e8ff;
  color: #7c3aed;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: capitalize;
}

.post-tag {
  background: #f3f4f6;
  color: #374151;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.post-tag:hover {
  background: #f3e8ff;
  color: #7c3aed;
}

.post-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #111827;
  line-height: 1.2;
}

@media (min-width: 1024px) {
  .post-title {
    font-size: 3rem;
  }
}

.post-excerpt {
  font-size: 1.25rem;
  color: #6b7280;
  margin-bottom: 2rem;
  line-height: 1.75;
  font-weight: 300;
}

.social-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 0;
  border-top: 1px solid #f3f4f6;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 2rem;
}

.comments-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background: #f9fafb;
  color: #6b7280;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.comments-button:hover {
  background: #dbeafe;
  color: #2563eb;
}

.comments-button svg {
  width: 1.25rem;
  height: 1.25rem;
}

.post-body {
  max-width: none;
}

.post-body p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
  color: #374151;
}

.post-body h2 {
  font-size: 1.875rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: #111827;
  scroll-margin-top: 100px;
}

.post-body h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: #1f2937;
  scroll-margin-top: 100px;
}

.post-body ul {
  margin: 1.5rem 0;
  padding-left: 1.5rem;
}

.post-body li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
}

.post-body strong {
  font-weight: 600;
  color: #7c3aed;
}

.post-body a {
  color: #7c3aed;
  text-decoration: underline;
}

.post-body a:hover {
  color: #5b21b6;
}

.tags-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #f3f4f6;
}

.tags-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tags-header svg {
  width: 1.25rem;
  height: 1.25rem;
  color: #6b7280;
}

.tags-header h3 {
  font-weight: 600;
  color: #111827;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-item {
  background: #f3f4f6;
  color: #374151;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tag-item:hover {
  background: #f3e8ff;
  color: #7c3aed;
}

.author-bio-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #f3f4f6;
}

.author-bio-card {
  background: linear-gradient(to right, #f3e8ff, #dbeafe);
  border-radius: 0.75rem;
  padding: 2rem;
}

.author-bio-content {
  display: flex;
  align-items: start;
  gap: 1.5rem;
}

.author-bio-avatar {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.author-bio-info {
  flex: 1;
}

.author-bio-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.5rem;
}

.author-bio-text {
  color: #6b7280;
  line-height: 1.75;
}

/* Comments Section */
.comments-section {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  padding: 2rem;
  animation: fadeIn 0.6s ease-in-out;
}

.comments-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1.5rem;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comment-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: #f9fafb;
  border-radius: 0.5rem;
}

.comment-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
}

.comment-content {
  flex: 1;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.comment-author {
  font-weight: 500;
  color: #111827;
}

.comment-date {
  font-size: 0.875rem;
  color: #6b7280;
}

.comment-text {
  color: #374151;
  margin-bottom: 0.5rem;
}

.comment-reply {
  color: #9333ea;
  font-size: 0.875rem;
  font-weight: 500;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

.comment-reply:hover {
  color: #7c3aed;
}

.comment-form-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #f3f4f6;
}

.comment-form-title {
  font-weight: 600;
  color: #111827;
  margin-bottom: 1rem;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment-textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  outline: none;
  resize: none;
  transition: all 0.3s ease;
}

.comment-textarea:focus {
  border-color: #9333ea;
  box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.5);
}

.comment-submit-button {
  background: #9333ea;
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.3s ease;
  align-self: flex-start;
}

.comment-submit-button:hover {
  background: #7c3aed;
}

/* Related Posts Section */
.related-posts-section {
  margin-top: 3rem;
}

.related-posts-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: #111827;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .related-posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.related-post-card {
  background: white;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.related-post-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: translateY(-0.25rem);
}

.related-post-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.related-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.related-post-card:hover .related-post-image img {
  transform: scale(1.05);
}

.related-post-content {
  padding: 1.5rem;
}

.related-post-badge {
  text-align: center;
  margin-bottom: 1rem;
}

.related-post-title {
  font-weight: 700;
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
  color: #111827;
  transition: color 0.3s ease;
}

.related-post-card:hover .related-post-title {
  color: #9333ea;
}

.related-post-excerpt {
  color: #6b7280;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.related-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: #6b7280;
}

/* Responsive Design */
@media (max-width: 768px) {
  .blog-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .share-dropdown {
    align-self: flex-end;
  }

  .post-content {
    padding: 1.5rem;
  }

  .post-title {
    font-size: 1.875rem;
  }

  .post-excerpt {
    font-size: 1.125rem;
  }

  .author-bio-content {
    flex-direction: column;
    text-align: center;
  }

  .social-actions {
    flex-wrap: wrap;
  }
}
