body {
  /* CRITICAL FIX: Prevents the entire page from stretching horizontally */
  overflow-x: hidden !important;
}

/* Base styles for the blog content */
.blog-content {
  max-width: 800px;
  margin: 2rem auto;
  padding: 1.5rem;
  line-height: 1.7;
  color: #374151; /* Dark gray text */
  font-size: 1rem;
}

.blog-content > * {
  margin-bottom: 1.5rem;
}

/* Headings, Paragraphs, Lists, Blockquotes, Code Blocks, Images, etc. (All base styles are correct) */

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
  font-weight: bold;
  color: #111827;
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

/* Headings */
.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
  font-weight: bold;
  color: #111827; /* Very dark gray/black */
  line-height: 1.3;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

/* Paragraphs */
.blog-content p {
  font-size: 1rem;
}

/* Lists */
.blog-content ul,
.blog-content ol {
  margin-left: 1.5rem;
  padding-left: 0;
}

.blog-content ul {
  list-style-type: disc;
}

.blog-content ol {
  list-style-type: decimal;
}

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

/* Blockquotes */
.blog-content blockquote {
  border-left: 0.25rem solid #cbd5e0; /* Light blue accent */
  padding-left: 1rem;
  font-style: italic;
  color: #718096; /* Medium gray */
  margin-left: 0;
  margin-right: 0;
}

/* Code blocks */
.blog-content pre {
  background-color: #f7fafc; /* Very light gray */
  padding: 1rem;
  border-radius: 0.25rem;
  overflow-x: auto;
  font-size: 0.9rem;
  font-family: monospace;
}

.blog-content code {
  font-family: monospace;
  font-size: 0.9rem;
  background-color: #edf2f7; /* Light gray */
  color: #2d3748; /* Dark gray */
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
}

.blog-content pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

.prose p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

/* Images */
.blog-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.25rem;
  margin: 1rem 0;
}

/* Strong and emphasis */
.blog-content strong {
  font-weight: 600; /* Semi-bold */
}

.blog-content em {
  font-style: italic;
}

/* Links */
.blog-content a {
  color: #3b82f6; /* Blue link color */
  text-decoration: underline;
  transition: color 0.2s ease-in-out;
}

.blog-content a:hover {
  color: #2563eb; /* Darker blue on hover */
}

/* Horizontal rules */
.blog-content hr {
  border-top: 1px solid #e0e6ed; /* Light gray border */
  margin: 2rem 0;
}

/* --- Responsive Adjustments (Desktop/Tablet) --- */
@media (max-width: 768px) {
  .blog-content {
    padding: 1rem;
    font-size: 0.95rem;
  }

  .blog-content h2 {
    font-size: 1.5rem;
  }

  .blog-content h3 {
    font-size: 1.25rem;
  }
}
/* ================================================= */
/* === Enhanced Table Styles - Mobile Optimized === */
/* ================================================= */

/* Table responsive wrapper */
.blog-content .table-responsive {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  border-radius: 0.5rem;
  margin: 1.5rem 0;
  border: 1px solid #e5e7eb;
  background: #fff;
  position: relative;
}

/* Visual indicator for scrollable tables */
.blog-content .table-responsive::after {
  content: "↔";
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
  color: #6b7280;
  opacity: 0.6;
  pointer-events: none;
}

/* Table styling */
.blog-content table {
  min-width: 450px !important;
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.95rem;
  margin: 0;
  background: white;
}

/* Table cells */
.blog-content table th,
.blog-content table td {
  padding: 0.75rem 1rem !important;
  border: 1px solid #e5e7eb !important;
  text-align: left;
  word-break: break-word;
  line-height: 1.4;
  vertical-align: top;
}

/* Head row styling */
.blog-content table thead th {
  background-color: #f8fafc;
  font-weight: 600;
  color: #1f2937;
  position: sticky;
  left: 0;
  border-bottom: 2px solid #e5e7eb !important;
}

/* Zebra stripes */
.blog-content table tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

.blog-content table tbody tr:hover {
  background-color: #f3f4f6;
}

