/* =========================================================================
   Municipalité proactive : couche responsive
   Réécrite le 20 septembre 2026.

   L'ancien fichier provenait d'un autre site (Dalby) : ses sélecteurs
   (.hooklifts, .details-produits, .made-france, #products-list...) ne
   correspondaient à rien ici. Sur ses 138 règles, une seule trouvait un
   élément dans la page. L'ancienne version est conservée dans
   sources/responsive-avant-reecriture-260920.css.

   Conventions :
   - points de rupture descendants (max-width), comme le fichier d'origine :
     1365 / 1199 / 1023 / 767 / 479 / 392, soit un pixel sous les
     valeurs usuelles pour que 1366, 1200, 1024... gardent la disposition
     du palier superieur ;
   - au-dessus de 1366px, rien ne change par rapport à main.css ;
   - les maximums des clamp() reprennent exactement les valeurs de main.css,
     donc l'affichage grand écran reste identique ;
   - deux variables portent la respiration : --mp-gouttiere (marge latérale)
     et --mp-section (rythme vertical).
   ========================================================================= */

:root {
    --mp-gouttiere: 60px;
    --mp-section: 120px;
}

/* --- Typographie fluide -------------------------------------------------
   Les titres étaient figés en pixels (76px, 57px, 43px...) et débordaient
   de l'écran sur téléphone. clamp() les fait descendre progressivement. */

h1 {
    font-size: clamp(34px, 5.3vw, 76px);
    max-width: min(736px, 100%);
}

#sheet h1 {
    max-width: min(830px, 100%);
}

h2 {
    font-size: clamp(28px, 4vw, 57px);
}

#home #section3 #content #title {
    font-size: clamp(26px, 3.2vw, 43px);
}

#newsletter-form-wrapper #title {
    font-size: clamp(28px, 4vw, 57px);
}

#sheet #section1 #intro {
    font-size: clamp(20px, 2.2vw, 30px);
}

.sheet-paragraph-title {
    font-size: clamp(22px, 2.2vw, 30px);
}

/* --- Garde-fous ---------------------------------------------------------- */

img,
svg,
video,
iframe {
    max-width: 100%;
}

/* Bloc d'image large dans le corps d'une fiche : il était figé à 645px. */
.sheet-paragraph-text .imgWrapper {
    width: 100%;
    max-width: 645px;
}

/* --- Gouttières ---------------------------------------------------------
   Aucun de ces blocs n'avait de marge latérale : sous leur largeur
   maximale, le texte venait toucher le bord de l'écran. */

#home #section1,
#category #section1,
#sheet #section1,
#sheets-cat-nav,
#newsletter-form-wrapper {
    padding-left: var(--mp-gouttiere);
    padding-right: var(--mp-gouttiere);
}

/* --- Navigation de fiche : structure commune ----------------------------
   Sur grand écran, display:contents efface le conteneur de la mise en page :
   les onglets restent les enfants directs de #sheet-nav, exactement comme
   avant. Le bouton n'apparaît qu'en dessous de 768px. */

#sheet-nav-list {
    display: contents;
}

#sheet-nav-toggle {
    display: none;
}

/* =========================================================================
   <= 1365px
   ========================================================================= */

@media (max-width: 1365px) {
    :root {
        --mp-gouttiere: 48px;
        --mp-section: 100px;
    }

    /* Quatre colonnes des 1365px. Six colonnes de 183px faisaient 1098px de
       large, ce qui etait la cause principale du defilement horizontal ;
       la hauteur passe en auto parce que la grille tient desormais sur
       deux rangees. */
    #sheets-cat-list,
    #sheets-cat-list.inside-cat {
        grid-template-columns: repeat(4, 1fr);
        height: auto;
        row-gap: 32px;
    }

    /* La pastille garde la proportion 2/3 de main.css, donc tous les boutons
       d'une rangee font la meme hauteur. Le rembourrage descend de 54/26 a
       40/22 pour qu'un titre de trois lignes y tienne sans la deformer. */
    /* #sheets-cat-list .cat-btn {
        width: 100%;
        max-width: 183px;
        height: auto;
        padding: 40px 22px;
    } */

    #sheet #section2,
    #breadcrumb {
        padding-left: var(--mp-gouttiere);
        padding-right: var(--mp-gouttiere);
    }

    /* On réserve une voie de 240px à la colonne de navigation collante. */
    .sheet-paragraph,
    #sheet-footer {
        width: 100%;
        max-width: calc(100% - 240px);
    }

    #home #section2,
    #category #section3,
    #sheet #section4 {
        padding-top: var(--mp-section);
        padding-bottom: var(--mp-section);
    }

    #category #section2,
    #sheet #section3,
    #section3b {
        padding: var(--mp-section) var(--mp-gouttiere);
    }

    #home #section3 #content {
        padding: var(--mp-section) var(--mp-gouttiere);
    }

    #footers-wrapper {
        padding: var(--mp-section) var(--mp-gouttiere) 24px var(--mp-gouttiere);
    }
}

