/* ------------------ */
/* Blog Hero Section */
/* ------------------ */
.blog-hero {
  margin-top: 95px;
  min-height: 450px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  
  /* Background with image and gradient overlay */
  background: linear-gradient(to right, #1e608bb6, #5f19a0b9),
              url("pics/serv_bg_2.jpg") no-repeat center center;
  background-size: cover;
  background-attachment: fixed;
  padding: 80px 0;
}

.blog-hero-content {
  max-width: 100%;
  z-index: 2;
  position: relative;
}

.blog-hero-heading {
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  color: white !important;
}

.blog-hero-paragraph {
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.4;
  opacity: 0.95;
  max-width: 90%;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  color: white !important;
}

/* Ensure text is always white and readable */
.blog-hero h1,
.blog-hero p {
  color: white !important;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7) !important;
}

/* Add subtle animation */
.blog-hero-content {
  animation: blogFadeInUp 0.8s ease-out;
}

@keyframes blogFadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Desktop specific styles */
@media (min-width: 1200px) {
  .blog-hero {
    background-attachment: fixed;
    min-height: 480px;
    padding: 100px 0;
  }
}

/* Large desktop */
@media (max-width: 1199px) and (min-width: 992px) {
  .blog-hero {
    min-height: 420px;
    padding: 80px 0;
  }

  .blog-hero-heading {
    font-size: 2.3rem;
  }
  
  .blog-hero-paragraph {
    font-size: 1.4rem;
  }
}

/* Tablet */
@media (max-width: 991px) and (min-width: 769px) {
  .blog-hero {
    min-height: 380px;
    padding: 70px 0;
    background-attachment: scroll; /* Better performance on tablets */
  }
  
  .blog-hero-heading {
    font-size: 2.1rem;
  }
  
  .blog-hero-paragraph {
    font-size: 1.3rem;
    max-width: 95%;
  }
}

/* Small tablet and large mobile */
@media (max-width: 768px) {
  .blog-hero {
    min-height: 320px;
    padding: 60px 0;
    background-attachment: scroll;
    margin-top: 70px;
    background-position: center;
  }
  
  .blog-hero-content {
    text-align: left !important; /* Center on mobile */
  }
  
  .blog-hero-heading {
    font-size: 1.9rem;
    margin-bottom: 0.8rem;
  }
  
  .blog-hero-paragraph {
    font-size: 1.2rem;
    max-width: 100%;
    line-height: 1.3;
  }
}

/* Mobile */
@media (max-width: 576px) {
  .blog-hero {
    min-height: 280px;
    padding: 50px 0;
    margin-top: 65px;
  }
  
  .blog-hero-heading {
    font-size: 1.7rem;
  }
  
  .blog-hero-paragraph {
    font-size: 1.1rem;
    line-height: 1.2;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .blog-hero {
    min-height: 250px;
    padding: 40px 0;
  }
  
  .blog-hero-heading {
    font-size: 1.5rem;
  }
  
  .blog-hero-paragraph {
    font-size: 1rem;
  }
}

/* Very small mobile */
@media (max-width: 375px) {
  .blog-hero {
    min-height: 220px;
    padding: 35px 0;
  }
  
  .blog-hero-heading {
    font-size: 1.4rem;
  }
  
  .blog-hero-paragraph {
    font-size: 0.95rem;
  }
}

/* Optional: Wave divider for blog hero */
.blog-hero-svg-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  pointer-events: none;
  z-index: 1;
}

.blog-hero-svg-wrapper svg {
  display: block;
  height: 80px;
  width: 100%;
}

/* Ensure gradient overlay works properly */
.blog-hero.linear-gradient {
  background: linear-gradient(to right, #1e608bb6, #5f19a0b9),
              url("pics/serv_bg_2.jpg") no-repeat center center;
  background-size: cover;
}

/* High DPI display optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .blog-hero {
    background-image: linear-gradient(to right, #1e608bb6, #5f19a0b9),
                      url("pics/serv_bg_2.jpg");
  }
}

/* Print styles */
@media print {
  .blog-hero {
    background: #667eea !important;
    color: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-scheme: exact;
  }
}

/* Blog Grid Section */
.blog-section {
  margin-top: 2rem;
  padding: 60px 0;
  background: #ffffff;
}

.blog-section-title {
  margin-bottom: 1rem;
  margin-top: 20px;
}

/* Blog Cards */
.blog-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  transition: all 0.3s ease;
  border: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.blog-card-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card-link:hover {
  text-decoration: none;
  color: inherit;
}

/* Blog Card Image */
.blog-card-image {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: block;
  border-radius: 12px 12px 0 0;
}

.blog-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover !important;
  object-position: center !important;
  transition: transform 0.3s ease;
  border-radius: 0;
  display: block !important;
  background-color: #f8f9fa;
  /* Remove any Bootstrap img-fluid conflicts */
  max-width: none !important;
  max-height: none !important;
  min-width: 100% !important;
  min-height: 100% !important;
}

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

/* Remove Bootstrap img-fluid class conflicts */
.blog-card-image .img-fluid {
  max-width: none !important;
  height: 100% !important;
  width: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}


/* Fallback for broken images */
.blog-card-image img:not([src]),
.blog-card-image img[src=""] {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.blog-card-image img::before {
  content: "📷";
  font-size: 2rem;
  color: #adb5bd;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #f8f9fa;
}

/* Responsive image heights */
@media (max-width: 1200px) {
  .blog-card-image {
    height: 200px;
  }
}

@media (max-width: 992px) {
  .blog-card-image {
    height: 190px;
  }
}

@media (max-width: 768px) {
  .blog-card-image {
    height: 180px;
  }
}

@media (max-width: 576px) {
  .blog-card-image {
    height: 160px;
  }
}

@media (max-width: 480px) {
  .blog-card-image {
    height: 150px;
  }
}

/* Force proper image sizing on all screen sizes */
@media (max-width: 1400px) {
  .blog-card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
  }
}

