/* Couche responsive des pages Solutions exportées de Claude Design.
   Les planches sont dessinées à 1 440 px avec des styles en ligne : on cible
   donc les dispositions par sélecteur d'attribut (même méthode que l'accueil). */

.cadre { width: min(1180px, calc(100% - 2 * clamp(20px, 5vw, 56px))) !important; }

/* Tablette : les colonnes fixes se partagent l'espace */
@media (max-width: 1100px) {
  h1[style*="font-size"] { font-size: clamp(2.2rem, 4.8vw, 3.3rem) !important; overflow-wrap: break-word; }
  h2[style*="font-size"] { font-size: clamp(1.8rem, 3.6vw, 2.5rem) !important; }
  :is([style*="grid-template-columns: 440px minmax(0, 1fr)"], [style*="grid-template-columns: 440px minmax(0px, 1fr)"]),
  :is([style*="grid-template-columns: 460px minmax(0, 1fr)"], [style*="grid-template-columns: 460px minmax(0px, 1fr)"]),
  :is([style*="grid-template-columns: 500px minmax(0, 1fr)"], [style*="grid-template-columns: 500px minmax(0px, 1fr)"]),
  :is([style*="grid-template-columns: 520px minmax(0, 1fr)"], [style*="grid-template-columns: 520px minmax(0px, 1fr)"]),
  :is([style*="grid-template-columns: minmax(0, 1fr) 420px"], [style*="grid-template-columns: minmax(0px, 1fr) 420px"]),
  :is([style*="grid-template-columns: minmax(0, 1fr) 440px"], [style*="grid-template-columns: minmax(0px, 1fr) 440px"]),
  :is([style*="grid-template-columns: minmax(0, 1fr) 460px"], [style*="grid-template-columns: minmax(0px, 1fr) 460px"]),
  :is([style*="grid-template-columns: minmax(0, 1fr) 500px"], [style*="grid-template-columns: minmax(0px, 1fr) 500px"]) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 40px !important;
  }
  :is([style*="repeat(5, minmax(0, 1fr))"], [style*="repeat(5, minmax(0px, 1fr))"]) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

