/* OFFROAD 32 65 — GABARIT UNIVERSEL DES PROGRAMMES */
#programDays{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:12px!important;
  align-items:start!important;
  align-content:start!important;
  min-height:0!important;
  height:auto!important;
}
#programDays .programme-total-visible,
#programmeTotalDistance{
  grid-column:1 / -1!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  min-height:0!important;
  height:auto!important;
  box-sizing:border-box!important;
  margin:0 0 8px!important;
  padding:4px 10px!important;
  border:1px solid rgba(255,122,0,.55)!important;
  border-radius:5px!important;
  background:rgba(255,122,0,.07)!important;
  line-height:1.15!important;
}
#programDays .programme-total-visible span,
#programmeTotalDistance span{
  color:#aaa!important;
  font-size:10px!important;
  font-weight:800!important;
  letter-spacing:.6px!important;
  line-height:1.15!important;
}
#programDays .programme-total-visible strong,
#programmeTotalDistance strong{
  color:#ff7a00!important;
  font-size:12px!important;
  font-weight:900!important;
  white-space:nowrap!important;
  line-height:1.15!important;
}
#programDays .day-card{
  width:100%!important;
  min-width:0!important;
  min-height:0!important;
  height:auto!important;
  align-self:start!important;
  box-sizing:border-box!important;
  break-inside:avoid!important;
}
#programDays .day-card > div:last-child{min-width:0!important}
#programDays .day-card h3,
#programDays .day-card p,
#programDays .day-card .moment-text,
#programDays .day-card .day-moments{
  height:auto!important;
  max-height:none!important;
  overflow:visible!important;
}
@media(max-width:700px){
  #programDays{grid-template-columns:1fr!important}
}


/* Disposition automatique selon la durée :
   1 à 3 jours = une colonne, comme le programme Espagne.
   4 jours et plus = deux colonnes. */
body.programme-1-colonne #programDays{
  grid-template-columns:1fr!important;
}
body.programme-2-colonnes #programDays{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
@media(max-width:700px){
  body.programme-1-colonne #programDays,
  body.programme-2-colonnes #programDays{
    grid-template-columns:1fr!important;
  }
}


/* Espacement horizontal uniforme entre les cartes */
#programDays{
  column-gap:12px!important;
  row-gap:12px!important;
}
body.programme-1-colonne #programDays{
  column-gap:0!important;
}
@media(max-width:700px){
  #programDays{
    column-gap:0!important;
    row-gap:12px!important;
  }
}


/* =========================================================
   V4 — ESPACEMENT VERTICAL RÉGULIER
   En mode 2 colonnes, chaque colonne est une pile indépendante.
   Ainsi une carte plus haute n'augmente plus artificiellement
   l'espace sous la carte voisine.
   ========================================================= */

body.programme-2-colonnes #programDays{
  display:block!important;
}

body.programme-2-colonnes #programDays .programme-total-visible{
  width:100%!important;
  margin:0 0 12px!important;
}

body.programme-2-colonnes #programDays .offroad-days-columns{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  column-gap:12px!important;
  align-items:start!important;
}

body.programme-2-colonnes #programDays .offroad-days-column{
  display:flex!important;
  flex-direction:column!important;
  gap:12px!important;
  min-width:0!important;
}

body.programme-2-colonnes #programDays .offroad-days-column .day-card{
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  margin:0!important;
  align-self:stretch!important;
}

/* 1 à 3 jours : logique Espagne, pile simple */
body.programme-1-colonne #programDays{
  display:flex!important;
  flex-direction:column!important;
  gap:12px!important;
}

@media(max-width:700px){
  body.programme-2-colonnes #programDays .offroad-days-columns{
    display:flex!important;
    flex-direction:column!important;
    gap:12px!important;
  }
  body.programme-2-colonnes #programDays .offroad-days-column{
    gap:12px!important;
  }
}


/* =========================================================
   CORRECTION V4 — COLONNES SUR TOUTE LA LARGEUR
   ========================================================= */

body.programme-2-colonnes #programDays{
  width:100%!important;
}

body.programme-2-colonnes #programDays .offroad-days-columns{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  column-gap:12px!important;
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  margin:0!important;
  box-sizing:border-box!important;
}

body.programme-2-colonnes #programDays .offroad-days-column{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  box-sizing:border-box!important;
}

body.programme-2-colonnes #programDays .offroad-days-column .day-card{
  width:100%!important;
  max-width:none!important;
  min-width:0!important;
  box-sizing:border-box!important;
}


/* V5 — structure directe, sans réorganisation JavaScript */
body.programme-2-colonnes #programDays,
#programDays:has(.offroad-days-columns){
  display:block!important;
  width:100%!important;
}
#programDays .offroad-days-columns{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  column-gap:12px!important;
  width:100%!important;
  max-width:none!important;
  box-sizing:border-box!important;
  margin:0!important;
}
#programDays .offroad-days-column{
  display:flex!important;
  flex-direction:column!important;
  gap:12px!important;
  width:100%!important;
  min-width:0!important;
  max-width:none!important;
}
#programDays .offroad-days-column .day-card{
  width:100%!important;
  max-width:none!important;
  margin:0!important;
}
@media(max-width:700px){
  #programDays .offroad-days-columns{
    display:flex!important;
    flex-direction:column!important;
    gap:12px!important;
  }
}
