/* BAO V38 — grille mobile harmonisée : gouttière extérieure unique de 16px.
   Chargé après les feuilles des thèmes et les ajustements V37.
   Concerne uniquement la mise en page mobile, jamais la typographie ou les couleurs. */
@media (max-width: 767px) {
  /* Référence commune : la photographie de section et toutes les cartes partagent
     le même alignement à 16px du bord de l'écran. */
  .section-row {
    margin-left: 16px !important;
    margin-right: 16px !important;
  }
  .section-row > .section-photo,
  .section-row > .section-text {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  /* Horaires et responsables : enlever les retraits internes hérités.
     .repe-groups est la grille ; les cartes restent à 100 % de sa largeur. */
  .section-row--repe #repe .repe-groups,
  .section-row--repe #repe .wp2 > .bureau-cards--repe {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box;
  }
  .section-row--repe #repe .repe-groups > .repe-group,
  .section-row--repe #repe .bureau-cards--repe > .bureau-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .section-row--bureau .bureau-cards {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Les cinq façons : une seule gouttière, sans padding ajouté par
     .site-container (qui ajoutait encore 15px de chaque côté). */
  .ways-section {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .ways-section > .site-container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .ways-section .ways-grid,
  .ways-section .way-card {
    width: 100%;
    min-width: 0;
  }

  /* Romane : le portrait et les 6 miniatures conservent exactement leur grille,
     mais les bordures extérieures s'alignent aux autres rubriques. */
  .romane-section {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .romane-section > .site-container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .romane-section__media,
  .romane-thumbs { min-width: 0; }

  /* Galerie : conserver la grille originale (2 colonnes sur iPhone),
     avec les mêmes marges que Romane et les photos de section. */
  #portfolio .gallery-grid {
    padding-left: 16px !important;
    padding-right: 16px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
  }
}
