.blog-content {
    font-family: inherit;
    line-height: 1.7;
    overflow-wrap: break-word;
    word-break: break-word;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    color: #222;
    font-size: 1rem;
}

/* Images, SVGs, pictures */
.blog-content img,
.blog-content picture,
.blog-content svg {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block;
    margin: 0.6rem 0;
    object-fit: contain;
}

/* Ensure any inline width/height doesn't break layout */
.blog-content [width],
.blog-content [height],
.blog-content [style*="width"] {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
}

/* Videos, embeds and iframes */
.blog-content iframe,
.blog-content video,
.blog-content embed,
.blog-content object {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block;
    margin: 0.6rem 0;
    border: 0;
    box-sizing: border-box;
}

/* Fallback aspect ratio where supported */
.blog-content iframe {
    aspect-ratio: 16/9;
    min-height: 180px;
}

/* Responsive embed wrapper (used by JS) */
.embed-responsive {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 */
    margin: 0.6rem 0;
}

.embed-responsive iframe,
.embed-responsive video,
.embed-responsive object {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Tables become horizontally scrollable on small screens */
.blog-content .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0.6rem 0;
}

.blog-content table {
    width: 100% !important;
    border-collapse: collapse;
    min-width: 100%;
}

.blog-content table th,
.blog-content table td {
    padding: 0.5rem;
    vertical-align: top;
    word-break: break-word;
}

/* Code blocks & inline code */
.blog-content pre,
.blog-content code {
    white-space: pre-wrap;
    word-break: break-word;
    overflow-x: auto;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
    background: #f6f8fa;
    margin: 0.6rem 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
    max-width: 100%;
    /* display: inline; */
    border-radius: 4px;
}

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

/* Figures */
.blog-content figure {
    margin: 0.6rem 0;
}

/* Make links that wrap images behave nicely */
.blog-content a img {
    display: block;
}

/* Content layout (TOC + content) — flexible + responsive */
.article-wrapper {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.table-of-contents {
    width: 240px;
    flex: 0 0 240px;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow: auto;
    padding-right: .5rem;
}

.article-content {
    flex: 1 1 auto;
    min-width: 0;
}

/* Collapse sidebar on smaller screens */
@media (max-width: 991.98px) {
    .article-wrapper {
        flex-direction: column;
    }

    .table-of-contents {
        position: static;
        width: 100%;
        max-height: none;
        margin-bottom: 1rem;
    }
}

/* safety net: break extremely long words/URLs */
.blog-content,
.blog-content p,
.blog-content li {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* small utilities */
.img-fluid {
    max-width: 100%;
    height: auto;
    display: block;
}

.article-featured-image {
    max-width: 95%;
    margin: 20px auto;
    /* centers the container */
    border-top: 3px solid var(--accent-color);
    background-color: var(--surface-color);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    text-align: center;
}

/* Fix for feature image centering */
.article-featured-image img.featured-img {
  display: block;
  margin: 0 auto;      
  max-width: 100%;         
  height: auto;         
  object-fit: contain;    
}

@media (max-width: 768px) {
  .article-featured-image img.featured-img {
    width: 100%;
  }
}
