/* ========================================================================
   TIMELINE-SECTION.CSS — Section Frise Chronologique
   ========================================================================
   Refactorisé : grid 3 colonnes [contenu-gauche | dot | contenu-droite]
   L'ordre des éléments dans le HTML détermine leur position.
   ========================================================================== */

.timeline {
  padding: 5px 0 110px;
  position: relative;
  background: #ffffff;
  color: #000;
  overflow: hidden;
}

.timeline .container {
  width: min(1100px, 92vw);
  margin: 0 auto;
  position: relative;
}

.timeline .hero {
  text-align: left;
  padding-top: 20px;
  margin-bottom: 30px;
  background: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: auto !important;
}

.heroBadge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primaryDark);
  font-size: 12px;
  letter-spacing: 0.4px;
  margin-top: 50px;
}

.timeline .hero h1 {
  margin-top: 2px;
  margin-left: 0;
  font-size: clamp(28px, 4vw, 56px);
  letter-spacing: 0.6px;
  text-align: left;
}

.timeline .hero h1 span {
  color: #e66a00;
}

.timeline .hero p {
  margin: 10px 0 0 0;
  max-width: 760px;
  color: var(--muted);
  line-height: 1.6;
  text-align: left;
}

.timelineRail {
  position: absolute;
  top: -90px;
  bottom: -200px;
  right: 350px;
  width: 2px;
  border-radius: 0;
  background: linear-gradient(
    180deg,
    rgba(150, 150, 150, 0.6),
    rgba(120, 120, 120, 0.4)
  );
}

.left img{
  margin-left: 25px;
}

/* =============================================
   ITEM : grille 3 colonnes
   [calc(100% - 366px)]  [16px]  [350px]
         gauche           dot      droite
   ============================================= */
.timelineItem {
  position: relative;
  width: 100%;
  margin: 0 0 50px;

  display: grid;
  grid-template-columns: calc(100% - 366px) 16px 350px;
  align-items: start;
}

/* =============================================
   DOT : enfant de la grille, plus absolu
   Il se place naturellement dans la colonne 2
   grâce à l'ordre du HTML.
   ============================================= */
.timelineDot {
  width: 16px;
  height: 16px;
  background: #e66a00;
  border-radius: 50%;
  margin-top: 20px;
  position:relative;
  left: 8px;
}

.garageDot, .stockageDot{
  opacity: 0;
}

/* =============================================
   CARTES
   ============================================= */
.card {
  width: min(420px, 100%); /* 100% = largeur de la colonne grid */
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--cardShadow);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
  position: relative;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card:hover {
  transform: none;
  box-shadow: none;
}

/* Cas spécial : item .right SANS dot dans le HTML
   → la carte doit aller en colonne 3 (droite)    */
.timelineItem.right > .card:only-child {
  grid-column: 3;
}

/* =============================================
   FLÈCHES des cartes (inchangées)
   ============================================= */
.timelineItem.left .card::after,
.timelineItem.right .card::after {
  content: "";
  position: absolute;
  top: 36px;
  width: 0;
  height: 0;
  border-style: solid;
}

.timelineItem.left .card::after {
  right: -14px;
  border-width: 10px 0 10px 14px;
  border-color: transparent transparent transparent var(--surface);
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.15));
}

.timelineItem.right .card::after {
  left: -14px;
  border-width: 10px 14px 10px 0;
  border-color: transparent var(--surface) transparent transparent;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.15));
}

/* =============================================
   RESTE DES STYLES (inchangés)
   ============================================= */
.cardTop { position: relative; }

.imgWrap {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, rgba(63, 81, 181, 0.12), rgba(255, 64, 129, 0.08));
  overflow: hidden;
}

.imgWrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform 0.35s ease;
}

.card:hover .imgWrap img { transform: scale(1.02); }

.cardTop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: none;
  pointer-events: none;
}

.cardBody { padding: 18px 18px 16px; }

.cardBody h2 {
  font-size: 56px;
  margin-bottom: 8px;
  margin-top: 0;
}

.cardbody img {
  margin-top : 30px;
}

.timeline-number {
  color: #e66a00;
  margin-right: 8px;
}

.cardBody p {
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 12px;
}

.card.revealed { border: none; width:100%}

/* Animations reveal */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.left  { transform: translate(-56px, 16px); }
.reveal.right { transform: translate(56px, 16px); }

.reveal.show  { opacity: 1; transform: translate(0, 0); }

/* Bouton Go Top */
.toTop {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(245, 245, 245, 0.92);
  color: rgba(33, 33, 33, 0.88);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.timelineItem img {
    border-radius: 8px;
}

.toTop.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  z-index: 100;
}

.toTop:hover { transform: translateY(-2px); }

.timeline-img-mobile{display: none;}
.timeline-mobile{display: none;}

/* =============================================
   RESPONSIVE 840px
   On repasse en flex simple + dot re-absolu
   ============================================= */
   @media (max-width: 1800px) {
    .timeline-img-desktop{
      width:440px;
    }
  }


@media (max-width: 840px) {
  .timeline { padding: 5px 0 60px; }

  .timelineRail {
    left: 44px;
    right: auto;
  }

  /* On sort du grid, on revient à un bloc simple */
  .timelineItem {
    display: flex;
    justify-content: flex-start !important;
  }

  /* Le dot redevient absolu pour coller au rail */
  .timelineDot {
    position: absolute;
    left: 36px; /* 44px - 8px (demi-largeur) */
    top: 20px;
    margin: 0;
  }

  .card {
    width: calc(100% - 74px);
    max-width: none;
    margin-left: 74px;
    grid-column: unset;
  }

  /* Annule le grid-column: 3 du cas only-child */
  .timelineItem.right > .card:only-child {
    grid-column: unset;
    margin-left: 74px;
  }

  .timelineItem.left .card::after,
  .timelineItem.right .card::after {
    left: -14px;
    right: auto;
    border-width: 10px 14px 10px 0;
    border-color: transparent var(--surface) transparent transparent;
  }

  .timelineItem img{
    width: 100%
  }

  .left img {
    margin-left: 0; 
  }

  .timelineDot{
    display: none;
  }
}

@media (max-width: 600px) {
  .timeline .container {
    width: 100%;
    padding: 0 12px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }

  .timelineRail { display: none; }
  .timelineDot  { display: none; }

  .timelineItem {
    justify-content: flex-start !important;
  }

  .card {
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
    min-height: auto;
  }

  .timelineItem.left .card::after,
  .timelineItem.right .card::after {
    display: none;
  }

  .timeline-img-mobile{display: block;}
  .timeline-img-desktop{display: none;}
  .timeline-desktop{display: none;}
  .timeline-mobile{display: block;}
  .timelineItem {
    display: flex;
    flex-direction: column;
  }

  .cardBody {
    padding: 18px 0;
  }

  .cardBody h2{font-size: 28px;}

  .timeline-number {
    font-weight: bold;
}
}