/* =========================================================================
   <= 1199px
   ========================================================================= */

@media (max-width: 1199px) {
    :root {
        --mp-gouttiere: 40px;
        --mp-section: 88px;
    }

    /* Moitie de l'espace d'origine (96px) : le titre et l'introduction
       n'ont plus besoin d'autant de respiration a cette largeur. */
    #home #section1 #intro {
        margin-bottom: 48px;
    }

    #home #section3 #image {
        height: 460px;
    }

    #category #section1 {
        gap: 40px;
    }

    #sheet #section1 #intro {
        margin: 72px 0;
    }

    #sheet-paragraphs-wrapper {
        gap: 88px;
        padding: 88px 0 140px 0;
    }

    .sheet-paragraph {
        padding: 48px 40px 0 40px;
        gap: 40px;
    }

    #sheet-footer {
        padding: 32px 40px 0 40px;
    }
}

/* =========================================================================
   <= 1023px
   ========================================================================= */

@media (max-width: 1023px) {
    :root {
        --mp-gouttiere: 32px;
        --mp-section: 72px;
    }

    /* La signature de la Commission passe en pile : « Une initiative de la »
       au-dessus du logo, les deux cales a gauche. Cote a cote, ils se serrent
       trop a partir de cette largeur. Le top remonte le bloc, qui est encore
       positionne en absolu tant que l'entete n'est pas repassee en flux. */
    header #logo-cmq {
        grid-template-columns: 1fr;
        justify-items: start;
        gap: 6px;
        top: 25px;
    }

    header #logo-cmq span {
        text-align: left;
    }

    #sheets-cat-list,
    #sheets-cat-list.inside-cat {
        grid-template-columns: repeat(3, 1fr);
        align-items: stretch;
    }

    /* Le survol ne doit plus forcer 330px, sinon les boutons se deforment
       des qu'un titre passe sur plusieurs lignes. La proportion 2/3 vient
       de main.css et n'est ecrasee nulle part. */
    #sheets-cat-list .cat-btn,
    #sheets-cat-list .cat-btn:hover {
        width: 100%;
        max-width: 183px;
        height: auto;
        min-height: 240px;
        padding: 32px 18px;
    }

    #sheets-list {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
        margin-top: 64px;
    }

    #category #section1 {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    #category #section1 #title {
        margin-top: 0;
    }

    #category #section1 #hero {
        max-width: 100%;
        aspect-ratio: 1.5;
    }

    #category #category-icon {
        width: 132px;
        height: 132px;
        padding: 28px;
        margin-bottom: 20px;
    }

    #home #section3 #content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    #home #section3 #image {
        height: 380px;
    }

    #sheet #section1 #intro {
        margin: 56px 0;
    }

    #sheet #section1 #intro .small-text {
        margin-left: 40px !important;
    }

    /* ---- Fiche : la colonne de navigation devient un menu deroulant colle
       en haut de l'ecran, dont le bouton affiche la section en cours. En
       dessous de 1024px les deux colonnes ne tiennent plus : la navigation
       de 200px ne laisserait qu'une colonne de lecture trop etroite. ---- */

    #sheet #section2 {
        margin-top: 48px;
        padding-left: 0;
        padding-right: 0;
    }

    #sheet-nav {
        position: sticky;
        top: 0;
        z-index: 40;
        display: block;
        width: 100%;
        margin-top: 0;
        background: #fff;
        border-bottom: 1px solid rgba(34, 46, 51, 0.15);
    }

    #sheet-nav-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        min-height: 52px;
        padding: 14px var(--mp-gouttiere);
        background: none;
        border: 0;
        cursor: pointer;
        text-align: left;
        color: var(--Charcoal, #222E33);
        font-family: "Bricolage Grotesque";
        font-size: 16px;
        font-weight: 600;
        line-height: 120%;
    }

    /* Une seule ligne : la barre collante garde une hauteur constante. */
    #sheet-nav-current {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    #sheet-nav-toggle::after {
        content: "";
        flex: 0 0 auto;
        width: 10px;
        height: 10px;
        border-right: 2px solid #222E33;
        border-bottom: 2px solid #222E33;
        transform: translateY(-3px) rotate(45deg);
        transition: transform 0.25s ease;
    }

    #sheet-nav.is-open #sheet-nav-toggle::after {
        transform: translateY(2px) rotate(-135deg);
    }

    #sheet-nav-list {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 8px 0;
        background: #fff;
        border-bottom: 1px solid rgba(34, 46, 51, 0.15);
        box-shadow: 0 12px 24px rgba(34, 46, 51, 0.12);
    }

    #sheet-nav.is-open #sheet-nav-list {
        display: block;
    }

    #sheet-nav .sheet-nav-tab {
        display: block;
        left: 0 !important;
        padding: 14px var(--mp-gouttiere) 14px calc(var(--mp-gouttiere) + 20px);
    }

    #sheet-nav .sheet-nav-tab .bullet {
        top: 50%;
        left: var(--mp-gouttiere);
        height: 20px;
        margin-top: -10px;
        opacity: 0;
    }

    #sheet-nav .sheet-nav-tab.active {
        font-weight: 700;
    }

    #sheet-nav .sheet-nav-tab.active .bullet {
        opacity: 1;
    }

    /* Le contenu ne se cale plus à droite d'une colonne fixe : le décalage
       négatif de 360px qui le remontait n'a plus lieu d'être. */
    #sheet-wrapper {
        top: 0;
        margin-bottom: 0;
    }

    .sheet-paragraph,
    #sheet-footer {
        max-width: 100%;
    }

    #sheet-paragraphs-wrapper {
        align-items: stretch;
        gap: 72px;
        padding: 40px var(--mp-gouttiere) 110px var(--mp-gouttiere);
    }

    .sheet-paragraph {
        padding: 40px 32px 0 32px;
        gap: 32px;
    }

    #sheet-footer {
        padding: 32px 32px 0 32px;
    }
}

