/* ANAKINE — corrections de mise en page tablette & mobile (chargé sur toutes les pages).
   Les maquettes sont en styles inline : les règles ci-dessous doivent donc être !important. */

/* ---------- Tablette & mobile : une seule colonne ---------- */
@media (max-width: 980px) {
  body [style*="grid-template-columns"]:not([data-ak-mock] *) { grid-template-columns: minmax(0, 1fr) !important; }
  body [style*="sticky"] { position: static !important; top: auto !important; }
  body [style*="100vh"], body [style*="100svh"] { min-height: 0 !important; height: auto !important; }
  body [style*="display:flex"]:not(.ak-mnav):not(.ak-mnav *):not([data-ak-mock] *):not([style*="overflow"]):not([style*="position:absolute"]),
  body [style*="display: flex"]:not([data-ak-mock] *):not([style*="overflow"]):not([style*="position:absolute"]) { flex-wrap: wrap; }
  body img:not([style*="object-fit"]):not([data-ak-mock] *), body video, body svg:not([data-ak-mock] *) { max-width: 100%; }

  /* gouttières latérales */
  body section, body footer { padding-left: 24px !important; padding-right: 24px !important; }
  header { padding-left: 20px !important; padding-right: 20px !important; }

  /* respirations verticales resserrées */
  body [style*="gap:72px"], body [style*="gap: 72px"] { gap: 40px !important; }
  body [style*="gap:80px"], body [style*="gap: 80px"] { gap: 40px !important; }
  body [style*="gap:56px"], body [style*="gap: 56px"] { gap: 32px !important; }

  /* rails de carrousel : plus de débord hors gouttière */
  body [class*="rail"] { margin-left: 0 !important; margin-right: 0 !important; }
  body [class*="rail"]::after { flex-basis: 0 !important; }

  /* encarts flottants ramenés dans le cadre */
  body [style*="position:absolute"][style*="left:-"]:not([data-step-dot]):not([aria-hidden="true"]), body [style*="position: absolute"][style*="left: -"]:not([data-step-dot]):not([aria-hidden="true"]) { left: 0 !important; }
  body [style*="position:absolute"][style*="right:-"], body [style*="position: absolute"][style*="right: -"] { right: 0 !important; }

  /* carrousels : cartes à la largeur de l'écran */
  body [style*="flex:0 0 396px"], body [style*="flex: 0 0 396px"],
  body [style*="flex:0 0 348px"], body [style*="flex: 0 0 348px"],
  body [style*="flex:0 0 320px"], body [style*="flex: 0 0 320px"] { flex: 0 0 82vw !important; }
}

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
  body section, body footer { padding-left: 18px !important; padding-right: 18px !important; }
  body [style*="padding:88px"], body [style*="padding: 88px"],
  body [style*="padding:104px"], body [style*="padding: 104px"],
  body [style*="padding:120px"], body [style*="padding: 120px"] { padding-top: 56px !important; padding-bottom: 56px !important; }
  body [style*="padding:56px"], body [style*="padding: 56px"] { padding-left: 24px !important; padding-right: 24px !important; }
  body [style*="padding:36px"], body [style*="padding: 36px"],
  body [style*="padding:32px 36px"] { padding-left: 22px !important; padding-right: 22px !important; }

  /* mockups et encarts flottants : remis dans le flux */
  body [style*="position:absolute"][style*="left:-"]:not([data-step-dot]):not([aria-hidden="true"]),
  body [style*="position: absolute"][style*="left: -"]:not([data-step-dot]):not([aria-hidden="true"]) { left: 0 !important; }
  body [style*="position:absolute"][style*="right:-"],
  body [style*="position: absolute"][style*="right: -"] { right: 0 !important; }

  /* pas de texte à la découpe */
  body [style*="white-space:nowrap"]:not(nav *):not(.ak-mnav *) { white-space: normal !important; }

  /* footer : deux colonnes maxi puis une */
  .ak-foot { grid-template-columns: minmax(0, 1fr) !important; gap: 28px !important; }
}