/* Additional fix for very small screens */
@media (max-width: 375px) {
  .blog-card-image {
    height: 140px;
  }
  
  .blog-card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
}

/* Ensure no aspect ratio interference */
.blog-card-image {
  aspect-ratio: unset !important; /* Remove any aspect ratio constraints */
}

/* Ensure images load properly */
.blog-card-image img {
  max-width: 100%;
  min-height: 100%;
  flex-shrink: 0;
}

/* High DPI display optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .blog-card-image img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Aspect ratio container for better responsiveness */
.blog-card-image {
  aspect-ratio: 16/9; /* Optional: maintain consistent aspect ratio */
}

/* for different image orientations */
.blog-card-image img[src*="landscape"],
.blog-card-image img[src*="wide"] {
  object-fit: cover !important;
  object-position: center !important;
}

.blog-card-image img[src*="portrait"],
.blog-card-image img[src*="tall"] {
  object-fit: cover !important;
  object-position: center top !important;
}

/* Lazy loading optimization */
.blog-card-image img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.blog-card-image img[loading="lazy"].loaded {
  opacity: 1;
}

/* Blog Card Content */
.blog-card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
}

.blog-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2d3748;
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 4.2rem; /* Ensure consistent height */
}

.blog-card-description {
  font-size: 0.95rem;
  color: #718096;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0;
  flex-grow: 1;
}

/* Equal height cards */
.blog-card {
  height: 100%;
  min-height: 400px; /* Ensure minimum height */
}

/* Responsive Design */
@media (max-width: 992px) {
  .blog-section {
    padding: 60px 0;
    margin-top: 5rem;
  }
  
  .blog-section-title {
    font-size: 2.2rem;
  }
  
  .blog-card {
    min-height: 380px;
  }
  
  .blog-card-content {
    padding: 20px;
  }
  
  .blog-card-title {
    font-size: 1.2rem;
  }
}

@media (max-width: 768px) {
  .blog-section {
    padding: 50px 0;
    margin-top: 4rem;
  }
  
  .blog-section-title {
    font-size: 2rem;
  }
  
  .blog-section-subtitle {
    font-size: 1rem;
  }
  
  .blog-card {
    min-height: 360px;
  }
  
  .blog-card-image {
    height: 180px;
  }
  
  .blog-card-content {
    padding: 18px;
  }
  
  .blog-card-title {
    font-size: 1.15rem;
    min-height: 3.8rem;
  }
  
  .blog-card-description {
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .blog-section {
    padding: 40px 0;
    margin-top: 3rem;
  }
  
  .blog-section-title {
    font-size: 1.8rem;
  }
  
  .blog-card {
    min-height: 340px;
  }
  
  .blog-card-image {
    height: 160px;
  }
  
  .blog-card-content {
    padding: 16px;
  }
  
  .blog-card-title {
    font-size: 1.1rem;
    min-height: 3.6rem;
  }
}

/* Hover animations for better UX */
@media (hover: hover) {
  .blog-card-title {
    transition: color 0.3s ease;
  }
  
  .blog-card:hover .blog-card-title {
    color: #4299e1;
  }
}

/* Loading state for images */
.blog-card-image img {
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

/* Focus states for accessibility */
.blog-card-link:focus {
  outline: 2px solid #4299e1;
  outline-offset: 2px;
}

.blog-card-link:focus:not(:focus-visible) {
  outline: none;
}

/* Blog Card Meta Information */
.blog-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 0;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 0;
  background: #ffffff;
}

.blog-card-author,
.blog-card-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #666666;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.blog-card-author i,
.blog-card-date i {
  font-size: 0.8rem;
  color: #999999;
}

.blog-card-author i {
  color: #667eea; 
}

.blog-card-date i {
  color: #667eea;
}

.blog-card-author span,
.blog-card-date span {
  color: #666666;
  font-weight: 600;
}

/* Adjust content padding to account for meta section */
.blog-card-content {
  padding: 20px 20px 24px; /* Reduced top padding */
}

/* Ensure proper spacing and layout */
.blog-card-meta + .blog-card-content {
  padding-top: 16px;
}

/* Responsive adjustments for meta section */
@media (max-width: 768px) {
  .blog-card-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px 8px;
  }
  
  .blog-card-author,
  .blog-card-date {
    font-size: 0.7rem;
    gap: 4px;
  }
  
  .blog-card-content {
    padding: 16px 16px 20px;
  }
}

@media (max-width: 576px) {
  .blog-card-meta {
    padding: 10px 14px 6px;
  }
  
  .blog-card-author,
  .blog-card-date {
    font-size: 0.65rem;
  }
  
  .blog-card-content {
    padding: 14px 14px 18px;
  }
}

/* Hover effects for meta elements */
.blog-card:hover .blog-card-author i,
.blog-card:hover .blog-card-date i {
  color: #5d76e6;
}

/* Ensure meta section doesn't interfere with card linking */
.blog-card-meta {
  pointer-events: none;
}

.blog-card-meta * {
  pointer-events: none;
}

/* Contact Us Section - Maintain Center Alignment */
.contact-us-section .row.mb-5.align-items-center {
  text-align: center;
}

.contact-us-section .col-lg-6 {
  text-align: center;
}

/* Specific styling for the "Let's Start Something Amazing" heading */
.contact-us-section h3.linear-gradient-text {
  text-align: center !important;
  display: block !important;
  width: 100% !important;
  margin: 0 auto !important;
}

/* Ensure center alignment on all screen sizes */
@media (max-width: 992px) {
  .contact-us-section .col-lg-6 {
    text-align: center !important;
  }
  
  .contact-us-section h3.linear-gradient-text {
    text-align: center !important;
    display: block !important;
    margin: 0 auto !important;
  }
}

