
.dropdown {
  background: rgba(2, 8, 16, 0.99);
}

.navbar {
  background-color: #000;
}

.nav-btn {
  background-color: rgb(62, 62, 62);
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  pointer-events: none;
  z-index: 2;
  -webkit-mask-image: radial-gradient(
    circle 80px at 0% 50%,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 1) 100%
  );
  mask-image: radial-gradient(
    circle 80px at 0% 50%,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 1) 100%
  );
  -moz-mask-image: radial-gradient(
    circle 80px at 0% 50%,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 1) 100%
  );
}

@keyframes fadeIn {
  from {
    opacity: 0;
    -webkit-transform: translateY(-20px);
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }
}

.scroll-progress-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  width: 200px;
  height: 5px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  z-index: 100;
}

.scroll-progress-bar {
  height: 100%;
  width: 0%;
  background-color: #fff;
  border-radius: 10px;
  -webkit-transition: width 0.2s ease-out;
  transition: width 0.2s ease-out;
}

body {
  margin: 0;
  padding: 0;
  font-family: "Poppins", sans-serif;
  background-color: #000;
  color: white;
  overflow-x: hidden;
  /* Correction pour la compatibilité des polices */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.headerACS {
  position: relative;
  width: 100%;
  height: 100vh;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  background-color: #000;
  animation: none;
  text-align: center;
  z-index: 30;
}

.header-content {
  position: relative;
  z-index: 100;
}

.headerACS h1 {
  margin-top: 100px;
  font-size: 3rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  -webkit-animation: fadeIn 2s ease-in-out;
  animation: fadeIn 2s ease-in-out;
  z-index: 1000;
}

p {
  font-size: 1.2rem;
  opacity: 0.8;
  /* Correction pour la compatibilité de l'opacité */
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
  filter: alpha(opacity=80);
}

.panel-container {
  position: relative;
  display: inline-block;
}

.Pannel {
  width: 800px;
  max-width: 100%;
  opacity: 1; 
  height: auto;
  display: block;
  position: relative;
  z-index: 1; 
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

.scroll-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  -webkit-transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
  transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
  z-index: 10;
}

.scroll-text {
  font-size: 2rem;
  text-align: center;
  color: rgb(0, 0, 0);
  max-width: 80%;
  -webkit-transition: opacity 1s ease-in-out;
  transition: opacity 1s ease-in-out;
}

.presentationACS {
  position: relative;
  margin: 150px 0;
  height: auto;
  text-align: justify;
  color: white;
  z-index: 300;
  opacity: 1;
  visibility: visible;
  -webkit-transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.presentationACS h1 {
  position: relative;
  margin-bottom: 20px;
  font-size: 2.4rem;
  color: rgb(255, 255, 255);
  opacity: 0.8;
  -webkit-transition: opacity 1s ease-in-out;
  transition: opacity 1s ease-in-out;
}

.presentationACS p {
  font-size: 1.5rem;
  color: rgb(255, 255, 255);
  opacity: 0.8;
  justify-content: center;
  text-align: justify;
  -webkit-transition: opacity 1s ease-in-out;
  transition: opacity 1s ease-in-out;
}

.scroll-presentation {
  text-align: center;
  max-width: 100%;
  -webkit-transition: opacity 1s ease-in-out;
  transition: opacity 1s ease-in-out;
}

.background-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  -o-object-fit: cover;
  object-fit: cover;
  pointer-events: none;
  z-index: -10;
}

.fixed-panel-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  -webkit-transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
  transition: opacity 1s ease-in-out, visibility 1s ease-in-out;
  z-index: 20;
  pointer-events: none;
}

.post-scroll-image {
  margin-top: 0px;
  width: 100%;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  height: 100%;
  z-index: -1;
}

.new-page-section {
  position: relative;
  min-height: 100vh;
  background-color: #111;
  z-index: 30;
  margin-top: 50vh;
  padding: 0px 0px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  text-align: center;
}

