/*
 * Safety net, not styling. The theme styles these grids (gap, card colours,
 * typography) and core's block-library CSS normally supplies the flex behaviour
 * of .wp-block-columns / .wp-block-column.
 *
 * "Normally" is the problem: WordPress can load core block styles per-block
 * (should_load_separate_core_block_assets), and these grids no longer come from
 * a real columns block — they are rendered by a shortcode. On a page where no
 * genuine columns block exists, the core stylesheet may not be enqueued at all,
 * and the cards would stack full-width with no warning.
 *
 * acl-carte was bitten by the same class of bug from the other direction: a
 * container that was a flex item sized by its content collapsed to 0px wide.
 * Declaring the two properties these grids actually depend on costs nothing and
 * removes the dependency.
 */

.acl-section .acl-price-grid,
.acl-section .acl-sched-grid,
.acl-section .acl-doc-grid,
.acl-section .acl-parcours {
	display: flex;
	flex-wrap: wrap;
}

.acl-section .acl-price-grid > .wp-block-column,
.acl-section .acl-sched-grid > .wp-block-column,
.acl-section .acl-doc-grid > .wp-block-column,
.acl-section .acl-parcours > .wp-block-column {
	/* flex-basis:0 with min-width:0 gives equal columns that can shrink; auto
	   would size them by content and make long addresses push the row wide. */
	flex: 1 1 0;
	min-width: 0;
}

/*
 * Les moyens de paiement sont en GRILLE et non en flex, et c'est la seule
 * grille de l'extension dans ce cas. Raison : ils sont CINQ, donc la dernière
 * rangée est forcément incomplète. En flex, le dernier élément — « Pass'Sport »,
 * deux mots — s'étirait sur toute la largeur pour absorber la place restante :
 * une carte de 900px de large sous quatre cartes de 207px. Constaté sur
 * staging, mesuré. Une grille laisse la cellule vide plutôt que d'étirer.
 *
 * minmax(240px, 1fr) donne trois colonnes sur la largeur du contenu (900px),
 * donc 3 + 2 : plus équilibré que 4 + 1, et assez large pour « Coupon Sport et
 * Chèques Vacances » sans césure.
 */
.acl-section .acl-paiement-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* The theme's own breakpoints already stack these below 860px (style.css),
   using the same selectors with !important, so they win over the rules above. */
