@media (max-width: 767px) {
    /*
      IMPORTANT: .site-header itself has z-index:50 in the theme's CSS,
      which creates its own stacking context. Anything inside the header
      (like .site-nav, even with z-index:10000) is compared against OTHER
      elements using the header's z-index:50 as its "rank" — not 10000.
      So the overlay below must stay UNDER 50, or it will visually sit on
      top of the header/sidebar and swallow all clicks on the nav links.
    */
    .site-nav {
        position: fixed !important;
        top: 0 !important;
        left: auto !important;
        right: -280px !important;
        width: 260px !important;
        height: 100vh !important;
        transform: none !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 76px 0 20px !important;
        gap: 0 !important;
        background: #ffffff !important;
        box-shadow: -8px 0 30px rgba(0, 0, 0, 0.25) !important;
        transition: right 0.3s ease-in-out !important;
        overflow-y: auto !important;
    }

    .site-nav.open {
        right: 0 !important;
        transform: none !important;
    }

    .site-nav a {
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 14px 28px !important;
        font-size: 16px !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    }

    .site-nav a.active {
        background: rgba(240, 165, 0, 0.08) !important;
    }

    .header-right {
        position: relative !important;
    }

    .menu-toggle.open {
        position: fixed !important;
        top: 22px !important;
        right: 20px !important;
        z-index: 60 !important;
    }

    /* Dark overlay behind the sidebar — kept BELOW the header's z-index:50 */
    .menu-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.45);
        z-index: 45;
    }

    .menu-overlay.open {
        display: block !important;
    }
}

.blog-grid-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -12px;
    margin-left: -12px;
}

.blog-grid-col {
    flex: 0 0 100%;
    max-width: 100%;
    padding-right: 12px;
    padding-left: 12px;
    margin-bottom: 24px;
    display: flex;
    align-items: stretch;
}

/* Tablet: 2 posts per row */
@media (min-width: 768px) {
    .blog-grid-col {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Desktop: 3 posts per row */
@media (min-width: 992px) {
    .blog-grid-col {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

:root {
    --brand-color: #DCAF63;
    --brand-hover: #DCAF63;
    --text-dark: #111111;
    --text-muted: #666666;
    --border-color: #eaeaea;
}

/* General Link Colors */
.post-content a {
    color: var(--brand-color);
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}
.post-content a:hover {
    color: var(--brand-hover);
    text-decoration: underline;
}

/* Headings with Bottom Accent Line */
.post-content h2,
.post-content h3,
.post-content h4 {
    position: relative;
    padding-bottom: 10px;
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
}
.post-content h2::after,
.post-content h3::after,
.post-content h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 3px;
    background-color: var(--brand-color);
    border-radius: 2px;
}

/* Custom Checkmark Lists */
.post-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
}
.post-content ul li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 12px;
    line-height: 1.6;
}
.post-content ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 20px;
    background-color: rgba(224, 149, 0, 0.15);
    color: var(--brand-color);
    font-weight: bold;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Tables Styling & Responsiveness */
.post-content table {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}
.post-content th,
.post-content td {
    padding: 12px 16px;
    vertical-align: middle;
    border-top: 1px solid var(--border-color);
    color: #333333;
}
.post-content th {
    text-align: left;
}
.post-content thead th {
    background-color: #f8f9fa;
    color: var(--text-dark);
    font-weight: 700;
    border-bottom: 2px solid var(--border-color);
    border-top: none;
}
.post-content tbody tr:hover {
    background-color: #fdfdfd;
}
.post-content figure.wp-block-table,
.post-content > table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Post Footer Box (Tags & Back Button) */
.custom-post-footer {
    margin-top: 3.5rem !important;
    padding-top: 2rem;
    padding-bottom: 2rem;
    padding-left: 1.75rem;
    padding-right: 1.75rem;
    border-top: 1px solid var(--border-color);
    background-color: #fafbfc;
    border-radius: 12px;
}
.back-to-insights-btn {
    background-color: var(--brand-color);
    color: #ffffff !important;
    border-radius: 50px;
    padding: 10px 24px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
}
.back-to-insights-btn:hover {
    background-color: var(--brand-hover);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(224, 149, 0, 0.2);
}

/* Related Posts Section Heading Accent */
.related-section-title {
    position: relative;
    padding-bottom: 10px;
    margin-top: 3.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}
.related-section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 3px;
    background-color: var(--brand-color);
    border-radius: 2px;
}

#blog-hero {
    background-color: #ffffff;
    border-bottom: 1px solid #eaeaea;
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
}
#blog-hero .hero-content-col {
    padding-left: 2rem;
    padding-right: 2rem;
}
#blog-hero .section-heading {
    margin-top: 35px;
    font-size: 2.5rem;
    color: #111111;
}
#blog-hero .md-divider {
    max-width: 100px;
    margin: 24px auto 0;
    border-top: 2px solid #DCAF63;
}

/* Content Feed Section Styles */
#blog-content {
    background-color: #f9f9f9;
}
.md-blog-card {
    background-color: #ffffff !important;
    color: #333333 !important;
    border: 1px solid #eaeaea !important;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}
.md-blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08) !important;
}
.md-blog-card .blog-thumb-img {
    height: 220px;
    object-fit: cover;
    width: 100%;
}
.md-blog-card .card-body {
    padding: 1.5rem !important;
}
.md-blog-card .card-title a {
    transition: color 0.2s;
    color: #111111 !important;
    text-decoration: none !important;
}
.md-blog-card .card-title a:hover {
    color: #DCAF63 !important;
    text-decoration: none !important;
}

.blog-date {
    font-size: 0.85rem;
    color: #999999;
}

/* Utility & Full Width Elements */
.blog-full-width {
    flex: 0 0 100%;
    max-width: 100%;
}
.blog-alert-box {
    background-color: #ffffff;
    color: #333333;
}

/* ==========================================================
   Blog Detail Template — Related Posts Grid & List Fixes
   (moved out of the inline <style> block in blog-detail.php)
   ========================================================== */

/* Related Posts Grid Setup */
.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 991.98px) {
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767.98px) {
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
}

/* Fix Ordered Lists in Post Content */
.post-content ol {
    list-style-type: decimal !important;
    padding-left: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.post-content ol li {
    list-style-type: decimal !important;
    margin-bottom: 0.75rem !important;
    display: list-item !important;
}

/* Fix Unordered Lists & Icon Overlaps using Flexbox
   (overrides the checkmark-list rule above via !important) */
.post-content ul {
    list-style-type: none !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
    margin-bottom: 1.5rem !important;
}

.post-content ul li {
    list-style-type: none !important;
    display: flex !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
    margin-bottom: 0.75rem !important;
}

/* Default Mobile View: Stacked in a column and centered */
.cta-buttons-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;       /* Centers the buttons horizontally in column layout */
    justify-content: center;   /* Centers them if there's vertical height */
    gap: 12px;                 /* Adds space between the buttons */
    width: 100%;
}

/* Optional: Make the buttons take full width on mobile for a cleaner look */
.cta-buttons-wrapper .content-cta a {
    display: block;
    text-align: center;
}

/* Desktop View: Side-by-side in a row and centered */
@media (min-width: 768px) {
    .cta-buttons-wrapper {
        flex-direction: row;
        align-items: center;
        justify-content: center; /* Centers the row of buttons in the middle of the screen */
    }
}