@media (max-width: 768px) {
  .contact-us-section .row.mb-5.align-items-center {
    text-align: center !important;
  }
  
  .contact-us-section .col-lg-6 {
    text-align: center !important;
  }
  
  .contact-us-section h3.linear-gradient-text {
    text-align: center !important;
    display: block !important;
    margin: 0 auto !important;
  }
  
  .contact-us-section p {
    text-align: center !important;
  }
}

@media (max-width: 576px) {
  .contact-us-section .col-lg-6 {
    text-align: center !important;
  }
  
  .contact-us-section h3.linear-gradient-text {
    text-align: center !important;
    display: block !important;
    margin: 0 auto !important;
  }
}

/* Alternative: Add text-center class to parent container */
.contact-us-section .mb-5 {
  text-align: center !important;
}

/* Ensure gradient text displays properly while centered */
.contact-us-section .linear-gradient-text {
  background: linear-gradient(90deg, #3ab6fe 0%, #667eea 50%, #764ba2 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  color: transparent !important;
  display: inline-block !important;
  text-align: center !important;
  width: 100% !important;
}

/* ============================================ */
/* Blog Post Individual Page Styling */
/* ============================================ */

/* Blog Post Hero Section */
.blog-post-hero {
  margin-top: 95px;
  min-height: 420px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  
  /* Different background image for blog posts */
  background: linear-gradient(to right, #1e608bb6, #5f19a0b9),
              url("../pics/blog-images/blog01.jpg") no-repeat center center;
  background-size: cover;
  background-attachment: fixed;
  padding: 80px 0;
}

.blog-post-hero-content {
  max-width: 100%;
  z-index: 2;
  position: relative;
}

/* Blog Post Meta Information in Hero */
.blog-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin-bottom: 0;
  margin-top: 1.5rem;
}

.blog-post-author,
.blog-post-date,
.blog-post-read-time {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  color: white !important;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.15);
  padding: 10px 14px;
  border-radius: 8px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  white-space: nowrap;
}

.blog-post-author:hover,
.blog-post-date:hover,
.blog-post-read-time:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.blog-post-author i,
.blog-post-date i,
.blog-post-read-time i {
  font-size: 0.9rem;
  color: white !important;
  opacity: 0.9;
}

.blog-post-author span,
.blog-post-date span,
.blog-post-read-time span {
  color: white !important; /* Ensure spans are white too */
  font-weight: 600;
}

/* Ensure proper spacing */
.blog-post-subtitle {
  margin-bottom: 1.5rem !important; /* Ensure space before meta */
}

.blog-post-meta {
  margin-top: 1.5rem !important; /* Space after subtitle */
}

/* Desktop styling */
@media (min-width: 992px) {
  .blog-post-meta {
    gap: 1.2rem;
  }
  
  .blog-post-author,
  .blog-post-date,
  .blog-post-read-time {
    padding: 10px 18px;
    font-size: 0.95rem;
  }
}

/* Tablet styling */
@media (max-width: 991px) and (min-width: 577px) {
  .blog-post-meta {
    gap: 0.8rem;
  }
  
  .blog-post-author,
  .blog-post-date,
  .blog-post-read-time {
    padding: 8px 14px;
    font-size: 0.85rem;
  }
}

/* Mobile Styling */
@media (max-width: 576px) {
  .blog-post-meta {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 0.25rem !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    width: 100% !important;
    max-width: calc(100vw - 40px) !important;
    padding: 0 !important;
    margin: 1rem 0 !important;
    justify-content: flex-start !important;
    align-items: center !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  .blog-post-author,
  .blog-post-date,
  .blog-post-read-time {
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    min-width: fit-content !important;
    max-width: none !important;
    width: auto !important;
    padding: 3px 6px !important;
    font-size: 0.6rem !important;
    border-radius: 8px !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    margin: 0 !important;
    text-overflow: clip !important;
    overflow: visible !important;
  }

  .blog-post-author i,
  .blog-post-date i,
  .blog-post-read-time i {
    font-size: 0.55rem !important;
    margin-right: 2px !important;
    margin-left: 0 !important;
  }

  .blog-post-author span,
  .blog-post-date span,
  .blog-post-read-time span {
    font-size: 0.6rem !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
}

/* Extra small mobile - Icons only option */
@media (max-width: 480px) {
  .blog-post-meta {
    gap: 0.3rem;
  }
  
  .blog-post-author,
  .blog-post-date,
  .blog-post-read-time {
    padding: 4px 8px;
    font-size: 0.65rem;
    border-radius: 12px;
  }

  /* Option to show only icons on very small screens */
  .blog-post-author.icon-only span,
  .blog-post-date.icon-only span,
  .blog-post-read-time.icon-only span {
    display: none;
  }
  
  .blog-post-author.icon-only,
  .blog-post-date.icon-only,
  .blog-post-read-time.icon-only {
    padding: 6px;
    width: 32px;
    height: 32px;
    justify-content: center;
  }
}

/* Ensure meta boxes don't break layout */
@media (max-width: 768px) {
  .blog-post-hero-content {
    overflow-x: hidden; /* Prevent horizontal overflow */
  }
  
  /* Custom scrollbar for meta on mobile */
  .blog-post-meta::-webkit-scrollbar {
    height: 2px;
  }
  
  .blog-post-meta::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
  }
  .blog-post-meta::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
  }
}

@media (prefers-color-scheme: dark) {
  .blog-post-author,
  .blog-post-date,
  .blog-post-read-time {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: white !important;
  }
  
  .blog-post-author i,
  .blog-post-date i,
  .blog-post-read-time i,
  .blog-post-author span,
  .blog-post-date span,
  .blog-post-read-time span {
    color: white !important;
  }
}

/* Print styles - hide meta in print */
@media print {
  .blog-post-meta {
    display: none;
  }
}

/* Accessibility improvements */
.blog-post-author:focus,
.blog-post-date:focus,
.blog-post-read-time:focus {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 2px;
}

