/* =========================================================
   BLOG ARTICLE LAYOUT (PUBLIC)
   Location : /blog/blog-article-layout.css
   Purpose  : Styles for blog article pages (/blog/<slug>/)
   Bootstrap: 5.3.7
   Container: container-xl (standard)

   IMPORTANT: All styles scoped under .blog-article-hero or
   .blog-article-wrapper to avoid conflicts with blog-home-layout.css
   ========================================================= */


/* =========================================================
   CSS VARIABLES
   ========================================================= */

:root {
    --article-primary:      #06b6d4;
    --article-primary-rgb:  6,182,212;

    --article-hero-bg-1: #0a0a12;
    --article-hero-bg-2: #050508;

    --article-hero-radius: 0px;
    --article-hero-image-radius: 0px;

    --article-text: rgba(255,255,255,0.94);
    --article-muted: rgba(255,255,255,0.74);

    /* Desktop hero height - TALLER */
    --article-hero-height: 520px;

    --article-left-pad-y: 2.5rem;
    --article-left-pad-x: 2.75rem;
}


/* =========================================================
   ARTICLE WRAPPER / BODY
   ========================================================= */

.blog-article-wrapper {
    padding-top: 0;
    padding-bottom: 3rem;
    overflow: visible !important;
}

.blog-article-wrapper .container-xl {
    overflow: visible !important;
}

.blog-article-body {
    padding-top: 2.25rem;
    font-size: 1.05rem;
    line-height: 1.75;
    overflow: visible !important;
}


/* =========================================================
   HERO SECTION (FULL BLEED)
   ========================================================= */

.blog-article-hero {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);

    background:
        radial-gradient(800px 400px at 10% 80%, rgba(6,182,212,0.08) 0%, transparent 60%),
        radial-gradient(600px 300px at 85% 20%, rgba(139,92,246,0.05) 0%, transparent 50%),
        linear-gradient(180deg, #0a0a12 0%, #050508 100%);

    overflow: hidden;
    position: relative;
    border-bottom: 1px solid rgba(6,182,212,0.15);
}

/* HUD overlay - scan lines + depth */
.blog-article-hero::before {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    inset: 0;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    pointer-events: none !important;
    clear: none !important;
    opacity: 0.4;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 3px,
            rgba(6,182,212,0.015) 3px,
            rgba(6,182,212,0.015) 4px
        ),
        linear-gradient(180deg, rgba(6,182,212,0.04) 0%, transparent 30%),
        radial-gradient(600px 240px at 20% 60%, rgba(6,182,212,0.06) 0%, transparent 70%) !important;
    z-index: 0 !important;
}


/* =========================================================
   HERO ROW (INNER PANEL)
   ========================================================= */

.blog-article-hero .blog-article-hero-row {
    position: relative !important;
    min-height: var(--article-hero-height) !important;
    min-height: 520px !important;
    padding: 28px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-wrap: wrap !important;
}

/* BS3 OVERRIDE: Reset Bootstrap 3 clearfix hack on .row pseudo-elements
   BS3 sets display:table which breaks our glassmorphism effect */
.blog-article-hero .blog-article-hero-row::before,
.blog-article-hero .blog-article-hero-row::after {
    display: block !important;
    clear: none !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
}

/* HUD panel background - glass with cyan tint */
.blog-article-hero .blog-article-hero-row::before {
    content: "" !important;
    position: absolute !important;
    inset: 1.25rem;
    top: 1.25rem !important;
    right: 1.25rem !important;
    bottom: 1.25rem !important;
    left: 1.25rem !important;
    border-radius: var(--article-hero-radius);
    pointer-events: none !important;
    background: linear-gradient(135deg, rgba(6,182,212,0.06), rgba(6,182,212,0.01)) !important;
    border: 1px solid rgba(6,182,212,0.18) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    z-index: 0 !important;
}

