/* --- BLOG POST STYLES (Mobile First) --- */

#mainWrapper {
    display: flex;
    min-height: calc(100vh - 120px);
    margin-bottom: 6rem;
}

.insight-post-section{ padding: 1.5rem;}
/* ─── Featured Hero Image ──────────────────────────────────────────────────── */
.hero-image {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 2rem;
    overflow: hidden;
    border-radius: 12px;
}
.hero-image picture,
.hero-image img {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    display: block;
}

/* Featured image on blog post page */
.blog-content-wrapper > picture,
.blog-content-wrapper > picture img {
    width: 100%;
    max-height: 350px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    margin: 1.5rem auto;
}

/* --- Blog Post Body --- */
.blog-post {
    padding: 1.5rem 1rem;
    max-width: 1200px;
    margin-top: 0;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    color: #333;
    line-height: 1.7;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
}

.blog-post h1 {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-align: center;
}

.blog-post .post-meta {
    font-size: 0.95rem;
    color: #777;
    text-align: center;
    margin-bottom: 2rem;
}

.blog-post img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    display: block;
}

.blog-post h2,
.blog-post h3 {
    margin-top: 2.2rem;
    margin-bottom: 1.15rem;
    font-weight: 700;
}

.blog-post h2 {
    font-size: 1.33rem;
}

.blog-post h3 {
    font-size: 1.12rem;
}

.blog-post p {
    margin-bottom: 1.2rem;
    font-size: 1.08rem;
    line-height: 1.7;
}

.blog-post ul,
.blog-post ol {
    margin: 1.5rem 0;
    padding-left: 2em;
    line-height: 1.1;
}



.blog-post ul li,
.blog-post ol li {
    margin-bottom: 1rem;
    font-size: 1.12rem;
    color: #1a1a1a;          /* Slightly darker for contrast */
    position: relative;
    padding-left: 1.5em;     /* Room for custom bullet */
}

.blog-post ul li::marker {
    color: #555;
}

/* --- Image sections with captions (AI inserted) --- */
.blog-post .image {
    max-width: 92%;
    margin: 2rem auto;
    text-align: center;
}

.blog-post .image picture,
.blog-post .image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 0.5rem;
}

.blog-post .image .caption {
    font-size: 0.9rem;
    color: #666;
}

/* --- Related Posts Section --- */
.related-posts {
    margin-top: 3rem;
}

.related-posts h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 700;
    font-size: 1.28rem;
    letter-spacing: 0.01em;
}

.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.1rem;
    margin: 0 auto;
    max-width: 1024px;
}

.related-card {
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
    box-shadow: 0 4px 24px rgba(0,0,0,0.09), 0 0px 1.5px rgba(0,0,0,0.03);
    transition:
            transform 0.14s cubic-bezier(.36,.07,.19,.97),
            box-shadow 0.2s,
            border-color 0.2s;
    cursor: pointer;
    outline: none;
    min-height: 340px;
    border: 2px solid transparent;
}

.related-card:focus,
.related-card:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 12px 36px rgba(0,123,255,0.10), 0 1.5px 4px rgba(0,0,0,0.04);
    border-color: #007BFF;
}

.related-img-wrap {
    width: 100%;
    height: 148px;
    background: #f4f4f4;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
}

.related-img-wrap picture, .related-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    display: block;
    transition: opacity 0.5s;
    opacity: 0.97;
}

.related-card-content {
    padding: 1.08rem 1rem 1.08rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: flex-start;
}

.related-card-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.3em;
    color: #111;
}

.related-card-content p {
    color: #555;
    font-size: 0.99rem;
    margin: 0;
    margin-bottom: 0.2em;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3em;
}

/* Keyboard focus highlight */
.related-card:focus {
    box-shadow: 0 0 0 3px #90cdf4, 0 12px 36px rgba(0,123,255,0.10);
    border-color: #007BFF;
}

/* Back to Blog Link */
.back-to-blog {
    display: inline-block;
    margin-top: 2rem;
    color: #007BFF;
    text-decoration: none;
    font-weight: bold;
    padding-left: 0.5rem;
    font-size: 1.06rem;
}
.back-to-blog:hover,
.back-to-blog:focus {
    text-decoration: underline;
    color: #0056b3;
}

/* Scroll to Top Button */
.scroll-top-btn {
    width: 50px;
    height: 50px;
    font-size: 1.75rem;
    padding: 0;
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    display: none;
    z-index: 999;
    cursor: pointer;
    transition: background-color 0.2s;
}
.scroll-top-btn:hover {
    background-color: #0056b3;
}

/* Fade In Animation */
/*
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
*/
/* Responsive (Tablet and Up) */
@media (min-width: 600px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    .blog-post h1 {
        font-size: 2.2rem;
    }
    .blog-post h2 {
        font-size: 1.34rem;
    }
    .blog-post h3 {
        font-size: 1.19rem;
    }
    .blog-post p,
    .blog-post li {
        font-size: 1.12rem;
    }
}
@media (min-width: 1024px) {
    .related-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.8rem;
    }
}

/* Wrapper tweaks for layout */
.blog-content-wrapper {
    position: relative;
    z-index: 1;
    width: -webkit-fill-available;
}

.blog-post-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    width: 100%;
}

.blog-post-page #mainWrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.post-inner-content {
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
    padding: 1.5rem;
}

/* Ensure images inside AI-inserted <section class="image"> get the right max-width */
.blog-post-page .image {
    max-width: 92%;
    margin: 2rem auto;
    text-align: center;
}
.blog-post-page .image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 0.5rem;
}

/* Printing: only main content */
@media print {
    body * { visibility: hidden; }
    .blog-post, .blog-post * { visibility: visible; }
    .scroll-top-btn, .related-posts, .back-to-blog { display: none; }
}

/* ─── Breadcrumbs: span same max-width as article and pin left ─── */
main.blog-post-page > nav.breadcrumb-wrap {
    display: flex;                    /* reinforce flex container */
    justify-content: flex-start;      /* keep items left */
    width: 100%;                      /* fill the article slot */
    max-width: 1200px;                /* same max-width as .blog-post */
    margin: 1rem auto 1.5rem;            /* center container then push down */
    padding: 0 1rem;                  /* consistent gutter */
    text-align: left;                 /* safety for inline children */
}