.new-page-content {
  position: relative;
  margin: 150px auto;
  width: 60%;
  height: auto;
  text-align: justify;
  color: white;
  z-index: 300;
  opacity: 1;
  visibility: visible;
  -webkit-transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.spacer {
  height: 100vh;
  width: 100%;
}

.partenaires_principaux img {
  width: 100%;
  max-width: 200px;
  height: 200px;
  -o-object-fit: contain;
  object-fit: contain;
  border-radius: 15px;
  background-color: transparent;
  padding: 5px;
  -ms-interpolation-mode: bicubic;
}

.partenaires_secondaires img {
  width: 100%;
  max-width: 150px;
  height: 150px;
  -o-object-fit: contain;
  object-fit: contain;
  border-radius: 15px;
  background-color: transparent;
  padding: 5px;
  -ms-interpolation-mode: bicubic;
}

.new-page-content p {
  position: relative;
  height: auto;
  text-align: left;
  color: white;
  z-index: 300;
  font-size: 1.5rem;
  opacity: 1;
  visibility: visible;
  -webkit-transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.new-page-content h1 {
  position: relative;
  margin-bottom: 20px;
  font-size: 2.4rem;
  color: rgb(255, 255, 255);
  opacity: 0.8;
  -webkit-transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
  transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

.Parteners {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}

.Parteners_secondaires {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  gap: 20px;
  padding: 20px;
}

.Historique {
  position: relative;
  min-height: 20vh;
  background-color: #f0eded;
  z-index: 40;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  text-align: center;
}

.Historique-content {
  position: relative;
  margin: 150px auto;
  width: 60%;
  opacity: 0;
  -webkit-transform: translateY(50px);
  transform: translateY(50px);
  -webkit-transition: opacity 1.5s ease-out, -webkit-transform 1.5s ease-out;
  transition: opacity 1.5s ease-out, -webkit-transform 1.5s ease-out;
  transition: opacity 1.5s ease-out, transform 1.5s ease-out;
  transition: opacity 1.5s ease-out, transform 1.5s ease-out,
    -webkit-transform 1.5s ease-out;
}

.Histo-Article {
  border-left: 5px solid black;
  padding-left: 40px;
}

.Article {
  margin-top: 10px;
  text-align: left;
  color: black;
}

.Historique h1 {
  text-align: left;
  font-size: 2.4rem;
  margin-bottom: 50px;
  color: black;
}

.Historique h2 {
  font-size: 2rem;
  margin-top: 50px;
  color: black;
}

.Histo-Article p {
  font-size: 1.5rem;
  text-align: left;
}

.Gallerie {
  position: relative;
  min-height: 100vh;
  background-color: #111;
  z-index: 50;
  padding: 0px 0px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  text-align: center;
}

.Gallerie h1 {
  position: relative;
  font-size: 2.4rem;
  padding: 0px 0px;
  margin-top: 150px;
  margin-bottom: 150px;
  color: white;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 800px;
  margin: 30px auto;
  padding: 0 20px;
}

.photo-item {
  overflow: hidden;
  border-radius: 10px;
  -webkit-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  background-color: #222;
  position: relative;
  aspect-ratio: 4/3;
}

.gallery-img {
  width: 100%;
  height: 100%;
  -o-object-fit: cover;
  object-fit: cover;
  -webkit-transition: -webkit-transform 0.5s ease;
  transition: -webkit-transform 0.5s ease;
  transition: transform 0.5s ease;
  transition: transform 0.5s ease, -webkit-transform 0.5s ease;
  cursor: pointer;
}

.gallery-img:hover {
  -webkit-transform: scale(1.05);
  transform: scale(1.05);
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
  -webkit-transition: opacity 0.3s ease;
  transition: opacity 0.3s ease;
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 80%;
  max-height: 80vh;
}

.caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  height: 150px;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  -webkit-transition: 0.3s;
  transition: 0.3s;
  cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
  color: #bbb;
  text-decoration: none;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 800px;
  margin: 30px auto;
  padding: 0 20px;
}

.photo-item {
  overflow: hidden;
  border-radius: 10px;
  -webkit-box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  background-color: #222;
  position: relative;
  aspect-ratio: 4/3;
}

.photo-item.hidden {
  display: none;
}

.toggle-button {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #333;
  color: white;
  font-size: 24px;
  margin: 20px auto;
  cursor: pointer;
  -webkit-transition: background-color 0.3s ease;
  transition: background-color 0.3s ease;
  border: none;
  outline: none;
}

.toggle-button:hover {
  background-color: #555;
}

.toggle-button.plus {
  display: block;
}

.logoACS {
  position: relative;
  display: block;
  height: auto;
  width: 20%;
  margin: 0 auto;
}

#orientation-message {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  color: white;
  z-index: 2000;
  text-align: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  font-family: "Poppins", sans-serif;
}

#orientation-message img {
  width: 50px;
  height: auto;
  margin-bottom: 20px;
  -webkit-animation: rotate 2s infinite;
  animation: rotate 2s infinite;
}

