/************************* STYLES DE LA VUE FICHE *************************/
.page-content {
  /* réinitialiser la marge et jouer avec le padding pour ajuster l'espace autour du contenu */
  margin: 0;
  padding: 3rem;
}

/* pour ajouter de la marge entre les sections
sans décaler les éléments */
.margin-block {
  margin: 120px 0;
}

/* neutraliser le padding du conteneur page-content 
pour ajouter un background sur toute la largeur de la page */
.full-width-bg {
  margin-left: -3rem;
  margin-right: -3rem;
  padding-left: 3rem;
  padding-right: 3rem;
}

section {
  margin-top: 2.5rem;
}

section .section-item {
  margin-top: 1rem;
}

/* styliser les liens éventuels dans les contenus renseignés par les agents */
.fiche-descr-gen a,
#programme a,
#bilan a,
#historique a,
#valorisations a:not(.external-link) {
  color: var(--cereq-color);
  text-decoration: underline;
}
.fiche-descr-gen a:hover,
#programme a:hover,
#bilan a:hover,
#historique a:hover,
#valorisations a:not(.external-link):hover {
  color: var(--cereq-color-dark);
}

/* styliser les liens éventuels dans le contenu */
/* a:not(.external-link) {
  color: var(--cereq-color);
  text-decoration: underline;
}
a:not(.external-link):hover {
  color: var(--cereq-color-dark);
} */

/* pour gérer les titres des sections bilan, 
programme et historique */
.section-title-layout {
  width: max-content;
  margin-left: -3rem;
  flex: 0 0 33%;
}

/* BANNIERE */
/* image de fond à côté des infos générales et derrière l'image bp */
.banner-bg {
  position: relative;
  overflow: hidden;
  margin: -3rem;
  padding: 3rem;
}
.banner-bg::before {
  content: "";
  background-image: url("../assets/images/fond-titre.svg");
  position: absolute;
  top: 0;
  right: 0;
  width: 60%;
  height: 100%;
  background-repeat: no-repeat;
  background-position: center; 
  z-index: -1000;
  /* fading */
  mask-image: linear-gradient(70deg, transparent 5%, black 45%);
  -webkit-mask-image: linear-gradient(70deg, transparent 5%, black 45%);
}

/* ETIQUETTES */
.tag {
  padding: 0.2em 0.8em;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 999px;
  text-align: center;
  white-space: nowrap;
  width: max-content;
}

.tag.yellow {
  border: 1px solid var(--cereq-color-yellow);
  margin-bottom: 5px;
}

.tag.blue {
  border: 1px solid var(--cereq-color-blue);
  margin-bottom: 5px;
}

.tag.md-tag {
  background: var(--cereq-color);
  color: #fff;
}

/* NAVIGATION CONTENU */
/* Non affichée par défaut */
.links-nav {
  display: none;
}

.links-nav p {
  color: var(--text-grey);
  font-size: 1rem;
  font-weight: 500;
}
.links-nav p #toggle-nav-btn {
  background-color: #fff;
  color: var(--cereq-color);
  border: none;
  transition: all 300ms ease 0s;
}

.links-nav ul {
  display: none;
  margin-top: 5px;
  margin-left: 20px;
}

.links-nav ul li {
  padding: 5px;
  border-radius: var(--border-radius-sm);
  width: max-content;
}

.links-nav ul li:hover {
  background-color: var(--item-hover);
}

.links-nav ul li a {
  color: var(--cereq-color);
  font-weight: 500;
}

.links-nav ul li a:hover {
  color: var(--cereq-color-dark);
}

/* TITRE */
.fiche-title {
  display: flex;
}

.fiche-title h1 {
  margin-bottom: 1rem;
  max-width: 40%;
}

.fiche-title.has-image .image-bp {
  max-width: 400px;
  height: max-content;
  margin-left: auto;
  box-shadow: var(--box-shadow-light);
}

/* METADONNEES */
.fiche-metadata {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}
.fiche-metadata .fiche-calendrier {
  color: var(--cereq-color);
}

.fiche-metadata .fiche-md p {
  font-weight: 600;
}
.fiche-metadata .fiche-md li {
  font-weight: 300;
}

/* DESCR GEN */
.fiche-descr-gen > :not(.tag) {
  font-size: 1.1rem;
  line-height: 1.5;
  margin-top: 15px;
}

/* EQUIPE */
#equipe .section-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

#equipe .section-grid .section-item {
  flex: 0 0 25%;
  max-width: 25%;
  width: 25%;
  padding: 1.5rem;
  border: 1px solid var(--border-light-grey);
  border-radius: var(--border-radius-sm);
  height: max-content;
}

#equipe .equipe-title {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

#equipe .equipe-title h3 {
  font-size: 1rem;
}

#equipe .equipe-title span {
  content: "";
  width: 2.5rem;
  height: 2px;
  background-color: var(--cereq-color);
}
#equipe .section-item p,
#equipe .section-item li {
  margin-bottom: 10px;
}
/* unité agents */
#equipe .section-item span {
  color: var(--text-grey);
  font-size: 0.8rem;
}

/* BILAN, PROGRAMME */
#bilan,
#programme {
  display: flex;
  gap: 1.5rem;
  align-items: start;
}

/* styliser les liens éventuels dans les descriptifs */
#bilan a,
#programme a {
  color: var(--cereq-color);
  text-decoration: underline;
}
#bilan a,
#programme a  {
  color: var(--cereq-color-dark);
}

#bilan .section-title-layout {
  background-color: var(--cereq-color-yellow);
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}
#programme .section-title-layout {
  background-color: var(--cereq-color-blue);
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
}

