/* =========================================================================
   Timeline
   ========================================================================= */
/* Recette: on white. */
.timeline { background: #fff; }
.timeline__head {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
  margin-bottom: 54px;
}
.timeline__intro { margin-top: 14px; color: var(--syn-body); font-size: 0.95rem; }
/* Heading typography (Figma "a propos", 1139:5295): Noto Sans throughout,
   a tight semibold title and a grey one-line intro. */
.timeline__head .eyebrow { margin-bottom: 12px; font-size: 0.9375rem; line-height: 16px; letter-spacing: 1.2px; color: #eb8200; }
.timeline__head .section__title {
  margin: 0;
  font-family: var(--font-body);
  font-size: clamp(2rem, 3.4vw, 3rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -1.2px;
  color: #171717;
}
/* The design's 362px heading column ("Notre histoire / au Maroc"). */
@media (min-width: 1025px) {
  .timeline__head .section__title { max-width: 362px; }
}
.timeline__head .timeline__intro { margin-top: 16px; font-size: 1rem; line-height: 24px; color: #737373; }

/* 17 years, so the strip scrolls and the active pill is kept in view. */
.timeline__years {
  position: relative;
  display: flex;
  justify-self: end;
  gap: 16px;
  max-width: 100%;
  /* The bottom padding keeps the active pill's shadow inside the strip,
     which clips as it scrolls. */
  padding-top: 46px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  /* JS narrows the strip to whole years; each scroll stops on a year. */
  scroll-snap-type: x mandatory;
}
.timeline__years::-webkit-scrollbar { display: none; }
.timeline__year {
  flex: none;
  scroll-snap-align: start;
  padding: 10px 20px;
  border: 0;
  border-radius: var(--r-pill);
  background: none;
  color: #737373;
  font: inherit;
  font-family: var(--font-inter);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 20px;
  cursor: pointer;
}
.timeline__year:hover { color: #171717; }
/* The selected year: a white pill with a soft shadow, dark label (Figma
   Component 73, 1139:5302). */
.timeline__year.is-active {
  background: #fff;
  color: #171717;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Prev / next chevrons sit either side of the card, narrower than the
   container as in Figma (Component 73, 1139:5302). */
.timeline__stage {
  position: relative;
  max-width: 1000px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
}
.timeline__nav {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: 34px; height: 45px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--syn-green-500);
  cursor: pointer;
  transform: translateY(-50%);
}
.timeline__nav::before {
  content: "";
  display: block;
  width: 18px; height: 18px;
  margin: 0 auto;
  border-inline-end: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
}
.timeline__nav--prev { inset-inline-start: -46px; }
.timeline__nav--prev::before { transform: rotate(135deg); }
.timeline__nav--next { inset-inline-end: -46px; }
.timeline__nav--next::before { transform: rotate(-45deg); }
.timeline__nav:hover { color: var(--syn-green-600); }
.timeline__nav[hidden] { display: none; }

.timeline__items > * { display: contents; }
.milestone[hidden] { display: none; }
.milestone {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  min-height: 410px;
  margin-top: 46px;
  padding: 64px 124px;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
/* The connector and dot above the card. */
.timeline--interactive .milestone::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  width: 1px; height: 52px;
  background: #d7ded7;
}
.timeline--interactive .milestone::after {
  content: "";
  position: absolute;
  top: 46px; left: 50%;
  width: 14px; height: 14px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--syn-green-500);
  box-shadow: 0 0 0 1px #d7ded7;
  transform: translateX(-50%);
}
.milestone__ghost {
  position: absolute;
  inset-inline-end: 40px; bottom: -40px;
  color: rgba(17, 24, 39, 0.045);
  font-family: var(--font-inter);
  font-size: 15rem;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}
.milestone__body { position: relative; flex: 1; min-width: 0; }
.milestone__year {
  display: inline-block;
  margin-bottom: 30px;
  padding: 6px 18px;
  border-radius: var(--r-pill);
  background: #e6f7ec;
  color: var(--syn-green-600);
  font-family: var(--font-inter);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1.36px;
  text-transform: uppercase;
}
/* Rule running from the year badge across the card. */
.milestone__year::after {
  content: "";
  position: absolute;
  top: 16px; inset-inline-start: 96px; inset-inline-end: 0;
  height: 1px;
  background: #e8e8e8;
}
/* Poppins Medium, dark grey (Figma Component 73). */
.milestone__title {
  margin: 0 0 14px;
  font-size: clamp(1.4rem, 2.4vw, 2.125rem);
  font-weight: 500;
  line-height: 1.42;
  color: #262626;
}
.milestone__text { color: var(--syn-body); }

/* Recette: only the first milestone is green, the others yellow. */
.milestone--alt .milestone__year { background: #fff4d6; color: #b37400; }
.timeline--interactive.is-alt .timeline__items::after { background: var(--syn-amber); }

/* Recette: the card slides in from the side the visitor moves towards. */
/* The cards share one track, clipped at its sides, so a card sliding out
   and the next sliding in show side by side (the JS animates them). The
   connector and dot belong to the track, so they stay put. */
.timeline--interactive .timeline__items { position: relative; display: grid; overflow-x: clip; }
/* Drupal wraps each card twice; both wrappers collapse so the cards are the
   track's own items, all in its one cell. */
.timeline--interactive .timeline__items > * > * { display: contents; }
.timeline--interactive .milestone { grid-area: 1 / 1; }
.timeline--interactive .milestone::before,
.timeline--interactive .milestone::after { content: none; }
.timeline--interactive .timeline__items::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 46px; left: 50%;
  width: 1px; height: 52px;
  background: #d7ded7;
}
.timeline--interactive .timeline__items::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 92px; left: 50%;
  width: 14px; height: 14px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--syn-green-500);
  box-shadow: 0 0 0 1px #d7ded7;
  transform: translateX(-50%);
}
@media (prefers-reduced-motion: reduce) {
  .milestone { animation: none; }
}
