/* Blog Detail Page Styles - Following detail.html structure */

/* =============================================================================
   1. ARTICLE CONTAINER (.blog-detail)
   ============================================================================= */
.blog-detail__header {
  max-width: 720px;
  margin: 0 auto;
}

/* =============================================================================
   2. HERO CARD HEADER (header.hero-card)
   ============================================================================= */
.hero-card {
  border-radius: 1.25rem;
  overflow: hidden;
  background: linear-gradient(140deg, rgba(13, 110, 253, 0.12), rgba(108, 117, 125, 0.1));
}

/* =============================================================================
   3. ASIDE - TABLE OF CONTENTS (.sticky-toc)
   ============================================================================= */
.sticky-toc {
  position: -webkit-sticky; /* For Safari */
  position: sticky;
  top: 30px; /* Adjust this value based on your navbar height */
  z-index: 1000;
}

/* TOC Container */
.toc {
  position: sticky;
  top: 1.5rem;
  max-height: calc(100vh - 3rem);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.06);
  align-self: flex-start;
}

/* TOC List Items */
#tocList li {
  margin: 0.25rem 0;
}

#tocList a {
  display: block;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  color: #1f1f1f;
  text-decoration: none;
  transition: all 0.2s ease;
}

#tocList a:hover {
  background: rgba(13, 110, 253, 0.08);
  color: #0d6efd;
}

#tocList a.active {
  background: rgba(13, 110, 253, 0.12);
  color: #0d6efd;
  font-weight: 600;
}

/* TOC Responsive */
@media (max-width: 991.98px) {
  .toc {
    position: static;
    max-height: none;
    box-shadow: none;
    padding: 0;
    background: transparent;
  }
  /* Making the toc non sticking for smaller screens */
  .sticky-toc {
    position: static;
  }

}

/* =============================================================================
   4. MAIN CONTENT (.blog-detail__content)
   ============================================================================= */

.post_container {
  padding-left: 0;
}

.blog-detail__content {
  font-size: 1.05rem;
  line-height: 1.8;
}

.blog-detail__content h2,
.blog-detail__content h3,
.blog-detail__content h4 {
  margin-top: 2.25rem;
  margin-bottom: 1rem;
}

.blog-detail__content p + p {
  margin-top: 1rem;
}

.blog-detail__content img {
  display: block;
  margin: 2rem auto;
  max-width: 100%;
  border-radius: 0.75rem;
  box-shadow: 0 1rem 2rem rgba(15, 23, 42, 0.1);
}

/* =============================================================================
   5. RELATED POSTS SECTION
   ============================================================================= */
.related-post-card {
  display: block;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  background: #f8f9fa;
  transition: background 0.2s ease, transform 0.2s ease;
  color: inherit;
}

.related-post-card:hover {
  background: #e7f1ff;
  transform: translateY(-3px);
}

/* =============================================================================
   6. CODE BLOCKS & COPY BUTTON
   ============================================================================= */
.highlight {
  position: relative;
  margin: 1.5rem 0;
  border-radius: 0.5rem;
}

.highlight pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  border-radius: 0.5rem;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.25rem;
  cursor: pointer;
  color: #6c757d;
  transition: all 0.2s ease;
  opacity: 0; /* Hidden by default */
  z-index: 10;
}

.highlight:hover .copy-btn {
  opacity: 1; /* Show on hover */
}

.copy-btn:hover {
  background: #fff;
  color: #0d6efd;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.copy-btn.copied {
  color: #198754;
  border-color: #198754;
}