/* Panel shadow - cyan outer glow */
.blog-article-hero .blog-article-hero-row::after {
    content: "" !important;
    position: absolute !important;
    inset: 1.25rem;
    top: 1.25rem !important;
    right: 1.25rem !important;
    bottom: 1.25rem !important;
    left: 1.25rem !important;
    border-radius: var(--article-hero-radius);
    pointer-events: none !important;
    box-shadow:
        0 28px 70px rgba(0,0,0,0.5),
        0 10px 26px rgba(0,0,0,0.35),
        0 0 40px rgba(6,182,212,0.06),
        inset 0 0 30px rgba(6,182,212,0.02) !important;
    opacity: 0.9;
    z-index: 0 !important;
}


/* =========================================================
   LEFT COLUMN (TEXT CONTENT) - SCOPED
   ========================================================= */

.blog-article-hero .blog-article-hero-inner {
    height: 100% !important;
    min-height: 400px !important;
    position: relative !important;
    z-index: 2 !important;

    padding: 50px 44px !important;
    box-sizing: border-box !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 1rem !important;

    color: var(--article-text) !important;
    overflow: hidden !important;
}

/* Decorative left glow - cyan HUD */
.blog-article-hero .blog-article-hero-inner::before {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    inset: 0;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    pointer-events: none !important;
    clear: none !important;
    opacity: 0.9;
    background: radial-gradient(700px 360px at 15% 45%, rgba(6,182,212,0.12) 0%, rgba(6,182,212,0.00) 60%) !important;
    z-index: 1 !important;
}

.blog-article-hero .blog-article-hero-inner > * {
    position: relative;
    z-index: 2;
}


/* =========================================================
   TITLE - SCOPED
   ========================================================= */

.blog-article-hero .blog-article-title {
    margin: 0 !important;
    max-width: 26ch;

    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.12 !important;
    font-size: var(--blog-article-title, 56px) !important;

    color: #ffffff !important;
    text-shadow: 0 0 40px rgba(6,182,212,0.15), 0 0 80px rgba(6,182,212,0.05) !important;

    overflow-wrap: break-word;
    word-break: break-word;
}


/* =========================================================
   CATEGORY ROW + PILLS - SCOPED TO ARTICLE HERO
   ========================================================= */

.blog-article-hero .blog-article-category-row {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 20px !important;
    max-width: 100% !important;
    margin-top: 1rem !important;
}

.blog-article-hero .ctb-category-pill-link {
    display: inline-flex !important;
    text-decoration: none !important;
    border-radius: 0 !important;
}

.blog-article-hero .ctb-category-pill-link:focus-visible {
    outline: 2px solid rgba(255,255,255,0.55);
    outline-offset: 2px;
}

/* ARTICLE HERO BADGES - HUD style with cyan accents */
.blog-article-hero .blog-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    font-size: 11px;
    padding: 7px 14px;

    letter-spacing: 0.1em;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;

    border-radius: 0;

    color: #06b6d4;
    background: rgba(6,182,212,0.06);
    border: 1px solid rgba(6,182,212,0.35);

    outline: none;

    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    text-shadow: 0 0 12px rgba(6,182,212,0.4);
    box-shadow: 0 0 15px rgba(6,182,212,0.08), inset 0 0 15px rgba(6,182,212,0.03);
    filter: none;
    animation: none;

    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

.blog-article-hero .blog-category-badge::before {
    content: '' !important;
    position: absolute !important;
    top: -2px !important;
    left: -2px !important;
    width: 8px !important;
    height: 8px !important;
    border-top: 2px solid #06b6d4 !important;
    border-left: 2px solid #06b6d4 !important;
    border-bottom: none !important;
    border-right: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    filter: drop-shadow(0 0 4px rgba(6,182,212,0.7));
    flex-shrink: 0;
    box-shadow: none;
    transition: width 0.3s ease, height 0.3s ease;
}