/* --- MOBILE FIXES (Screen <= 768px) --- */
@media (max-width: 768px) {
  .blog-content .table-responsive {
    margin: 1rem 0;
    border-radius: 0.375rem;
  }

  /* REDUCED: Smaller table width for mobile */
  .blog-content table {
    min-width: 380px !important; /* Reduced from 400px */
    font-size: 0.9rem !important;
  }

  .blog-content table th,
  .blog-content table td {
    padding: 0.6rem 0.8rem !important;
  }

  /* Force header text to stay on one line */
  .blog-content table thead th {
    white-space: nowrap !important;
    font-size: 0.875rem;
  }

  /* First column styling - slightly narrower */
  .blog-content table th:first-child,
  .blog-content table td:first-child {
    width: 30% !important; /* Reduced from 35% */
    min-width: 100px !important; /* Reduced from 120px */
    max-width: 130px !important; /* Reduced from 150px */
    white-space: nowrap !important;
    font-weight: 600 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    position: sticky;
    left: 0;
    background: inherit;
    z-index: 1;
  }

  /* Second column - allow wrapping with reduced min-width */
  .blog-content table th:not(:first-child),
  .blog-content table td:not(:first-child) {
    white-space: normal !important;
    word-break: break-word !important;
    min-width: 180px !important; /* Reduced from 200px */
  }
}

/* --- SMALL MOBILE FIXES (Screen <= 480px) --- */
@media (max-width: 480px) {
  .blog-content .table-responsive {
    margin-left: -0.5rem; /* Reduced from -1rem */
    margin-right: -0.5rem; /* Reduced from -1rem */
    width: calc(100% + 1rem) !important; /* Reduced from +2rem */
    border-radius: 0.375rem;
    border-left: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
  }

  /* FURTHER REDUCED: Even smaller table width for small mobile */
  .blog-content table {
    min-width: 320px !important; /* Reduced from 350px */
    font-size: 0.85rem !important;
  }

  .blog-content table th,
  .blog-content table td {
    padding: 0.5rem 0.6rem !important; /* Slightly reduced padding */
  }

  /* First column - even narrower */
  .blog-content table th:first-child,
  .blog-content table td:first-child {
    min-width: 90px !important; /* Reduced from 100px */
    max-width: 110px !important; /* Reduced from 130px */
    padding-right: 0.5rem !important; /* Reduced right padding */
  }

  /* Second column - further reduced */
  .blog-content table th:not(:first-child),
  .blog-content table td:not(:first-child) {
    min-width: 150px !important; /* Reduced from 180px */
    padding-left: 0.5rem !important; /* Reduced left padding */
  }
}

/* --- EXTRA SMALL DEVICES (Screen <= 375px) --- */
@media (max-width: 375px) {
  .blog-content .table-responsive {
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    width: calc(100% + 0.5rem) !important;
  }

  /* MINIMUM REDUCED: Smallest table width for very small screens */
  .blog-content table {
    min-width: 300px !important; /* Reduced from 320px */
    font-size: 0.82rem !important;
  }

  .blog-content table th,
  .blog-content table td {
    padding: 0.4rem 0.5rem !important; /* Minimal padding */
  }

  /* First column - minimal width */
  .blog-content table th:first-child,
  .blog-content table td:first-child {
    min-width: 80px !important; /* Minimal width */
    max-width: 100px !important;
    font-size: 0.8rem !important;
  }

  /* Second column - minimal width */
  .blog-content table th:not(:first-child),
  .blog-content table td:not(:first-child) {
    min-width: 130px !important; /* Minimal width */
    font-size: 0.8rem !important;
  }
}

/* --- TINY SCREENS (Screen <= 320px) --- */
@media (max-width: 320px) {
  .blog-content table {
    min-width: 280px !important; /* Absolute minimum for tiny screens */
  }

  .blog-content table th:first-child,
  .blog-content table td:first-child {
    min-width: 70px !important;
    max-width: 90px !important;
  }

  .blog-content table th:not(:first-child),
  .blog-content table td:not(:first-child) {
    min-width: 120px !important;
  }
}

/* Fallback for tables that aren't wrapped (just in case) */
.blog-content table:not(.table-responsive table) {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
  margin: 1.5rem 0;
  border: 1px solid #e5e7eb;
  min-width: 380px !important; /* Same reduced width as mobile */
}

.blog-content table:not(.table-responsive table) tbody {
  white-space: normal;
}
