/* Modern Blog Article Layout CSS - Toppicks.ph Style */

/* CRITICAL: Ensure parent containers don't break sticky positioning */
/* Fix overflow for all blog sections to allow sticky positioning */
/* This must override app.css .section { overflow: hidden; } rule */
.section {
    overflow: visible !important;
}

.section .section-body {
    overflow: visible !important;
}

.section .container {
    overflow: visible !important;
}

.section .container .row {
    overflow: visible !important;
}

/* Ensure row doesn't wrap - keep all three columns in one row */
.section.blog-article-section .section-body .row {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: 100%;
}

@media (min-width: 992px) {
    .section.blog-article-section .section-body .row {
        flex-wrap: nowrap !important;
        display: flex !important;
    }
    
    .section.blog-article-section .section-body .row > [class*="col-lg-"] {
        flex: 0 0 auto;
        width: auto;
    }
    
    /* Explicit column widths for large screens */
    .section.blog-article-section .section-body .row > .col-lg-2 {
        flex: 0 0 16.66666667%;
        max-width: 16.66666667%;
    }
    
    .section.blog-article-section .section-body .row > .col-lg-7 {
        flex: 0 0 58.33333333%;
        max-width: 58.33333333%;
    }
    
    .section.blog-article-section .section-body .row > .col-lg-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* Main Content - Post Content */
.post-content {
    margin-bottom: 30px;
}

.post-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 15px 0;
    color: #212529;
}

