/*
 * Ajustements pour téléphone et petite tablette. La version ordinateur n'est pas concernée.
 * Les styles des pages étant écrits en ligne, les surcharges utilisent !important.
 */

/* Barres d'onglets défilantes (Mosaïk, Nos actions, Agir) : sans barre de défilement visible */
nav[aria-label="Sections de la page"], nav[aria-label="Choisir une action"], nav[aria-label="Choisir une façon d’agir"] {
  scrollbar-width: none;
  scroll-behavior: smooth;
}
nav[aria-label="Sections de la page"]::-webkit-scrollbar, nav[aria-label="Choisir une action"]::-webkit-scrollbar { display: none; }

/* Calculateur de don (Agir avec nous) : la carte doit pouvoir rétrécir sous sa largeur de base (440 px) */
.m-calc, .m-calc * { min-width: 0; }
.m-calc div[style*="justify-content: space-between"] { flex-wrap: wrap; }

@media (max-width: 899px) {
  /* Accueil, liste « Nos actions » : la ligne entière est cliquable, la pastille flèche prend trop de place */
  #actions a > span:nth-child(4) { display: none !important; }
  #actions a { padding: 24px 2px !important; gap: 12px 20px !important; }
}

@media (max-width: 640px) {
  /* Grands titres : interligne sûr, les retours à la ligne varient selon l'écran */
  h1, h2 { line-height: .98 !important; }

  /* Carrousels : les cartes défilent à l'horizontale au lieu de s'empiler */
  .m-carousel {
    display: flex !important;
    gap: 12px !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    margin-inline: -20px;
    padding: 4px 20px 12px;
    scroll-padding-inline: 20px;
    scrollbar-width: none;
  }
  .m-carousel::-webkit-scrollbar { display: none; }
  .m-carousel > * { flex: 0 0 84% !important; min-width: 0; scroll-snap-align: start; }
  .m-carousel.m-photos > * { height: 300px !important; }
  .m-carousel.m-valeurs > * { min-height: 250px !important; gap: 28px !important; }
  .m-carousel.m-tickets > * { flex-basis: 88% !important; }

  /* Grilles 2 colonnes compactes */
  .m-grid2 { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .m-chiffres > * { padding: 18px 16px !important; gap: 12px !important; }
  .m-chiffres > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .m-chiffres span[style*="clamp(44px"] { font-size: 38px !important; }
  .m-partenaires > * { min-height: 92px !important; padding: 16px !important; gap: 16px !important; }
  .m-partenaires span[style*="font: 800 21px"] { font-size: 15px !important; }
  .m-partenaires > :last-child:nth-child(odd) { grid-column: 1 / -1; }

  /* Cartes d'accès en haut des pages Nos actions et Agir avec nous */
  .m-herocards > a { gap: 10px !important; border-radius: 20px !important; }
  .m-herocards img { height: 92px !important; border-radius: 14px !important; }
  .m-herocards span[style*="font: 800 21px"] { font-size: 15px !important; }
  .m-herocards > a[style*="min-height: 190px"] { min-height: 128px !important; padding: 16px !important; gap: 18px !important; }
  .m-herocards span[style*="font: 800 30px"] { font-size: 21px !important; }

  /* Calculateur de don : pleine largeur, marges intérieures resserrées, montants lisibles */
  .m-calc { flex-basis: 100% !important; padding: 18px !important; gap: 16px !important; border-radius: 26px !important; }
  .m-calc h3 { font-size: 21px !important; }
  .m-calc input[type="number"] { font-size: 28px !important; padding: 12px 0 !important; }
  .m-calc > div[style*="background: #F6F8F8"] { padding: 4px 16px !important; }
  .m-calc span[style*="font: 800 36px"] { font-size: 28px !important; }
  .m-calc span[style*="font-size: 20px"] { font-size: 17px !important; }
  .m-calc div[style*="repeat(4, minmax(0, 1fr))"] button { padding: 11px 2px !important; font-size: 13px !important; }

  /* Pied de page : plan du site sur deux colonnes */
  footer nav { grid-template-columns: 1fr 1fr !important; gap: 28px 16px !important; }
  footer nav > div:last-child { grid-column: 1 / -1; }
}