.blog-article-hero .blog-category-badge::after {
    content: '' !important;
    display: block !important;
    position: absolute !important;
    bottom: -2px !important;
    right: -2px !important;
    width: 8px !important;
    height: 8px !important;
    border-bottom: 2px solid #06b6d4 !important;
    border-right: 2px solid #06b6d4 !important;
    border-top: none !important;
    border-left: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    filter: drop-shadow(0 0 4px rgba(6,182,212,0.7));
    transition: width 0.3s ease, height 0.3s ease;
}

.blog-article-hero .ctb-category-pill-link:hover .blog-category-badge,
.blog-article-hero .ctb-category-pill-link:focus-visible .blog-category-badge {
    outline: none;
    background: rgba(6,182,212,0.12);
    border-color: rgba(6,182,212,0.6);
    text-shadow: 0 0 16px rgba(6,182,212,0.6);
    box-shadow: 0 0 30px rgba(6,182,212,0.15), inset 0 0 25px rgba(6,182,212,0.05);
    transform: translateY(-2px);
}

.blog-article-hero .ctb-category-pill-link:hover .blog-category-badge::before,
.blog-article-hero .ctb-category-pill-link:hover .blog-category-badge::after {
    width: calc(100% + 4px);
    height: calc(100% + 4px);
    filter: drop-shadow(0 0 8px rgba(6,182,212,1));
}


/* =========================================================
   AUTHOR ROW - SCOPED TO ARTICLE HERO
   ========================================================= */

.blog-article-hero .blog-author-row {
    display: flex;
    align-items: center;
}

.blog-article-hero .blog-author-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0 !important;
}

