/* --- Sticky Sidebar Fixes (Robust) --- */
/* Sticky requires ancestors to have overflow: visible */
/* Only applying to single guide pages to avoid regression elsewhere */
/* Sticky requires ancestors to have overflow: visible */
/* Fix for migrated Pages using the Template */
body, body.single-guide,
body.page-template-single-guide,
body.page-template-single-guide-php,
html.guide-overflow-fix,
body.single-guide .maincontainer,
body.page-template-single-guide .maincontainer,
body.single-guide #content,
body.page-template-single-guide #content,
body.single-guide .wrapper,
body.page-template-single-guide .wrapper {
    overflow-x: visible !important;
}

/* Ensure columns take full height for sticky to work */
/* Ensure columns take full height for sticky to work */
/* ENFORCE FLEX ROW FOR STICKY HEIGHT */
.guide-wrapper-row,
.vc_row.guide-wrapper-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
}

/* Propagate Full Height down to the wrapper */
#summary_column,
.guide-sidebar-column,
.guide-wrapper-row .vc_col-sm-3 {
    display: flex !important;
    flex-direction: column !important;
}

#summary_column>.vc_column-inner,
.guide-sidebar-column>.vc_column-inner,
.guide-wrapper-row .vc_col-sm-3>.vc_column-inner {
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    /* Critical fallback */
}

#summary_column>.vc_column-inner>.wpb_wrapper,
.guide-sidebar-column>.vc_column-inner>.wpb_wrapper,
.guide-wrapper-row .vc_col-sm-3>.vc_column-inner>.wpb_wrapper {
    flex-grow: 1 !important;
    display: block !important;
    height: 100% !important;
    width: 100% !important;
}

/* Flex Parent Constraints */
#summary_column,
.guide-wrapper-row .vc_col-sm-3 {
    height: auto;
    /* Do NOT force 100% height here, otherwise sticky elem has no track to scroll in */
}

/* Flex Container */
/* --- Automated Grid Layout --- */
.guide-grid-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: flex-start;
    /* Correct alignment */
    position: relative;
}

/* Left Column (Content) */
.guide-content-column {
    flex: 1;
    min-width: 0;
    /* Prevent flex overflow */
    max-width: 100%;
}

/* Right Column (Sidebar) */
.guide-sidebar-column {
    flex: 0 0 300px;
    /* Fixed width */
    max-width: 300px;
    width: 300px;
}

/* Sticky Inner Wrapper */
.guide-sticky-sidebar-inner {
    position: -webkit-sticky;
    position: sticky;
    top: 150px;
    /* Header offset */
    height: auto;
    z-index: 10;
    margin-top: 0 !important;
    /* User requested removal */
}

/* Mobile Responsiveness for Grid */
@media (max-width: 900px) {
    .guide-grid-container {
        flex-direction: column;
    }

    .guide-sidebar-column {
        width: 100%;
        max-width: 100%;
        flex: auto;
        order: 2;
    }

    .guide-content-column {
        order: 1;
    }
}

/* Legacy Support (Keeping clean) */
.guide-main-content {
    flex: 1;
    min-width: 0;
}

/* --- Header Full Width --- */
.guide-full-header {
    width: 100%;
    margin-bottom: 40px;
}

/* --- Container Fixes --- */
.guide-content-wrapper.guide-centered-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    /* Ensure it takes available space up to max */
    box-sizing: border-box;
}


/* --- Summary Box --- */
/* --- Summary Box --- */
/* Target both generated class and WPBakery class */
/* Use specific descendant selector to ensure we style the visible box if WPBakery wraps it */
/* --- Summary Box --- */
/* Target the specific WPBakery text column with the resume_block class */
.wpb_text_column.resume_block,
div.el_class_resume_block {
    border: 2px solid #197de7 !important;
    border-radius: 10px !important;
    padding: 25px !important;
    margin: 0 0 2.5em 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background-color: #fff !important;
    color: #197de7 !important;
    font-size: 14px !important;
    /* Force 14px on Desktop */
}

/* Helper to ensure inner p/ul/li inherit color or get forced */
.wpb_text_column.resume_block .wpb_wrapper p,
.wpb_text_column.resume_block .wpb_wrapper li,
.wpb_text_column.resume_block .wpb_wrapper {
    color: #197de7 !important;
    font-size: inherit !important;
}

.wpb_text_column.resume_block .summary_title {
    margin-top: 0 !important;
    color: #197de7 !important;
    font-size: 1.4em !important;
    margin-bottom: 1em !important;
    font-weight: 500 !important;
}

.wpb_text_column.resume_block ul {
    margin: 0 !important;
    padding-left: 20px !important;
    list-style-type: disc !important;
    font-size: inherit !important;
    /* Fix: Override generic 18px */
}

.wpb_text_column.resume_block li {
    margin-bottom: 10px !important;
    line-height: 1.6 !important;
    font-size: inherit !important;
    /* Fix: Override generic 18px */
}

/* --- Table of Contents --- */
.guide-toc {
    margin-bottom: 30px;
    margin-top: 0 !important;
    /* User requested removal */
}

.guide-toc .resume_title {
    font-size: 1.1em;
    margin-bottom: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.guide-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid #eee;
    /* Visual rail */
}

.guide-toc li {
    margin-bottom: 0;
}

