:root {
  --maincolor: #faebcd;
  --policetitle: "Instrument Serif", serif;
  --policesecondtiltle: "Inria Serif", serif;
  --colortextbg: #4b4b4b;
  --colorlight: #eeb138;
}

canvas{

  width: 50%;
}

#timeline {
  
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  color: var(--colortextbg);
  
  background-image: url('../img/background.jpg');
  background-repeat: no-repeat;
  background-position: center;

width: 100%;
margin: auto;
border-radius: 10px;
padding-right: 5px;
margin-top: 20px;

}

/* chaque année */
#timeline .yearBox {
  position: relative;
  width: 35px;           /* espace entre deux ticks = largeur d'une "graduation" */
  height: 45px;
  padding-bottom:5px ;
  display: flex;
  align-items: flex-end;  /* pour que le texte (ex: 1960) reste en bas */
  justify-content: center;
  font-size: 0.8rem;
  background-color: transparent;
  cursor: pointer;
}

/* tick gradué : petit trait en haut de chaque case */
#timeline .yearBox::before {
  content: "";
  position: absolute;
  top: 0;                /* collé en haut */
  left: 0%;             /* centré sur la case */
  transform: translateX(-50%);
  width: 1px;            /* largeur du trait */
  height: 15px;           /* hauteur du tick = 2px */
  background: var(--colortextbg);      /* couleur noire (comme une règle) */
  
}

#goldText, #silverText, #bronzeText{
  font-family: var(--policesecondtiltle);
}

#goldText{

  font-size: 3rem;
}

#silverText{

  font-size: 2.5rem;
}

#bronzeText{

  font-size: 2rem;
}

.yearBox {
  width: 35px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  background-color: transparent;
  
}

.yearBox:hover {
  border-right: #000 1px solid;
  border-left: #000 1px solid;
  
}


.yearBox.selected {
  border-left: 2px solid var(--colorlight);
  border-right: 2px solid var(--colorlight);
  font-weight: bold;
}

.yearSelect {
  display: none;
  width: fit-content;
  max-width: 420px;
  margin: 12px auto;
  padding: 8px 10px;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fff;
}

/* Sur téléphone : afficher le select et cacher la timeline */
@media (max-width: 900px) {
  .yearSelect {
    display: block;
  }
  #timeline {
    display: none; /* on cache la frise sur mobile */
  }
}

/* Sur téléphone : afficher le select et cacher la timeline */
@media (max-width: 769px) {
  canvas{

    width: 100%;
  }
}