.blog-article-hero .blog-author-avatars {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.blog-article-hero .blog-author-avatar {
    width: 44px !important;
    height: 44px !important;
    border-radius: 999px;
    border: 2px solid rgba(6,182,212,0.3) !important;
    background: #0f0f18;
    object-fit: cover;
    margin-top: 0 !important;

    box-shadow:
        0 10px 24px rgba(0,0,0,0.35),
        0 3px 10px rgba(0,0,0,0.20),
        0 0 12px rgba(6,182,212,0.1);
}

.blog-article-hero .blog-author-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.blog-article-hero .blog-author-name {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: rgba(255,255,255,0.92) !important;
    margin-top: 0 !important;
}


/* =========================================================
   META ROW (DATE + READ TIME) - SCOPED TO ARTICLE HERO
   ========================================================= */

.blog-article-hero .blog-article-meta-row {
    margin-top: auto !important;
    padding-top: 1rem !important;
}

.blog-article-hero .blog-post-meta {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
    align-items: center !important;

    /* Override home layout borders */
    padding: 0 !important;
    border: none !important;
    margin-top: 0 !important;
}

.blog-article-hero .blog-post-meta .blog-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 8px 14px !important;
    border-radius: 0 !important;

    background: rgba(6,182,212,0.04) !important;
    border: 1px solid rgba(6,182,212,0.2) !important;

    font-size: 14px !important;
    font-weight: 400 !important;
    font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
    color: rgba(255,255,255,0.80) !important;

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.blog-article-hero .blog-post-meta .blog-meta-item i {
    font-size: 16px;
    line-height: 1;
    opacity: 0.85;
    color: #06b6d4 !important;
    filter: drop-shadow(0 0 4px rgba(6,182,212,0.5));
}


/* =========================================================
   RIGHT COLUMN (IMAGE) - SCOPED
   ========================================================= */

.blog-article-hero .blog-article-hero-media {
    height: 100% !important;
    min-height: 280px !important;
    position: relative !important;
    z-index: 2 !important;

    padding: 1.25rem !important;
    box-sizing: border-box !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* HUD image frame - cyan glass */
.blog-article-hero .blog-article-hero-media::before {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    inset: 1.25rem;
    top: 1.25rem !important;
    right: 1.25rem !important;
    bottom: 1.25rem !important;
    left: 1.25rem !important;
    border-radius: var(--article-hero-image-radius);
    pointer-events: none !important;
    clear: none !important;

    background: linear-gradient(135deg, rgba(6,182,212,0.06), rgba(6,182,212,0.01)) !important;
    border: 1px solid rgba(6,182,212,0.2) !important;

    box-shadow:
        0 22px 60px rgba(0,0,0,0.5),
        0 8px 20px rgba(0,0,0,0.3),
        0 0 30px rgba(6,182,212,0.05),
        inset 0 0 20px rgba(6,182,212,0.02) !important;
    z-index: 1 !important;
}

.blog-article-hero .blog-article-hero-image {
    width: 100%;
    height: 100%;
    min-height: 240px;

    object-fit: cover;
    object-position: center;

    border-radius: calc(var(--article-hero-image-radius) - 2px);
    border: 1px solid rgba(6,182,212,0.25);

    background: #0a0a12;

    box-shadow:
        0 18px 44px rgba(0,0,0,0.45),
        0 6px 18px rgba(0,0,0,0.25),
        0 0 20px rgba(6,182,212,0.06);

    position: relative;
    z-index: 2;
}

.blog-article-hero .blog-article-hero-image-placeholder {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

/* Seam fade on left edge */
.blog-article-hero .blog-article-hero-media::after {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    inset: 0;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    pointer-events: none !important;
    clear: none !important;
    opacity: 0.9;
    background: linear-gradient(
        90deg,
        rgba(5,10,20,0.55) 0%,
        rgba(5,10,20,0.18) 45%,
        rgba(5,10,20,0.00) 70%
    ) !important;
    z-index: 3 !important;
}


/* =========================================================
   HELPER CLASSES
   ========================================================= */

.padding-top-none-article-banner {
    padding-top: 0 !important;
}


/* =========================================================
   RESPONSIVE: TABLET (< 992px)
   ========================================================= */

@media (max-width: 991.98px) {

    :root {
        --article-hero-height: auto;
        --article-left-pad-y: 1.75rem;
        --article-left-pad-x: 1.5rem;
    }

    .blog-article-hero .blog-article-hero-row {
        min-height: auto !important;
        padding: 1rem !important;
    }

    .blog-article-hero .blog-article-hero-row::before,
    .blog-article-hero .blog-article-hero-row::after {
        inset: 1rem;
        top: 1rem !important;
        right: 1rem !important;
        bottom: 1rem !important;
        left: 1rem !important;
        border-radius: 0 !important;
    }

    .blog-article-hero .blog-article-title {
        max-width: 100% !important;
    }

    .blog-article-hero .blog-article-hero-media {
        min-height: 220px !important;
    }

    .blog-article-hero .blog-article-hero-media::after {
        background: linear-gradient(
            180deg,
            rgba(5,10,20,0.60) 0%,
            rgba(5,10,20,0.00) 100%
        );
    }

    .blog-article-body {
        padding-top: 1.75rem;
    }
}


/* =========================================================
   RESPONSIVE: MOBILE (< 768px)
   ========================================================= */

@media (max-width: 767.98px) {

    :root {
        --article-left-pad-y: 1.5rem;
        --article-left-pad-x: 1.25rem;
    }

    .blog-article-hero .blog-article-hero-inner {
        justify-content: flex-start !important;
        padding-top: 1.25rem !important;
        padding-bottom: 1.25rem !important;
        min-height: auto !important;
    }

    .blog-article-hero .blog-article-title {
        font-size: 2.6rem !important;
        line-height: 1.15 !important;
    }

    .blog-article-hero .blog-author-avatar {
        width: 36px !important;
        height: 36px !important;
    }

    .blog-article-hero .blog-author-name {
        font-size: 0.875rem !important;
    }

    .blog-article-hero .blog-category-badge {
        font-size: 9px;
        padding: 5px 10px;
    }

    .blog-article-hero .blog-category-badge::before {
        width: 6px !important;
        height: 6px !important;
    }

    .blog-article-hero .blog-category-badge::after {
        width: 6px !important;
        height: 6px !important;
    }

    .blog-article-hero .blog-article-meta-row {
        margin-top: 0.5rem !important;
        padding-top: 0 !important;
    }

    .blog-article-hero .blog-post-meta .blog-meta-item {
        font-size: 10px !important;
        padding: 5px 8px !important;
    }

    .blog-article-hero .blog-post-meta .blog-meta-item i {
        font-size: 10px !important;
    }

    .blog-article-hero .blog-article-hero-media {
        min-height: 200px !important;
    }
}


/* =========================================================
   RESPONSIVE: SMALL MOBILE (< 576px)
   ========================================================= */

@media (max-width: 575.98px) {

    :root {
        --article-left-pad-y: 1.25rem;
        --article-left-pad-x: 1rem;
    }

    .blog-article-hero .blog-article-hero-row {
        padding: 0.75rem !important;
    }

    .blog-article-hero .blog-article-hero-row::before,
    .blog-article-hero .blog-article-hero-row::after {
        inset: 0.75rem;
        top: 0.75rem !important;
        right: 0.75rem !important;
        bottom: 0.75rem !important;
        left: 0.75rem !important;
        border-radius: 0 !important;
    }

    .blog-article-hero .blog-article-title {
        font-size: 2.2rem !important;
    }

    .blog-article-hero .blog-author-avatar {
        width: 32px !important;
        height: 32px !important;
    }

    .blog-article-hero .blog-category-badge {
        font-size: 9px !important;
        padding: 4px 8px !important;
    }

    .blog-article-hero .blog-article-hero-media {
        min-height: 180px !important;
        padding: 0.75rem !important;
    }

    .blog-article-hero .blog-article-hero-media::before {
        inset: 0.75rem;
        top: 0.75rem !important;
        right: 0.75rem !important;
        bottom: 0.75rem !important;
        left: 0.75rem !important;
        border-radius: 0 !important;
    }

    .blog-article-hero .blog-article-hero-image {
        border-radius: 0 !important;
        min-height: 160px !important;
    }
}


/* =========================================================
   MOTION SAFETY
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .blog-article-hero .blog-category-badge {
        transition: none;
    }

    .blog-article-hero .ctb-category-pill-link:hover .blog-category-badge,
    .blog-article-hero .ctb-category-pill-link:focus-visible .blog-category-badge {
        transform: none;
    }
}


/* =========================================================
   ARTICLE BODY LAYOUT - TOC SIDEBAR + CONTENT
   ========================================================= */

.blog-article-body {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 992px) {
    .blog-article-body {
        flex-direction: row;
        align-items: flex-start;
        gap: 3rem;
    }
}


/* =========================================================
   TABLE OF CONTENTS (Jump Menu)
   ========================================================= */

.sectionList {
    flex-shrink: 0;
    order: 0;  /* TOC first on all screen sizes */
}

/* Mobile: full width TOC with CSS sticky - sits below mobile nav */
@media (max-width: 991.98px) {
    .sectionList {
        width: 100vw;
        margin-left: calc(-50vw + 50%);
        margin-right: calc(-50vw + 50%);
        margin-top: -2rem;  /* Remove white space gap */
        position: sticky;
        top: 97px;  /* Below the mobile sticky nav */
        z-index: 999;  /* Below nav z-index */
    }
}

@media (min-width: 992px) {
    .sectionList {
        align-self: flex-start;
        /* Sticky handled by JavaScript */
    }
}

.toc {
    background: rgba(15,15,24,0.85);
    padding: 0;
    border-radius: 0;
    max-height: calc(100vh - 210px);  /* Account for sticky nav + offset */
    overflow: hidden;
    border: 1px solid rgba(6,182,212,0.12);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 0 20px rgba(6,182,212,0.04), inset 0 0 15px rgba(6,182,212,0.02);
}

/* Mobile: full width, no border radius, compact */
@media (max-width: 991.98px) {
    .toc {
        width: 100% !important;
        border-radius: 0 !important;
        max-height: none !important;
        padding: 0 !important;
    }

    /* Make h2 a flex container on mobile so Back link goes to right */
    .toc h2 {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 0.75rem !important;
        font-size: 11px !important;
        padding: 0.9rem 1rem !important;
        margin: 0 !important;
        min-height: 44px !important;
    }

    .toc ul {
        margin: 0 !important;
        padding: 0 !important;
    }

    .toc ul li a {
        font-size: 11px !important;
        padding: 0.3rem 0.75rem !important;
        line-height: 1.3 !important;
    }

    /* When stuck on mobile */
    .toc.toc-stuck-mobile {
        box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    }
}

@media (min-width: 992px) {
    .toc {
        width: 280px;
    }
}

/* HUD top bar - thin cyan line */
.toc::before {
    content: "";
    display: block;
    background: rgba(6,182,212,0.3);
    height: 1px;
}

/* HUD bottom bar - thin cyan line */
.toc::after {
    content: "";
    display: block;
    background: rgba(6,182,212,0.3);
    height: 1px;
}

/* TOC Title - "On this page" - subtle mono label */
.toc h2 {
    font-size: 10px !important;
    font-weight: 500 !important;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255,255,255,0.35) !important;
    background: transparent;
    margin: 0 !important;
    padding: 0.75rem 1rem !important;
    line-height: 1.3 !important;
    font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

/* TOC List */
.toc ul {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.toc ul li {
    margin: 0;
    padding: 0;
}

/* Zebra striping - full width */
.toc ul li:nth-child(odd) {
    background: rgba(255,255,255,0.02);
}

.toc ul li:nth-child(even) {
    background: transparent;
}

/* TOC Links - HUD style */
.toc ul li a {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    line-height: 1.5;
    display: block;
    padding: 0.6rem 1rem;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, text-shadow 0.2s ease;
    border-left: 2px solid transparent;
}

.toc ul li a:hover {
    color: #06b6d4;
    background: rgba(6,182,212,0.06);
    text-decoration: none;
    border-left-color: #06b6d4;
    text-shadow: 0 0 8px rgba(6,182,212,0.3);
}


/* =========================================================
   BACK TO BLOG LINK - STYLED WITH PRIMARY COLOR
   ========================================================= */

/* Back to Blog - base reset (HUD styling applied via cortex-blog-public.css Section 99) */
.backToBlogLink {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    margin-bottom: 0.75rem;
    position: relative;
    overflow: visible;
}

.backToBlogLink::before,
.backToBlogLink::after {
    pointer-events: none;
}

.backToBlogLink:hover {
    text-decoration: none;
}

/* Mobile: hide standalone back link - will show inline in TOC header when stuck */
@media (max-width: 991.98px) {
    .backToBlogLink {
        display: none !important;
    }
}

/* When sectionList is stuck (sticky) - Desktop */
.sectionList.sectionList-stuck {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 15px rgba(6,182,212,0.04);
}

.sectionList.sectionList-stuck .toc {
    border-radius: 0;
}

/* =========================================================
   MOBILE STUCK STATE - COLLAPSIBLE TOC
   ========================================================= */

@media (max-width: 991.98px) {

    /* Mobile stuck: compact header bar layout - HUD */
    .sectionList.sectionList-stuck-mobile {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 0 15px rgba(6,182,212,0.04);
        background: #0a0a12;
        border-bottom: 1px solid rgba(6,182,212,0.1);
    }

    .sectionList.sectionList-stuck-mobile .toc {
        border-radius: 0;
        background: transparent;
        max-height: none;
        border: none;
    }

    /* Hide the TOC header bar borders when stuck */
    .sectionList.sectionList-stuck-mobile .toc::before,
    .sectionList.sectionList-stuck-mobile .toc::after {
        display: none;
    }

    /* Make h2 a flex container for "ON THIS PAGE" + Back to Blog + Chevron */
    .sectionList.sectionList-stuck-mobile .toc h2 {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #0a0a12;
        padding: 0.5rem 0.75rem !important;
        cursor: pointer;
        user-select: none;
        border-bottom: 1px solid rgba(255,255,255,0.04);
    }

    /* Chevron indicator - removed ::after, now using JS-injected .toc-chevron */

    /* Hide the standalone back link on mobile stuck */
    .sectionList.sectionList-stuck-mobile > .backToBlogLink {
        display: none;
    }

    /* Collapse TOC list by default on mobile stuck */
    .sectionList.sectionList-stuck-mobile .toc ul {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease;
        background: #0f0f18;
    }

    /* Expand TOC list when toggled */
    .sectionList.sectionList-stuck-mobile.toc-expanded .toc ul {
        max-height: 500px;
    }
}

/* Back to Blog link INSIDE the h2 (injected by JS on mobile) */
.toc-back-link {
    font-size: 13px;
    font-weight: 700;
    color: #06b6d4 !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
    padding: 0.45rem 0.9rem;
    background: rgba(6,182,212,0.08);
    border-radius: 5px;
    white-space: nowrap;
    border: 1px solid rgba(6,182,212,0.2);
    box-shadow: none;
}

.toc-back-link:hover {
    color: #06b6d4 !important;
    background: rgba(6,182,212,0.15);
    text-decoration: none;
}

/* Arrow for inline back link */
.toc-back-link::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    flex-shrink: 0;
}

/* Chevron indicator next to "ON THIS PAGE" (JS-injected) */
.toc-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: rgba(255,255,255,0.9);
    transition: transform 0.2s ease;
}

.toc-chevron i {
    font-size: inherit;
    line-height: 1;
}

/* Rotate chevron when TOC is expanded */
.sectionList.toc-expanded .toc-chevron {
    transform: rotate(180deg);
}

/* Wrap h2 text in span for flexbox layout (text comes first) */
.sectionList.sectionList-stuck-mobile .toc h2 {
    gap: 0.5rem;
}


/* =========================================================
   ARTICLE CONTENT
   ========================================================= */

.articleContent {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    order: 1;  /* Content comes after TOC */
}

@media (min-width: 992px) {
    .articleContent {
        /* No max-width - let it fill remaining space in container-xl */
        order: 1;
    }
}

/* Article H1 - Title */
.articleContent h1 {
    font-size: 32px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    line-height: 1.25 !important;
    margin: 0 0 1.5rem 0 !important;
}

/* Article H2 - Section headings */
.articleContent h2 {
    font-size: 22px !important;
    font-weight: 600 !important;
    color: #06b6d4 !important;
    line-height: 1.3 !important;
    margin: 2.5rem 0 1rem 0 !important;
}

/* Article H3 */
.articleContent h3 {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: rgba(255,255,255,0.85) !important;
    line-height: 1.35 !important;
    margin: 2rem 0 0.75rem 0 !important;
}

/* Article paragraphs */
.articleContent p {
    font-size: 16px;
    line-height: 1.75;
    color: rgba(255,255,255,0.75);
    margin-bottom: 1.25rem;
}

/* Article lists */
.articleContent ul,
.articleContent ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.articleContent li {
    font-size: 16px;
    line-height: 1.75;
    color: rgba(255,255,255,0.75);
    margin-bottom: 0.5rem;
}

/* Article images - HUD frame */
.articleContent img {
    max-width: 100%;
    height: auto;
    border-radius: 0;
    margin: 1.5rem 0;
    border: 1px solid rgba(6,182,212,0.15);
    box-shadow: 0 0 20px rgba(6,182,212,0.04);
}

/* Article links - cyan HUD */
.articleContent a {
    color: #06b6d4;
    text-decoration: none;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.articleContent a:hover {
    color: #22d3ee;
    text-decoration: none;
    text-shadow: 0 0 8px rgba(6,182,212,0.3);
}
