/* BOUTE – lisibilité sur téléphone. Ajouté par export_site.js à toutes les pages, après leurs styles.
   Les écrans de la maquette sont dessinés pour l'ordinateur : cette couche les resserre sous 720 px
   sans toucher au rendu ordinateur. Les styles des pages sont en ligne, d'où les !important. */
#m-burger, #m-drawer, #m-bar { display: none; }

@media (max-width: 720px) {
  html { -webkit-text-size-adjust: 100%; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }

  /* En-tête compact qui reste en haut ; le bandeau d'infos et la navigation passent dans le menu */
  #dc-root div:has(+ header) { display: none !important; }
  #dc-root header { position: sticky !important; top: 0; z-index: 50 !important; }
  #dc-root header > div:first-child { padding: 10px 72px 10px 16px !important; flex-wrap: nowrap !important; }
  #dc-root header > div:first-child > a:first-child img { height: 42px !important; }
  #dc-root header > div:first-child > a:first-child > span > span:first-child { font-size: 21px !important; }
  #dc-root header > div:first-child > a:first-child > span > span + span,
  #dc-root header > div:first-child > div,
  #dc-root header > div:nth-child(2) { display: none !important; }

  /* Respirations : les grands espaces prévus pour l'ordinateur sont réduits */
  #dc-root :is([style*="padding-top: 56px"], [style*="padding-top: 64px"], [style*="padding-top: 72px"], [style*="padding-top: 80px"], [style*="padding-top: 88px"], [style*="padding-top: 96px"],
    [style*="padding: 56px"], [style*="padding: 64px"], [style*="padding: 72px"], [style*="padding: 80px"], [style*="padding: 88px"], [style*="padding: 96px"]) { padding-top: 36px !important; }
  #dc-root :is([style*="padding-bottom: 56px"], [style*="padding-bottom: 64px"], [style*="padding-bottom: 72px"], [style*="padding-bottom: 80px"], [style*="padding-bottom: 88px"], [style*="padding-bottom: 96px"],
    [style*="padding: 0 0 80px"], [style*="padding: 80px"], [style*="padding: 88px"], [style*="padding: 96px"], [style*="72px clamp"], [style*="80px clamp"], [style*="88px clamp"], [style*="96px clamp"]) { padding-bottom: 36px !important; }
  #dc-root :is([style*="margin-bottom: 32px"], [style*="margin-bottom: 40px"], [style*="margin-bottom: 48px"]) { margin-bottom: 20px !important; }

  /* Grilles de cartes avec photo : 2 colonnes au lieu d'une, photos carrées */
  #dc-root :is([style*="repeat(auto-fit"], [style*="repeat(auto-fill"]):not([style*="min(3"]):has(> * img) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 14px 10px !important;
  }
  #dc-root :is([style*="repeat(auto-fit"], [style*="repeat(auto-fill"]):not([style*="min(3"]):has(> * img) > * :is(span, div, figure, a, button)[style*="height:"]:has(> img),
  #dc-root :is([style*="repeat(auto-fit"], [style*="repeat(auto-fill"]):not([style*="min(3"]):has(> * img) > * > img[style*="height:"],
  #dc-root :is([style*="repeat(auto-fit"], [style*="repeat(auto-fill"]):not([style*="min(3"]):has(> * img) > img[style*="height:"] {
    height: auto !important; aspect-ratio: 1 / 1; min-height: 0 !important;
  }
  #dc-root :is([style*="repeat(auto-fit"], [style*="repeat(auto-fill"]):not([style*="min(3"]):has(> * img) > * :is(h3, strong, b)[style*="font-size"] { font-size: 16px !important; line-height: 1.25 !important; }
  #dc-root :is([style*="repeat(auto-fit"], [style*="repeat(auto-fill"]):not([style*="min(3"]):has(> * img) > * :is(p, span)[style*="font-size: 1"]:not(:has(*)) { font-size: 14px !important; line-height: 1.4 !important; }
  #dc-root :is([style*="repeat(auto-fit"], [style*="repeat(auto-fill"]):not([style*="min(3"]):has(> * img) > * [style*="padding: 2"] { padding: 12px !important; }
  #dc-root :is([style*="repeat(auto-fit"], [style*="repeat(auto-fill"]):not([style*="min(3"]):has(> * img) > * [style*="padding: 1"] { padding: 10px !important; }
  #dc-root :is([style*="repeat(auto-fit"], [style*="repeat(auto-fill"]):not([style*="min(3"]):has(> * img) > * [style*="font-size: 26px"] { font-size: 20px !important; }

  /* Grandes cartes d'une colonne : photo moins haute, marges intérieures resserrées */
  #dc-root article > div[style*="aspect-ratio: 3 / 2"] { aspect-ratio: 2 / 1 !important; }
  #dc-root article > div[style*="padding: 28px"] { padding: 20px 18px 24px !important; }

  /* Galeries en mosaïque (photos d'ambiance) : 2 par ligne */
  #dc-root [style*="flex-wrap: wrap"]:has(> figure > img) > figure { flex: 1 1 calc(50% - 6px) !important; min-width: 0 !important; }
  #dc-root [style*="flex-wrap: wrap"]:has(> figure > img) > figure :is(strong, b, figcaption > :first-child) { font-size: 15px !important; }
  #dc-root [style*="flex-wrap: wrap"]:has(> figure > img) > figure :is(span, p, small) { font-size: 14px !important; line-height: 1.35 !important; }

  /* Boutons d'action côte à côte : pleine largeur, plus faciles à toucher */
  #dc-root [style*="display: flex"][style*="flex-wrap: wrap"] > a[style*="min-height: 5"],
  #dc-root [style*="display: flex"][style*="flex-wrap: wrap"] > a[style*="min-height: 6"] { flex: 1 1 100% !important; justify-content: center !important; text-align: center !important; }
  #dc-root :is([style*="repeat(auto-fit"], [style*="repeat(auto-fill"]):not([style*="min(3"]):has(> * img) a[style*="text-transform: uppercase"] { font-size: 13px !important; letter-spacing: 0 !important; }

  /* Fiches produits : grande photo et vignettes adaptées à l'écran */
  #dc-root [style*="height: 660px"] { height: 340px !important; }
  #dc-root button[style*="height: 120px"] { height: 72px !important; }
  #dc-root [style*="font-size: 48px"] { font-size: 38px !important; }

  /* Grandes photos d'ambiance et vidéos : moins hautes */
  #dc-root :is(div, figure, span)[style*="height: 5"]:has(> :is(img, video)),
  #dc-root :is(div, figure, span)[style*="height: 6"]:has(> :is(img, video)),
  #dc-root :is(div, figure, span)[style*="height: 4"]:has(> :is(img, video)) { height: 300px !important; }

  /* Textes : jamais sous 14 px, titres de section un peu moins hauts */
  #dc-root [style*="font-size: 12px"], #dc-root [style*="font-size: 13px"] { font-size: 14px !important; }
  #dc-root h2[style*="font-size: 4"], #dc-root h2[style*="font-size: clamp(3"], #dc-root h2[style*="font-size: clamp(4"] { font-size: 30px !important; line-height: 1.12 !important; }
  #dc-root p[style*="font-size: 19px"], #dc-root p[style*="font-size: 20px"] { font-size: 17px !important; }

  /* Pied de page plus court */
  #dc-root footer > div { padding-top: 40px !important; gap: 28px !important; }
  #dc-root footer img[style*="height: 104px"] { height: 64px !important; }

  /* Bouton menu, tiroir et barre d'actions (créés par site.js) */
  #m-burger { display: inline-flex; position: fixed; top: 12px; right: 12px; z-index: 60; width: 48px; height: 48px; align-items: center; justify-content: center;
    background: #111111; color: #FADC0A; border: 0; border-radius: 0; cursor: pointer; }
  #m-drawer { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(17,17,17,.5); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
  #m-drawer.open { opacity: 1; pointer-events: auto; }
  #m-drawer .m-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 88vw); background: #FFFFFF; overflow-y: auto; padding: 16px 20px 32px;
    transform: translateX(100%); transition: transform .25s cubic-bezier(.2,.7,.2,1); font-family: 'Jost', system-ui, sans-serif; color: #111111; }
  #m-drawer.open .m-panel { transform: none; }
  #m-drawer .m-close { display: flex; margin-left: auto; width: 48px; height: 48px; align-items: center; justify-content: center; background: #F1EFEA; border: 0; color: #111111; cursor: pointer; }
  #m-drawer nav a { display: flex; align-items: center; min-height: 52px; border-bottom: 1px solid #E6E4DF; font-size: 19px; font-weight: 600; color: #111111; text-decoration: none; }
  #m-drawer nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: #FADC0A; text-decoration-thickness: 4px; text-underline-offset: 6px; }
  #m-drawer h2 { margin: 28px 0 8px; font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #5E5E5E; }
  #m-drawer .m-tel { display: flex; justify-content: space-between; align-items: center; min-height: 52px; padding: 0 14px; margin-bottom: 8px; background: #111111; color: #FFFFFF; text-decoration: none; font-size: 16px; }
  #m-drawer .m-tel strong { color: #FADC0A; }
  #m-drawer .m-devis { display: flex; align-items: center; justify-content: center; min-height: 56px; margin-top: 20px; background: #FADC0A; color: #111111; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; text-decoration: none; }
  #m-bar { display: grid; grid-template-columns: 1fr 1fr 1.3fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55; height: calc(64px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: #111111; font-family: 'Jost', system-ui, sans-serif; }
  #m-bar a, #m-bar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #FFFFFF; background: transparent; border: 0;
    font: 600 13px 'Jost', system-ui, sans-serif; text-decoration: none; cursor: pointer; }
  #m-bar svg { color: #FADC0A; }
  #m-bar .m-bar-devis { background: #FADC0A; color: #111111; font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
  @media (prefers-reduced-motion: reduce) { #m-drawer, #m-drawer .m-panel { transition: none; } }
}
