/* Fix for sticky behavior: ensure columns stretch */
.cd-grid {
    align-items: stretch !important;
}

/* TOC Styles */
.cd-toc-card {
    margin-bottom: 24px;
    max-height: calc(100vh - 160px);
    /* Adapt to viewport height */
    overflow-y: auto;
    padding-right: 5px;
    /* Space for scrollbar */
}

/* Custom Thin Scrollbar for TOC */
.cd-toc-card::-webkit-scrollbar {
    width: 4px;
}

.cd-toc-card::-webkit-scrollbar-track {
    background: #323247;
    border-radius: 10px;
}

.cd-toc-card::-webkit-scrollbar-thumb {
    background: #4B4B63;
    border-radius: 10px;
}

.cd-toc-card::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}


.cd-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cd-toc-item {
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.cd-toc-link {
    color: #4b5563;
    text-decoration: none;
    display: block;
    padding: 6px 12px;
    border-left: 2px solid transparent;
    transition: all 0.2s;
    border-radius: 0 4px 4px 0;
}

.cd-toc-link:hover {
    color: #0F62FE;
    background: #f3f4f6;
}

.cd-toc-link.active {
    color: #0F62FE;
    font-weight: 600;
    border-left-color: #0F62FE;
    background: #f5f3ff;
}

.cd-toc-h3 {
    padding-left: 24px;
    font-size: 0.85rem;
}

/* Premium Sidebar Banners */
.cd-banner-card {
    background: linear-gradient(135deg, #0061ff 0%, #0037a5 100%);
    color: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border: none;
}

.cd-banner-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.cd-banner-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.cd-banner-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.cd-banner-text {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 20px;
    line-height: 1.4;
}

.cd-banner-btn {
    background: white;
    color: #0061ff !important;
    font-weight: 700;
    padding: 10px 24px;
    border-radius: 50px;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    border: none;
    font-size: 0.9rem;
}

.cd-banner-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Sticky Sidebar Logic */
.cd-sticky-container {
    position: -webkit-sticky;
    position: sticky;
    top: 100px;
    z-index: 10;
    align-self: start;
}

/* Blog Layout Fixes */
.blog-content {
    scroll-behavior: smooth;
    line-height: 1.8;
    color: #374151;
    word-break: break-word;
    overflow-wrap: break-word;
    /* Standard property */
    max-width: 100%;
    /* Ensure it never exceeds container */
}

.blog-content h2,
.blog-content h3 {
    scroll-margin-top: 100px;
}

/* Meta Pill Style */
.btn-info-pill {
    background: #059669;
    /* Default green */
    color: white;
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-info-pill:hover {
    background: #047857;
    color: white;
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(5, 150, 105, 0.3);
}

/* Pulse animation for high visibility */
.btn-info-pill-pulse {
    animation: pill-pulse 2s infinite;
}

@keyframes pill-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(5, 150, 105, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(5, 150, 105, 0);
    }
}

/* Blog Content styles merged from second style block */
.blog-content h2,
.blog-content h3,
.blog-content h4 {
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    color: #111827;
    font-weight: 700;
    line-height: 1.3;
}

.blog-content h2 {
    font-size: 1.75rem;
    border-bottom: 1px solid #323247;
    padding-bottom: 0.5rem;
}

.blog-content h3 {
    font-size: 1.4rem;
}

.blog-content p {
    margin-bottom: 1.4rem;
    color: #4b5563;
    word-wrap: break-word;
    /* Ensure long words break */
    font-size: 1rem;
}

.blog-content ul,
.blog-content ol {
    margin-bottom: 1.4rem;
    padding-left: 1.8rem;
}

.blog-content li {
    margin-bottom: 0.6rem;
    color: #4b5563;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 1.5rem 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Responsive Tables */
.blog-content table {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
    display: block;
    /* Important for horizontal scroll */
    overflow-x: auto;
    white-space: nowrap;
}

.blog-content th,
.blog-content td {
    padding: 0.75rem;
    border: 1px solid #4B4B63;
}

.blog-content th {
    background-color: #1E1E2E;
    font-weight: 600;
    color: #F3F4F6;
}

/* Responsive Iframes (Youtube/Maps) */
.blog-content iframe {
    max-width: 100%;
    border-radius: 8px;
    width: 100%;
    /* Force width */
}

@media (max-width: 768px) {
    .blog-content h2 {
        font-size: 1.5rem;
    }

    .blog-content h3 {
        font-size: 1.25rem;
    }

    .cd-grid {
        grid-template-columns: 1fr !important;
        display: block !important;
    }

    /* Reduce card padding on mobile to save space */
    .cd-card,
    .cd-header-card {
        padding: 1rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        box-sizing: border-box;
    }

    .cd-container {
        padding: 0 10px !important;
    }

    /* Ensure badges wrap properly on small screens */
    .cd-header-card .badge {
        white-space: normal !important;
        text-align: left;
        display: block;
        width: fit-content;
        line-height: 1.4;
        font-size: 0.75rem;
    }

    /* Ensure headings break words if too long */
    .cd-header-card h1 {
        font-size: 1.4rem !important;
        word-wrap: break-word;
        overflow-wrap: break-word;
        line-height: 1.3;
        margin-top: 10px;
    }

    /* Adjust meta section for small screens */
    .cd-meta .d-flex {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }

    .btn-info-pill {
        width: 100%;
        justify-content: center;
        margin-top: 5px;
        padding: 10px 15px;
        font-size: 0.8rem;
    }

    /* Hide sticky behavior on mobile as it's stacked */
    .cd-sticky-container {
        position: static !important;
    }
}
/* Mobile Side Margins */
@media (max-width: 768px) {
    .container, .container-fluid, .cd-container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

