/*
 * Formaestro CSE - grille commune, reference : hero de la homepage.
 * Modifier ces variables pour les prochaines pages, pas la largeur du menu
 * dans un widget local. Ne change ni les fonds, ni les transitions, ni les
 * espacements verticaux. Les colonnes de lecture peuvent rester plus etroites.
 */
:root {
    --fm-layout-max: 1280px;
    --fm-layout-gutter: 48px;
    --fm-layout-width: min(var(--fm-layout-max), calc(100% - var(--fm-layout-gutter) - var(--fm-layout-gutter)));
}
@media (max-width: 1024px) {
    :root { --fm-layout-gutter: 28px; }
}
@media (max-width: 767px) {
    :root { --fm-layout-gutter: 20px; }
}

/* Header identique sur toutes les pages, y compris les pages de domaine.
 * La priorite explicite neutralise l'ancienne exception propre a la home. */
html body .formaestro-header .fm-header-container {
    width: var(--fm-layout-width) !important;
    max-width: var(--fm-layout-max) !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
}

/* Classe reutilisable sur une section pleine largeur : une seule gouttiere. */
html body .fm-layout-shell {
    box-sizing: border-box;
    width: var(--fm-layout-width) !important;
    max-width: var(--fm-layout-max) !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
}

/* Gabarits historiques : garder leurs structures et unifier leurs enveloppes.
 * Les sous-grilles, les cartes, les filtres et les modales restent inchanges. */
html body .elementor .formaestro-wp-home,
html body .elementor .fm-catalogue-page {
    --shell: var(--fm-layout-width) !important;
}
html body .elementor.elementor-27 .formaestro-wp-home .section-shell:not(.hp-hero),
html body .elementor.elementor-27 .formaestro-wp-home .fm-story .st-shell,
html body .elementor.elementor-27 .formaestro-wp-home .fm-story.st-metrics-pending,
html body .elementor .fm-catalogue-page .fc-shell,
html body .elementor .fm-catalogue-page .fc-page-wayfinding,
html body .elementor .fm-contact-page .ct-shell,
html body .elementor.elementor-223 .fm-story .st-shell {
    width: var(--fm-layout-width) !important;
    max-width: var(--fm-layout-max) !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
}

/* Elementor natif : guide Bien choisir et futurs conteneurs racines boxes.
 * Les gouttieres sont portees par la section, jamais ajoutees une 2e fois
 * dans e-con-inner. Le fond reste bord a bord, le contenu suit le logo. */
html body .elementor[data-elementor-type="wp-page"] > .e-con.e-con-boxed {
    --content-width: var(--fm-layout-max) !important;
    --container-max-width: var(--fm-layout-max) !important;
    --padding-left: var(--fm-layout-gutter) !important;
    --padding-right: var(--fm-layout-gutter) !important;
    padding-inline: var(--fm-layout-gutter) !important;
}
html body .elementor[data-elementor-type="wp-page"] > .e-con.e-con-boxed > .e-con-inner {
    box-sizing: border-box;
    width: 100% !important;
    max-width: var(--fm-layout-max) !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
}

