/**
 * JPB Custom Vertical Timeline CSS
 * Design moderne, responsive et fidèle au site Jean-Pascal Boffo
 */

:root {
  --jpb-timeline-color: #68BEC9;
  --jpb-timeline-color-dark: #4faab5;
  --jpb-timeline-card-bg: rgba(255, 255, 255, 0.94);
  --jpb-timeline-shadow: 0 4px 18px rgba(0, 0, 0, 0.09);
  --jpb-timeline-border-radius: 6px;
}

.jpb-timeline-wrapper {
  position: relative;
  width: 100%;
  max-width: 1140px;
  margin: 40px auto;
  padding: 20px 0;
  box-sizing: border-box;
}

/* Axe central vertical */
.jpb-timeline-wrapper::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background-color: var(--jpb-timeline-color);
  transform: translateX(-50%);
  border-radius: 3px;
}

.jpb-timeline-container {
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Ligne / Rangée individuelle */
.jpb-timeline-row {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  margin-bottom: 50px;
  box-sizing: border-box;
}

.jpb-timeline-row:last-child {
  margin-bottom: 0;
}

/* Alternance Gauche / Droite (Desktop) */
.jpb-timeline-row.jpb-row-left {
  flex-direction: row;
}

.jpb-timeline-row.jpb-row-right {
  flex-direction: row-reverse;
}

/* Moitié Carte (50% de largeur) */
.jpb-timeline-card-col {
  width: 50%;
  display: flex;
  box-sizing: border-box;
}

.jpb-row-left .jpb-timeline-card-col {
  justify-content: flex-end;
  padding-right: 45px;
}

.jpb-row-right .jpb-timeline-card-col {
  justify-content: flex-start;
  padding-left: 45px;
}

/* Moitié Date (50% de largeur) */
.jpb-timeline-date-col {
  width: 50%;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.jpb-row-left .jpb-timeline-date-col {
  justify-content: flex-start;
  padding-left: 45px;
}

.jpb-row-right .jpb-timeline-date-col {
  justify-content: flex-end;
  padding-right: 45px;
}

/* Badge Date */
.jpb-timeline-badge {
  display: inline-block;
  background-color: var(--jpb-timeline-color);
  color: #ffffff;
  font-family: 'Lato', 'Roboto', sans-serif;
  font-size: 15px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(104, 190, 201, 0.35);
  letter-spacing: 0.5px;
  white-space: nowrap;
  user-select: none;
}

/* Pastille Icône Centrale sur l'axe */
.jpb-timeline-node {
  position: absolute;
  left: 50%;
  top: 24px;
  transform: translate(-50%, -50%);
  width: 38px;
  height: 38px;
  background-color: var(--jpb-timeline-color);
  border: 3px solid #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 14px;
  box-shadow: 0 0 0 2px var(--jpb-timeline-color), 0 3px 10px rgba(0, 0, 0, 0.15);
  z-index: 2;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.jpb-timeline-row:hover .jpb-timeline-node {
  transform: translate(-50%, -50%) scale(1.12);
  background-color: var(--jpb-timeline-color-dark);
}

/* Boîte / Carte de contenu */
.jpb-timeline-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--jpb-timeline-card-bg);
  border: 1px solid var(--jpb-timeline-color);
  border-radius: var(--jpb-timeline-border-radius);
  box-shadow: var(--jpb-timeline-shadow);
  padding: 16px 20px;
  box-sizing: border-box;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.jpb-timeline-card:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
  transform: translateY(-2px);
}

/* Flèche reliant la carte au nœud central */
.jpb-timeline-card::after {
  content: '';
  position: absolute;
  top: 18px;
  width: 0;
  height: 0;
  border-style: solid;
}

.jpb-row-left .jpb-timeline-card::after {
  right: -9px;
  border-width: 8px 0 8px 9px;
  border-color: transparent transparent transparent var(--jpb-timeline-color);
}

.jpb-row-right .jpb-timeline-card::after {
  left: -9px;
  border-width: 8px 9px 8px 0;
  border-color: transparent var(--jpb-timeline-color) transparent transparent;
}

/* Visuel / Pochette */
.jpb-timeline-image {
  margin-bottom: 14px;
  overflow: hidden;
  border-radius: 4px;
}

.jpb-timeline-image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s ease;
}

.jpb-timeline-card:hover .jpb-timeline-image img {
  transform: scale(1.02);
}

/* Titre */
.jpb-timeline-title {
  font-family: 'Lato', 'Roboto', sans-serif;
  font-size: 17px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--jpb-timeline-color);
  margin: 0 0 10px 0;
  padding: 0;
  letter-spacing: 0.5px;
}

.jpb-timeline-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.jpb-timeline-title a:hover {
  color: var(--jpb-timeline-color-dark);
}

/* Contenu texte et listes */
.jpb-timeline-text {
  font-family: 'Roboto', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #333333;
}

.jpb-timeline-text p {
  margin: 0 0 10px 0;
}

.jpb-timeline-text p:last-child {
  margin-bottom: 0;
}

.jpb-timeline-text ul {
  margin: 0 0 10px 0;
  padding-left: 18px;
}

.jpb-timeline-text ul:last-child {
  margin-bottom: 0;
}

.jpb-timeline-text li {
  margin-bottom: 6px;
}

.jpb-timeline-text a {
  color: var(--jpb-timeline-color);
  font-weight: 500;
  text-decoration: underline;
  transition: color 0.2s ease;
}

.jpb-timeline-text a:hover {
  color: var(--jpb-timeline-color-dark);
}

/* ==========================================================================
   RESPONSIVE (Tablette & Mobile : < 880px)
   ========================================================================== */
@media screen and (max-width: 880px) {
  .jpb-timeline-wrapper {
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Déplacer l'axe vertical sur la gauche */
  .jpb-timeline-wrapper::before {
    left: 24px;
    transform: none;
  }

  .jpb-timeline-row,
  .jpb-timeline-row.jpb-row-left,
  .jpb-timeline-row.jpb-row-right {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 55px;
    margin-bottom: 40px;
  }

  /* Nœud sur l'axe gauche */
  .jpb-timeline-node {
    left: 24px;
    top: 20px;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .jpb-timeline-row:hover .jpb-timeline-node {
    transform: translate(-50%, -50%) scale(1.1);
  }

  /* Date badge au-dessus de la carte */
  .jpb-timeline-date-col,
  .jpb-row-left .jpb-timeline-date-col,
  .jpb-row-right .jpb-timeline-date-col {
    width: 100%;
    justify-content: flex-start;
    padding: 0 0 10px 0;
  }

  .jpb-timeline-badge {
    font-size: 13px;
    padding: 5px 12px;
  }

  /* Carte pleine largeur */
  .jpb-timeline-card-col,
  .jpb-row-left .jpb-timeline-card-col,
  .jpb-row-right .jpb-timeline-card-col {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }

  .jpb-timeline-card {
    max-width: 100%;
  }

  /* Flèche toujours vers la gauche */
  .jpb-timeline-card::after,
  .jpb-row-left .jpb-timeline-card::after,
  .jpb-row-right .jpb-timeline-card::after {
    top: 14px;
    left: -8px;
    right: auto;
    border-width: 7px 8px 7px 0;
    border-color: transparent var(--jpb-timeline-color) transparent transparent;
  }
}
