/* ==========================================================================
   SINGLE BLOG POST STYLES (single.php)
   ========================================================================== */

.single-blog-with-toc {
  background: #fff;
}

/* Post Hero Section */
.post-hero {
  background: #fff;
  padding: 60px 0 40px;
}

.post-hero-content {
  max-width: 900px;
  margin: 0 auto 40px;
}

.post-category-badge {
  display: inline-block;
  padding: 6px 16px;
  background: #f0f0f0;
  color: #666;
  text-decoration: none;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 8px;
}

.post-hero-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 700;
  color: #1a1a1a;
  margin: 20px 0;
  line-height: 1.2;
}

.post-hero-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 14px;
  color: #666;
  margin-top: 20px;
}

.post-hero-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post-hero-meta .meta-separator {
  color: #ddd;
}

.post-hero-meta i {
  color: #999;
}

.post-hero-image {
  max-width: 900px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.post-hero-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Post Content with Sidebar Layout */
.post-content-section {
  padding: 60px 0;
  background: #fff;
}

.post-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}

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

.post-toc-wrapper {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 25px 20px;
}

.toc-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 20px 0;
}

.table-of-contents {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.table-of-contents a {
  display: block;
  padding: 8px 12px;
  color: #666;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
  border-left: 3px solid transparent;
  transition: all 0.3s ease;
}

.table-of-contents a:hover {
  color: #1a1a1a;
  background: rgba(0, 0, 0, 0.03);
  border-left-color: var(--accent);
}

.table-of-contents a.active {
  color: var(--accent);
  font-weight: 600;
  background: rgba(57, 166, 61, 0.05);
  border-left-color: var(--accent);
}

/* Main Content Area */
.post-main-content {
  min-width: 0;
}

.post-content-inner {
  font-size: 18px;
  line-height: 1.8;
  color: #333;
  max-width: 750px;
}

.post-content-inner h2 {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 50px 0 20px 0;
  scroll-margin-top: 120px;
}

.post-content-inner h3 {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 40px 0 15px 0;
  scroll-margin-top: 120px;
}

.post-content-inner h4 {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 30px 0 12px 0;
  scroll-margin-top: 120px;
}

/* Account for WordPress admin bar when logged in */
.admin-bar .post-content-inner h2,
.admin-bar .post-content-inner h3,
.admin-bar .post-content-inner h4 {
  scroll-margin-top: 152px; /* 120px + 32px admin bar */
}

.post-content-inner h2:first-child,
.post-content-inner h3:first-child {
  margin-top: 0;
}

.post-content-inner p {
  margin-bottom: 25px;
}

.post-content-inner ul,
.post-content-inner ol {
  margin: 25px 0;
  padding-left: 30px;
}

.post-content-inner li {
  margin-bottom: 10px;
}

.post-content-inner img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 30px 0;
  display: block;
}

.post-content-inner blockquote {
  border-left: 4px solid var(--accent);
  padding: 20px 30px;
  margin: 30px 0;
  background: #f8f9fa;
  font-style: italic;
  color: #555;
}

.post-content-inner a {
  color: var(--accent);
  text-decoration: underline;
}

.post-content-inner a:hover {
  color: var(--accent-dark);
}

/* Tags Section */
.post-tags-section {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 1px solid #e0e0e0;
  max-width: 750px;
}

.post-tags {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.post-tags strong {
  color: #1a1a1a;
  font-size: 14px;
}

.post-tag {
  display: inline-block;
  padding: 6px 14px;
  background: #f0f0f0;
  color: #666;
  text-decoration: none;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.post-tag:hover {
  background: var(--accent);
  color: #fff;
}

/* Author Box */
.author-box {
  display: flex;
  gap: 20px;
  padding: 30px;
  background: #f8f9fa;
  border-radius: 12px;
  margin-top: 40px;
  max-width: 750px;
}

.author-avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
}

.author-info {
  flex: 1;
}

.author-name {
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 10px 0;
}

.author-bio {
  font-size: 14px;
  line-height: 1.6;
  color: #666;
  margin: 0;
}

/* Post Navigation */
.post-navigation {
  padding: 40px 0;
  background: #f8f9fa;
  border-top: 1px solid #e0e0e0;
}

.post-nav-links {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  max-width: 1000px;
  margin: 0 auto;
}

.post-nav-link {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  flex: 1;
  max-width: 45%;
}

.post-nav-link:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.nav-direction {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #999;
  margin-bottom: 8px;
  font-weight: 600;
}

.nav-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
}

/* Related Posts */
.related-posts {
  padding: 80px 0;
  background: #fff;
}

.related-posts-title {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 50px;
  color: #1a1a1a;
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.related-post-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.related-post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
}

.related-post-image {
  aspect-ratio: 16/10;
  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: 20px;
}

.related-post-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.4;
}

.related-post-title a {
  color: #1a1a1a;
  text-decoration: none;
}

.related-post-title a:hover {
  color: #39a63d;
}

.related-post-meta {
  font-size: 13px;
  color: #999;
}

.related-post-meta .meta-separator {
  color: #ddd;
  margin: 0 8px;
}

/* Comments */
.post-comments {
  padding: 60px 0;
  background: #f8f9fa;
}

.comments-wrapper {
  max-width: 900px;
  margin: 0 auto;
}

/* Responsive */
@media (max-width: 1024px) {
  .post-layout {
    grid-template-columns: 200px 1fr;
    gap: 40px;
  }

  .post-content-inner {
    font-size: 17px;
  }

  .post-content-inner h2 {
    font-size: 28px;
  }
}

@media (max-width: 768px) {
  .post-hero {
    padding: 40px 0 30px;
  }

  .post-hero-title {
    font-size: 32px;
  }

  .post-hero-meta {
    font-size: 13px;
  }

  .post-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .post-sidebar {
    position: static;
    order: -1;
  }

  .post-toc-wrapper {
    padding: 20px 15px;
  }

  .post-content-inner {
    font-size: 16px;
  }

  .post-content-inner h2 {
    font-size: 24px;
    margin: 40px 0 15px 0;
  }

  .post-content-inner h3 {
    font-size: 20px;
    margin: 30px 0 12px 0;
  }

  .author-box {
    flex-direction: column;
    text-align: center;
    padding: 25px 20px;
  }

  .author-avatar {
    margin: 0 auto;
  }

  .post-nav-links {
    flex-direction: column;
  }

  .post-nav-link {
    max-width: 100%;
  }

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

@media (max-width: 480px) {
  .post-hero-title {
    font-size: 28px;
  }

  .post-content-section {
    padding: 40px 0;
  }

  .post-content-inner {
    font-size: 15px;
  }

  .post-tags-section {
    margin-top: 40px;
  }
}