@-webkit-keyframes rotate {
  0% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  25% {
    -webkit-transform: rotate(90deg);
    transform: rotate(90deg);
  }
  50% {
    -webkit-transform: rotate(90deg);
    transform: rotate(90deg);
  }
  75% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
}

@keyframes rotate {
  0% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  25% {
    -webkit-transform: rotate(90deg);
    transform: rotate(90deg);
  }
  50% {
    -webkit-transform: rotate(90deg);
    transform: rotate(90deg);
  }
  75% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  100% {
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
}

#orientation-message p {
  margin: 10px 20px;
  line-height: 1.5;
}

@media only screen and (max-width: 480px) {
  .photo-grid {
    -ms-grid-columns: 1fr;
    grid-template-columns: 1fr;
  }
}

@-webkit-keyframes modalOpen {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.footer {
  background-color: rgb(13, 13, 13);
  z-index: 10000;
  text-align: left;
}

.nav-links {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

@supports (display: grid) {
  .photo-grid {
    display: grid;
  }
}

@supports not (display: grid) {
  .photo-grid {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
  }
  .photo-item {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 calc(25% - 15px);
    flex: 0 0 calc(25% - 15px);
  }
}

@supports not (aspect-ratio: 4/3) {
  .photo-item::before {
    content: "";
    display: block;
    padding-top: 75%; 
  }
  .gallery-img {
    position: absolute;
    top: 0;
    left: 0;
  }
}

@supports not (object-fit: cover) {
  .gallery-img {
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
  }
}

@media only screen and (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  .navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 1000;
  }

  .nav-links {
    display: none;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    background-color: rgba(21, 21, 21, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    position: absolute;
    top: 60px;
    right: 10%;
    width: 80%;
    border-radius: 8px;
    padding: 10px;
  }

  .headerACS h1 {
    font-size: 1.8rem;
    padding: 0 15px;
    margin-top: 10px;
    display: block;
    text-align: center;
    white-space: normal !important;
    word-spacing: normal;
  }

  .Pannel {
    width: 90%;
    height: auto;
  }

  .panel-container {
    width: 100%;
  }

  .presentationACS p {
    font-size: 1.2rem;
  }

  .scroll-text {
    font-size: 1.2rem;
    max-width: 95%;
  }

  .post-scroll-image {
    height: 100%;
    width: auto;
  }

  .new-page-content {
    width: 90%;
    padding: 0 10px;
  }

  .new-page-content p {
    font-size: 1.2rem;
  }

  .new-page-content h1 {
    font-size: 2rem;
  }

  .partenaires_principaux {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: center;
    gap: 10px;
  }
  .partenaires_principaux img {
    width: 100%;
    max-width: 100px;
    height: 100px;
    -o-object-fit: contain;
    object-fit: contain;
    border-radius: 15px;
    cursor: pointer;
    background-color: transparent;
    padding: 5px;
    flex: 0 0 auto;
  }

 

  .partenaires_secondaires img {
    width: 100%;
    max-width: 100px;
    height: 100px;
    -o-object-fit: contain;
    object-fit: contain;
    border-radius: 15px;
    cursor: pointer;
    background-color: transparent;
    padding: 5px;
  }

  .photo-grid {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: nowrap;
    flex-wrap: nowrap;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    margin: 20px auto;
    padding: 0;
    gap: 0;
  }

  .photo-item {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 80%;
    flex: 0 0 80%;
    width: 100%;
    -webkit-transition: -webkit-transform 0.5s ease;
    transition: -webkit-transform 0.5s ease;
    transition: transform 0.5s ease;
    transition: transform 0.5s ease, -webkit-transform 0.5s ease;
    aspect-ratio: 1/1;
    position: relative;
    scroll-snap-align: center;
    display: block !important;
  }

  .photo-item.hidden {
    display: block !important;
  }

  .toggle-button {
    display: none;
    opacity: 0;
  }

  .carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
  }

  .carousel-track {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-transition: -webkit-transform 0.5s ease-out;
    transition: -webkit-transform 0.5s ease-out;
    transition: transform 0.5s ease-out;
    transition: transform 0.5s ease-out, -webkit-transform 0.5s ease-out;
  }

  .carousel-item {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 100%;
    flex: 0 0 100%;
    width: 100%;
  }

  .Gallerie h1 {
    margin-bottom: 30px;
  }

  .Historique-content {
    width: 90%;
    margin: 100px auto;
  }

  .Historique h1 {
    font-size: 2.4rem;
    margin-left: 45px;
  }

  .Historique h2 {
    font-size: 1.5rem;
  }

  .Histo-Article {
    margin-left: 40px;
  }

  .Article {
    margin-left: 20px;
    margin-right: 20px;
  }

  .Article p {
    font-size: 1.5rem;
    margin: 10px 0;
  }

  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .modal-content {
    max-width: 95%;
  }

  

  .scroll-progress-container {
    width: 150px;
  }

  

  .presentationACS h1 {
    font-size: 2rem;
  }
}

@media only screen and (max-width: 480px) {
  .headerACS h1 {
    font-size: 1.5rem;
    margin-top: 50px;
  }

  

  .Pannel {
    width: 95%;
  }

  .new-page-content {
    margin: 100px auto;
  }

  .new-page-content p {
    font-size: 1rem;
    line-height: 1.4;
  }

  .partenaires_principaux img {
    max-width: 90px;
    height: 90px;
  }

  .partenaires_secondaires img {
    max-width: 70px;
    height: 70px;
  }

  .Histo-Article {
    margin-left: 20px;
    border-left: 3px solid black;
  }

  .Article {
    margin-left: 15px;
    margin-right: 15px;
  }

  .Article p {
    font-size: 1rem;
  }

  .photo-grid {
    -ms-grid-columns: 1fr;
    grid-template-columns: 1fr;
  }

  .Historique {
    min-height: auto;
    padding-bottom: 50px;
  }

  .Gallerie h1 {
    margin-top: 80px;
    font-size: 1.8rem;
  }

  .toggle-button {
    width: 40px;
    height: 40px;
  }
}

@media only screen and (max-width: 385px) {
  .presentationACS h1 {
    white-space: normal !important;
    word-spacing: normal !important;
    letter-spacing: 1px;
    text-align: left;
  }
}

@supports (-webkit-appearance: none) {
  .Pannel {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  .gallery-img {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}

/* Corrections pour Firefox */
@-moz-document url-prefix() {
  .photo-grid {
    display: -moz-grid;
  }

  .Pannel {
    -moz-transform: translateZ(0);
    transform: translateZ(0);
  }
}

/* Corrections pour Internet Explorer */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
  .photo-grid {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
  }

  .photo-item {
    -ms-flex: 0 0 calc(25% - 15px);
    flex: 0 0 calc(25% - 15px);
    margin-bottom: 20px;
  }

  .Pannel {
    filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100);
  }

  /* Fallback pour les propriétés non supportées */
  .partenaires_principaux img,
  .partenaires_secondaires img,
  .gallery-img,
  .background-video {
    -ms-interpolation-mode: bicubic;
  }
}

/* Corrections pour Safari */
@supports (-webkit-marquee-repetition: infinite) {
  .background-video {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }

  .Pannel {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
  }
}

/* ========================================
   MEDIA QUERIES POUR TABLETTES EN MODE PORTRAIT
   ======================================== */

/* Tablettes en mode portrait (768px à 1024px) */
@media only screen and (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
  /* Navigation adaptée */
  .navbar {
    height: 70px;
    padding: 0 20px;
  }

  .nav-links {
    gap: 15px;
  }

  /* Header principal */
  .headerACS h1 {
    font-size: 2.5rem;
    margin-top: 80px;
    padding: 0 30px;
  }

  .headerACS p {
    font-size: 1.3rem;
    padding: 0 40px;
  }

  /* Panneau principal */
  .Pannel {
    width: 85%;
    max-width: 600px;
  }

  .panel-container {
    width: 100%;
    display: flex;
    justify-content: center;
  }

  /* Section présentation */
  .presentationACS {
    margin: 120px auto;
    max-width: 700px;
  }

  .presentationACS h1 {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 30px;
  }

  .presentationACS p {
    font-size: 1.3rem;
    line-height: 1.6;
    text-align: left;
  }

  /* Texte de défilement */
  .scroll-text {
    font-size: 1.5rem;
    max-width: 85%;
    line-height: 1.5;
  }

  /* Nouvelle page de contenu */
  .new-page-content {
    width: 80%;
    max-width: 700px;
    margin: 120px auto;
  }

  .new-page-content h1 {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 40px;
  }

  .new-page-content p {
    font-size: 1.3rem;
    line-height: 1.6;
    text-align: left;
  }

  /* Section partenaires */
  .Parteners {
    gap: 25px;
    padding: 30px 20px;
    justify-content: center;
  }

  

  .Parteners_secondaires {
    gap: 20px;
    padding: 25px 20px;
    justify-content: center;
  }

  .partenaires_principaux img {
    width: 100%;
    max-width: 160px;
    height: 160px;
    object-fit: contain;
    border-radius: 12px;
    padding: 8px;
  }

  .partenaires_secondaires img {
    width: 100%;
    max-width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 10px;
    padding: 6px;
  }

  /* Section historique */
  .Historique-content {
    width: 85%;
    max-width: 700px;
    margin: 120px auto;
  }

  .Historique h1 {
    font-size: 2.2rem;
    margin-bottom: 40px;
    text-align: center;
  }

  .Historique h2 {
    font-size: 1.8rem;
    margin-top: 40px;
    margin-bottom: 20px;
  }

  .Histo-Article {
    border-left: 4px solid black;
    padding-left: 30px;
    margin-bottom: 30px;
  }

  .Article {
    margin: 15px 0;
  }

  .Article p {
    font-size: 1.3rem;
    line-height: 1.5;
    margin: 12px 0;
  }

  /* Galerie photo */
  .Gallerie h1 {
    font-size: 2.2rem;
    margin-top: 120px;
    margin-bottom: 60px;
  }

  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 700px;
    margin: 40px auto;
    padding: 0 30px;
  }

  .photo-item {
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
  }

  .gallery-img:hover {
    transform: scale(1.03);
  }

  /* Modal pour les images */
  .modal-content {
    max-width: 85%;
    max-height: 75vh;
  }

  .caption {
    width: 85%;
    font-size: 1.1rem;
    padding: 15px 0;
  }

  .close-btn {
    font-size: 35px;
    top: 20px;
    right: 30px;
  }

  /* Bouton toggle */
  .toggle-button {
    width: 45px;
    height: 45px;
    font-size: 20px;
    margin: 25px auto;
  }

  

  /* Barre de progression */
  .scroll-progress-container {
    width: 180px;
    bottom: 25px;
  }

  /* Espacements généraux */
  .spacer {
    height: 80vh;
  }

  /* Message d'orientation (caché en mode portrait) */
  #orientation-message {
    display: none !important;
  }
}

