.p-box-epv {
  display: flex;
  flex-direction: column;
  margin: 0 20px;
  padding-bottom: 3vh;
  transition: max-height 0.3s, opacity 0.3s, height 0.3s, min-height 0.3s;
}

.epreuve-toggle {
  display: none;
}

.p-epv-txt {
  font-size: 1.4rem;
  font-weight: 550;
  cursor: pointer;
}

.mini-text-p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 350;
}

.box-epreuve-p {
  padding-top: 2vh;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-items: center;
}

.box-info-p {
  position: absolute;
  display: none;
  background-color: #fff;
  border: 1px solid #ccc;
  padding: 10px;
  min-width: 20vw;
  max-width: 40vw;
  min-height: 5vh;
  right: 28vw;
  animation: fadeIn 0.4s ease-in-out;
  border-radius: 7px;
  border: 1px solid rgb(203, 201, 201);
  box-shadow: 0 0 10px;

  /* Adjust the width as needed for desktop */
}

.box-epreuve-p:hover .box-info-p {
  display: block;
}

.p-epv {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s, opacity 0.3s, height 0.3s, min-height 0.3s;
  display: flex;
  align-items: start;
  flex-direction: column;
}

.epreuve-toggle:checked + .p-epv {
  max-height: 100vh; /* A large enough value */
  opacity: 1;
  height: auto; /* Set height to auto to accommodate varying content */
}

@media (max-width: 768px) {
  .box-epreuve-p {
    margin-left: 2vw;
    display: flex;
    flex-direction: row;
    align-items: center;
    position: relative;
  }
  .box-info-p {
    display: none;
    position: fixed;
    top: 35vh; /* Center vertically */
    left: 50vw; /* Center horizontally */
    transform: translate(-50%, -50%); /* Center the modal */
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 10px;
    animation: fadeIn 0.4s ease-in-out;
    width: 80vw; /* Adjust the width as needed for mobile */
    max-width: 100vw; /* Set a maximum width for smaller screens */
    z-index: 1000; /* Ensure it's above other content */
  }

  /* Add this CSS to your existing stylesheet or in a separate CSS file */
  .box-epreuve-p:focus .box-info-p {
    display: block;
  }

  body:focus .box-info-p {
    display: none;
  }
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 999; /* Ensure it's above other content */
  cursor: pointer;
}

/* Show the overlay when the .box-info-p is displayed */
.box-info-p {
  display: none;
}
.box-info-p:target {
  display: block;
}
.box-info-p:target + .overlay {
  display: block;
}

/* Hide the .box-info-p when clicking the overlay */
.overlay:target + .box-info-p {
  display: none;
}

