/* IBCSC — couche de symetrie (13.11.2026, audit tools/symmetry-audit) :
   une rangee de blocs forme toujours un rectangle — memes hauteurs, aucune carte orpheline. */

/* Rangées : les blocs voisins prennent la hauteur du plus grand. */
.lab-partners-brief { align-items: stretch !important; }

/* /services : 9 categories en 3x3, puis le bloc « accompagnement mensuel » sur toute la largeur (regle 3n+1 ci-dessous). */

/* Principes : 9 → 3×3 ; 6 → 3×2 ; 8 → 4×2 ; autres nombres : la derniere rangee s'etire. */
@media (min-width: 721px) {
  .commercial-principles:has(> :nth-child(9):last-child),
  .commercial-principles:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .commercial-principles:has(> :nth-child(8):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .commercial-principles:has(> :nth-child(13):last-child) { display: flex !important; flex-wrap: wrap; }
  .commercial-principles:has(> :nth-child(13):last-child) > * { flex: 1 1 calc(20% - 16px); min-width: 0; }
}

/* Grilles de 3 colonnes : un dernier bloc seul occupe toute la rangee (etape finale). */
@media (min-width: 721px) {
  .process-rail > .container > :last-child:nth-child(3n + 1),
  .commercial-category-grid > :last-child:nth-child(3n + 1) { grid-column: 1 / -1; }
}

/* ---- Audit v2 (13.11.2026) ---- */

/* Grilles de 3 cartes : la carte seule de la derniere rangee prend toute la largeur. */
/* Cartes de service : grille de 6 pistes — rangee de 3 = 2 pistes chacune, rangee finale de 2 = 3 pistes, de 1 = toute la largeur. */
@media (min-width: 721px) {
  .service-card-grid { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
  .service-card-grid > * { grid-column: span 2; }
  .service-card-grid > :nth-last-child(2):nth-child(3n + 1),
  .service-card-grid > :last-child:nth-child(3n + 2) { grid-column: span 3; }
  .service-card-grid > :last-child:nth-child(3n + 1) { grid-column: 1 / -1; }
}

/* Listes courtes : 3 elements → 3 colonnes egales (une seule colonne sur mobile). */
.home-estimate-points:has(> :nth-child(3):last-child),
.missions-axis > ul:has(> :nth-child(3):last-child),
.watch-pipeline-stats:has(> :nth-child(3):last-child),
.diagnostic-capabilities:has(> :nth-child(3):last-child),
.intel-domain > ul:has(> :nth-child(3):last-child) { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; align-items: stretch; }
@media (max-width: 720px) {
  .home-estimate-points:has(> :nth-child(3):last-child),
  .missions-axis > ul:has(> :nth-child(3):last-child),
  .watch-pipeline-stats:has(> :nth-child(3):last-child),
  .diagnostic-capabilities:has(> :nth-child(3):last-child),
  .intel-domain > ul:has(> :nth-child(3):last-child) { grid-template-columns: 1fr !important; }
}
/* 6 elements sur 4 colonnes → 3×2. */
@media (min-width: 721px) {
  .training-guardrails-list:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

/* Colonne de texte + panneau : le panneau descend jusqu'au bas de la colonne voisine. */
@media (min-width: 1081px) {
  .ai-space-grid { align-items: stretch !important; }
  .ai-space-grid > .ai-technical-panel { height: auto; }
  .obs-work-wrap { align-items: stretch !important; }
  .obs-work-wrap > .obs-side { position: static !important; display: flex; flex-direction: column; gap: 14px; }
  .obs-work-wrap > .obs-side > .obs-side-box:last-child { flex: 1 1 auto; }
}

/* TechBlog : images cote a cote dans des cadres de meme hauteur, image entiere visible. */
.techblog-figure-grid { align-items: stretch !important; }
.techblog-figure-grid .techblog-figure, .techblog-figure-grid .techblog-figure-open { height: 100%; }
.techblog-figure-grid .techblog-figure-open { display: flex; align-items: center; justify-content: center; }
.techblog-figure-grid .techblog-figure img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; }

/* Accueil mobile (13.11.2026, capture iPhone) : les colonnes ne depassent plus l'ecran ;
   les chiffres du TechBlog forment deux tuiles egales sur toute la largeur. */
@media (max-width: 760px) {
  .page-home .home-techblog-stats { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; width: 100%; }
  .page-home .home-techblog-stats .fx-stat, .page-home .home-techblog-stats li { min-width: 0 !important; }
  .page-home .home-techblog-copy > a, .page-home .home-techblog-copy .button { max-width: 100%; box-sizing: border-box; }
}
/* Sur-titre du TechBlog : l'icone est masquee, son retrait de 26px decalait le texte par rapport au titre. */
html body main .home-chapter.home-chapter.home-chapter.home-chapter.home-chapter.home-chapter .home-techblog-kicker { padding-left: 0 !important; }

/* TechBlog mobile : figures alignees sur la colonne de texte (les marges negatives les decalaient a gauche) ;
   tableaux larges defilants plutot que coupes. */
@media (max-width: 760px) {
  .techblog-prose .techblog-figure { margin-left: 0 !important; margin-right: 0 !important; width: 100% !important; }
  .techblog-prose table:not(.is-stackable) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