/* Loading animation for meta content */
@keyframes blogMetaFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Blog Post Title */
.blog-post-title {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  color: white !important;
}

.blog-post-subtitle {
  font-size: 1.3rem;
  font-weight: 400;
  line-height: 1.4;
  opacity: 0.95;
  max-width: 90%;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  color: white !important;
}

/* Blog Article Content */
.blog-post-article {
  padding: 50px 0;
  background: #ffffff;
}

.blog-post-content {
  max-width: 100%;
  margin: 0 auto;
}

/* Article Typography */
.blog-lead-paragraph {
  font-size: 1.25rem;
  line-height: 1.6;
  color: #4a5568;
  margin-bottom: 2rem;
  font-weight: 400;
  border-left: 4px solid #667eea;
  padding-left: 1.5rem;
  background: #f8f9ff;
  padding: 1.5rem;
  border-radius: 8px;
}

.blog-section {
  margin-bottom: 2rem;
}

.blog-section-intro {
  margin-bottom: 2rem;
}

.blog-section-heading {
  font-size: 2rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 1rem;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5rem;
  position: relative;
}

.blog-section-heading::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(to right, #667eea, #764ba2);
}

.blog-subsection {
  margin-bottom: 1.5rem;
  padding-left: 1rem;
}

.blog-subsection-heading {
  font-size: 1.4rem;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 0.8rem;
}

/* Ensure proper spacing in blog sections */
.blog-section h2.blog-section-heading {
    margin-bottom: 1rem; /* Reduce space after heading */
}

.blog-section p {
  margin-top: 0;
  font-size: 1.1rem;
  line-height: 1.7;
  color: #4a5568;
  margin-bottom: 1rem;
  text-align: justify;
}