/* =========================================================================
   <= 767px
   ========================================================================= */

@media (max-width: 767px) {
    :root {
        --mp-gouttiere: 24px;
        --mp-section: 56px;
    }

    /* Entête : le bouton et la signature de la Commission étaient posés en
       absolu à 60px des bords, par-dessus le logo centré. En dessous de
       768px, les trois se chevauchaient. On repasse en flux. */
    header>div {
        height: auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 20px var(--mp-gouttiere);
    }

    #headerSheetsBtn {
        position: static;
        top: auto;
        left: auto;
        flex: 0 0 auto;
    }

    header #logo {
        margin-top: 0;
    }

    header #logo-cmq {
        position: static;
        top: auto;
        right: auto;
        gap: 10px;
    }

    header #logo-cmq img {
        width: 104px;
    }

    header #logo-cmq span {
        font-size: 12px;
    }

    #breadcrumb {
        padding-top: 24px;
        padding-bottom: 16px;
        flex-wrap: wrap;
    }

    #breadcrumb a {
        display: inline-block;
        padding: 6px 0;
    }

    #sheets-cat-list,
    #sheets-cat-list.inside-cat {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 16px;
    }

    #sheets-cat-list .cat-btn,
    #sheets-cat-list .cat-btn:hover {
        padding: 28px 16px;
    }

    #sheets-list {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
        margin-top: 48px;
    }

    #sheets-list .sheet-wrapper {
        padding-bottom: 64px;
    }

    #sheets-list .sheet-btn {
        min-height: 44px;
    }

    #home #section1 {
        padding-top: 64px;
    }

    #home #section3 #image {
        height: 260px;
    }

    #sheet #section1 #title {
        padding: 40px 0;
    }

    #sheet #section1 #quick-infos {
        flex-direction: column;
        row-gap: 24px;
        padding: 24px 0;
    }

    #sheet #section1 #intro {
        margin: 40px 0;
    }

    #sheet #section1 #intro .small-text {
        margin-left: 0 !important;
    }

    #sheet-paragraphs-wrapper {
        gap: 48px;
        padding: 32px var(--mp-gouttiere) 80px var(--mp-gouttiere);
    }

    .sheet-paragraph {
        flex-direction: column;
        gap: 24px;
        padding: 32px 24px 0 24px;
    }

    .sheet-paragraph-icon {
        width: 72px;
        height: 72px;
    }

    .sheet-paragraph-icon img {
        width: 36px;
        height: 36px;
    }

    #sheet-footer {
        padding: 32px 24px 0 24px;
    }

    #sheet #intro ul {
        padding-left: 24px;
    }

    /* Infolettre : le bouton était remonté dans le champ par une marge
       négative de 147px. Il passe dessous. */
    #newsletter-form-wrapper #intro {
        margin-bottom: 40px;
    }

    #newsletter-form-wrapper input {
        max-width: 100%;
    }

    /* Le bouton revient dans le flux, sous le champ. */
    #newsletter-form-wrapper button {
        position: static;
        right: auto;
        top: auto;
        display: block;
        width: 100%;
        max-width: 280px;
        margin: 16px auto 0 auto;
        aspect-ratio: auto;
    }

    #footer-top {
        grid-template-columns: 1fr;
        gap: 24px;
        justify-items: start;
    }

    #footer-bottom {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    footer #logo {
        width: 200px;
    }
}