/* Mobile */
@media (max-width: 860px) {
  [style*="grid-template-columns"]:not(.agenda-grille) {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 32px !important;
  }
  :is([style*="repeat(5, minmax(0, 1fr))"], [style*="repeat(5, minmax(0px, 1fr))"]) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

  h1[style*="font-size"] { font-size: clamp(2.1rem, 8.5vw, 2.9rem) !important; line-height: 1.1 !important; }
  h2[style*="font-size"] { font-size: clamp(1.7rem, 6.8vw, 2.3rem) !important; line-height: 1.15 !important; }
  p[style*="font-size: 30px"], p[style*="font-size: 32px"] { font-size: 1.4rem !important; }
  .chapo { font-size: 17px !important; }

  /* Espacements verticaux et blocs très rembourrés */
  section[style*="padding: 104px 0"], section[style*="padding: 112px 0"],
  section[style*="padding: 96px 0"], section[style*="padding: 88px 0"] {
    padding-top: 64px !important;
    padding-bottom: 64px !important;
  }
  [style*="padding: 72px 80px"] { padding: 40px 24px !important; }
  [style*="padding: 56px 64px"], [style*="padding: 56px 56px 56px 64px"],
  [style*="padding: 36px 64px 44px"] { padding: 32px 22px !important; }
  [style*="padding: 40px 48px 0"] { padding: 28px 22px 0 !important; }

  /* Visuels composés au pixel (écrans, cartes flottantes, téléphone) : mis à
     l'échelle plutôt que redimensionnés, pour garder leur composition. */
  [style*="height: 600px"]:not(iframe), [style*="height: 560px"], [style*="height: 520px"],
  [style*="height: 500px"], [style*="height: 480px"], [style*="height: 470px"],
  [style*="height: 430px"]:not([style*="position: absolute"]), [style*="height: 420px"],
  [style*="height: 400px"], [style*="min-height: 620px"] {
    zoom: 0.7;
  }

  /* Pied de page et rangées de liens : passage à la ligne */
  footer [style*="display: flex"] { flex-wrap: wrap !important; row-gap: 12px !important; }
  .chapo { max-width: 100% !important; }
  .flottant[style*="right: -"] { right: 8px !important; }
  .flottant[style*="left: -"] { left: 8px !important; }

  /* Titre et chapô côte à côte : empilés */
  [style*="justify-content: space-between"][style*="align-items: flex-end"] {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 24px !important;
  }
  /* Onglets des prestations : bandeau qui défile horizontalement */
  [role="tablist"] {
    grid-template-columns: repeat(5, minmax(150px, 1fr)) !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  [role="tablist"] > * { scroll-snap-align: start; }

  /* En-tête : le bouton quitte la barre, le sous-menu tient dans l'écran */
  header .btn { display: none !important; }
  .sous-menu-panneau { width: min(560px, calc(100vw - 32px)) !important; grid-template-columns: minmax(0, 1fr) !important; }
  .sous-menu { left: -60px !important; }
}

@media (max-width: 560px) {
  [style*="height: 600px"]:not(iframe), [style*="height: 560px"], [style*="height: 520px"],
  [style*="height: 500px"], [style*="height: 480px"], [style*="height: 470px"],
  [style*="height: 430px"]:not([style*="position: absolute"]), [style*="height: 420px"],
  [style*="height: 400px"], [style*="min-height: 620px"] {
    zoom: 0.56;
  }
  :is([style*="repeat(5, minmax(0, 1fr))"], [style*="repeat(5, minmax(0px, 1fr))"]),
  :is([style*="repeat(3, minmax(0, 1fr))"], [style*="repeat(3, minmax(0px, 1fr))"]),
  :is([style*="repeat(2, minmax(0, 1fr))"], [style*="repeat(2, minmax(0px, 1fr))"]) { grid-template-columns: minmax(0, 1fr) !important; }
}

/* À l'intérieur d'un visuel mis à l'échelle : pas de seconde réduction, et les
   grilles internes (collages de photos, mini-interfaces) gardent leurs colonnes. */
@media (max-width: 860px) {
  :is([style*="height: 600px"]:not(iframe), [style*="height: 560px"], [style*="height: 520px"], [style*="height: 500px"], [style*="height: 480px"], [style*="height: 470px"], [style*="height: 430px"]:not([style*="position: absolute"]), [style*="height: 420px"], [style*="height: 400px"], [style*="min-height: 620px"]) :is([style*="height: 600px"]:not(iframe), [style*="height: 560px"], [style*="height: 520px"], [style*="height: 500px"], [style*="height: 480px"], [style*="height: 470px"], [style*="height: 430px"]:not([style*="position: absolute"]), [style*="height: 420px"], [style*="height: 400px"], [style*="min-height: 620px"]) { zoom: 1 !important; }
  :is([style*="height: 600px"]:not(iframe), [style*="height: 560px"], [style*="height: 520px"], [style*="height: 500px"], [style*="height: 480px"], [style*="height: 470px"], [style*="height: 430px"]:not([style*="position: absolute"]), [style*="height: 420px"], [style*="height: 400px"], [style*="min-height: 620px"]) :is([style*="repeat(2, minmax(0, 1fr))"], [style*="repeat(2, minmax(0px, 1fr))"]) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  :is([style*="height: 600px"]:not(iframe), [style*="height: 560px"], [style*="height: 520px"], [style*="height: 500px"], [style*="height: 480px"], [style*="height: 470px"], [style*="height: 430px"]:not([style*="position: absolute"]), [style*="height: 420px"], [style*="height: 400px"], [style*="min-height: 620px"]) :is([style*="repeat(3, minmax(0, 1fr))"], [style*="repeat(3, minmax(0px, 1fr))"]) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
