/* ----------------------
   Base Styles
---------------------- */

/* Remove any margin between navbar and hero/title section */
body > header + section:first-of-type,
body > nav + section:first-of-type {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Defensive reset for common suspects */
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

header,
nav {
  margin-bottom: 0 !important;
}

section:first-of-type {
  margin-top: 0 !important;
}

.breadcrumb {
  background-color: transparent;
}

.narrow-content {
  max-width:800px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem; /* Base padding for mobile */
}

@media (min-width: 768px) {
  .narrow-content {
    padding: 0 2rem;
  }
}

@media (min-width: 1200px) {
  .narrow-content {
    max-width: 960px; /* Slightly wider for large screens */
  }
}


/* ----------------------
   Blog Header Background (legacy — can be removed if not used) testing stop start
---------------------- */

.blog-head-bg {
  background-image: url("/static/img/blog-head.0ae080ddc7f3.jpg");
}

/* ----------------------
   Blog Card Styling
---------------------- */

.blog-card {
  transition: all 0.3s ease;
  padding-bottom: 1rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.blog-card .card-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

/* ----------------------
   Blog Card Image
---------------------- */

.blog-card-img-wrapper {
  height: 220px; /* Matches height in HTML */
  overflow: hidden;
  position: relative;
  display: block;
}

.blog-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.blog-card:hover .blog-card-img {
  transform: scale(1.03);
}

/* ----------------------
   Blog Card Description (truncate to 4 lines)
---------------------- */

.truncate-description {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 6.4em;
  min-height: 6.4em;
  line-height: 1.6;
  font-size: 1rem;
  color: #6c757d;
}

/* ----------------------
   Read More Button (Underline Hover)
---------------------- */

.blog-readmore {
  position: relative;
  transition: all 0.3s ease;
  margin-top: auto;
}

.blog-readmore::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--bs-primary);
  transition: width 0.3s ease;
}

.blog-readmore:hover::after {
  width: 100%;
}

/* ----------------------
   Hover Overlay on Image
---------------------- */

.blog-card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

.blog-card:hover .blog-card-overlay {
  opacity: 1;
}

.blog-card-overlay span {
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 12px;
  border-radius: 6px;
}




/* Ensure these rules override the highlight.js theme */
pre code.hljs {
  background-color: #f0f4f8 !important; /* A slightly bluish-gray */
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 1rem;
  display: block;
  overflow-x: auto;
  margin-bottom: 1rem;
  color: #333 !important; /* Force a darker text color for contrast */
}

article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
  text-align: center;
}
article img[loading] {
  aspect-ratio: attr(width) / attr(height);
}


/* ----------------------
   Article Container Box
---------------------- */

article {
  background-color: #ffffff;
  border: 1px solid #dee2e6; /* Light gray border */
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03); /* Subtle lift */
  margin-bottom: 3rem;
}





/* ----------------------
   ARTICLES ATTEMPTED AD BUFFER
---------------------- */
.article-top-buffer,
.article-bottom-buffer {
  padding: 0.5rem 0;
}



/* ----------------------
   Article Typography
---------------------- */
article p {
  text-align: justify;
  font-size: 1.3rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  line-height: 1.75;
  color: #212529;
  margin-bottom: 1.25rem;
}

/* ----------------------
   Social share stuff
---------------------- */

.social-share-container a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 1.2rem;
  background-color: #f8f9fa;
  color: #333;
  border: 1px solid #dee2e6;
  transition: background-color 0.2s ease;
  min-width: 40px;
  text-decoration: none;
}

.social-share-container a:hover {
  background-color: #e9ecef;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
/* ----------------------
   Series Detail Layout – Clean & Professional
---------------------- */
/* ----------------------
   Series-specific article container
---------------------- */
.series-article {
  max-width: 820px;        /* 🔒 Consistent fixed width */
  width: 100%;
  margin: 0 auto;          /* 🔥 Center the article */
  padding: 2rem;
  background-color: #fff;
  border-radius: 8px;
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  box-sizing: border-box; /* Ensure padding doesn't cause overflow */
}

/* 🔒 Prevent content inside from breaking layout */
.series-article img,
.series-article iframe,
.series-article pre,
.series-article code,
.series-article table {
  max-width: 100%;
  overflow-x: auto;
  display: block;
  box-sizing: border-box;
}

/* Optional: consistent text size */
.series-article p {
  font-size: 1.2rem;
  line-height: 1.8;
}

#sidebarMenu {
  max-height: 100vh;
  overflow-y: auto;
  background-color: #f8f9fa;
  border-left: 2px solid #e9ecef;
  padding-right: 1rem;
}
.sidebar .nav-item.bg-white {
  background-color: #ffffff;
  border-left: 4px solid #007bff;
  border-radius: 0 4px 4px 0;
}

.sidebar .nav-link:hover {
  background-color: #f8f9fa;
}
.sidebar-sticky {
  position: -webkit-sticky;
  position: sticky;
  top: 40px;
}

/* Content */
.content-body {
  font-size: 1.1rem;
  line-height: 1.75;
}

/* Hero Section */
section.py-5.border-bottom {
  margin-bottom: 2rem;
}

