#divisions {
  /* height: calc(80vh - 100px); */
  display: flex;
  justify-content: center;
  align-items: center;
  align-content: center;
  flex-wrap: wrap-reverse;
  animation-duration: 0.3s;
}

.container-hexagons {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  filter: drop-shadow(4px -4px 5px rgba(0, 0, 0, 0.3));
}

#divisions .container-hexagons .hexagon-1,
.hexagon-2,
.hexagon-3 {
  clip-path: polygon(0 25%, 50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%);
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2%;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
  will-change: transform;
}

.hexagon-1 {
  background: #5482b5;
  width: 250px;
  height: 280px;
  transform: translate(0, 20%) scale(1);
}
.hexagon-1:hover {
  background: #456a8a;
  transform: translate(-5%, 17.5%) scale(1.1);
}

.hexagon-2 {
  background: #96c121;
  background-size: cover;
  width: 250px;
  height: 280px;
  transform: translate(-10%, 20%);
}
.hexagon-2:hover {
  background: #7ca11a;
  transform: translate(-5%, 17.5%) scale(1.1);
}

.hexagon-3 {
  background: #fecb04;
  background-size: cover;
  width: 250px;
  height: 280px;
  transform: translate(-5%, -14%);
}
.hexagon-3:hover {
  background: #e7b900;
  transform: translate(-5%, -9%) scale(1.1);
}
.hexagon-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hexagon-content h3 {
  text-align: center;
  color: white;
  text-transform: uppercase;
  font-size: inherit;
  margin: 0;
  padding: 0 10px 0 10px;
}

.hexagon-content img {
  filter: invert(1) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.8));
  width: 30px;
  margin-bottom: 5px;
}

/* Mobile portrait */
@media (max-width: 450px) {
  #divisions {
    max-height: 400px;
  }
  
  .container-hexagons {
  scale: 0.7;
  }

  .hexagon-1 {
    transform: translate(-51%, 65%) scale(1);
  }
  .hexagon-1:hover {
    transform: translate(-56%, 63%) scale(1.1);
  }

  .hexagon-2 {
    transform: translate(51%, -40%) scale(1);
  }
  .hexagon-2:hover {
    transform: translate(56%, -43%) scale(1.1);
  }

  .hexagon-3 {
    transform: translate(0, -68.5%) scale(1);
  }
  .hexagon-3:hover {
    transform: translate(0, -64%) scale(1.1);
  }
}

/* Tablet  */
@media (min-width: 450px) and (max-width: 600px) {

  #divisions {
    max-height: 400px;
  }
  
  .container-hexagons {
  scale: 0.7;
  }

  .hexagon-1 {
/* orange */
    transform: translate(-51%, 85%) scale(1);
  }
  .hexagon-1:hover {
    transform: translate(-56%, 82.5%) scale(1.1); /* h - v */
  }
/* vert */
  .hexagon-2 {
    transform: translate(51%, -22%) scale(1);
  }
  .hexagon-2:hover {
    transform: translate(56%, -24%) scale(1.1);
  }
/* bleu */
  .hexagon-3 {
    transform: translate(0, -52%) scale(1);
  }
  .hexagon-3:hover {
    transform: translate(0, -47%) scale(1.1);
  }
}

/* Mobile landscape */
@media (min-height: 0px ) and (max-height: 450px ) {
  #divisions {
    height: calc(100vh - 50px);
    overflow: hidden;
  }

  #divisions .container-hexagons .hexagon-1,
  .hexagon-2,
  .hexagon-3 {
    margin: 1%;
  }

  .container-hexagons {
    transform: translate(0, -10%);
    scale: 0.7;
  }
