* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #f8f8f8;
  height: auto;
}

h2, h3 {
  color: #152F4F;
}

/* Carrousel */
#container {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100vh; /* Assurez-vous de définir une hauteur fixe */
}

.hero {
  position: absolute;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0; /* Cache par défaut */
  transition: opacity 1s ease-in-out; /* Transition douce de l'opacité */
}

/* Classe pour animer l'entrée de la div */
.hero-in {
  animation: slideIn 1s forwards; /* Utilise l'animation slideIn */
}

/* Classe pour animer la sortie de la div */
.hero-out {
  animation: slideOut 1s forwards; /* Utilise l'animation slideOut */
}

#scrollDownArrow {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  color: #fff; /* Couleur de la flèche */
  animation: bounce 2s infinite; /* Animation de rebond */
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-20px);
  }
  60% {
    transform: translateX(-50%) translateY(-10px);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(-100%);
    opacity: 0;
  }
}

/* Affiche la première div par défaut */
.hero:first-of-type {
  opacity: 1;
}

/* End carrousel */

section {
  padding: 20px;
  text-align: center;
}

.centres-contenair {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
}

.centres-contenair div {
  width: 50%;
  padding: 10px;
  text-align: left;
  margin-bottom: 20px;
}

.centres-contenair img {
  float: inline-start;
  margin-right: 15px;
  width: 50%;
}

  /* Animations d'entrée */

  /* CSS inchangé pour l'état initial */
  .centre-header, .centre-detail {
      opacity: 0;
      transform: translateY(50px);
      transition: transform 0.6s, opacity 0.6s;
  }

  /* CSS inchangé pour l'état animé */
  .centre-header.animated, .centre-detail.animated {
      opacity: 1;
      transform: translateY(0);
  }

#nous {
  height: auto; /* Hauteur de la demi-page */
  background-color: #b3b3b3;
}

#nos-centres {
  display: flex;
  flex-direction: column;
  height: auto;
  justify-content: center;
  align-items: center;
  background-color: #f8f8f8;
}

#nos-soins {
  display: flex;
  flex-direction: column;
  height: auto;
  justify-content: space-around;
  align-items: center;
  background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('images/soinsinfirmiers.jpg');
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  padding-top: 30px;
  padding-bottom: 30px;
  color: white;
}

#nos-soins p, #nos-soins h2 {
  color: rgb(230, 230, 230);
}

.contact-div {
  display: flex;
  text-align: left;
  flex-direction: column;
  justify-content: center;
  align-items: end;
}

#join-us {
  height: auto; /* Hauteur de la demi-page */
  background-color: #f5f5f5;
}

.fit-img {
  width: auto;
  height: 45vh;
}


.footer{
  background: #152F4F;
  color:white;
  text-align: left;

  .links{
    ul {list-style-type: none;}
    li a{
      color: white;
      transition: color .2s;
      &:hover{
        text-decoration:none;
        color:#4180cb;
        }
    }
  }  
  .about-company{
    i{font-size: 25px;}
    a{
      color:white;
      transition: color .2s;
      &:hover{color:#4180cb}
    }
  } 
  .location{
    i{font-size: 18px;}
  }
  .copyright p{border-top:1px solid rgba(255,255,255,.1);} 
}

.footer h2 {
  color: #fff;
}

.footer h4 {
  margin-top: 10px !important;
  margin-bottom: 10px !important;
}

#secondary-page {
  padding-top: 80px;
}

.services-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* Crée une grille avec trois colonnes de taille égale */
  gap: 20px; /* Espace entre les éléments */
}

.service {
  height: auto; /* La hauteur s'ajustera en fonction du contenu */
  padding: 1em; /* Ajout d'un peu d'espace à l'intérieur des blocs */
  box-sizing: border-box; /* S'assure que le padding et la bordure sont inclus dans la largeur et la hauteur totales */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease-in-out; /* Animation de transformation pour l'effet zoom */
}

/* Styles pour le conteneur d'icônes, incluant la transition pour le fond */
.icon-container {
  flex: 0 0 50%; /* La taille de .icon-container ne se réduit pas et représente 50% de .service */
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid; /* Couleur définie dans le style en ligne pour chaque service */
  border-radius: 10%; /* Rend le conteneur de l'icône arrondi */
  padding: 1em; /* Espacement à l'intérieur du conteneur de l'icône */
  transition: background-color 0.3s; /* Animation de fond */
}

/* Changement de fond sur hover */
.service:hover .icon-container {
  background-color: #FF0000; /* Ce devrait être la même couleur que le border-color */
}

/* Assurez-vous de remplacer la couleur de fond dans la règle ci-dessus
avec la couleur appropriée pour chaque service. */

/* Autres styles restent inchangés... */
/* Dans .icon-container, utilisez une variable CSS pour définir la couleur de la bordure */
.icon-container {
  /* ... autres styles ... */
  border: 4px solid var(--icon-border-color, #FF0000); /* Valeur par défaut #FF0000 */
}

/* Dans le hover de .service, utilisez la même variable CSS pour la couleur de fond */
.service:hover .icon-container {
  background-color: var(--icon-border-color, #FF0000); /* Valeur par défaut #FF0000 */
}

.service i {
  font-size: 4em; /* Taille des pictogrammes */
}

.service p {
  margin-top: 10px;
  font-size: 1em;
}

.under-img {
  background-color: white;
  padding: 15px;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.icon-container img {
  width: 56px;
  height: auto;
  filter: invert();
}

#secondary-page {
  background-color: #152F4F;
}

#secondary-page h1 {
  color: white;
  text-align: center;
}

#organisation, #engagement {
  color: #f5f5f5;
}