/* Tablettes plus grandes en mode portrait (1025px à 1366px) */
@media only screen and (min-width: 1025px) and (max-width: 1366px) and (orientation: portrait) {
  .headerACS h1 {
    font-size: 2.8rem;
    margin-top: 100px;
  }

  .Pannel {
    width: 70%;
    max-width: 700px;
  }

  .fixed-panel-section {
    width: 160%;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
    align-items: center;
    justify-content: center;
  }

  .presentationACS {
    max-width: 800px;
  }

  .new-page-content {
    width: 80%;
    max-width: 800px;
  }

  .photo-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 900px;
  }

  .Historique-content {
    width: 75%;
    max-width: 800px;
  }

  .partenaires_principaux img {
    max-width: 180px;
    height: 180px;
  }

  .partenaires_secondaires img {
    max-width: 140px;
    height: 140px;
  }
}

/* Corrections spécifiques pour iPad et tablettes similaires */
@media only screen and (device-width: 768px) and (device-height: 1024px) and (orientation: portrait) {
  .headerACS h1 {
    font-size: 2.4rem;
    letter-spacing: 2px;
  }

  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .scroll-text {
    font-size: 1.4rem;
  }
}

/* Support pour les tablettes Android */
@media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (orientation: portrait) {
  /* Optimisations spécifiques Android */
  .background-video {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }

  .gallery-img {
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }

  /* Touch optimizations */
  .gallery-img,
  .toggle-button,
  .close-btn {
    touch-action: manipulation;
  }
}

/* Corrections pour les tablettes avec des DPR élevés */
@media only screen and (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) and (-webkit-min-device-pixel-ratio: 2) {
  .partenaires_principaux img,
  .partenaires_secondaires img,
  .gallery-img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Améliorations pour l'accessibilité sur tablettes */
@media only screen and (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
  /* Zones tactiles plus grandes */
  .close-btn {
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
  }

  .toggle-button {
    min-width: 44px;
    min-height: 44px;
  }

  /* Amélioration du contraste pour les petits textes */
  .caption {
    color: #e0e0e0;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 8px;
  }
}

/* Gestion des tablettes en mode portrait avec clavier virtuel ouvert */
@media only screen and (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) and (max-height: 600px) {
  .modal {
    padding-top: 20px;
  }

  .modal-content {
    max-height: 60vh;
  }

  .headerACS h1 {
    font-size: 2rem;
    margin-top: 60px;
  }
}