.guide-toc a {
    text-decoration: none;
    color: #555;
    font-size: 0.95em;
    display: block;
    padding: 5px 0 5px 15px;
    transition: all 0.2s;
    border-left: 2px solid transparent;
    /* Highlight rail */
    margin-left: -2px;
    /* Overlap border */
}

.guide-toc a:hover {
    color: #197de7;
}

/* Active State for ScrollSpy */
.guide-toc a.active {
    color: #197de7;
    font-weight: 700;
    border-left-color: #197de7;
    background-color: rgb(25 125 231 / 5%);
    /* Subtle background highlight */
}

/* Fix TOC Anchor Scrolling (Header Offset & Smooth Scroll) */
html {
    scroll-behavior: smooth;
}

body.single-guide h2,
h2[id^="section-"] {
    scroll-margin-top: 40px !important;
    /* Adjusted offset */
}

/* --- Sidebar Buttons (Contact & Social) --- */
.guide-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Contact Button */
/* Using theme 'blue' button style if possible, or refined custom */
.btn-main-contact {
    display: block;
    background: #197de7;
    color: #fff;
    text-align: center;
    padding: 12px 20px;
    border-radius: 0;
    /* Square as requested? Or just standard? User said 'pas le bon style'. Assuming theme standard is square or different. Let's try neutral first. */
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s;
    text-transform: uppercase;
    /* Often theme style */
}

.btn-main-contact:hover {
    background: #1062b8;
    color: #fff;
}

/* Social Sharing Section */
.guide-share-tools {
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 15px;
}

.share-label {
    display: block;
    font-size: 0.85em;
    color: #888;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Container for Agency-Style Social Buttons */
.social-buttons-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

/* Agency Style LinkedIn/FB Buttons */
.btn-share-social {
    background-color: #222843;
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 0;
    /* No radius as requested */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    padding: 0;
}

.btn-share-social:hover {
    background-color: #040e31;
    opacity: 0.9;
}

.btn-share-social .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: #fff;
}

/* Images inside Social Buttons (for LLM icons) */
.btn-share-social img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    display: block;
}

/* LLM / AI Buttons Row (High Specificity Fix) */
.llm-row {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

/* Target element having BOTH classes to win specificity war */
.social-buttons-row .btn-share-social.llm-btn {
    width: 105px;
    height: 32px !important;
    min-width: unset !important;
    padding: 0 5px !important;
    gap: 2px;
    background-color: #f5f5f5 !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    display: inline-flex !important;
    text-decoration: none;
    transition: all 0.2s;
}

.social-buttons-row .btn-share-social.llm-btn:hover {
    background-color: #e0e0e0 !important;
    border-color: #ccc !important;
}

/* Ensure image doesn't force size weirdly */
.social-buttons-row .btn-share-social.llm-btn img {
    margin-right: 5px;
    /* Spacing between icon and text */
}

.llm-name {
    display: inline-block !important;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #333;
    line-height: 1;
}


/* Mobile Responsiveness */
@media (max-width: 900px) {

    /* 1. H1 Override */
    h1,
    .guide-full-header h1 {
        font-size: 2em !important;
        line-height: 1.2 !important;
        word-wrap: break-word;
    }

    .guide-flex-layout {
        flex-direction: column;
    }

    .aside_guide {
        max-width: 100%;
        position: static;
        margin-bottom: 40px;
        order: 2;
    }

    .guide-main-content {
        order: 1;
    }

    /* Sidebar relocated style (No Border Top requested) */
    .guide-sidebar-mobile-relocated {
        margin-top: 20px;
        margin-bottom: 30px;
        padding-top: 0;
        border-top: none !important;
    }

    /* Reset TOC margin in mobile relocated state */
    .guide-sidebar-mobile-relocated .guide-toc {
        margin-top: 0 !important;
    }

    /* Reduce Resume Font Size on Mobile */
    .wpb_text_column.resume_block,
    div.el_class_resume_block {
        font-size: 13px !important;
        /* Smaller text on mobile (~0.85em) */
        padding: 15px !important;
    }

    /* User Requested Override for Layout Position */
    .guide-content-wrapper {
        margin-top: -250px !important;
    }
}

/* Fix Social Icons (FB/LI) - Deep Fix */
/* Ensure Dashicons font is loaded/applied */
.btn-share-social .dashicons {
    font-family: "dashicons" !important;
    font-size: 20px !important;
    width: 20px !important;
    height: 20px !important;
    line-height: 20px !important;
    display: inline-block !important;
    /* Flex child */
    text-align: center;
    color: #fff !important;
    margin: 0 !important;
    /* Remove auto margin if flex centers it */
}

.btn-share-social svg {
    width: 20px !important;
    height: 20px !important;
    fill: #fff !important;
    display: block !important;
}

/* Ensure Button Flex Centering works perfectly */
.btn-share-social {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

/* Fix New Inline SVGs */
.btn-share-social svg {
    width: 20px !important;
    height: 20px !important;
    fill: #fff !important;
    display: block !important;
}

/* Back Button (User Request) */
.my_back_button a,
.my_back_button {
    color: inherit !important;
    text-decoration: none !important;
    box-shadow: none !important;
    border: none !important;
    background: none !important;
}

.my_back_button a:hover,
.my_back_button a:active,
.my_back_button a:focus,
.my_back_button a:visited {
    color: inherit !important;
    text-decoration: none !important;

}