/* Quote Styling */
.blog-quote {
  background: linear-gradient(135deg, #f8f9ff 0%, #e6f3ff 100%);
  border-left: 6px solid #667eea;
  padding: 2rem;
  margin: 2rem 0;
  border-radius: 8px;
  font-size: 1.2rem;
  font-style: italic;
  color: #2d3748;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.blog-quote cite {
  display: block;
  margin-top: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #667eea;
  font-style: normal;
}

/* Call to Action Section */
.blog-cta-section {
  margin: 3rem 0;
}

.blog-cta-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2.5rem;
  border-radius: 16px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.blog-cta-heading {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: white;
}

.blog-cta-description {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  opacity: 0.9;
  line-height: 1.6;
}

.blog-cta-card .btn {
  background: rgba(255, 255, 255, 0.2) !important;
  border: 2px solid white !important;
  color: white !important;
  font-weight: 600;
  padding: 12px 32px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.blog-cta-card .btn:hover {
  background: white !important;
  color: #667eea !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

.blog-section .blog-subsection {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.blog-subsection h3.blog-subsection-heading {
    margin-bottom: 0.8rem; /* Reduce space after subheading */
}

.blog-subsection + p {
    margin-top: 0; /* Remove space between subsection and following paragraph */
}

/* Remove excessive spacing between intro and first section */
.blog-section-intro + .blog-section {
  margin-top: 1.5rem;
}

/* Ensure consistent spacing between sections */
.blog-section + .blog-section {
  margin-top: 1rem;
}

/* Remove excessive spacing */
.blog-section > *:first-child {
    margin-top: 0;
}

.blog-section > *:last-child {
    margin-bottom: 0;
}

/* Blog Navigation */
.blog-post-navigation {
  margin: 3rem 0;
  padding: 1.5rem 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
}

.blog-nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #4a5568;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.blog-nav-link:hover {
  color: #667eea;
  text-decoration: none;
  transform: translateX(-3px);
}

.blog-nav-next:hover {
  transform: translateX(3px);
}

/* Related Articles Section */
.related-articles-section {
  background: #f8f9fa;
  padding: 60px 0;
  margin-top: 0;
}

.related-articles-heading {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.related-articles-subtitle {
  font-size: 1.1rem;
  color: #6c757d;
  margin-bottom: 3rem;
}

/* Responsive Design for Blog Posts */
@media (max-width: 1200px) {
  .blog-post-title {
    font-size: 2.4rem;
  }
  
  .blog-post-subtitle {
    font-size: 1.2rem;
  }
}

@media (max-width: 992px) {
  .blog-post-hero {
    min-height: 380px;
    padding: 70px 0;
  }
  
  .blog-post-title {
    font-size: 2.2rem;
  }
  
  .blog-post-subtitle {
    font-size: 1.1rem;
    max-width: 95%;
  }
  
  .blog-section-heading {
    font-size: 1.8rem;
  }
}

@media (max-width: 768px) {
  .blog-post-hero {
    min-height: 320px;
    padding: 60px 0;
    margin-top: 70px;
    background-attachment: scroll;
  }
  
  .blog-post-meta {
    gap: 16px;
    margin-bottom: 1rem;
  }
  
  .blog-post-author,
  .blog-post-date,
  .blog-post-read-time {
    font-size: 0.8rem;
    padding: 6px 10px;
  }
  
  .blog-post-title {
    font-size: 1.9rem;
    margin-bottom: 0.8rem;
  }
  
  .blog-post-subtitle {
    font-size: 1rem;
    max-width: 100%;
    line-height: 1.3;
  }
  
  .blog-post-article {
    padding: 50px 0;
    margin-bottom: 0;
  }
  
  .blog-section-heading {
    font-size: 1.6rem;
  }
  
  .blog-subsection-heading {
    font-size: 1.2rem;
  }
  
  .blog-section p {
    font-size: 1rem;
  }
  
  .blog-lead-paragraph {
    font-size: 1.1rem;
    padding: 1rem;
  }
  
  .blog-quote {
    padding: 1.5rem;
    font-size: 1.1rem;
  }
  
  .blog-cta-card {
    padding: 2rem;
  }
  
  .blog-cta-heading {
    font-size: 1.5rem;
  }
}

@media (max-width: 576px) {
  .blog-post-hero {
    min-height: 280px;
    padding: 50px 0;
  }
  
  .blog-post-meta {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .blog-post-title {
    font-size: 1.7rem;
  }
  
  .blog-post-subtitle {
    font-size: 0.95rem;
  }
  
  .blog-section-heading {
    font-size: 1.4rem;
  }
  
  .blog-nav-link {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .blog-post-hero {
    min-height: 250px;
    padding: 40px 0;
  }
  
  .blog-post-title {
    font-size: 1.5rem;
  }
  
  .blog-post-subtitle {
    font-size: 0.9rem;
  }
}

/* Print Styles */
@media print {
  .blog-post-hero {
    background: #667eea !important;
    color: white !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .blog-post-navigation,
  .related-articles-section,
  .blog-cta-section {
    display: none;
  }
}

/* ============================== */
/* Blog Section Images Styling */
/* ============================== */

.blog-section-image {
  max-width: 100%;
  overflow: hidden;
  border-radius: 12px;
  background: #f8f9fa;
}

.blog-section-image:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.blog-section-image img {
  width: 100% !important;
  height: 300px !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 12px;
  display: block;
  background: #f8f9fa;
}

.blog-section-image:hover img {
  transform: scale(1.02);
}

.blog-section-image.contain-fit img {
  object-fit: contain;
  background: #ffffff;
  padding: 10px;
}

/* Responsive image heights */
@media (max-width: 1200px) {
  .blog-section-image img {
    height: 280px;
  }
}

@media (max-width: 992px) {
  .blog-section-image img {
    height: 250px !important;
  }
}

@media (max-width: 768px) {
  .blog-section-image {
    margin: 1rem 0;
    border-radius: 8px;
  }
  
  .blog-section-image img {
    height: 220px !important;
    border-radius: 8px;
  }
}

@media (max-width: 576px) {
  .blog-section-image img {
    height: 200px !important;
  }
}

@media (max-width: 480px) {
  .blog-section-image img {
    height: 180px !important;
  }
}

/* Error handling for broken images */
.blog-section-image img {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="%23f8f9fa"/><text x="50" y="50" text-anchor="middle" dy=".3em" fill="%23adb5bd">Image</text></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100px 100px;
}

/* High DPI display optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .blog-section-image img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Image Caption Styling */
.blog-image-caption {
  margin-top: 0.8rem;
  text-align: center;
  font-style: italic;
  line-height: 1.4;
  padding: 0 1rem;
}

.blog-image-caption small {
  color: #6c757d !important;
  font-size: 0.85rem;
  font-weight: 500;
  display: block;
}

/* Full-width image option */
.blog-section-image.full-width {
  margin-left: -2rem;
  margin-right: -2rem;
  border-radius: 0;
}

.blog-section-image.full-width img {
  border-radius: 0;
  max-height: 500px;
}

/* Side-by-side image and text layout */
.blog-section-with-image {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin: 2rem 0;
}

.blog-section-with-image .blog-section-image {
  flex: 0 0 45%;
  margin: 0;
}

.blog-section-with-image .blog-section-text {
  flex: 1;
}

/* Image positioning options */
.blog-section-image.float-right {
  float: right;
  margin: 0 0 1rem 2rem;
  max-width: 50%;
}

.blog-section-image.float-left {
  float: left;
  margin: 0 2rem 1rem 0;
  max-width: 50%;
}

/* Responsive image sizing */
@media (max-width: 1200px) {
  .blog-section-image img {
    max-height: 350px;
  }
  
  .blog-section-with-image {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .blog-section-with-image .blog-section-image {
    flex: none;
  }
}

@media (max-width: 992px) {
  .blog-section-image img {
    max-height: 300px;
  }
  
  .blog-section-image.full-width {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
  }
  
  .blog-section-image.float-right,
  .blog-section-image.float-left {
    float: none;
    margin: 1rem 0;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .blog-section-image {
    margin: 1rem 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
  
  .blog-section-image img {
    max-height: 250px;
    border-radius: 8px;
  }
  
  .blog-section-image.full-width {
    margin-left: -1rem;
    margin-right: -1rem;
  }
  
  .blog-image-caption {
    margin-top: 0.6rem;
    padding: 0 0.5rem;
  }
  
  .blog-image-caption small {
    font-size: 0.8rem;
  }
}

@media (max-width: 576px) {
  .blog-section-image img {
    max-height: 200px;
  }
  
  .blog-section-image.full-width {
    margin-left: -0.8rem;
    margin-right: -0.8rem;
  }
  
  .blog-image-caption small {
    font-size: 0.75rem;
  }
}

/* Loading state for images */
.blog-section-image img {
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
}

/* Image overlay effects */
.blog-section-image.with-overlay {
  position: relative;
}

.blog-section-image.with-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.blog-section-image.with-overlay:hover::before {
  opacity: 1;
}

/* Zoom effect for images */
.blog-section-image.zoom-effect {
  overflow: hidden;
}

.blog-section-image.zoom-effect img {
  transition: transform 0.5s ease;
}

.blog-section-image.zoom-effect:hover img {
  transform: scale(1.1);
}

/* Lazy loading optimization */
.blog-section-image img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.blog-section-image img[loading="lazy"].loaded {
  opacity: 1;
}

/* High DPI display optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .blog-section-image img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Print styles for images */
@media print {
  .blog-section-image {
    page-break-inside: avoid;
    margin: 1rem 0;
    box-shadow: none !important;
  }
  
  .blog-section-image img {
    max-height: 300px !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .blog-image-caption {
    color: #000 !important;
  }
}

/* Accessibility improvements */
.blog-section-image img {
  cursor: pointer; /* Indicate clickable if needed */
}

.blog-section-image img:focus {
  outline: 2px solid #4299e1;
  outline-offset: 2px;
}

/* Image gallery styles (if multiple images) */
.blog-image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.blog-image-gallery .blog-section-image {
  margin: 0;
}

@media (max-width: 768px) {
  .blog-image-gallery {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* Caption styling variations */
.blog-image-caption.center {
  text-align: center;
}

.blog-image-caption.left {
  text-align: left;
}

.blog-image-caption.right {
  text-align: right;
}

/* Image border styles */
.blog-section-image.bordered {
  border: 3px solid #e2e8f0;
  padding: 0.5rem;
  background: #ffffff;
}

.blog-section-image.bordered img {
  border-radius: 8px;
}

/* Gradient border effect */
.blog-section-image.gradient-border {
  padding: 3px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 15px;
}

.blog-section-image.gradient-border img {
  border-radius: 12px;
  background: #ffffff;
}

/* ============================================ */
/* Blog Sidebar Styling */
/* ============================================ */

/* Main Sidebar Container */
.blog-sidebar {
  padding-left: 2rem;
  position: sticky;
  top: 120px; /* Account for fixed navbar */
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

/* Sidebar Sections */
.blog-sidebar-section {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease;
}

.blog-sidebar-section:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Sidebar Headings */
.blog-sidebar-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
  position: relative;
}

.blog-sidebar-heading::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 30px;
  height: 2px;
  background: linear-gradient(to right, #667eea, #764ba2);
}

/* ============================== */
/* Table of Contents Styling */
/* ============================== */

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

.blog-toc-list li {
  margin-bottom: 0.5rem;
}

.blog-toc-link {
  display: block;
  color: #4a5568;
  text-decoration: none;
  padding: 0.5rem 0;
  font-size: 0.9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  padding-left: 0.8rem;
  transition: all 0.3s ease;
}

.blog-toc-link:hover,
.blog-toc-link.active {
  color: #667eea;
  border-left-color: #667eea;
  background: rgba(102, 126, 234, 0.05);
  text-decoration: none;
  transform: translateX(3px);
}

/* Subsections */
.blog-toc-sublist {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0 1rem;
}

.blog-toc-sublink {
  display: block;
  color: #718096;
  text-decoration: none;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  font-weight: 400;
  border-left: 2px solid transparent;
  padding-left: 0.6rem;
  transition: all 0.3s ease;
}

.blog-toc-sublink:hover,
.blog-toc-sublink.active {
  color: #764ba2;
  border-left-color: #764ba2;
  background: rgba(118, 75, 162, 0.05);
  text-decoration: none;
  transform: translateX(2px);
}

/* ============================== */
/* Social Share Styling */
/* ============================== */

.blog-social-share {
  display: flex;
  flex-direction: row; 
  /* justify-content: space-between;  */
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0;
}

.blog-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px; 
  border-radius: 50%; 
  text-decoration: none;
  font-size: 1.1rem; 
  font-weight: 500;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.blog-share-btn:hover {
  text-decoration: none;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.blog-share-btn i {
  z-index: 2;
  position: relative;
  transition: all 0.3s ease;
}

/* Facebook */
.facebook-share {
  background: #f0f2ff;
  color: #1877f2;
  border-color: #e3e8ff;
}

.facebook-share:hover {
  background: #1877f2;
  color: white;
  border-color: #1877f2;
}

/* LinkedIn */
.linkedin-share {
  background: #f0f9ff;
  color: #0077b5;
  border-color: #e0f2fe;
}

.linkedin-share:hover {
  background: #0077b5;
  color: white;
  border-color: #0077b5;
}

/* Twitter */
.twitter-share {
  background: #f0f9ff;
  color: #1da1f2;
  border-color: #e0f2fe;
}

.twitter-share:hover {
  background: #1da1f2;
  color: white;
  border-color: #1da1f2;
}

/* Hover animation effects */
.blog-share-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.blog-share-btn:hover::before {
  width: 100%;
  height: 100%;
}

/* Active/Focus states for accessibility */
.blog-share-btn:focus {
  outline: 2px solid #4299e1;
  outline-offset: 2px;
}

.blog-share-btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* ============================== */
/* Responsive Design for Social Share */
/* ============================== */

@media (max-width: 1200px) {
  .blog-share-btn {
    width: 42px;
    height: 42px;
    font-size: 1rem;
  }
}

@media (max-width: 991px) {
  .blog-social-share {
    gap: 0.8rem;
    justify-content: center; /* Center on tablet */
  }
  
  .blog-share-btn {
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
  }
}

@media (max-width: 768px) {
  .blog-social-share {
    gap: 0.6rem;
    justify-content: center;
  }
  
  .blog-share-btn {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .blog-social-share {
    gap: 0.5rem;
    justify-content: space-around; /* Better distribution on mobile */
  }
  
  .blog-share-btn {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  .blog-social-share {
    gap: 0.4rem;
  }
  
  .blog-share-btn {
    width: 34px;
    height: 34px;
    font-size: 0.8rem;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .blog-share-btn {
    border: 2px solid currentColor;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .facebook-share {
    background: rgba(24, 119, 242, 0.2);
    color: #42a5f5;
  }
  
  .linkedin-share {
    background: rgba(0, 119, 181, 0.2);
    color: #29b6f6;
  }
  
  .twitter-share {
    background: rgba(29, 161, 242, 0.2);
    color: #42a5f5;
  }
}

/* Print styles - hide social share */
@media print {
  .blog-social-share {
    display: none;
  }
}

/* ============================== */
/* Author Section Styling */
/* ============================== */

.blog-author-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.blog-author-avatar {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #e2e8f0;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.author-image {
  width: 100%;
  height: 100%;
  object-fit: contain !important; 
  object-position: center !important;
  border-radius: 0; 
  background: transparent; 
  padding: 2px; 
}

.blog-author-info {
  flex-grow: 1;
}

.author-name {
  font-size: 1rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.author-bio {
  font-size: 0.85rem;
  color: #718096;
  line-height: 1.4;
  margin-bottom: 0.8rem;
}

.author-social {
  display: flex;
  gap: 0.5rem;
}

.author-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f7fafc;
  color: #1877f2;
  text-decoration: none;
  transition: all 0.3s ease;
}

.author-social a:hover {
  background: #1877f2;
  color: white;
  transform: translateY(-2px);
}

/* ======================== */
/* Related Articles Widget */
/* ====================== */

.blog-related-articles {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.blog-related-item {
  display: flex;
  gap: 0.8rem;
  padding: 0.8rem;
  border-radius: 8px;
  background: #f8f9fa;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
}

.blog-related-item:hover {
  background: #e9ecef;
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.related-image {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.related-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important; /* Ensures image covers the container */
  object-position: center !important; /* Centers the image */
  border-radius: 0 !important; /* Remove border radius from image */
  display: block !important;
  background: #f8f9fa;
}

.related-content {
  flex-grow: 1;
  min-width: 0;
}

.related-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #2d3748;
  line-height: 1.3;
  margin-bottom: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-date {
  font-size: 0.75rem;
  color: #718096;
  font-weight: 500;
}

/* Tablet view */
@media (max-width: 991px) {
  .blog-related-item {
    padding: 1rem; /* More padding on tablet */
    gap: 1rem;
  }
  
  .related-image {
    width: 65px;
    height: 65px;
    border-radius: 6px;
  }
  
  .related-title {
    font-size: 0.85rem;
  }
}
@media (max-width: 768px) {
  .blog-related-item {
    padding: 0.8rem;
    gap: 0.8rem;
    border-radius: 10px; /* Larger border radius for mobile */
  }
  
  .related-image {
    width: 60px !important; /* Fixed width */
    height: 60px !important; /* Fixed height */
    min-width: 60px !important; /* Prevent shrinking */
    max-width: 60px !important; /* Prevent growing */
    border-radius: 8px !important;
    flex-shrink: 0 !important; /* Prevent image container from shrinking */
  }
  .related-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important; /* Cover the entire container */
    object-position: center !important; /* Keep image centered */
    border-radius: 0 !important;
    display: block !important;
  }
  
  .related-content {
    flex: 1; /* Take remaining space */
    min-width: 0; /* Allow text to wrap properly */
  }

  .related-title {
    font-size: 0.8rem;
    line-height: 1.2;
    margin-bottom: 0.3rem;
    -webkit-line-clamp: 2; /* Ensure only 2 lines */
    line-clamp: 2; /* Standard property for compatibility */
  }
  
  .related-date {
    font-size: 0.7rem;
  }
}

/* Small mobile */
@media (max-width: 576px) {
  .blog-related-item {
    padding: 0.6rem;
    gap: 0.6rem;
  }
  
  .related-image {
    width: 50px !important;
    height: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    border-radius: 6px !important;
  }
  
  .related-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
  }
  
  .related-title {
    font-size: 0.75rem;
    line-height: 1.2;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
  
  .related-date {
    font-size: 0.65rem;
  }
}

/* Extra small mobile */
@media (max-width: 480px) {
  .blog-related-item {
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  .related-image {
    width: 45px !important;
    height: 45px !important;
    min-width: 45px !important;
    max-width: 45px !important;
    border-radius: 6px !important;
  }
  
  .related-title {
    font-size: 0.7rem;
    line-height: 1.1;
  }
  
  .related-date {
    font-size: 0.6rem;
  }
}

/* Very small screens */
@media (max-width: 375px) {
  .related-image {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
  }
  
  .related-title {
    font-size: 0.65rem;
  }
}

/* ============================== */
/* Responsive Design for Sidebar */
/* ============================== */

@media (max-width: 991px) {
  .blog-sidebar-section.toc-section {
    display: none !important; /* Hide TOC completely on mobile */
  }

  /* Hide Related Articles section on mobile */
  .blog-sidebar-section.related-articles-section,
  .blog-related-articles-section,
  .blog-sidebar-section:has(.blog-related-articles),
  .blog-sidebar-section:has(.related-articles),
  .blog-sidebar-section:has(.blog-related-item) {
    display: none !important; /* Hide Related Articles on mobile */
  }
  
  .blog-sidebar {
    padding-left: 0;
    margin-top: 3rem;
    position: static;
    max-height: none;
    overflow-y: visible;
  }
  
  .blog-sidebar-section {
    padding: 1.2rem;
  }
  
  .blog-social-share {
    display: flex !important;
    flex-direction: row !important; 
    flex-wrap: nowrap !important; 
    gap: 0.8rem !important;
    justify-content: center !important;
    align-items: center !important;
  }
  
  .blog-share-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 45px !important;
    height: 45px !important;
    min-width: 45px !important;
    max-width: 45px !important;
    border-radius: 50% !important;
    font-size: 1rem !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
  }
  
  .blog-share-btn span {
    display: none;
  }
}

@media (max-width: 768px) {
  .blog-sidebar-section.toc-section {
    display: none !important;
  }
  
  /* Hide Related Articles section on mobile */
  .blog-sidebar-section.related-articles-section,
  .blog-related-articles-section,
  .blog-sidebar-section:has(.blog-related-articles),
  .blog-sidebar-section:has(.related-articles),
  .blog-sidebar-section:has(.blog-related-item) {
    display: none !important; /* Hide Related Articles on mobile */
  }

  .blog-sidebar-section {
    padding: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .blog-social-share {
    gap: 0.6rem !important;
    justify-content: center !important;
  }
  
  .blog-share-btn {
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    font-size: 0.95rem !important;
  }
  
  .blog-author-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  
  .blog-author-avatar {
    width: 80px;
    height: 80px;
  }
  
  .author-social {
    justify-content: center;
  }
  
  .blog-related-item {
    padding: 0.6rem;
  }
  
  .related-image {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 576px) {
  .blog-sidebar-section.toc-section {
    display: none !important;
  }

  .blog-social-share {
    display: flex !important;
    flex-direction: row !important; 
    flex-wrap: nowrap !important;
    gap: 0.5rem !important;
    justify-content: center !important;
  }
  
  .blog-share-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    border-radius: 50% !important;
    font-size: 0.9rem !important;
    flex: 0 0 auto !important;
  }

  .blog-share-btn span {
    display: none !important;
  }

  .blog-share-btn i {
    font-size: 0.9rem !important;
  }
}

/* ============================== */
/* Sticky Sidebar Enhancements */
/* ============================== */

/* Smooth scrolling for TOC links */
html {
  scroll-behavior: smooth;
}

/* Active TOC link highlighting */
.blog-toc-link.active {
  background: rgba(102, 126, 234, 0.1);
  font-weight: 600;
}

/* Custom scrollbar for sidebar */
.blog-sidebar::-webkit-scrollbar {
  width: 4px;
}

.blog-sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 2px;
}

.blog-sidebar::-webkit-scrollbar-thumb {
  background: #667eea;
  border-radius: 2px;
}

.blog-sidebar::-webkit-scrollbar-thumb:hover {
  background: #5a67d8;
}

/* Print styles - hide sidebar */
@media print {
  .blog-sidebar {
    display: none;
  }
  
  .col-lg-8 {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Blog section spacing - matches reference blog */
.blog-section {
    margin-bottom: 2rem;
}

.blog-section h2.blog-section-heading {
    margin-bottom: 1rem;
    line-height: 1.2;
}

.blog-section p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.blog-section p:last-child {
    margin-bottom: 0;
}

/* Subsection spacing */
.blog-subsection {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.blog-subsection h3.blog-subsection-heading {
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.blog-subsection + p {
    margin-top: 0.75rem;
}

/* Remove excessive spacing between consecutive elements */
.blog-section > h2 + p {
    margin-top: 0;
}

.blog-section > .blog-subsection + p {
    margin-top: 0.75rem;
}

/* Image spacing within sections */
.blog-section .blog-section-image {
    margin: 1.5rem 0;
}

/* Quote spacing within sections */
.blog-section .blog-quote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
}

/* Lead paragraph spacing */
.blog-section-intro {
    margin-bottom: 2rem;
}

.blog-lead-paragraph {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* ============================== */
/* Tighter Spacing Between H2 and H3 */
/* ============================== */

/* Reduce space between main heading and subheading */
.blog-section-heading + .blog-subsection {
    margin-top: 0.5rem !important; /* Reduced from 1.5rem */
}

/* Reduce space when H3 immediately follows H2 */
.blog-section h2.blog-section-heading + .blog-subsection h3.blog-subsection-heading {
    margin-top: 0.3rem !important;
}

/* Specific spacing for subsection after main section heading */
.blog-section > h2.blog-section-heading + div.blog-subsection {
    margin-top: 0.3rem !important;
    margin-bottom: 0.8rem !important;
}

/* Reduce space between H2 and immediately following H3 */
.blog-section h2 + h3,
.blog-section h2 + .blog-subsection h3 {
    margin-top: 0.4rem !important;
}

/* Ensure H3 after H2 has minimal top margin */
.blog-subsection h3.blog-subsection-heading {
    margin-top: 0 !important;
    margin-bottom: 0.6rem !important;
}

/* Tight spacing between section heading and subsection */
.blog-section-heading {
    margin-bottom: 0.8rem !important; /* Reduced from 1rem */
}

/* When subsection immediately follows main heading */
.blog-section > .blog-section-heading + .blog-subsection {
    margin-top: 0.2rem !important;
}

/* Content spacing adjustments */
.blog-subsection + p {
    margin-top: 0.5rem !important; /* Reduced from 0.75rem */
}

/* Remove extra spacing on first child elements */
.blog-section > *:first-child {
    margin-top: 0 !important;
}

.blog-subsection > *:first-child {
    margin-top: 0 !important;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .blog-section-heading + .blog-subsection {
        margin-top: 0.3rem !important;
    }
    
    .blog-section h2.blog-section-heading + .blog-subsection h3.blog-subsection-heading {
        margin-top: 0.2rem !important;
    }
    
    .blog-section-heading {
        margin-bottom: 0.6rem !important;
    }
    
    .blog-subsection h3.blog-subsection-heading {
        margin-bottom: 0.5rem !important;
    }
}

@media (max-width: 576px) {
    .blog-section-heading + .blog-subsection {
        margin-top: 0.25rem !important;
    }
    
    .blog-section-heading {
        margin-bottom: 0.5rem !important;
    }
}

/* Loading state styling */
.loading-indicator {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    border: 1px solid #e2e8f0;
}

.loading-indicator i.fa-spinner {
    color: #667eea;
    margin-right: 0.5rem;
}

/* Smooth transition for content replacement */
.static-fallback {
    transition: opacity 0.3s ease-out;
}

.static-fallback.fade-out {
    opacity: 0;
}

/* Ensure dynamic cards match static card styling exactly */
.blog-card-meta {
    padding: 16px 20px 8px;
    border-bottom: 1px solid #f0f0f0;
    background: #ffffff;
}

.blog-card-author,
.blog-card-date {
    font-size: 0.75rem;
    color: #666666;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.blog-card-author i,
.blog-card-date i {
    color: #667eea;
    margin-right: 6px;
}

.blog-card-content {
    padding: 20px;
}

.blog-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-description {
    font-size: 0.95rem;
    color: #718096;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 16px;
}

.blog-card-tags .badge {
    font-size: 0.7rem;
    padding: 4px 8px;
    margin-right: 4px;
}

/* Ensure consistent card heights */
.blog-card {
    height: 100%;
    min-height: 420px;
}

/* ============================== */