
/* =========================================================
   Legacy Hub automatic layout repairs — v0.9.6
   Structure based, reusable across sites.
   ========================================================= */

/* 3 icon-box columns + a CTA column -> 3 cards, CTA centered below */
body.tsle-legacy-page .tsle-auto-three-plus-cta-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
    justify-content: center !important;
}

body.tsle-legacy-page .tsle-auto-card-third {
    flex: 0 0 33.333333% !important;
    width: 33.333333% !important;
    max-width: 33.333333% !important;
    min-width: 0 !important;
}

body.tsle-legacy-page .tsle-auto-cta-full {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-top: 16px !important;
}

body.tsle-legacy-page .tsle-auto-cta-full > .elementor-widget-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body.tsle-legacy-page .tsle-auto-cta-full .elementor-widget-ld_button {
    width: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.tsle-legacy-page .tsle-auto-card-third .iconbox {
    max-width: 310px;
    margin-left: auto;
    margin-right: auto;
}

/*
 * Two top-level columns where the first has 3+ icon boxes and the second
 * is CTA/buttons -> stack only the TOP-LEVEL columns.
 * Nested icon-box columns are intentionally untouched.
 */
body.tsle-legacy-page .tsle-auto-stack-two-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: stretch !important;
}

body.tsle-legacy-page .tsle-auto-stack-primary,
body.tsle-legacy-page .tsle-auto-stack-secondary {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

body.tsle-legacy-page .tsle-auto-stack-primary {
    margin-bottom: 30px !important;
}

body.tsle-legacy-page .tsle-auto-stack-secondary > .elementor-widget-wrap {
    max-width: 760px;
    margin-left: auto !important;
    margin-right: auto !important;
    text-align: center;
}

body.tsle-legacy-page .tsle-auto-stack-secondary .elementor-widget-ld_button {
    width: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Conservative FAQ cleanup only. */
body.tsle-legacy-page .tsle-auto-faq .elementor-widget-ld_accordion {
    width: 100% !important;
}

/* General legacy icon-box stability without changing layout. */
body.tsle-legacy-page .elementor-widget-ld_icon_box,
body.tsle-legacy-page .elementor-widget-ld_icon_box .iconbox,
body.tsle-legacy-page .elementor-widget-ld_icon_box .contents {
    min-width: 0;
}

@media (max-width: 767px) {
    body.tsle-legacy-page .tsle-auto-card-third,
    body.tsle-legacy-page .tsle-auto-cta-full {
        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.tsle-legacy-page .tsle-auto-card-third {
        margin-bottom: 18px !important;
    }
}