.organisation-presentation {
  background-color: white;
  padding: 15px;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.organisation-presentation div {
  width: 98%;
  height: auto;
  background-color: #4180CB;
  padding: 5px;
  margin-bottom: 10px;
  border-radius: 10px;
}

.organisation-presentation div span {
  height: 25%;;
}


.organisation-presentation div p {
  margin-top: 10px;
  text-align: right;
  color: #fff;
}

.organisation-presentation div h4 {
  margin-top: 10px;
  text-align: right;
  color: #fff;
}

.organisation-presentation div h5 {
  margin-top: 10px;
  text-align: right;
  color: #fff;
}

.organisation-presentation img {
  width: 40%;
  height: auto;
  float: left;
  border-radius: 10px;
  margin-right: 5px;
}

.engagement-presentation {
  background-color: white;
  padding: 15px;
  border-radius: 5px;
}

.engagement-presentation div {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
}

.engagement-presentation img {
  width: 50vh;
  height: auto;
  max-width: 50%;
}

.hidden {
  opacity: 0;
  transition: opacity 1s ease;
}

.visible {
  opacity: 1;
  transition: opacity 1s ease;
}

.engagement-presentation img {
  transition: opacity 1s ease, transform 1s ease;
  opacity: 0;
  transform: translateX(-100%);
}

.engagement-presentation img.visible {
  opacity: 1;
  transform: translateX(0);
}

.centre-presentation {
  display: flex;
  flex-direction: row;
  justify-content: center;
  text-align: left;
}

.centre-presentation em {
  display: block;
  margin-bottom: 0;
  font-style: italic;
  text-align: right;
}

.centre-presentation div {
  max-width: 50%;
  background-color: #f5f5f5;
  border-radius: 10px;
  padding: 5px;
  margin: 5px;
  height: auto;
}

.centre-vertical {
  width: 100%;
  height: auto;
  max-height: 550px;
}

.directrice-photo {
  float: right;
  border-radius: 50%;
  width: auto;
  height: 120px;
  margin: 10px;
  border: 4px solid #4180cb;
}

.centre-presentation span {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
}

#equipe-moulins {
  background-color: #fff;
}

#equipe-moulins h2 {
  text-align: center;
}

#temoignages-moulins {
  background-color: #fff;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  justify-items: start;
}

#temoignages-moulins div {
  display: flex;
  flex-direction: column;
  justify-content: start;
  background-color: #152F4F;
  border: solid 2px #fff;
  border-radius: 10px;
  box-shadow: 0 9px 18px rgba(0,0,0,0.30), 0 5px 2px rgba(0,0,0,0.22);
  color: #fff;
  text-align: left;
  padding: 5px;
  min-height: 200px;
}

#temoignages-moulins p, h6 {
  margin-top: 15px;
}

.icon-soin-title {
  display: flex;
  flex-direction: row;
  border-bottom: solid 3px #00d9ff;
  margin-bottom: 5px;
  align-items: end;
  text-align: left;
}

.icon-soin-title img {
  width: 100px;
  height: 100px;
  margin-right: 5px;
  filter: invert();
  margin-right: 15px;
}

.icon-soin-title {
  border-bottom: 4px solid var(--icon-border-color, #FF0000); /* Valeur par défaut #FF0000 */
}

#page-soins h1 {
  z-index: 4;
  color: #fff;
}

#page-soins {
  display: flex;
  flex-direction: column;
  height: auto;
  justify-content: space-around;
  align-items: center;
  position: relative;
}

#page-soins::before {
  content: "";
  background-image: url('images/soinsinfirmiers.jpg');
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 1;
  transition: opacity 1s ease-in-out;
  z-index: 1;
}

#page-soins::after {
  content: "";
  background-image: url('images/slider-medicament.jpeg');
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  z-index: 2;
  animation: changeBackground 12s infinite; /* 4 images, 4 seconds each */
}

@keyframes changeBackground {
  0% { opacity: 0; }
  25% { opacity: 1; background-image: url('images/slider-medicament.jpeg'); }
  50% { opacity: 0; }
  75% { opacity: 1; background-image: url('images/vl-slider.jpeg'); }
  100% { opacity: 0; }
}

#page-soins p {
  color: rgb(255, 255, 255);
  margin-top: 10px;
  margin-bottom: 20px;
  font-size: 18px;
  z-index: 4;
  text-align: left;
}

.soin-detail {
  width: 80%;
  z-index: 4;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 10px;
  margin-bottom: 10px;
  padding: 15px;
}

.soin-detail h2 {
  color: #fff;
}

.cartes-contenair {
  display: flex;
  flex-direction: row;
  justify-content: space-around;
  align-items: center;
  margin-top: 20px;
}

.cartes-contenair div {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}

.cartes-contenair h4 {
  color: #fff;
}

.tel-contact a {
  font-size: 18px;
  font-weight: 700;
}

#logo-navbar {
  height: 64px;
  width: 64px;
}

/* Correctifs images verticales centres */

.img-centre-vertical-moulins {
  background-image: url(images/moulins-vertcal.jpeg);
  background-size: cover;
  background-position: center;
  width: 100%;
  height: max-content;
}

.img-centre-vertical-vl {
  background-image: url(images/vl-vertical.jpeg);
  background-size: cover;
  background-position: center;
  width: 100%;
  height: max-content;
}

/* Animation ancien/nouveau */

.old-new-container {
  display: flex;
  flex-direction: row;
  position: relative;
  margin: 0 auto;
  overflow: hidden;
}

.old-new-img {
  position: relative;
  width: 100%;
  height: auto;
  transition: all 1s ease;
}

.old-new-img.active {
  opacity: 1;
}
.old {
  z-index: 1;
}
.new {
  z-index: 2;
}

.old-new-text {
  background-color: white;
  padding: 15px;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  width: 100%;
}