/* Position initiale en mode lanscape (row)  */
  .hexagon-1 {
    transform: translate(-50%, 40%) scale(1);
  }

  .hexagon-2 {
    transform: translate(50%, 40%) scale(1);
  }

  .hexagon-3 {
    transform: translate(0, -65%) scale(1);
  }

  /* Effet hover global via le conteneur parent */
  .container-hexagons:hover .hexagon-3 {
    transform: translate(0, -65%) scale(1.1);
  }

  .container-hexagons:hover .hexagon-1 {
    transform: translate(-55%, 40%) scale(1);
  }

  .container-hexagons:hover .hexagon-2 {
    transform: translate(55%, 40%) scale(1);
  }

  /* Priorité pour les hovers individuels */
  .hexagon-1:hover {
    transform: translate(-50%, 40%) scale(1.1) !important;
  }

  .hexagon-2:hover {
    transform: translate(50%, 40%) scale(1.1) !important;
  }

  .hexagon-3:hover {
    transform: translate(0, -65%) scale(1.1) !important;
  }

  /* Réinitialisation et ajustement des positions pour conserver l'espacement */
  .hexagon-1:hover ~ .hexagon-3 {
    transform: translate(5%, -65%) scale(1) !important; /* Ajuste la position de .hexagon-3 */
  }

  .hexagon-2:hover ~ .hexagon-3 {
    transform: translate(-5%, -65%) scale(1) !important; /* Ajuste la position de .hexagon-3 */
  }

  .hexagon-1:hover ~ .hexagon-2 {
    transform: translate(55%, 40%) scale(1) !important; /* Ajuste la position de .hexagon-2 */
  }

  .hexagon-2:hover ~ .hexagon-1 {
    transform: translate(-55%, 40%) scale(1) !important; /* Ajuste la position de .hexagon-1 */
  }
}

/* Gestion du bouton de retour au menu */
/* Styles pour le conteneur du titre et du bouton */
.col-md-12.col-sm-12.col-xs-12.pt-cv-content-item.pt-cv-1-col {
  overflow: visible;
}
.pt-cv-title-container {
  /* border: 1px solid red; */
  z-index: 10;
  position: sticky;
  top: 25%;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-items: center;
  justify-self: center;
  /* gap: 15px; */
  margin: 0;
}
/* Reset les marges de titre par défaut pour :before */
.services-dispositifs h4.pt-cv-title {
  /* border: 1px solid red; */
  display: flex;
  justify-content: center;
  text-align: start;
  margin: 0;
  padding: 50px 0 25px 0;
}
/* Mise en forme du titre  */
.services-dispositifs h4.pt-cv-title > a {
  /* text-transform: uppercase; */
  font-variant: small-caps;
  font-size: 24px !important;
}

button.back-to-divisions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  border-radius: 30px;
  background: black;
  color: white !important;
  font-family: "Nunito", sans-serif !important;
  font-size: 15px;
  font-weight: 600;
  padding: 5px 30px 5px 30px;
  box-shadow: 1px 5px 10px 2px rgba(0, 0, 0, 0.5);
}

button.back-to-divisions:hover {
  background: black;
  box-shadow: 4px 4px 4px -4px rgba(255, 255, 255, 0.1);
  filter: invert(1);
}

button.back-to-divisions > .svg-wrapper {
  padding-top: 5px;
  animation: 0.5s ease-in-out infinite alternate bounceleft;
}

button.back-to-divisions:hover > .svg-wrapper {
  animation: none;
}

button.back-to-divisions > .svg-wrapper > svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

button.back-to-divisions:hover > .svg-wrapper > svg {
  transform: translateX(-20px);
}
/* Button Icon Animation */
@keyframes bounceleft {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-5px);
  }
}

button.srvc-btn {
  color: white;
  font-size: 15px;
  padding: 2px 10px;
  font-family: "Nunito", sans-serif;
}

button.srvc-btn:hover {
  color: black;
}

/* hauteur section dispositifs  */
#sante,
#logement,
#accueil {
  min-height: calc(100vh - 200px);
}

/* Animations CSS pour transition entre pôles et services */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.services-dispositifs {
  animation-duration: 0.3s;
}

.services-dispositifs.fade-in {
  animation-name: fadeIn;
}

.services-dispositifs.fade-out {
  animation-name: fadeOut;
}

#divisions.fade-out {
  animation-name: fadeOut;
}

#divisions.fade-in {
  animation-name: fadeIn;
}


@media (max-height: 800px) {
  #divisions {
    height: calc(100vh - 140px);
  }
}
