/* ================================================================
   CORTEX BLOG PUBLIC CSS - MASTER ISOLATION FILE
   ================================================================
   File     : /includes/cortex/blog/cortex-blog-public.css
   Purpose  : Complete CSS isolation for CORTEX blogs on BS3 sites.

   CRITICAL: All styles are SCOPED to blog containers to prevent
   leaking into the site's nav/footer.

   USAGE:
   - Copy this file to any site's /includes/cortex/blog/ folder
   - Link it in the blog page templates
   ================================================================ */


/* ================================================================
   SECTION 1: CSS ISOLATION RESET (SCOPED TO BLOG CONTAINERS)
   ================================================================ */

/* Font stack defined in main :root block below (Section 3) */

/* Master reset for all blog containers */
.blog-home-wrapper,
.blog-article-wrapper,
.blog-article-hero,
.blog-category-wrapper,
.ctb-category-wrapper,
.blog-mobile-cat-bar {
    font-family: var(--blog-font-family) !important;
    font-size: 16px !important;
    line-height: var(--blog-line-height) !important;
    color: var(--blog-color-text) !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Reset box-sizing for all blog elements */
.blog-home-wrapper *,
.blog-home-wrapper *::before,
.blog-home-wrapper *::after,
.blog-article-wrapper *,
.blog-article-wrapper *::before,
.blog-article-wrapper *::after,
.blog-article-hero *,
.blog-article-hero *::before,
.blog-article-hero *::after,
.blog-category-wrapper *,
.blog-category-wrapper *::before,
.blog-category-wrapper *::after,
.ctb-category-wrapper *,
.ctb-category-wrapper *::before,
.ctb-category-wrapper *::after {
    box-sizing: border-box !important;
}


/* ================================================================
   SECTION 2: SCOPED TYPOGRAPHY RESETS
   ================================================================
   Only affects elements INSIDE blog containers.
   ================================================================ */

/* Headings */
.blog-home-wrapper h1,
.blog-home-wrapper h2,
.blog-home-wrapper h3,
.blog-home-wrapper h4,
.blog-home-wrapper h5,
.blog-home-wrapper h6,
.blog-article-wrapper h1,
.blog-article-wrapper h2,
.blog-article-wrapper h3,
.blog-article-wrapper h4,
.blog-article-wrapper h5,
.blog-article-wrapper h6,
.blog-article-hero h1,
.blog-category-wrapper h1,
.blog-category-wrapper h2 {
    font-family: var(--blog-font-family) !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    margin-top: 0 !important;
}

/* Paragraphs - SCOPED */
.blog-home-wrapper p,
.blog-article-wrapper p,
.blog-category-wrapper p {
    font-family: var(--blog-font-family) !important;
    line-height: var(--blog-line-height) !important;
    margin-top: 0 !important;
    margin-bottom: 1rem !important;
}

/* Lists - SCOPED */
.blog-home-wrapper ul,
.blog-home-wrapper ol,
.blog-article-wrapper ul,
.blog-article-wrapper ol,
.blog-category-wrapper ul,
.blog-category-wrapper ol {
    font-family: var(--blog-font-family) !important;
    margin-top: 0 !important;
    margin-bottom: 1rem !important;
    padding-left: 2rem !important;
}

/* Images - SCOPED */
.blog-home-wrapper img,
.blog-article-wrapper img,
.blog-article-hero img,
.blog-category-wrapper img {
    max-width: 100% !important;
    height: auto !important;
    vertical-align: middle !important;
}


/* ================================================================
   SECTION 3: QUICK-CHANGE VARIABLES
   ================================================================
   ALL customizable values in ONE place.
   Change these to control the entire blog's look per site.
   ================================================================ */

:root {

    /* ── SITE COLORS ─────────────────────────────────────────────
       Brand colors used across homepage, articles, TOC, badges
       ──────────────────────────────────────────────────────────── */
    --color-primary:            #2A3A64;    /* Buttons, links, TOC header, badges */
    --color-secondary:          #161616;    /* Dark backgrounds, footer accents   */
    --color-accent:             #50C6F5;    /* Highlight / special elements        */

    /* ── GLOBAL TOGGLES ──────────────────────────────────────────
       Quick on/off switches and position tweaks
       ──────────────────────────────────────────────────────────── */
    --blog-corners-rounded:     1;          /* 1 = rounded corners, 0 = sharp     */
    --blog-nav-height:          0px;        /* Fixed nav height offset for article hero */
    --blog-home-nav-height:     0px;        /* Fixed nav height offset for blog homepage */
    --blog-toc-mobile-top:      20px;       /* Mobile sticky TOC distance from top */
    --blog-toc-scroll-offset:   140px;      /* Jump-link scroll offset (fixed hdr) */

    /* ── MOBILE CATEGORY BAR ─────────────────────────────────────
       "Article Categories" dropdown bar on mobile
       ──────────────────────────────────────────────────────────── */
    --blog-mobile-cat-top:      0px;        /* Distance from top when sticky      */
    --blog-mobile-cat-bg:       linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    --blog-mobile-cat-text:     #ffffff;
    --blog-mobile-cat-border:   rgba(255,255,255,0.08);
    --blog-mobile-cat-hover:    rgba(255,255,255,0.05);

    /* ── FONTS ───────────────────────────────────────────────────
       Font stacks and base text settings
       ──────────────────────────────────────────────────────────── */
    --blog-font-family:         -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --blog-font-family-mono:    SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --blog-color-text:          #212529;
    --blog-color-text-muted:    #6c757d;
    --blog-line-height:         1.6;

    /* ── HOMEPAGE SIZES ──────────────────────────────────────────
       Font sizes for blog homepage cards and elements
       ──────────────────────────────────────────────────────────── */
    --blog-body-text:           16px;       /* Body text                           */
    --blog-body-line:           26px;       /* Body line height                    */
    --blog-h1:                  22px;       /* H1 headings                         */
    --blog-h2:                  28px;       /* H2 headings                         */
    --blog-card-title:          36px;       /* Card title                          */
    --blog-card-lead:           15px;       /* Card preview / lead text            */
    --blog-hero-title:          42px;       /* Hero card title                     */
    --blog-hero-lead:           18px;       /* Hero card lead text                 */
    --blog-category-badge:      12px;       /* Category badge text                 */
    --blog-date-time:           14px;       /* Date/time metadata                  */
    --blog-read-more:           14px;       /* Read more link                      */
    --blog-author-name:         14px;       /* Author name                         */
    --blog-author-date:         13px;       /* Author date                         */

    /* ── CATEGORY PAGE SIZES ─────────────────────────────────────
       Font sizes for /blog/category/ listing pages
       ──────────────────────────────────────────────────────────── */
    --blog-category-page-title: 28px;       /* Category page title                 */
    --blog-category-subhead:    14px;       /* Category subheading                 */
    --blog-category-item-title: 18px;       /* Category list item title             */

    /* ── ARTICLE HERO SIZES ──────────────────────────────────────
       Font sizes for the article hero banner area
       ──────────────────────────────────────────────────────────── */
    --blog-article-title:       56px;       /* Article hero title                  */
    --blog-article-category:    12px;       /* Article category badge              */
    --blog-article-date:        14px;       /* Article date                        */
    --blog-article-author:      15px;       /* Article author name                 */

    /* ── SIDEBAR SIZES ───────────────────────────────────────────
       Font sizes for the homepage sidebar
       ──────────────────────────────────────────────────────────── */
    --blog-sidebar-title:       20px;       /* Sidebar section title               */
    --blog-sidebar-pill:        13px;       /* Sidebar category pill               */
    --blog-sidebar-count:       13px;       /* Sidebar count badge                 */

    /* ── ARTICLE CONTENT (uploaded post HTML) ────────────────────
       Controls for the article body text, headings, lists, links
       ──────────────────────────────────────────────────────────── */
    --article-content-padding-top:      40px;       /* Content top padding         */
    --article-content-padding-bottom:   40px;       /* Content bottom padding      */
    --article-content-max-width:        800px;      /* Max content width           */
    --article-body-font-size:           18px;       /* Body font size              */
    --article-body-line-height:         1.7;        /* Body line height            */
    --article-h2-font-size:             28px;       /* H2 size                     */
    --article-h2-margin-top:            48px;       /* H2 top margin              */
    --article-h2-margin-bottom:         16px;       /* H2 bottom margin           */
    --article-h2-font-weight:           700;        /* H2 weight                   */
    --article-h2-color:                 #1a365d;    /* H2 color                    */
    --article-title-echo-multiplier:    1.6;        /* titleEcho = H2 size x this  */
    --article-h3-font-size:             22px;       /* H3 size                     */
    --article-h3-margin-top:            32px;       /* H3 top margin              */
    --article-h3-margin-bottom:         12px;       /* H3 bottom margin           */
    --article-h3-font-weight:           600;        /* H3 weight                   */
    --article-h3-color:                 #2d3748;    /* H3 color                    */
    --article-h4-font-size:             18px;       /* H4 size                     */
    --article-h4-margin-top:            24px;       /* H4 top margin              */
    --article-h4-margin-bottom:         10px;       /* H4 bottom margin           */
    --article-p-margin-bottom:          32px;       /* Paragraph bottom margin     */
    --article-list-margin-top:          12px;       /* List top margin             */
    --article-list-margin-bottom:       20px;       /* List bottom margin          */
    --article-list-padding-left:        28px;       /* List left indent            */
    --article-list-item-spacing:        8px;        /* Space between list items    */
    --article-link-color:               var(--color-primary, #2A3A64);
    --article-link-hover-color:         #1a365d;

    /* ── TABLE OF CONTENTS ───────────────────────────────────────
       Styling for the sticky sidebar TOC
       ──────────────────────────────────────────────────────────── */
    --toc-padding-top:                  0px;        /* TOC container top padding    */
    --toc-padding-bottom:               20px;       /* TOC container bottom padding */
    --toc-item-padding-y:               12px;       /* TOC item vertical padding    */
    --toc-item-padding-x:               16px;       /* TOC item horizontal padding  */
    --toc-font-size:                    15px;       /* TOC link font size           */
    --toc-heading-font-size:            14px;       /* "On this page" heading size  */
    --toc-background:                   #f7f9fc;    /* TOC background color         */
    --toc-border-color:                 #e2e8f0;    /* TOC border color             */
    --toc-active-color:                 var(--color-primary, #2A3A64);
    --toc-active-border-width:          3px;        /* Active item left border      */

    /* ── COMPUTED (auto-calculated, don't change) ────────────────
       Border radii derived from --blog-corners-rounded toggle
       ──────────────────────────────────────────────────────────── */
    --blog-radius-xs:           calc(4px * var(--blog-corners-rounded));
    --blog-radius-sm:           calc(8px * var(--blog-corners-rounded));
    --blog-radius-md:           calc(12px * var(--blog-corners-rounded));
    --blog-radius-lg:           calc(16px * var(--blog-corners-rounded));
    --blog-radius-xl:           calc(24px * var(--blog-corners-rounded));
    --blog-radius-pill:         calc(999px * var(--blog-corners-rounded));
}


/* ── RESPONSIVE OVERRIDES ────────────────────────────────────────
   Tablet / mobile size adjustments (all in one place)
   ──────────────────────────────────────────────────────────────── */

@media (max-width: 991px) {
    :root {
        /* Homepage */
        --blog-h1:                  36px;
        --blog-h2:                  24px;
        --blog-card-title:          20px;
        --blog-hero-title:          28px;
        /* Article content */
        --article-body-font-size:   17px;
        --article-h2-font-size:     26px;
        --article-h2-margin-top:    40px;
        --article-h3-font-size:     20px;
        --article-h3-margin-top:    28px;
        --toc-font-size:            14px;
    }
}

@media (max-width: 767px) {
    :root {
        /* Homepage */
        --blog-body-text:           15px;
        --blog-h1:                  28px;
        --blog-card-title:          18px;
        --blog-hero-title:          24px;
        --blog-article-title:       1.65rem;
        --blog-category-badge:      11px;
        /* Article content */
        --article-content-padding-top: 24px;
        --article-body-font-size:   16px;
        --article-h2-font-size:     24px;
        --article-h2-margin-top:    36px;
        --article-h3-font-size:     19px;
        --article-h3-margin-top:    24px;
        --article-list-padding-left: 24px;
        --toc-item-padding-y:       10px;
        --toc-font-size:            14px;
    }
}

@media (max-width: 575px) {
    :root {
        /* Homepage */
        --blog-body-text:           14px;
        --blog-h1:                  24px;
        --blog-card-title:          16px;
        --blog-hero-title:          20px;
        --blog-article-title:       1.4rem;
        /* Article content */
        --article-content-padding-top: 20px;
        --article-body-font-size:   15px;
        --article-h2-font-size:     22px;
        --article-h2-margin-top:    32px;
        --article-h3-font-size:     18px;
        --article-h3-margin-top:    20px;
    }
}






/* ================================================================
   SECTION 4: APPLY FONT SIZES
   ================================================================ */

.blog-home-wrapper {
    font-size: var(--blog-body-text) !important;
    line-height: var(--blog-body-line) !important;
    padding-top: var(--blog-home-nav-height) !important;
}

.blog-card-title {
    font-size: var(--blog-card-title) !important;
}

.blog-card-lead,
.blog-card-text {
    font-size: var(--blog-card-lead) !important;
}

.blog-hero-card .blog-card-title {
    font-size: var(--blog-hero-title) !important;
}

.blog-category-badge {
    font-size: var(--blog-category-badge) !important;
}

.blog-post-meta .blog-meta-item {
    font-size: var(--blog-date-time) !important;
}

.blog-readmore-link {
    font-size: var(--blog-read-more) !important;
}

.blog-author-name {
    font-size: var(--blog-author-name) !important;
}

.blog-author-date {
    font-size: var(--blog-author-date) !important;
}

.blog-sidebar-title {
    font-size: var(--blog-sidebar-title) !important;
}

.blog-article-title {
    font-size: var(--blog-article-title) !important;
}

/* ARTICLE HERO: High-specificity overrides for font sizes */
.blog-article-hero .blog-article-title {
    font-size: var(--blog-article-title) !important;
    font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif !important;
    font-weight: 700 !important;
}

.blog-article-hero .blog-post-meta .blog-meta-item {
    font-size: var(--blog-article-date) !important;
}

.blog-article-hero .blog-author-name {
    font-size: var(--blog-article-author) !important;
}

.blog-article-hero .blog-category-badge {
    font-size: var(--blog-article-category) !important;
}

/* ARTICLE HERO: Category row and meta styling */
.blog-article-hero .blog-article-category-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 20px !important;
    margin-top: 1rem !important;
    margin-bottom: 0.75rem !important;
}

.blog-article-hero .blog-post-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    align-items: center !important;
}

.blog-article-hero .blog-post-meta .blog-meta-item,
body .blog-article-hero .blog-post-meta .blog-meta-item,
body.blog-public .blog-article-hero .blog-post-meta .blog-meta-item {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 14px !important;
    border-radius: var(--blog-radius-pill) !important;
    background: rgba(255,255,255,0.08) !important;
    border: 1px solid rgba(255,255,255,0.15) !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    color: rgba(255,255,255,0.90) !important;
}

.blog-article-hero .blog-post-meta .blog-meta-item i {
    font-size: 16px !important;
    line-height: 1 !important;
    opacity: 0.85 !important;
    color: rgba(255,255,255,0.90) !important;
}


/* ================================================================
   SECTION 5: BS5 CONTAINERS (SAFE - unique class name)
   ================================================================ */

.container-xl {
    width: 100%;
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

@media (min-width: 1200px) {
    .container-xl {
        max-width: 1320px;
    }
}


/* ================================================================
   SECTION 6: FLEXBOX UTILITIES (SAFE - BS3 doesn't have these)
   ================================================================ */

.d-flex { display: flex !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline-flex { display: inline-flex !important; }

.flex-row { flex-direction: row !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-nowrap { flex-wrap: nowrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }

.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-around { justify-content: space-around !important; }

.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.align-items-stretch { align-items: stretch !important; }

.align-self-start { align-self: flex-start !important; }
.align-self-center { align-self: center !important; }
.align-self-end { align-self: flex-end !important; }


/* ================================================================
   SECTION 7: GAP UTILITIES (SAFE - BS3 doesn't have these)
   ================================================================ */

.gap-0 { gap: 0 !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }
.gap-4 { gap: 1.5rem !important; }
.gap-5 { gap: 3rem !important; }


/* ================================================================
   SECTION 8: ROW FLEXBOX + GUTTER UTILITIES (g-* classes)
   ================================================================
   Bootstrap 5 uses flexbox rows. These polyfill for BS3.
   ================================================================ */

/* Base row as flexbox container (BS5 style) */
.blog-home-wrapper .row,
.blog-article-wrapper .row,
.blog-category-wrapper .row {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-left: -15px;
    margin-right: -15px;
}

/* Gutter utilities */
.row.g-0 { margin-left: 0; margin-right: 0; }
.row.g-0 > * { padding-left: 0; padding-right: 0; }

.row.g-2 { margin-left: -0.25rem; margin-right: -0.25rem; }
.row.g-2 > * { padding-left: 0.25rem; padding-right: 0.25rem; margin-bottom: 0.5rem; }

.row.g-3 { margin-left: -0.5rem; margin-right: -0.5rem; }
.row.g-3 > * { padding-left: 0.5rem; padding-right: 0.5rem; margin-bottom: 1rem; }

.row.g-4 { margin-left: -0.75rem; margin-right: -0.75rem; }
.row.g-4 > * { padding-left: 0.75rem; padding-right: 0.75rem; margin-bottom: 1.5rem; }


/* ================================================================
   SECTION 9: SIZING UTILITIES
   ================================================================ */

.w-100 { width: 100% !important; }
.w-auto { width: auto !important; }
.h-100 { height: 100% !important; }
.h-auto { height: auto !important; }
.mw-100 { max-width: 100% !important; }


/* ================================================================
   SECTION 10: SPACING UTILITIES (BS5 naming - ms/me/ps/pe)
   ================================================================ */

/* Margins */
.m-0 { margin: 0 !important; }
.m-1 { margin: 0.25rem !important; }
.m-2 { margin: 0.5rem !important; }
.m-3 { margin: 1rem !important; }
.m-4 { margin: 1.5rem !important; }
.m-5 { margin: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }
.mt-auto { margin-top: auto !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.ms-0 { margin-left: 0 !important; }
.ms-1 { margin-left: 0.25rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-3 { margin-left: 1rem !important; }
.ms-auto { margin-left: auto !important; }

.me-0 { margin-right: 0 !important; }
.me-1 { margin-right: 0.25rem !important; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.me-auto { margin-right: auto !important; }

.mx-auto { margin-left: auto !important; margin-right: auto !important; }

.my-0 { margin-top: 0 !important; margin-bottom: 0 !important; }
.my-3 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }

/* Paddings */
.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

.pt-0 { padding-top: 0 !important; }
.pt-3 { padding-top: 1rem !important; }
.pt-4 { padding-top: 1.5rem !important; }
.pt-5 { padding-top: 3rem !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-3 { padding-bottom: 1rem !important; }
.pb-4 { padding-bottom: 1.5rem !important; }
.pb-5 { padding-bottom: 3rem !important; }

.ps-0 { padding-left: 0 !important; }
.ps-3 { padding-left: 1rem !important; }

.pe-0 { padding-right: 0 !important; }
.pe-3 { padding-right: 1rem !important; }

.px-0 { padding-left: 0 !important; padding-right: 0 !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.px-4 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }

.py-0 { padding-top: 0 !important; padding-bottom: 0 !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }


/* ================================================================
   SECTION 11: TEXT UTILITIES
   ================================================================ */

.text-start { text-align: left !important; }
.text-end { text-align: right !important; }
.text-center { text-align: center !important; }

.text-nowrap { white-space: nowrap !important; }
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fw-light { font-weight: 300 !important; }
.fw-normal { font-weight: 400 !important; }
.fw-medium { font-weight: 500 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-bold { font-weight: 700 !important; }

.fst-italic { font-style: italic !important; }

.text-decoration-none { text-decoration: none !important; }
.text-muted { color: #6c757d !important; }

.small { font-size: 0.875em !important; }

.lh-1 { line-height: 1 !important; }
.lh-sm { line-height: 1.25 !important; }


/* ================================================================
   SECTION 12: POSITION UTILITIES
   ================================================================ */

.position-static { position: static !important; }
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed { position: fixed !important; }
.position-sticky { position: sticky !important; }

.top-0 { top: 0 !important; }
.bottom-0 { bottom: 0 !important; }
.start-0 { left: 0 !important; }
.end-0 { right: 0 !important; }


/* ================================================================
   SECTION 13: BORDER UTILITIES
   ================================================================ */

.border { border: 1px solid #dee2e6 !important; }
.border-0 { border: 0 !important; }
.border-top { border-top: 1px solid #dee2e6 !important; }
.border-bottom { border-bottom: 1px solid #dee2e6 !important; }

.rounded { border-radius: var(--blog-radius-sm) !important; }
.rounded-0 { border-radius: 0 !important; }
.rounded-circle { border-radius: 50% !important; }
.rounded-pill { border-radius: var(--blog-radius-pill) !important; }


/* ================================================================
   SECTION 14: SHADOW / OVERFLOW / OPACITY
   ================================================================ */

.shadow-none { box-shadow: none !important; }
.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075) !important; }
.shadow { box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.15) !important; }

.overflow-auto { overflow: auto !important; }
.overflow-hidden { overflow: hidden !important; }
.overflow-visible { overflow: visible !important; }

.opacity-0 { opacity: 0 !important; }
.opacity-50 { opacity: 0.5 !important; }
.opacity-100 { opacity: 1 !important; }


/* ================================================================
   SECTION 15: STRETCHED LINK (for card clicks)
   ================================================================ */

.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}


/* ================================================================
   SECTION 16: LIST UTILITIES
   ================================================================ */

.list-unstyled {
    padding-left: 0;
    list-style: none;
}


/* ================================================================
   SECTION 17: RESPONSIVE DISPLAY
   ================================================================ */

@media (min-width: 576px) {
    .d-sm-none { display: none !important; }
    .d-sm-block { display: block !important; }
    .d-sm-flex { display: flex !important; }
}

@media (min-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
    .d-md-inline { display: inline !important; }
    .d-md-inline-flex { display: inline-flex !important; }
}

@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; }
}

@media (min-width: 1200px) {
    .d-xl-none { display: none !important; }
    .d-xl-block { display: block !important; }
    .d-xl-flex { display: flex !important; }
}


/* ================================================================
   SECTION 18: RESPONSIVE FLEX
   ================================================================ */

@media (min-width: 768px) {
    .flex-md-row { flex-direction: row !important; }
    .flex-md-column { flex-direction: column !important; }
}

@media (min-width: 992px) {
    .flex-lg-row { flex-direction: row !important; }
    .flex-lg-column { flex-direction: column !important; }
}


/* ================================================================
   SECTION 18.1: RESPONSIVE COLUMN UTILITIES (BS5 POLYFILL FOR BS3)
   ================================================================
   Bootstrap 3 doesn't have col-xl-* or col-12 classes. These polyfill them.
   IMPORTANT: Media queries MUST be ordered smallest to largest (mobile-first)
   so larger breakpoints override smaller ones.
   ================================================================ */

/* Base column styles */
[class*="col-"] {
    position: relative;
    min-height: 1px;
    padding-left: 15px;
    padding-right: 15px;
}

/* col-12 (full width at all breakpoints) */
.col-12 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

/* MD breakpoint columns (768px+) - MUST come first */
@media (min-width: 768px) {
    .col-md-1 { flex: 0 0 8.333333% !important; max-width: 8.333333% !important; }
    .col-md-2 { flex: 0 0 16.666667% !important; max-width: 16.666667% !important; }
    .col-md-3 { flex: 0 0 25% !important; max-width: 25% !important; }
    .col-md-4 { flex: 0 0 33.333333% !important; max-width: 33.333333% !important; }
    .col-md-5 { flex: 0 0 41.666667% !important; max-width: 41.666667% !important; }
    .col-md-6 { flex: 0 0 50% !important; max-width: 50% !important; }
    .col-md-7 { flex: 0 0 58.333333% !important; max-width: 58.333333% !important; }
    .col-md-8 { flex: 0 0 66.666667% !important; max-width: 66.666667% !important; }
    .col-md-9 { flex: 0 0 75% !important; max-width: 75% !important; }
    .col-md-10 { flex: 0 0 83.333333% !important; max-width: 83.333333% !important; }
    .col-md-11 { flex: 0 0 91.666667% !important; max-width: 91.666667% !important; }
    .col-md-12 { flex: 0 0 100% !important; max-width: 100% !important; }
}

/* LG breakpoint columns (992px+) - overrides MD */
@media (min-width: 992px) {
    .col-lg-1 { flex: 0 0 8.333333% !important; max-width: 8.333333% !important; }
    .col-lg-2 { flex: 0 0 16.666667% !important; max-width: 16.666667% !important; }
    .col-lg-3 { flex: 0 0 25% !important; max-width: 25% !important; }
    .col-lg-4 { flex: 0 0 33.333333% !important; max-width: 33.333333% !important; }
    .col-lg-5 { flex: 0 0 41.666667% !important; max-width: 41.666667% !important; }
    .col-lg-6 { flex: 0 0 50% !important; max-width: 50% !important; }
    .col-lg-7 { flex: 0 0 58.333333% !important; max-width: 58.333333% !important; }
    .col-lg-8 { flex: 0 0 66.666667% !important; max-width: 66.666667% !important; }
    .col-lg-9 { flex: 0 0 75% !important; max-width: 75% !important; }
    .col-lg-10 { flex: 0 0 83.333333% !important; max-width: 83.333333% !important; }
    .col-lg-11 { flex: 0 0 91.666667% !important; max-width: 91.666667% !important; }
    .col-lg-12 { flex: 0 0 100% !important; max-width: 100% !important; }
}

/* XL breakpoint columns (1200px+) - overrides LG and MD - MUST come last */
@media (min-width: 1200px) {
    .col-xl-1 { flex: 0 0 8.333333% !important; max-width: 8.333333% !important; }
    .col-xl-2 { flex: 0 0 16.666667% !important; max-width: 16.666667% !important; }
    .col-xl-3 { flex: 0 0 25% !important; max-width: 25% !important; }
    .col-xl-4 { flex: 0 0 33.333333% !important; max-width: 33.333333% !important; }
    .col-xl-5 { flex: 0 0 41.666667% !important; max-width: 41.666667% !important; }
    .col-xl-6 { flex: 0 0 50% !important; max-width: 50% !important; }
    .col-xl-7 { flex: 0 0 58.333333% !important; max-width: 58.333333% !important; }
    .col-xl-8 { flex: 0 0 66.666667% !important; max-width: 66.666667% !important; }
    .col-xl-9 { flex: 0 0 75% !important; max-width: 75% !important; }
    .col-xl-10 { flex: 0 0 83.333333% !important; max-width: 83.333333% !important; }
    .col-xl-11 { flex: 0 0 91.666667% !important; max-width: 91.666667% !important; }
    .col-xl-12 { flex: 0 0 100% !important; max-width: 100% !important; }
}


/* ================================================================
   SECTION 19: SCOPED CARD STYLES (BLOG ONLY)
   ================================================================
   These only apply inside blog containers.
   ================================================================ */

.blog-home-wrapper .card,
.blog-article-wrapper .card,
.blog-category-wrapper .card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: transparent;
    background-clip: border-box;
    border: none;
    overflow: hidden;
    border-radius: var(--blog-radius-sm);
}

.blog-home-wrapper .card-body,
.blog-article-wrapper .card-body,
.blog-category-wrapper .card-body {
    flex: 1 1 auto;
    padding: 1rem;
}


/* ================================================================
   SECTION 20: SCOPED BUTTON STYLES (BLOG ONLY)
   ================================================================
   These only apply inside blog containers - won't affect nav.
   ================================================================ */

.blog-home-wrapper .btn,
.blog-article-wrapper .btn,
.blog-category-wrapper .btn {
    display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border-radius: var(--blog-radius-sm);
    transition: all 0.15s ease-in-out;
}

.blog-home-wrapper .btn-primary,
.blog-article-wrapper .btn-primary,
.blog-category-wrapper .btn-primary {
    color: #fff;
    background-color: var(--color-primary, var(--bs-primary, #0d6efd));
    border-color: var(--color-primary, var(--bs-primary, #0d6efd));
}


/* ================================================================
   SECTION 21: STICKY TOC POSITIONING
   ================================================================ */

.sectionList-stuck {
    position: fixed !important;
    top: 180px;
    z-index: 1000 !important;
}

@media (max-width: 991.98px) {
    .sectionList-stuck-mobile {
        top: var(--blog-toc-mobile-top);
        left: 0 !important;
        width: 100vw !important;
    }
}


/* ================================================================
   SECTION 22: OBJECT FIT
   ================================================================ */

.object-fit-cover { object-fit: cover !important; }
.object-fit-contain { object-fit: contain !important; }


/* ================================================================
   SECTION 23: CATEGORY PAGE COMPLETE OVERRIDES (BS3 ISOLATION)
   ================================================================
   Complete styling for category pages to override Bootstrap 3.
   Copied from working dc-brain blog-article-list.css with !important.
   ================================================================ */

/* ===== AGGRESSIVE FONT RESET FOR CATEGORY PAGE ===== */
/* Force all elements to inherit font from wrapper, override BS3 */
.ctb-category-wrapper,
.ctb-category-wrapper *,
.ctb-category-wrapper *::before,
.ctb-category-wrapper *::after {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

.ctb-category-wrapper {
    font-size: 16px !important;
    line-height: 1.6 !important;
    color: #212529 !important;
}

/* Reset BS3 classes that set font sizes */
.ctb-category-wrapper .btn,
.ctb-category-wrapper .btn-link,
.ctb-category-wrapper .list-group-item,
.ctb-category-wrapper .small,
.ctb-category-wrapper .text-muted {
    font-size: inherit !important;
    font-family: inherit !important;
}

/* ===== WRAPPER TOKENS ===== */
.ctb-category-wrapper {
    --ctb-radius: var(--blog-radius-lg);
    --ctb-inner-radius: var(--blog-radius-md);
    --ctb-border: 1px solid rgba(0,0,0,0.08);
    --ctb-soft-border: 1px solid rgba(15, 23, 42, 0.08);
    --ctb-shadow-1: 0 18px 44px rgba(0,0,0,0.10);
    --ctb-shadow-2: 0 6px 16px rgba(0,0,0,0.06);
    --ctb-title-size: 28px;
    --ctb-title-weight: 950;
    --ctb-subtext: rgba(15, 23, 42, 0.62);
    --ctb-pill-font-size: 12px;
    --ctb-pill-letter-spacing: .08em;
    --ctb-pill-pad-y: .46rem;
    --ctb-pill-pad-x: .85rem;
    --ctb-accent-width: 6px;
    --ctb-frame-bg: #f1f3f5;
    --ctb-frame-pad: 6px;
    --ctb-row-hover: rgba(15, 23, 42, 0.03);
    --ctb-row-focus: rgba(56, 121, 183, 0.18);
    --ctb-cta-bg: rgba(15, 23, 42, 0.06);
    --ctb-cta-bg-hover: rgba(15, 23, 42, 0.10);
    --ctb-accent: var(--blog-category-color, #64748b);
    --ctb-zebra-odd: #ffffff;
    --ctb-zebra-even: #eef2f6;
    padding-top: 2.75rem !important;
    padding-bottom: 3.25rem !important;
}

/* ===== HEADER CARD ===== */
.ctb-category-wrapper .ctb-category-header {
    position: relative !important;
    border-radius: var(--ctb-radius) !important;
    border: var(--ctb-border) !important;
    overflow: hidden !important;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%) !important;
    box-shadow: var(--ctb-shadow-1), var(--ctb-shadow-2) !important;
    padding: 1.6rem 1.7rem !important;
}

.ctb-category-wrapper .ctb-category-header::before {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: var(--ctb-accent-width) !important;
    background: var(--ctb-accent) !important;
    opacity: 0.95 !important;
}

.ctb-category-wrapper .ctb-category-title {
    margin: 0 !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em !important;
    line-height: 1.12 !important;
    color: #111827 !important;
}

.ctb-category-wrapper .ctb-category-subhead {
    margin-top: .45rem !important;
    color: var(--ctb-subtext) !important;
    font-size: 16px !important;
}

.ctb-category-wrapper .ctb-category-count {
    font-size: 16px !important;
    color: var(--ctb-subtext) !important;
}

.ctb-category-wrapper .ctb-category-count strong {
    font-weight: 700 !important;
}

/* ===== LIST GROUP (CARD ROWS) ===== */
.ctb-category-wrapper .ctb-category-list {
    border-radius: var(--ctb-radius) !important;
    border: var(--ctb-border) !important;
    padding: var(--ctb-frame-pad) !important;
    overflow: hidden !important;
    box-shadow: var(--ctb-shadow-2) !important;
    background: var(--ctb-frame-bg) !important;
}

/* Override BS3 list-group-item completely */
.ctb-category-wrapper .ctb-category-item.list-group-item {
    position: relative !important;
    border: var(--ctb-soft-border) !important;
    border-radius: var(--ctb-inner-radius) !important;
    padding: 1.1rem 1.2rem !important;
    padding-left: calc(1.2rem + var(--ctb-accent-width)) !important;
    margin: 0 0 6px 0 !important;
    background: #ffffff !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease !important;
    display: block !important;
    text-decoration: none !important;
    color: inherit !important;
}

.ctb-category-wrapper .ctb-category-item.list-group-item:last-child {
    margin-bottom: 0 !important;
}

/* Zebra striping */
.ctb-category-wrapper .ctb-category-item.ctb-row-odd {
    background: var(--ctb-zebra-odd) !important;
}

.ctb-category-wrapper .ctb-category-item.ctb-row-even {
    background: var(--ctb-zebra-even) !important;
}

/* Left accent rail */
.ctb-category-wrapper .ctb-category-item::before {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    top: 12px !important;
    bottom: 12px !important;
    width: 0 !important;
    border-radius: var(--blog-radius-pill) !important;
    background: var(--ctb-accent) !important;
    opacity: 0.95 !important;
    transition: width 0.18s ease !important;
}

.ctb-category-wrapper .ctb-category-item:hover::before,
.ctb-category-wrapper .ctb-category-item:focus::before {
    width: var(--ctb-accent-width) !important;
}

/* Hover / focus lift */
.ctb-category-wrapper .ctb-category-item:hover,
.ctb-category-wrapper .ctb-category-item:focus {
    background: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 14px 30px rgba(0,0,0,0.10), 0 6px 14px rgba(0,0,0,0.06) !important;
    text-decoration: none !important;
    color: inherit !important;
}

/* Item inner layout */
.ctb-category-wrapper .ctb-item-inner {
    gap: 1rem !important;
}

.ctb-category-wrapper .ctb-item-title {
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    color: #111827 !important;
    line-height: 1.2 !important;
    font-size: 16px !important;
}

.ctb-category-wrapper .ctb-item-meta {
    color: rgba(15, 23, 42, 0.62) !important;
    font-size: 14px !important;
}

.ctb-category-wrapper .ctb-meta-sep {
    margin: 0 .4rem !important;
    opacity: 0.7 !important;
}

/* ===== CTA CHIP (READ ARTICLE) ===== */
.ctb-category-wrapper .ctb-item-cta {
    display: inline-flex !important;
    align-items: center !important;
    gap: .45rem !important;
    opacity: 1 !important;
    font-weight: 900 !important;
    letter-spacing: 0.02em !important;
    padding: .48rem .8rem !important;
    border-radius: var(--blog-radius-pill) !important;
    background: var(--ctb-cta-bg) !important;
    border: 1px solid rgba(15, 23, 42, 0.10) !important;
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease !important;
    font-size: 14px !important;
    color: rgba(15, 23, 42, 0.7) !important;
}

/* Explicit text element sizing */
.ctb-category-wrapper .ctb-read-text {
    font-size: 14px !important;
    font-weight: 900 !important;
}

.ctb-category-wrapper .ctb-back-text {
    font-size: 16px !important;
    font-weight: 800 !important;
}

.ctb-category-wrapper .ctb-category-item:hover .ctb-item-cta {
    transform: translateX(2px) !important;
    background: var(--ctb-cta-bg-hover) !important;
    border-color: rgba(15, 23, 42, 0.14) !important;
}

/* ===== BACK LINK (Override BS3 .btn .btn-link) ===== */
.ctb-category-wrapper .ctb-back-link.btn.btn-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: .45rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.3px !important;
    text-decoration: none !important;
    color: inherit !important;
    opacity: 0.92 !important;
    transition: opacity 0.15s ease, transform 0.15s ease !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    font-size: 16px !important;
}

/* Also target without .btn classes in case markup differs */
.ctb-category-wrapper .ctb-back-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: .45rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.3px !important;
    text-decoration: none !important;
    color: inherit !important;
    opacity: 0.92 !important;
    font-size: 16px !important;
}

.ctb-category-wrapper .ctb-back-link.btn.btn-link:hover,
.ctb-category-wrapper .ctb-back-link.btn.btn-link:focus {
    opacity: 1 !important;
    transform: translateX(-2px) !important;
    text-decoration: none !important;
    color: inherit !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* ===== BACK ARROW (←) ===== */
.ctb-category-wrapper .ctb-back-arrow {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 29px !important;
    height: 34px !important;
    line-height: 0 !important;
    font-size: 0 !important;
    transform-origin: 50% 55% !important;
    transition: transform 0.18s ease !important;
}

.ctb-category-wrapper .ctb-back-arrow::before {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    right: 28% !important;
    width: 34% !important;
    height: 2px !important;
    background: var(--blog-category-color, #64748b) !important;
    transform: translateY(-50%) !important;
}

.ctb-category-wrapper .ctb-back-arrow::after {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    left: 28% !important;
    width: 10px !important;
    height: 10px !important;
    border-left: 2px solid var(--blog-category-color, #64748b) !important;
    border-top: 2px solid var(--blog-category-color, #64748b) !important;
    transform: translateY(-50%) rotate(-45deg) !important;
}

.ctb-category-wrapper .ctb-back-link:hover .ctb-back-arrow,
.ctb-category-wrapper .ctb-back-link:focus .ctb-back-arrow {
    transform: translateY(-2px) rotate(45deg) !important;
}

/* ===== READ ARROW (→) ===== */
.ctb-category-wrapper .ctb-read-arrow {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 29px !important;
    height: 34px !important;
    line-height: 0 !important;
    font-size: 0 !important;
    transform-origin: 50% 55% !important;
    transition: transform 0.18s ease !important;
}

.ctb-category-wrapper .ctb-read-arrow::before {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    left: 28% !important;
    width: 34% !important;
    height: 2px !important;
    background: var(--blog-category-color, #64748b) !important;
    transform: translateY(-50%) !important;
}

.ctb-category-wrapper .ctb-read-arrow::after {
    content: "" !important;
    position: absolute !important;
    top: 50% !important;
    right: 28% !important;
    width: 10px !important;
    height: 10px !important;
    border-right: 2px solid var(--blog-category-color, #64748b) !important;
    border-top: 2px solid var(--blog-category-color, #64748b) !important;
    transform: translateY(-50%) rotate(45deg) !important;
}

.ctb-category-wrapper .ctb-category-item:hover .ctb-read-arrow,
.ctb-category-wrapper .ctb-category-item:focus .ctb-read-arrow {
    transform: translateY(-2px) rotate(-45deg) !important;
}

/* ===== MOBILE: SMALLER READ ARTICLE PILL ===== */
@media (max-width: 767.98px) {
    .ctb-category-wrapper .ctb-item-cta {
        font-size: 11px !important;
        padding: 0.3rem 0.55rem !important;
        gap: 0.2rem !important;
    }
    .ctb-category-wrapper .ctb-read-text {
        font-size: 13px !important;
    }
    .ctb-category-wrapper .ctb-read-arrow {
        width: 26px !important;
        height: 28px !important;
    }
    .ctb-category-wrapper .ctb-read-arrow::before {
        height: 1.75px !important;
    }
    .ctb-category-wrapper .ctb-read-arrow::after {
        width: 7px !important;
        height: 7px !important;
        border-width: 1.75px !important;
    }
}

@media (max-width: 479.98px) {
    .ctb-category-wrapper .ctb-item-cta {
        font-size: 10px !important;
        padding: 0.25rem 0.45rem !important;
    }
    .ctb-category-wrapper .ctb-read-text {
        font-size: 12px !important;
    }
    .ctb-category-wrapper .ctb-read-arrow {
        width: 15px !important;
        height: 17px !important;
    }
    .ctb-category-wrapper .ctb-read-arrow::after {
        width: 5px !important;
        height: 5px !important;
    }
}

/* ===== THUMBNAIL ===== */
.ctb-category-wrapper .ctb-item-thumb {
    width: 120px !important;
    height: 80px !important;
    border-radius: var(--blog-radius-sm) !important;
    overflow: hidden !important;
    background: #f0f0f0 !important;
    flex-shrink: 0 !important;
}

.ctb-category-wrapper .ctb-thumb-img {
    width: 120px !important;
    height: 80px !important;
    object-fit: cover !important;
    border-radius: var(--blog-radius-sm) !important;
}

.ctb-category-wrapper .ctb-item-right {
    margin-left: auto !important;
    flex-shrink: 0 !important;
}

/* ===== RESPONSIVE (991px) ===== */
@media (max-width: 991px) {
    .ctb-category-wrapper .ctb-category-title {
        font-size: 23px !important;
    }

    .ctb-category-wrapper .ctb-category-header {
        padding: 1.35rem 1.25rem !important;
    }
}

/* ===== RESPONSIVE (767px) ===== */
@media (max-width: 767px) {
    .ctb-category-wrapper {
        padding-top: 2rem !important;
        padding-bottom: 2.5rem !important;
    }

    .ctb-category-wrapper .ctb-category-title {
        font-size: 21px !important;
    }

    .ctb-category-wrapper .ctb-item-title {
        font-size: 16px !important;
    }

    .ctb-category-wrapper .ctb-category-item {
        padding: 1.05rem 1.05rem !important;
        padding-left: calc(1.05rem + var(--ctb-accent-width)) !important;
    }
}


/* ================================================================
   SECTION 24: BORDER RADIUS OVERRIDES (ALL PAGES)
   ================================================================
   Master overrides for border-radius on Homepage, Article, and
   Category pages. Controlled by --blog-corners-rounded toggle.
   ================================================================ */

/* ===== HOMEPAGE OVERRIDES ===== */
/* Override the homepage CSS variables */
.blog-home-wrapper {
    --blog-panel-radius: var(--blog-radius-lg) !important;
    --blog-inner-radius: var(--blog-radius-md) !important;
}

/* Main card/panel */
.blog-home-wrapper .blog-panel,
.blog-home-wrapper .blog-post-card {
    border-radius: var(--blog-radius-lg) !important;
}

/* Inner card and content areas */
.blog-home-wrapper .blog-content-card,
.blog-home-wrapper .blog-post-card .blog-content-card {
    border-radius: var(--blog-radius-md) !important;
}

/* Card images - force all corners rounded */
.blog-home-wrapper .blog-card-media img,
.blog-home-wrapper .blog-hero-media img,
.blog-home-wrapper .blog-card-image,
.blog-home-wrapper .blog-hero-image,
.blog-home-wrapper .blog-post-card img,
.blog-home-wrapper .blog-panel img,
.blog-home-wrapper .blog-media-card img {
    border-radius: var(--blog-radius-md) !important;
}

/* Card panel - clip corners */
.blog-home-wrapper .blog-panel,
.blog-home-wrapper .card.blog-panel,
.blog-home-wrapper .blog-post-card {
    overflow: hidden !important;
}

/* Card media containers - ensure overflow hidden for corner clipping */
.blog-home-wrapper .blog-card-media,
.blog-home-wrapper .blog-hero-media,
.blog-home-wrapper .blog-media-card {
    overflow: hidden !important;
}

/* Hero card specific */
.blog-home-wrapper .blog-hero-card,
.blog-home-wrapper .blog-hero-card .blog-content-card {
    border-radius: var(--blog-radius-lg) !important;
}

.blog-home-wrapper .blog-hero-card .blog-hero-image,
.blog-home-wrapper .blog-hero-card img {
    border-radius: var(--blog-radius-lg) !important;
}

/* Category badges */
.blog-home-wrapper .blog-category-badge {
    border-radius: var(--blog-radius-pill) !important;
}

/* Category badge dot */
.blog-home-wrapper .blog-category-badge::before {
    border-radius: var(--blog-radius-pill) !important;
}

/* Read more link and button */
.blog-home-wrapper .blog-readmore-link,
.blog-home-wrapper .blog-post-card .btn {
    border-radius: var(--blog-radius-sm) !important;
}

/* Read more arrow */
.blog-home-wrapper .blog-readmore-arrow {
    border-radius: var(--blog-radius-pill) !important;
}

/* Author avatar */
.blog-home-wrapper .blog-author-avatar,
.blog-home-wrapper .blog-author-avatar img {
    border-radius: var(--blog-radius-pill) !important;
}

/* ===== SIDEBAR COMPLETE OVERRIDES (BS3/BS5 ISOLATION) ===== */
/* Sidebar card wrapper */
.blog-home-wrapper .blog-sidebar,
.blog-home-wrapper .blog-sidebar-card {
    background: #f8f9fa !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
    border-radius: var(--blog-radius-lg) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
}

.blog-home-wrapper .blog-sidebar-body {
    padding: 1.25rem !important;
}

/* Sidebar header */
.blog-home-wrapper .blog-sidebar-head {
    margin-bottom: 1rem !important;
    padding-bottom: 0.75rem !important;
    border-bottom: 1px solid rgba(0,0,0,0.08) !important;
}

.blog-home-wrapper .blog-sidebar-title {
    font-size: 18px !important;
    font-weight: 800 !important;
    letter-spacing: 0.02em !important;
    text-transform: uppercase !important;
    color: #1e293b !important;
    margin: 0 !important;
}

/* Sidebar list container */
.blog-home-wrapper .blog-sidebar-list {
    border-radius: var(--blog-radius-md) !important;
    background: transparent !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Sidebar list items - override BS3 list-group-item */
.blog-home-wrapper .blog-sidebar-item,
.blog-home-wrapper .blog-sidebar-list .list-group-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.65rem 0.85rem !important;
    margin-bottom: 6px !important;
    background: #ffffff !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
    border-radius: var(--blog-radius-sm) !important;
    text-decoration: none !important;
    transition: all 0.15s ease !important;
}

.blog-home-wrapper .blog-sidebar-list .list-group-item:last-child {
    margin-bottom: 0 !important;
}

.blog-home-wrapper .blog-sidebar-item:hover,
.blog-home-wrapper .blog-sidebar-list .list-group-item:hover {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.12) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06) !important;
    transform: translateX(2px) !important;
}

/* Sidebar left/right containers */
.blog-home-wrapper .blog-sidebar-left {
    flex: 1 !important;
    min-width: 0 !important;
}

.blog-home-wrapper .blog-sidebar-right {
    flex-shrink: 0 !important;
    margin-left: 0.75rem !important;
}

/* Sidebar category pill */
.blog-home-wrapper .blog-sidebar-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 0.35rem 0.75rem !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    border-radius: var(--blog-radius-pill) !important;
    white-space: nowrap !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Sidebar count badge */
.blog-home-wrapper .blog-sidebar-count {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 28px !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    background: #f1f5f9 !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
    border-radius: var(--blog-radius-sm) !important;
}

/* BS5 text-bg-light utility (for BS3 compatibility) */
.blog-home-wrapper .text-bg-light {
    color: #64748b !important;
    background: #f1f5f9 !important;
}

/* Meta items */
.blog-home-wrapper .blog-post-meta .blog-meta-item {
    border-radius: var(--blog-radius-pill) !important;
}

/* ===== ARTICLE PAGE OVERRIDES ===== */
/* Override the article page CSS variables */
.blog-article-wrapper,
.blog-article-hero {
    --article-hero-radius: var(--blog-radius-xl) !important;
    --article-hero-image-radius: var(--blog-radius-lg) !important;
}

/* TOC Active Section Arrow */
.toc-pointer-arrow {
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    height: 4px;
    background: var(--color-primary, #3879b7);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.toc-pointer-arrow.active {
    opacity: 1;
}

/* Arrowhead */
.toc-pointer-arrow .toc-pointer-arrow-head {
    position: absolute;
    right: -6px;
    top: -6px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 12px solid var(--color-primary, #3879b7);
}

/* Hide arrow on mobile */
@media (max-width: 991px) {
    .toc-pointer-arrow {
        display: none !important;
    }
}

/* TOC fade when overlapping footer - completely hide */
.sectionList.toc-faded {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

/* Fix TOC jumplink scroll offset */
.blog-article-wrapper h1[id],
.blog-article-wrapper h2[id],
.blog-article-wrapper h3[id],
.blog-article-wrapper h4[id],
.blog-article-wrapper h5[id],
.blog-article-wrapper h6[id],
.blog-article-wrapper [id].anchor,
.blog-article-wrapper .anchor[id] {
    scroll-margin-top: var(--blog-toc-scroll-offset) !important;
}

/* Mobile TOC bar position */
@media (max-width: 991px) {
    .blog-article-wrapper .blog-toc-mobile,
    .blog-article-wrapper .toc-mobile-bar,
    .blog-article-wrapper .sectionList-mobile {
        top: var(--blog-toc-mobile-top) !important;
        position: sticky !important;
    }
}

/* Fix cursor - default to arrow, pointer for clickable */
.blog-article-hero,
.blog-article-hero *,
.blog-article-wrapper,
.blog-article-wrapper * {
    cursor: default !important;
}

.blog-article-hero a,
.blog-article-hero a *,
.blog-article-hero button,
.blog-article-hero [role="button"],
.blog-article-hero .blog-category-badge,
.blog-article-hero .ctb-category-pill-link,
.blog-article-wrapper a,
.blog-article-wrapper a *,
.blog-article-wrapper button,
.blog-article-wrapper [role="button"] {
    cursor: pointer !important;
}

/* Outer hero container - ALWAYS sharp corners (full bleed) */
.blog-article-wrapper .blog-article-hero,
.blog-article-hero {
    border-radius: 0 !important;
    padding-top: var(--blog-nav-height) !important;
}

/* Hero container pseudo-elements - ALWAYS sharp */
.blog-article-hero::before,
.blog-article-hero::after {
    border-radius: 0 !important;
}

.blog-article-wrapper .blog-hero-image-wrapper,
.blog-article-hero .blog-hero-image-wrapper {
    border-radius: var(--blog-radius-lg) !important;
}

/* Image wrapper pseudo-elements (frame effect) */
.blog-article-hero .blog-hero-image-wrapper::before,
.blog-article-hero .blog-hero-image-wrapper::after {
    border-radius: var(--blog-radius-lg) !important;
}

/* Hero image AND its frame - all need border-radius */
.blog-article-hero .blog-article-hero-media::before,
.blog-article-hero .blog-article-hero-media::after {
    border-radius: calc(16px * var(--blog-corners-rounded)) !important;
}

.blog-article-wrapper .blog-hero-image,
.blog-article-hero .blog-hero-image,
.blog-article-hero .blog-article-hero-image,
.blog-article-hero-image,
.blog-article-hero .blog-article-hero-media .blog-article-hero-image,
img.blog-article-hero-image {
    border-radius: calc(14px * var(--blog-corners-rounded)) !important;
    object-fit: cover !important;
    object-position: center !important;
    width: 100% !important;
    height: 100% !important;
}

.blog-article-wrapper .blog-category-badge,
.blog-article-hero .blog-category-badge {
    border-radius: var(--blog-radius-pill) !important;
}

.blog-article-wrapper .blog-post-meta .blog-meta-item,
.blog-article-hero .blog-post-meta .blog-meta-item,
.blog-public .blog-article-hero .blog-post-meta .blog-meta-item {
    border-radius: var(--blog-radius-pill) !important;
}

.blog-article-wrapper .blog-author-avatar,
.blog-article-wrapper .blog-author-avatar img {
    border-radius: var(--blog-radius-pill) !important;
}

/* Article body elements */
.blog-article-wrapper .blog-article-body img {
    border-radius: var(--blog-radius-sm) !important;
}

.blog-article-wrapper .blog-article-body pre,
.blog-article-wrapper .blog-article-body code {
    border-radius: var(--blog-radius-xs) !important;
}

/* TOC / Sidebar */
.blog-article-wrapper .blog-toc,
.blog-article-wrapper .sectionList {
    border-radius: var(--blog-radius-sm) !important;
}

/* Mobile TOC bar - full width = sharp corners */
@media (max-width: 991.98px) {
    .blog-article-wrapper .blog-toc,
    .blog-article-wrapper .sectionList,
    .sectionList.sectionList-stuck-mobile {
        border-radius: 0 !important;
    }
}

/* Related articles */
.blog-article-wrapper .blog-related-card {
    border-radius: var(--blog-radius-md) !important;
}


/* ================================================================
   SECTION 25: ARTICLE CONTENT STYLES (post.html)
   ================================================================
   CSS rules that apply the variables from Section 3
   All styles scoped to .articleContent and .sectionList
   ================================================================ */

/* ===== ARTICLE CONTENT CONTAINER ===== */
.articleContent {
    padding-top: var(--article-content-padding-top) !important;
    padding-bottom: var(--article-content-padding-bottom) !important;
    font-size: var(--article-body-font-size) !important;
    line-height: var(--article-body-line-height) !important;
    color: #333 !important;
}

/* ===== ARTICLE HEADINGS ===== */
.articleContent h2 {
    font-size: var(--article-h2-font-size) !important;
    font-weight: var(--article-h2-font-weight) !important;
    margin-top: var(--article-h2-margin-top) !important;
    margin-bottom: var(--article-h2-margin-bottom) !important;
    color: var(--article-h2-color) !important;
    line-height: 1.3 !important;
}

/* First H2 - less top margin if it's right after intro paragraph */
.articleContent > p:first-child + h2 {
    margin-top: calc(var(--article-h2-margin-top) * 0.75) !important;
}

/* ===== TITLE ECHO (first [T] heading - article title) ===== */
.articleContent h2.titleEcho {
    font-size: calc(var(--article-h2-font-size) * var(--article-title-echo-multiplier)) !important;
    color: var(--color-primary, #2A3A64) !important;
    margin-top: 0 !important;
    margin-bottom: 24px !important;
}

.articleContent h3 {
    font-size: var(--article-h3-font-size) !important;
    font-weight: var(--article-h3-font-weight) !important;
    margin-top: var(--article-h3-margin-top) !important;
    margin-bottom: var(--article-h3-margin-bottom) !important;
    color: var(--article-h3-color) !important;
    line-height: 1.3 !important;
}

.articleContent h4 {
    font-size: var(--article-h4-font-size) !important;
    font-weight: 600 !important;
    margin-top: var(--article-h4-margin-top) !important;
    margin-bottom: var(--article-h4-margin-bottom) !important;
    color: var(--article-h3-color) !important;
    line-height: 1.3 !important;
}

/* ===== H3 FOLLOWED BY CONTENT ===== */
/* Reduce space between H3 and immediately following p, ol, ul */
.articleContent h3 + p {
    margin-top: 8px !important;
}

.articleContent h3 + ol,
.articleContent h3 + ul {
    margin-top: 8px !important;
}

/* ===== ARTICLE PARAGRAPHS ===== */
.articleContent p {
    margin-top: 0 !important;
    margin-bottom: var(--article-p-margin-bottom) !important;
    font-size: inherit !important;
    line-height: inherit !important;
}

/* ===== ARTICLE LISTS ===== */
.articleContent ul,
.articleContent ol {
    margin-top: var(--article-list-margin-top) !important;
    margin-bottom: var(--article-list-margin-bottom) !important;
    padding-left: var(--article-list-padding-left) !important;
}

.articleContent li {
    margin-bottom: var(--article-list-item-spacing) !important;
    line-height: var(--article-body-line-height) !important;
}

.articleContent li:last-child {
    margin-bottom: 0 !important;
}

/* Nested lists */
.articleContent ul ul,
.articleContent ol ol,
.articleContent ul ol,
.articleContent ol ul {
    margin-top: 8px !important;
    margin-bottom: 8px !important;
}

/* ===== ARTICLE LINKS ===== */
.articleContent a {
    color: var(--article-link-color) !important;
    text-decoration: underline !important;
    transition: color 0.15s ease !important;
}

.articleContent a:hover {
    color: var(--article-link-hover-color) !important;
}

/* ===== REMOVE EXTERNAL LINK ICONS ===== */
/* Hide the external link icon (□) that appears after links */
.articleContent a[target="_blank"]::after,
.articleContent a[rel*="noopener"]::after,
.articleContent a[href^="http"]::after,
.blog-article-wrapper a[target="_blank"]::after,
.blog-article-wrapper a[rel*="noopener"]::after {
    content: none !important;
    display: none !important;
}

/* Also hide any icon fonts used for external links */
.articleContent a .fa-external-link,
.articleContent a .fa-external-link-alt,
.articleContent a .bi-box-arrow-up-right,
.articleContent a i[class*="external"] {
    display: none !important;
}

/* ===== ARTICLE TABLES ===== */
/* Responsive wrapper for horizontal scroll on mobile */
.articleContent .table-responsive,
.blog-article-wrapper .articleContent .table-responsive {
    margin-top: 1.5rem !important;
    margin-bottom: 2rem !important;
    border-radius: 8px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border: 1px solid #e5e7eb !important;
}

/* Base table styling */
.articleContent table,
.blog-article-wrapper .articleContent table,
body .articleContent table,
html body .blog-article-wrapper .articleContent table {
    width: 100% !important;
    border-collapse: collapse !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    background: #fff !important;
    margin: 0 !important;
}

/* Table header - MUST display with dark background */
.articleContent table thead,
.blog-article-wrapper .articleContent table thead,
body .articleContent table thead,
html body .blog-article-wrapper .articleContent table thead {
    display: table-header-group !important;
    visibility: visible !important;
    background: #1e293b !important;
    background-color: #1e293b !important;
}

.articleContent table thead tr,
.blog-article-wrapper .articleContent table thead tr,
body .articleContent table thead tr,
html body .blog-article-wrapper .articleContent table thead tr {
    display: table-row !important;
    visibility: visible !important;
    background: #1e293b !important;
    background-color: #1e293b !important;
}

.articleContent table thead th,
.blog-article-wrapper .articleContent table thead th,
body .articleContent table thead th,
html body .blog-article-wrapper .articleContent table thead th,
.articleContent table thead tr th,
.blog-article-wrapper .articleContent table thead tr th {
    display: table-cell !important;
    visibility: visible !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    padding: 14px 16px !important;
    text-align: left !important;
    border: none !important;
    background: #1e293b !important;
    background-color: #1e293b !important;
    white-space: nowrap !important;
    line-height: 1.4 !important;
}

/* First header cell - rounded left corner */
.articleContent table thead tr th:first-child {
    border-top-left-radius: 7px !important;
}

/* Last header cell - rounded right corner */
.articleContent table thead tr th:last-child {
    border-top-right-radius: 7px !important;
}

/* Table body */
.articleContent table tbody,
.blog-article-wrapper .articleContent table tbody {
    display: table-row-group !important;
}

/* Table body cells */
.articleContent table tbody td,
.blog-article-wrapper .articleContent table tbody td,
body .articleContent table tbody td,
html body .blog-article-wrapper .articleContent table tbody td {
    padding: 12px 16px !important;
    border-bottom: 1px solid #e5e7eb !important;
    vertical-align: top !important;
    font-size: 15px !important;
    line-height: 1.5 !important;
    background: inherit !important;
}

/* Alternating row colors */
.articleContent table tbody tr:nth-child(odd) {
    background: #f8fafc !important;
}

.articleContent table tbody tr:nth-child(even) {
    background: #fff !important;
}

/* Hover effect */
.articleContent table tbody tr:hover {
    background: #e0f2fe !important;
}

/* Last row - rounded bottom corners */
.articleContent table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 7px !important;
}

.articleContent table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 7px !important;
}

/* Links in tables */
.articleContent table a {
    color: #2563eb !important;
    font-weight: 500 !important;
}

.articleContent table a:hover {
    text-decoration: underline !important;
}

/* Bold text in table cells */
.articleContent table strong {
    color: #1e293b !important;
    font-weight: 600 !important;
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .articleContent table,
    body .articleContent table {
        font-size: 14px !important;
    }

    .articleContent table thead th,
    .articleContent table tbody td,
    body .articleContent table thead th,
    body .articleContent table tbody td {
        padding: 10px 12px !important;
        font-size: 14px !important;
    }
}

/* ===== TOC / SECTION LIST STYLING ===== */
.sectionList {
    padding-top: var(--toc-padding-top) !important;
    padding-bottom: var(--toc-padding-bottom) !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
}

/* Keep transparent when stuck */
.sectionList.sectionList-stuck {
    background: transparent !important;
    box-shadow: none !important;
}

/* TOC container transparent */
.sectionList .toc,
.sectionList.sectionList-stuck .toc {
    background: transparent !important;
    box-shadow: none !important;
}

/* TOC heading "On this page" */
.sectionList h2,
.sectionList .toc h2,
.toc h2 {
    font-size: var(--toc-heading-font-size) !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    color: #ffffff !important;
    background: var(--color-primary, #2A3A64) !important;
    padding: var(--toc-item-padding-y) var(--toc-item-padding-x) !important;
    margin: 0 !important;
    border-bottom: 1px solid var(--toc-border-color) !important;
    border-radius: var(--blog-radius-sm) var(--blog-radius-sm) 0 0 !important;
}

/* TOC list - with scrollbar for long lists (desktop only) */
.sectionList nav ul,
.sectionList .toc ul,
.toc ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Desktop: scrollable TOC */
@media (min-width: 992px) {
    .sectionList nav ul,
    .sectionList .toc ul,
    .toc ul {
        max-height: 60vh !important;
        overflow-y: auto !important;
    }
}

/* Mobile stuck: collapse TOC by default */
@media (max-width: 991.98px) {
    /* Sharp corners on mobile - full width bar */
    .sectionList,
    .sectionList.sectionList-stuck-mobile,
    .sectionList .toc,
    .sectionList h2,
    .sectionList .toc h2,
    .toc h2 {
        border-radius: 0 !important;
    }

    .sectionList.sectionList-stuck-mobile .toc ul {
        max-height: 0 !important;
        overflow: hidden !important;
        transition: max-height 0.25s ease !important;
    }

    /* Expand when toggled */
    .sectionList.sectionList-stuck-mobile.toc-expanded .toc ul {
        max-height: 500px !important;
    }
}

/* Custom scrollbar styling for TOC */
.sectionList nav ul::-webkit-scrollbar,
.toc ul::-webkit-scrollbar {
    width: 6px;
}

.sectionList nav ul::-webkit-scrollbar-track,
.toc ul::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.sectionList nav ul::-webkit-scrollbar-thumb,
.toc ul::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sectionList nav ul::-webkit-scrollbar-thumb:hover,
.toc ul::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* TOC list items */
.sectionList nav ul li,
.sectionList .toc ul li,
.toc ul li {
    margin: 0 !important;
    padding: 0 !important;
    border-bottom: 1px solid var(--toc-border-color) !important;
}

.sectionList nav ul li:last-child,
.sectionList .toc ul li:last-child,
.toc ul li:last-child {
    border-bottom: none !important;
}

/* TOC links */
.sectionList nav ul li a,
.sectionList .toc ul li a,
.toc ul li a {
    display: block !important;
    padding: var(--toc-item-padding-y) var(--toc-item-padding-x) !important;
    font-size: var(--toc-font-size) !important;
    color: #334155 !important;
    text-decoration: none !important;
    border-left: var(--toc-active-border-width) solid transparent !important;
    transition: all 0.15s ease !important;
}

.sectionList nav ul li a:hover,
.sectionList .toc ul li a:hover,
.toc ul li a:hover {
    background: rgba(0, 0, 0, 0.03) !important;
    color: var(--toc-active-color) !important;
    border-left-color: var(--toc-active-color) !important;
}

/* TOC active state */
.sectionList nav ul li a.active,
.sectionList .toc ul li a.active,
.toc ul li a.active {
    background: rgba(0, 0, 0, 0.04) !important;
    color: var(--toc-active-color) !important;
    border-left-color: var(--toc-active-color) !important;
    font-weight: 600 !important;
}

/* ===== BACK TO BLOG LINK ===== */
.sectionList .backToBlogLink,
.backToBlogLink {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px !important;
    margin-bottom: 12px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--color-primary, #2A3A64) !important;
    text-decoration: none !important;
    background: #fff !important;
    border: 1px solid var(--toc-border-color) !important;
    border-radius: var(--blog-radius-pill) !important;
    transition: all 0.15s ease !important;
}

.sectionList .backToBlogLink:hover,
.backToBlogLink:hover {
    background: var(--color-primary, #2A3A64) !important;
    color: #fff !important;
    border-color: var(--color-primary, #2A3A64) !important;
}

/* Mobile: hide standalone back link - shown inline in TOC header when stuck */
@media (max-width: 991.98px) {
    .sectionList > .backToBlogLink,
    .backToBlogLink {
        display: none !important;
    }

    /* Remove white gap between mobile category bar and hero */
    .padding-top-none-article-banner {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        margin-top: 0 !important;
    }

    .padding-top-none-article-banner > .container-xl {
        padding-top: 0 !important;
    }
}

/* ===== READ MORE ARTICLES LINK ===== */
.articleContent a[href="../"] b,
.articleContent p:last-child b a {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 12px 20px !important;
    margin-top: 24px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.02em !important;
    color: #fff !important;
    background: var(--color-primary, #2A3A64) !important;
    border-radius: var(--blog-radius-sm) !important;
    text-decoration: none !important;
    transition: all 0.15s ease !important;
}

.articleContent a[href="../"] b:hover,
.articleContent p:last-child b a:hover {
    opacity: 0.9 !important;
}

/* ===== RESPONSIVE ARTICLE CONTENT RULES ===== */
/* Note: Variable overrides are in Section 3 */
@media (max-width: 767px) {
    .articleContent {
        padding-top: var(--article-content-padding-top) !important;
    }
}


/* ================================================================
   SECTION 30: MOBILE CATEGORY BAR
   ================================================================
   Collapsible category navigation for mobile devices.
   Appears below the main nav on blog pages.
   ================================================================ */

/* Mobile Category Bar - Only visible on mobile */
.blog-mobile-cat-bar {
    display: none;
    background: var(--blog-mobile-cat-bg) !important;
    border-bottom: 1px solid var(--blog-mobile-cat-border) !important;
}

@media (max-width: 991.98px) {
    .blog-mobile-cat-bar {
        display: block;
        position: sticky !important;
        top: var(--blog-mobile-cat-top) !important;
        z-index: 990 !important;  /* Below nav (1000+) */
    }
}

.blog-mobile-cat-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--blog-mobile-cat-text) !important;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.blog-mobile-cat-toggle:hover,
.blog-mobile-cat-toggle:focus {
    background: var(--blog-mobile-cat-hover) !important;
    outline: none;
}

.blog-mobile-cat-toggle-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-mobile-cat-toggle-icon {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.blog-mobile-cat-chevron {
    width: 16px;
    height: 16px;
    opacity: 0.6;
    transition: transform 0.3s ease;
}

.blog-mobile-cat-bar.is-open .blog-mobile-cat-chevron {
    transform: rotate(180deg);
}

/* Dropdown panel */
.blog-mobile-cat-dropdown {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    background: rgba(0,0,0,0.2);
}

.blog-mobile-cat-bar.is-open .blog-mobile-cat-dropdown {
    max-height: 500px;
}

.blog-mobile-cat-list {
    padding: 8px 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Category row link */
.blog-mobile-cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.blog-mobile-cat-item:hover {
    background: var(--blog-mobile-cat-hover) !important;
    text-decoration: none;
}

/* Category pill - matches .blog-category-badge but smaller for mobile */
.blog-mobile-cat-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;

    font-size: 10px;
    padding: 4px 10px;

    letter-spacing: 0.2px;
    font-weight: 900;
    text-transform: uppercase;
    line-height: 1;

    border-radius: 999px;
    position: relative;

    color: rgba(255,255,255,0.96);
    background: #64748b; /* Default gray, overridden by inline style */
    border: 1px solid rgba(255,255,255,0.55);

    outline: 2px solid rgba(255,255,255,0.35);
    outline-offset: 2px;

    box-shadow: none;
}

.blog-mobile-cat-pill::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255,255,255,0.95);
}

/* Count badge */
.blog-mobile-cat-count {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.7);
}


/* ================================================================
   END OF CORTEX BLOG PUBLIC CSS
   ================================================================ */