.post-summary {
    font-size: 1.125rem;
    color: #6c757d;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Badge Category */
.badge-category {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    background-color: #007bff;
    text-decoration: none;
}

.badge-category:hover {
    background-color: #0056b3;
    color: #fff;
    text-decoration: none;
}

/* Article Tags */
.article-tags .badge {
    transition: all 0.3s ease;
    font-weight: 500;
}

.article-tags .badge.bg-primary {
    background-color: var(--primary_color, #0d6efd) !important;
    color: #fff !important;
}

.article-tags .badge.bg-primary:hover {
    background-color: var(--primary_color_dark, #0a58ca) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Post Details Meta */
.post-details-meta {
    font-size: 0.875rem;
    color: #6c757d;
    gap: 20px;
}

.item-meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.item-meta svg {
    flex-shrink: 0;
}

.item-meta-comment {
    display: inline-flex;
    align-items: center;
}

.item-meta-comment i {
    margin-right: 5px;
}

/* Share Buttons */
.post-share-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-share {
    display: inline-flex;
}

.btn-share a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-share a i {
    font-size: 18px;
    color: #fff;
    line-height: 1;
}

.btn-share a:hover i {
    color: #fff;
}

.color-facebook {
    background-color: #1877f2;
    color: #fff;
}

.color-facebook:hover {
    background-color: #166fe5;
    color: #fff;
}

.color-twitter {
    background-color: #1da1f2;
    color: #fff;
}

.color-twitter:hover {
    background-color: #1a8cd8;
    color: #fff;
}

.color-linkedin {
    background-color: #0077b5;
    color: #fff;
}

.color-linkedin:hover {
    background-color: #006399;
    color: #fff;
}

.color-whatsapp {
    background-color: #25d366;
    color: #fff;
}

.color-whatsapp:hover {
    background-color: #20ba5a;
    color: #fff;
}

.color-pinterest {
    background-color: #bd081c;
    color: #fff;
}

.color-pinterest:hover {
    background-color: #9d0718;
    color: #fff;
}

.btn-print {
    background-color: #6c757d;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-print:hover {
    background-color: #5a6268;
    color: #fff;
}

/* Post Text */
.post-text {
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
    margin-top: 20px;
}

/* Ensure code blocks inside word-wrap preserve formatting */
.word-wrap pre,
.word-wrap pre code,
.post-text pre,
.post-text pre code {
    white-space: pre !important;
    word-wrap: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    display: block !important;
}

.post-text p {
    margin-bottom: 1.25rem;
}

.post-text img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

/* Ensure headings have IDs and scroll margin for TOC navigation */
.post-text h2,
.post-text h3,
.post-text h4 {
    scroll-margin-top: 120px;
    margin-top: 30px;
    margin-bottom: 15px;
    padding-top: 10px;
}

.post-text h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
    border-top: 2px solid #e9ecef;
    padding-top: 20px;
    margin-top: 40px;
}

.post-text h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
}

.post-text h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

/* Balanced spacing for CTA alerts inside article content */
.post-text .alert {
    /* Explicitly override Bootstrap utilities (py-2, my-2) which use !important */
    padding: 10px 22px !important; /* +2px over 8px/20px from previous css*/
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    border: 1px solid;
}

.post-text .alert h4,
.post-text .alert h5,
.post-text .alert p {
    /* Inner elements also get an additional +2px bump */
    margin: calc(0.25rem + 8px) 0;
}

/* TOC Sidebar Card - Matching BlogSidebar Design */
.toc-sidebar-card {
    position: sticky;
    top: 20px;
    align-self: flex-start;
    border: 1px solid var(--border_color, #e9ecef);
    border-radius: 0;
    overflow: hidden;
    background-color: #ffffff;
}

.toc-sidebar-card .card-header {
    background-color: transparent;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    padding: 1.5rem 0 1rem 0;
    margin: 0 1.25rem;
    position: relative;
}

/* Tightened body padding to mirror sidebar density */
.toc-sidebar-card .card-body {
    padding: 0.5rem 0.75rem;
}

/* Accent line below title - Infinite Blog style */
.toc-sidebar-card .card-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 50%;
    height: 2px;
    background-color: var(--primary_color, #ffcc1e);
    transition: all 0.3s ease;
}

/* Hover effect for the accent line */
.toc-sidebar-card:hover .card-header::after {
    width: 60%;
    opacity: 0.9;
}

.toc-sidebar-card .card-title {
    color: #003a89;
    font-size: 1.125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.toc-menu-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
    max-height: none; /* Show all items without internal scrolling */
    overflow: visible;
}

.toc-menu-list li {
    margin-bottom: 0.375rem;
    padding: 0.375rem 0;
    border-bottom: 1px solid var(--border_color, #e9ecef);
}

.toc-menu-list li:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.toc-menu-list a {
    color: var(--text_color, #003a89);
    text-decoration: none;
    font-size: 0.8rem;
    line-height: 1.35;
    display: block;
    transition: color 0.3s ease, background-color 0.3s ease;
    white-space: normal; /* Allow wrapping to prevent overflow */
    overflow-wrap: anywhere;
    word-break: break-word;
}

.toc-menu-list a:hover {
    color: var(--primary_color, #ffcc1e);
}

/* Keyboard focus for accessibility */
.toc-menu-list a:focus-visible {
    outline: 2px solid var(--primary_color, #ffcc1e);
    outline-offset: 2px;
    background-color: #fffbe6; /* subtle highlight */
}

.toc-menu-list a.active {
    color: var(--primary_color, #ffcc1e);
    font-weight: 600;
}

/* Responsive adjustments to mirror sidebar */
@media (max-width: 767.98px) {
    .toc-sidebar-card .card-header {
        padding: 1.25rem 0 0.875rem 0;
        margin: 0 1rem;
    }
    .toc-sidebar-card .card-title {
        font-size: 1rem;
        letter-spacing: 0.5px;
        color: #003a89;
    }
    .toc-sidebar-card .card-header::after {
        width: 45%;
    }
    .toc-sidebar-card:hover .card-header::after {
        width: 55%;
    }
}

/* Custom scrollbar for TOC list */
.toc-menu-list::-webkit-scrollbar {
    width: 4px;
}

.toc-menu-list::-webkit-scrollbar-track {
    background: var(--background_color, #f8f9fa);
    border-radius: 10px;
}

.toc-menu-list::-webkit-scrollbar-thumb {
    background: var(--text_muted, #adb5bd);
    border-radius: 10px;
}

.toc-menu-list::-webkit-scrollbar-thumb:hover {
    background: var(--secondary_color, #6c757d);
}

/* Custom scrollbar for sticky sidebars */
.jump-to-nav::-webkit-scrollbar {
    width: 6px;
}

.jump-to-nav::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 10px;
}

.jump-to-nav::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 10px;
}

.jump-to-nav::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

.jump-to-nav h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #495057;
}

.jump-to-nav ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: item;
}

.jump-to-nav li {
    counter-increment: item;
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
}

.jump-to-nav li::before {
    content: counter(item);
    position: absolute;
    left: 0;
    top: 0;
    background: #dc3545;
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jump-to-nav a {
    color: #495057;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease, font-weight 0.2s ease;
    display: block;
    padding: 2px 0;
}

.jump-to-nav a:hover {
    color: #dc3545;
}

.jump-to-nav a.active {
    color: #dc3545;
    position: relative;
    padding-left: 5px;
}

.jump-to-nav a.active::before {
    content: '→';
    position: absolute;
    left: -15px;
    color: #dc3545;
}

/* Main Content Area */
.article-content {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
}

/* When no left sidebar, limit main content width */
.blog-article-grid.no-left-sidebar .article-content {
    max-width: 900px;
    margin: 0 auto;
}

.article-header {
    margin-bottom: 30px;
}

.category-tag {
    display: inline-block;
    background: #007bff;
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.article-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 15px 0;
    color: #212529;
}

.article-intro {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 20px;
    line-height: 1.5;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    font-size: 14px;
    color: #6c757d;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-item i {
    font-size: 12px;
}

.social-share {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
}

.social-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.social-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.social-btn.facebook { background: #1877f2; }
.social-btn.twitter { background: #1da1f2; }
.social-btn.linkedin { background: #0077b5; }
.social-btn.whatsapp { background: #25d366; }
.social-btn.pinterest { background: #bd081c; }
.social-btn.print { background: #6c757d; }

.article-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 30px;
}

.article-body {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}

.article-body h2,
.article-body h3,
.article-body h4 {
    scroll-margin-top: 100px; /* Offset for fixed headers */
}

.article-body h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 30px 0 15px 0;
    color: #212529;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.article-body h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 25px 0 12px 0;
    color: #212529;
}

.article-body h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0 10px 0;
    color: #212529;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* Print-specific cleanup for article pages */
@media print {
    /* Page margins */
    @page { margin: 12mm; }

    /* Hide global chrome */
    .header, header,
    .footer, footer,
    /* Site navbar and announcement banner */
    .nav-bar, .nav-bar-sm, .nav-bar-bg, .announcement {
        display: none !important;
    }

    /* Hide non-essential UI on print */
    .post-share-buttons,
    .btn-print,
    .article-tags,
    .item-meta-comment,
    .post-details-meta,
    .toc-sidebar-card,
    .blog-sidebar,
    .breadcrumb,
    .breadcrumbs,
    .comment-form {
        display: none !important;
    }

    /* Hide any contact-specific forms if present */
    .contact-form,
    .contact,
    form[action*="contact"] {
        display: none !important;
    }

    /* Expand main content to full width */
    .col-md-12.col-lg-7,
    .col-md-12.col-lg-9,
    .post-content {
        max-width: 100% !important;
        width: 100% !important;
        flex: 0 0 100% !important;
    }

    /* Avoid awkward page breaks */
    .post-text h2,
    .post-text h3,
    .post-text h4 { page-break-after: avoid; }
    .post-text img,
    .post-text pre,
    .post-text blockquote,
    .post-text table { page-break-inside: avoid; }
}

/* Smooth scrolling within sticky sidebars */
.jump-to-nav,
.popular-posts {
    scroll-behavior: smooth;
}

/* Add transition for smooth sticky behavior */
.jump-to-nav,
.popular-posts {
    transition: box-shadow 0.3s ease, transform 0.2s ease;
}

/* Enhanced shadow when scrolling (optional visual feedback) */
.jump-to-nav:hover,
.popular-posts:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.article-body p {
    margin-bottom: 16px;
}

.article-body ul, .article-body ol {
    margin-bottom: 16px;
    padding-left: 20px;
}

.article-body li {
    margin-bottom: 8px;
}

/* Todo list styling */
.article-body .todo-list {
    list-style: none;
    padding-left: 0;
}

.article-body .todo-list li {
    position: relative;
    padding-left: 30px;
    margin-bottom: 10px;
}

.article-body .todo-list li input[type="checkbox"] {
    position: absolute;
    left: 0;
    top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.article-body .todo-list li.todo-list__item--checked {
    text-decoration: line-through;
    color: #6c757d;
}

/* Horizontal line styling */
.article-body hr {
    margin: 30px 0;
    border: 0;
    border-top: 2px solid #e9ecef;
}

/* Subscript and Superscript */
.article-body sub {
    font-size: 0.75em;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
    bottom: -0.25em;
}

.article-body sup {
    font-size: 0.75em;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
    top: -0.5em;
}

/* Strikethrough */
.article-body s,
.article-body strike,
.article-body del {
    text-decoration: line-through;
}

/* Media embed responsive */
.article-body .media {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin: 20px 0;
}

.article-body .media iframe,
.article-body .media object,
.article-body .media embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Table styling enhancements */
.article-body table {
    width: 100%;
    margin: 20px 0;
    border-collapse: collapse;
    background: white;
}

.article-body table th,
.article-body table td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.article-body table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #212529;
}

.article-body table tr:hover {
    background: #f8f9fa;
}

.article-body table tr:nth-child(even) {
    background: #ffffff;
}

.article-body table tr:nth-child(odd) {
    background: #f9f9f9;
}


/* Popular Posts (Legacy - keeping for compatibility) */
.popular-posts {
    background: white;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
    position: -webkit-sticky; /* Safari support */
    position: sticky;
    top: 20px; /* Distance from top when stuck */
    max-height: calc(100vh - 40px); /* Ensure it fits in viewport with padding */
    overflow-y: auto; /* Allow scrolling if content is too tall */
    z-index: 100; /* Ensure it stays above other content */
    align-self: flex-start; /* Stick to the top of its container */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); /* Add subtle shadow for depth */
    will-change: transform; /* Optimize for sticky positioning */
}

/* Custom scrollbar for popular posts sidebar */
.popular-posts::-webkit-scrollbar {
    width: 6px;
}

.popular-posts::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 10px;
}

.popular-posts::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 10px;
}

.popular-posts::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

.popular-posts h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    padding-bottom: 10px;
    border-bottom: 2px solid #dc3545;
}

.popular-post {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f3f4;
}

.popular-post:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.popular-post-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.popular-post-content {
    flex: 1;
    min-width: 0;
}

.popular-post-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 5px 0;
    color: #212529;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-post-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.popular-post-title a:hover {
    color: #dc3545;
}

.popular-post-meta {
    font-size: 12px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 8px;
}

.popular-post-meta i {
    font-size: 10px;
}

/* Custom scrollbar for jump-to-container */
.jump-to-container::-webkit-scrollbar {
    width: 6px;
}

.jump-to-container::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 10px;
}

.jump-to-container::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 10px;
}

.jump-to-container::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* Responsive Design */
@media (max-width: 992px) {
    .jump-to-container {
        position: static;
        max-height: none;
    }
    
    .post-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 768px) {
    .post-title {
        font-size: 1.5rem;
    }
    
    .post-summary {
        font-size: 1rem;
    }
    
    .post-details-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .post-share-buttons {
        flex-wrap: wrap;
    }
    
    .btn-share a {
        width: 36px;
        height: 36px;
    }
    
    .btn-share a i {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .post-title {
        font-size: 1.25rem;
    }
    
    .post-text {
        font-size: 0.9375rem;
    }
}

/* Breadcrumbs */
.breadcrumbs {
    background: #f8f9fa;
    padding: 15px 0;
    margin-bottom: 0;
}

/* Blog Article Breadcrumb Spacing */
.section.blog-article-section nav[aria-label="breadcrumb"] {
    margin-bottom: 30px;
    padding-bottom: 0;
}

.section.blog-article-section .breadcrumb {
    margin: 0 0 30px 0;
    padding: 0;
    background: none;
    font-size: 14px;
}

.section.blog-article-section .breadcrumb-item {
    display: inline;
}

.section.blog-article-section .breadcrumb-item + .breadcrumb-item::before {
    content: " / ";
    color: #6c757d;
}

.section.blog-article-section .breadcrumb-item a {
    color: #007bff;
    text-decoration: none;
}

.section.blog-article-section .breadcrumb-item.active {
    color: #6c757d;
}

/* Ensure section-body has proper top spacing */
.section.blog-article-section .section-body {
    margin-top: 0;
    padding-top: 0;
}

/* Code Block Styling - Dark theme */
.article-body pre,
.word-wrap pre {
    margin: 20px 0;
    background: #2d3748 !important;
    border-radius: 8px;
    border: 1px solid #4a5568;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    white-space: pre;
    word-wrap: normal;
    word-break: normal;
    position: relative;
    z-index: 1;
}

.article-body pre code,
.word-wrap pre code {
    display: block;
    overflow-x: auto;
    padding: 1.5em;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-weight: normal;
    font-style: normal;
    background: transparent !important;
    white-space: pre;
    word-wrap: normal;
    word-break: normal;
    -moz-tab-size: 4;
    -o-tab-size: 4;
    tab-size: 4;
    /* DON'T set color here - let Prism.js handle syntax highlighting colors */
    /* Default fallback color only if Prism.js isn't loaded */
    color: #e2e8f0;
}

/* Only apply default color if Prism.js hasn't highlighted */
.article-body pre:not([class*="language-"]) code,
.article-body pre code:not(.token),
.word-wrap pre:not([class*="language-"]) code,
.word-wrap pre code:not(.token) {
    color: #e2e8f0;
}

/* Prism.js highlighted code blocks */
.article-body pre[class*="language-"] code,
.word-wrap pre[class*="language-"] code {
    color: inherit; /* Let Prism.js tokens control colors */
    white-space: pre;
    word-wrap: normal;
    word-break: normal;
    -moz-tab-size: 4;
    -o-tab-size: 4;
    tab-size: 4;
}

/* Code Viewer: keep Prism tokens inline for accurate tag placement */
.article-body pre[class*="language-"] code[class*="language-"] .token,
.article-body pre[class*="language-"] code[class*="language-"] .punctuation {
    display: inline;
}

.article-body code {
    background: #f5f5f5;
    color: #333;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-weight: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Prism.js token styling - Colors are handled by Prism.js CSS (prism-tomorrow theme) */

/* Override any conflicting styles for Prism.js tokens */
.article-body pre[class*="language-"] code .token.comment,
.article-body pre[class*="language-"] code .token.prolog,
.article-body pre[class*="language-"] code .token.doctype,
.article-body pre[class*="language-"] code .token.cdata,
.word-wrap pre[class*="language-"] code .token.comment,
.word-wrap pre[class*="language-"] code .token.prolog,
.word-wrap pre[class*="language-"] code .token.doctype,
.word-wrap pre[class*="language-"] code .token.cdata {
    color: #8e9aaf !important; /* Comments - light gray */
    font-style: italic;
}

.article-body pre[class*="language-"] code .token.punctuation,
.word-wrap pre[class*="language-"] code .token.punctuation {
    color: #e2e8f0 !important; /* Punctuation - white */
}

.article-body pre[class*="language-"] code .token.keyword,
.article-body pre[class*="language-"] code .token.atrule,
.article-body pre[class*="language-"] code .token.attr-name,
.word-wrap pre[class*="language-"] code .token.keyword,
.word-wrap pre[class*="language-"] code .token.atrule,
.word-wrap pre[class*="language-"] code .token.attr-name {
    color: #c792ea !important; /* Keywords - purple */
}

.article-body pre[class*="language-"] code .token.string,
.article-body pre[class*="language-"] code .token.attr-value,
.word-wrap pre[class*="language-"] code .token.string,
.word-wrap pre[class*="language-"] code .token.attr-value {
    color: #c3e88d !important; /* Strings - green */
}

.article-body pre[class*="language-"] code .token.function,
.article-body pre[class*="language-"] code .token.class-name,
.word-wrap pre[class*="language-"] code .token.function,
.word-wrap pre[class*="language-"] code .token.class-name {
    color: #82aaff !important; /* Functions/Classes - blue */
}

.article-body pre[class*="language-"] code .token.property,
.article-body pre[class*="language-"] code .token.tag,
.word-wrap pre[class*="language-"] code .token.property,
.word-wrap pre[class*="language-"] code .token.tag {
    color: #ff5370 !important; /* Properties/Tags - red */
}

.article-body pre[class*="language-"] code .token.number,
.article-body pre[class*="language-"] code .token.boolean,
.word-wrap pre[class*="language-"] code .token.number,
.word-wrap pre[class*="language-"] code .token.boolean {
    color: #f78c6c !important; /* Numbers/Booleans - orange */
}

.article-body pre[class*="language-"] code .token.operator,
.word-wrap pre[class*="language-"] code .token.operator {
    color: #89ddff !important; /* Operators - cyan */
}

.article-body pre[class*="language-"] code .token.selector,
.word-wrap pre[class*="language-"] code .token.selector {
    color: #c792ea !important; /* Selectors - purple */
}

/* Only apply default color to non-highlighted code blocks */
.article-body pre:not([class*="language-"]) code,
.word-wrap pre:not([class*="language-"]) code {
    background: transparent !important;
    color: #e2e8f0;
    padding: 0;
    border: none;
    border-radius: 0;
}

/* Prism.js highlighted code blocks - remove color override */
.article-body pre[class*="language-"] code,
.word-wrap pre[class*="language-"] code {
    background: transparent !important;
    color: inherit; /* Inherit from Prism.js tokens */
    padding: 0;
    border: none;
    border-radius: 0;
}

/* Hide empty code elements - More aggressive approach */
.article-body code:empty,
.article-body pre:empty,
.article-body code:not(:has(*)):is(:empty),
.article-body pre:not(:has(*)):is(:empty) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: none !important;
}

/* Hide code elements with only whitespace or invisible content */
.article-body code:not(:has(*)):not(:empty):is(:empty),
.article-body pre:not(:has(*)):not(:empty):is(:empty) {
    display: none !important;
}

/* Additional fallback for empty elements */
.article-body .word-wrap code:empty,
.article-body .word-wrap pre:empty {
    display: none !important;
}

/* Class-based hiding for empty code elements */
.empty-code-element {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: none !important;
    overflow: hidden !important;
}

/* Prism.js toolbar - Minimal styling only */
.code-toolbar {
    position: relative;
}

/* Prism.js line numbers - Dark theme adjustments */
pre[class*="language-"].line-numbers {
    position: relative;
    padding-left: 3.8em;
    counter-reset: linenumber;
}

pre[class*="language-"].line-numbers > code {
    position: relative;
    white-space: inherit;
}

.line-numbers .line-numbers-rows {
    position: absolute;
    pointer-events: none;
    top: 0;
    font-size: 100%;
    left: -3.8em;
    width: 3em;
    letter-spacing: -1px;
    border-right: 1px solid #4a5568;
    user-select: none;
    background: #1a202c;
    padding: 1.5em 0;
}

.line-numbers-rows > span {
    display: block;
    counter-increment: linenumber;
}

.line-numbers-rows > span:before {
    content: counter(linenumber);
    color: #718096;
    display: block;
    padding-right: 0.8em;
    text-align: right;
    font-size: 12px;
}

/* Let Prism.js handle all syntax highlighting colors */

/* Code block responsive design */
@media (max-width: 768px) {
    .article-body pre {
        margin: 15px -15px;
    }
    
    .article-body pre code {
        padding: 0.8em;
        font-size: 13px;
    }
}

/* Call to Action Box Styling - Custom CTA design from CKEditor plugin */
/* CTA boxes use custom inline styles, no additional CSS needed */

/* Action Button Call to Action Styling */
/* Used in SQL articles for download/CTA buttons */
.post-text .action-button,
.article-body .action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    color: #ffffff;
    text-decoration: none;
    background-color: #1d4ed8; /* bg-blue-700 */
    border: 1px solid transparent;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 150ms ease;
    transform: translateY(0);
}

.post-text .action-button:hover,
.article-body .action-button:hover {
    color: #ffffff;
    text-decoration: none;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
    background-color: #1e40af; /* darker blue on hover */
}

/* Action button variants based on data-type attribute */
.post-text .action-button[data-type="success"],
.article-body .action-button[data-type="success"] {
    background-color: #16a34a; /* green */
}

.post-text .action-button[data-type="success"]:hover,
.article-body .action-button[data-type="success"]:hover {
    background-color: #15803d;
}

.post-text .action-button[data-type="warning"],
.article-body .action-button[data-type="warning"] {
    background-color: #ea580c; /* orange */
}

.post-text .action-button[data-type="warning"]:hover,
.article-body .action-button[data-type="warning"]:hover {
    background-color: #c2410c;
}

.post-text .action-button[data-type="danger"],
.article-body .action-button[data-type="danger"] {
    background-color: #dc2626; /* red */
}

.post-text .action-button[data-type="danger"]:hover,
.article-body .action-button[data-type="danger"]:hover {
    background-color: #b91c1c;
}

/* Center-aligned paragraphs containing action buttons */
.post-text p[style*="text-align: center"],
.article-body p[style*="text-align: center"] {
    text-align: center;
    margin: 1.5rem 0;
}

/* Responsive design for action buttons */
@media (max-width: 768px) {
    .post-text .action-button,
    .article-body .action-button {
        display: flex;
        width: 100%;
        margin: 0.5rem 0;
        justify-content: center;
    }
}

/* Utility Classes */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.word-wrap {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* CRITICAL: Code blocks inside word-wrap must NOT break words */
.word-wrap pre,
.word-wrap pre code,
.post-text pre,
.post-text pre code,
.word-wrap pre[class*="language-"],
.word-wrap pre[class*="language-"] code {
    word-wrap: normal !important;
    overflow-wrap: normal !important;
    white-space: pre !important;
    word-break: normal !important;
}

/* override for breadcrumb top padding */
.section {
padding: 0px !important;
}

.blog-breadcrumb-wrapper {
    margin-top: 15px;
    margin-bottom: 15px;
    margin-left: -5px;
}

.blog-breadcrumb-wrapper.article {
    margin-left: 0;
}

.section .container.container-custom {
    margin-bottom: 100px;
}