#bilan .section-title-layout h2,
#programme .section-title-layout h2 {
  font-size: 1.2rem;
  font-weight: 400;
  margin-left: 3rem;
  padding: 1.5rem 0.5rem 1.5rem 0;
}

#bilan .section-title-layout h2 > span,
#programme .section-title-layout h2 > span {
  font-size: 1.8rem;
  font-weight: 500;
}

#bilan .section-title-layout h2 {
  color: var(--text-dark);
}
#programme .section-title-layout h2 {
  color: #ffffff;
}

/* HISTORIQUE */
#historique .historique-toggle {
  display: flex;
  align-items: end;
  gap: 10px;
}

#historique .historique-toggle h2 {
  font-weight: 600;
  font-size: 1.1rem;
}

#historique .historique-toggle button {
  background-color: #fff;
  color: var(--cereq-color);
  font-size: 1.2rem;
  border: none;
  transition: all 300ms ease 0s;
}

#historique .historique-content {
  display: none;
}

#historique .historique-content hr {
  color: var(--border-light-grey);
  /* width: 100%; */
  width: 7em;
  margin-left: 0;
  margin-top: 2rem;
}

#historique .historique-content .historique-item {
  margin-top: 2rem;
  display: flex;
  gap: 1.5rem;
  align-items: start;
}

#historique .historique-content .historique-item h3 {
  font-weight: normal;
  color: var(--text-grey);
  font-size: 1.3rem;
  margin-left: 3rem;
}

/* styliser les liens éventuels dans les descriptifs */
#historique a {
  color: var(--cereq-color);
  text-decoration: underline;
}
#historique a {
  color: var(--cereq-color-dark);
}

/* VALORISATIONS */
#valorisations .full-width-bg {
  background-color: #f7f7f7;
  padding-top: 1rem;
  padding-bottom: 3rem;
  margin-bottom: -3rem;
}

#valorisations .section-item:first-of-type {
  margin-bottom: 3rem;
}

#valorisations .valorisations-title {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

#valorisations .valorisations-title span {
  content: "";
  width: 2.5rem;
  height: 2px;
  background-color: var(--cereq-color);
}

#valorisations li {
  list-style: none;
  line-height: 1.5;
  margin-top: 15px;
}

#valorisations li,
#valorisations p {
  margin-top: 10px;
  font-weight: 300;
}

#valorisations li .external-link {
  color: var(--cereq-color);
}
#valorisations li .external-link:hover {
  color: var(--cereq-color-dark);
}

/******************** RESPONSIVE ********************/

/* Breakpoints en em */
/* Mobile	480px	30em
Tablette	768px	48em
Petit laptop	1024px	64em
Desktop	1280px	80em */

@media screen and (min-width: 112em) {
  .page-content {
    padding: 3rem 15rem;
  }
  .full-width-bg {
    margin-left: -15rem;
    margin-right: -15rem;
    padding-left: 15rem;
    padding-right: 15rem;
  }

  /* TODO: pour faire déborder la bannière au delà du container */
  .banner-bg {
    margin: -3rem -15rem;
    padding: 3rem 15rem;
  }

  #bilan .section-title-layout,
  #programme .section-title-layout {
    margin-left: -15rem;
    flex: 0 0 33%;
  }

  #bilan .section-title-layout h2,
  #programme .section-title-layout h2 {
    margin-left: 15rem;
  }

  #historique .historique-content .historique-item .section-title-layout {
    margin-left: -3rem;
    flex: none;
  }
}

@media screen and (max-width: 64em) {
  .margin-block {
    margin: 80px 0;
  }

  /* afficher la navigation du contenu */
  .links-nav {
    display: block;
  }

  /* pour ne pas l'afficher si on est en haut de la page (js) */
  .links-nav.hidden {
    display: none !important;
  }

  /* navigation fixe */
  .links-nav.sticky {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: #fff; /* ou autre couleur de fond */
    box-shadow: var(--box-shadow-light);
    padding: 0.5rem 1.5rem;
  }

  .fiche-descr-gen {
    margin-top: 1.5rem;
  }

  .fiche-title.has-image .image-bp {
    margin-top: 1.5rem;
    max-width: 300px;
    height: max-content;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
  }
}

@media screen and (max-width: 58em) {
  .banner-bg {
    padding: 0;
    margin: 0;
  }
  /* pas de fond titre sur écrans moyens et petits */
  .banner-bg::before {
    display: none;
  }

  .fiche-title h1 {
    max-width: 100%;
  }

  .fiche-title.has-image {
    display: block;
  }
}

@media screen and (max-width: 48em) {
  /* ajuster l'espace autour du contenu de la page sur petits écrans */
  .page-content {
    padding: 3rem 1.5rem;
  }
  .full-width-bg {
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .fiche-title.has-image .image-bp {
    margin-top: 1.5rem;
    max-width: 200px;
    height: max-content;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
  }

  .fiche-descr-gen > :not(.tag) {
    line-height: normal;
  }

  #equipe .section-grid {
    display: block;
  }
  #equipe .section-grid .section-item {
    max-width: inherit;
    width: inherit;
  }

  #bilan,
  #programme {
    display: block;
  }

  #bilan .section-title-layout,
  #programme .section-title-layout {
    border-radius: var(--border-radius-sm);
  }

  .section-title-layout {
    width: inherit;
    margin-bottom: 1rem;
  }

  #bilan .section-title-layout h2,
  #programme .section-title-layout h2 {
    padding: 0.5rem 0;
  }

  #historique .historique-content .historique-item {
    display: block;
  }
}
/******************** FIN RESPONSIVE ********************/
