/**
 * Compatibilité mobile ciblée pour le document juridique.
 *
 * Certaines mises en page compactes traitent le premier conteneur Elementor
 * contenant un h1 comme un bandeau. Ces règles préservent uniquement ce
 * composant, sans modifier la mise en page du reste du site.
 */

@media (max-width: 480px) and (orientation: portrait) {
    html body:not(.wp-admin):not(.wp-admin) .elementor.elementor[data-elementor-type="wp-page"] > :is(.e-con.e-con, .elementor-section.elementor-section):has(.teml-document.teml-document.teml-document[data-tm-phone-layout="preserve"]) .teml-document.teml-document[data-tm-phone-layout="preserve"] .teml-hero h1 {
        font-size: clamp(2rem, 10vw, 2.75rem) !important;
    }

    html body:not(.wp-admin):not(.wp-admin) .elementor.elementor[data-elementor-type="wp-page"] > :is(.e-con.e-con, .elementor-section.elementor-section):has(.teml-document.teml-document[data-tm-phone-layout="preserve"]) {
        display: block !important;
        block-size: auto !important;
        min-block-size: 0 !important;
        aspect-ratio: auto !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        overflow: visible !important;
    }

    html body:not(.wp-admin):not(.wp-admin) .elementor.elementor[data-elementor-type="wp-page"] > :is(.e-con.e-con, .elementor-section.elementor-section):has(.teml-document.teml-document[data-tm-phone-layout="preserve"]) :is(.e-con, .elementor-section, .wp-block-cover):has(.teml-document[data-tm-phone-layout="preserve"]) {
        block-size: auto !important;
        min-block-size: 0 !important;
        flex: 0 1 auto !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
    }

    html body:not(.wp-admin):not(.wp-admin) .elementor.elementor[data-elementor-type="wp-page"] > :is(.e-con.e-con, .elementor-section.elementor-section):has(.teml-document.teml-document[data-tm-phone-layout="preserve"]) .teml-document h1 {
        inline-size: auto !important;
        max-inline-size: 18ch !important;
        margin: 0 0 20px !important;
        font-size: clamp(2rem, 10vw, 2.75rem) !important;
        line-height: 1.18 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
        text-align: left !important;
    }

    html body:not(.wp-admin):not(.wp-admin) .elementor.elementor[data-elementor-type="wp-page"] > :is(.e-con.e-con, .elementor-section.elementor-section):has(.teml-document.teml-document[data-tm-phone-layout="preserve"]) .teml-document h2 {
        inline-size: auto !important;
        max-inline-size: none !important;
        margin: 3px 0 0 !important;
        font-size: 1.75rem !important;
        line-height: 1.18 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        text-align: left !important;
    }

    html body:not(.wp-admin):not(.wp-admin) .elementor.elementor[data-elementor-type="wp-page"] > :is(.e-con.e-con, .elementor-section.elementor-section):has(.teml-document.teml-document[data-tm-phone-layout="preserve"]) .teml-document h3 {
        inline-size: auto !important;
        max-inline-size: none !important;
        margin: 34px 0 13px !important;
        font-size: 1.25rem !important;
        line-height: 1.18 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        text-align: left !important;
    }

    html body:not(.wp-admin):not(.wp-admin) .elementor.elementor[data-elementor-type="wp-page"] > :is(.e-con.e-con, .elementor-section.elementor-section):has(.teml-document.teml-document[data-tm-phone-layout="preserve"]) .teml-document :is(h4, h5, h6) {
        inline-size: auto !important;
        max-inline-size: none !important;
        margin: 0 0 10px !important;
        font-size: 1.05rem !important;
        line-height: 1.18 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        text-align: left !important;
    }

    html body:not(.wp-admin):not(.wp-admin) .elementor.elementor[data-elementor-type="wp-page"] > :is(.e-con.e-con, .elementor-section.elementor-section):has(.teml-document.teml-document[data-tm-phone-layout="preserve"]) .teml-document p {
        display: block !important;
        inline-size: auto !important;
        max-inline-size: none !important;
        margin: 0 0 1em !important;
        font-size: 1em !important;
        line-height: 1.72 !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
        text-align: left !important;
        text-wrap: wrap !important;
    }

    html body:not(.wp-admin):not(.wp-admin) .elementor.elementor[data-elementor-type="wp-page"] > :is(.e-con.e-con, .elementor-section.elementor-section):has(.teml-document.teml-document[data-tm-phone-layout="preserve"]) .teml-document .teml-eyebrow {
        display: inline-flex !important;
        width: auto !important;
        margin: 0 0 18px !important;
        font-size: .78em !important;
        line-height: 1.2 !important;
        text-align: left !important;
    }

    html body:not(.wp-admin):not(.wp-admin) .elementor.elementor[data-elementor-type="wp-page"] > :is(.e-con.e-con, .elementor-section.elementor-section):has(.teml-document.teml-document[data-tm-phone-layout="preserve"]) .teml-document .teml-lead {
        margin: 0 0 26px !important;
        font-size: 1.02rem !important;
    }

    html body:not(.wp-admin):not(.wp-admin) .elementor.elementor[data-elementor-type="wp-page"] > :is(.e-con.e-con, .elementor-section.elementor-section):has(.teml-document.teml-document[data-tm-phone-layout="preserve"]) .teml-document .teml-updated {
        margin: 18px 0 0 !important;
        font-size: .88em !important;
    }

    html body:not(.wp-admin):not(.wp-admin) .elementor.elementor[data-elementor-type="wp-page"] > :is(.e-con.e-con, .elementor-section.elementor-section):has(.teml-document.teml-document[data-tm-phone-layout="preserve"]) .teml-document :is(.teml-card, .teml-callout, .teml-example) > :is(h3, h4):first-child {
        margin-top: 0 !important;
    }

    html body:not(.wp-admin):not(.wp-admin) .elementor.elementor[data-elementor-type="wp-page"] > :is(.e-con.e-con, .elementor-section.elementor-section):has(.teml-document.teml-document[data-tm-phone-layout="preserve"]) .teml-document :is(.teml-section, .teml-card, .teml-callout, .teml-example) p:last-child,
    html body:not(.wp-admin):not(.wp-admin) .elementor.elementor[data-elementor-type="wp-page"] > :is(.e-con.e-con, .elementor-section.elementor-section):has(.teml-document.teml-document[data-tm-phone-layout="preserve"]) .teml-document .teml-footer p {
        margin-bottom: 0 !important;
    }
}