/* =========================================================================
   <= 479px
   ========================================================================= */

@media (max-width: 479px) {
    :root {
        --mp-gouttiere: 20px;
        --mp-section: 44px;
    }

    /* Le logo passe seul sur la première rangée, le bouton et la signature
       se partagent la seconde. */
    header>div {
        flex-wrap: wrap;
        row-gap: 14px;
        padding: 16px var(--mp-gouttiere);
    }

    header>div>a:not(#headerSheetsBtn) {
        order: -1;
        flex: 1 0 100%;
        display: flex;
        justify-content: center;
    }

    header #logo {
        width: 150px;
        height: 48px;
    }

    /* Deux colonnes depuis le palier 767 : il ne reste que les ecarts. */
    #sheets-cat-list,
    #sheets-cat-list.inside-cat {
        column-gap: 14px;
        row-gap: 20px;
    }

    #sheets-cat-list .cat-btn,
    #sheets-cat-list .cat-btn:hover {
        min-height: 210px;
        padding: 26px 14px;
    }

    #sheets-list {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    #search-form-wrapper input {
        height: 56px;
        padding: 0 24px;
    }

    #search-form-wrapper button {
        width: 56px;
        height: 56px;
    }

    #search-form-wrapper button i {
        font-size: 24px;
    }

    #home #section3 #image {
        height: 200px;
    }

    .sheet-paragraph {
        padding: 24px 20px 0 20px;
    }

    #sheet-footer {
        padding: 24px 20px 0 20px;
    }

    #newsletter-form-wrapper button {
        max-width: 100%;
    }
}

/* =========================================================================
   <= 392px
   ========================================================================= */

@media (max-width: 392px) {
    :root {
        --mp-gouttiere: 16px;
    }

    #sheets-cat-list .cat-btn,
    #sheets-cat-list .cat-btn:hover {
        min-height: 196px;
        padding: 22px 12px;
    }

    #sheets-cat-list .title {
        font-size: 16px;
    }

    header #logo-cmq img {
        width: 88px;
    }

    header #logo-cmq span {
        font-size: 11px;
    }
}