/* Correctifs d'affichage v2 : vidéos, carrousel et interface mobile. */
.modal-visual .editable-video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  border: 0;
  background: #10162b;
  object-fit: contain;
}

/* Galerie facultative des fiches projet. */
.project-carousel {
  position: absolute;
  z-index: 4;
  inset: 0;
  min-height: 100%;
  overflow: hidden;
  background: #10162b;
}

.project-carousel-slide {
  position: absolute;
  inset: 0;
  display: none;
}

.project-carousel-slide.is-active {
  display: block;
}

.project-carousel-slide img,
.project-carousel-slide video,
.project-carousel-slide iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: contain;
  background: #10162b;
  border: 0;
}

.project-carousel-arrow {
  position: absolute;
  z-index: 2;
  top: 50%;
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  color: #1b203e;
  font-size: 1.2rem;
  cursor: pointer;
  background: #fff;
  border: 0;
  place-items: center;
  transform: translateY(-50%);
  transition:
    color 180ms ease,
    background-color 180ms ease,
    transform 180ms ease;
}

.project-carousel-arrow:hover {
  color: #fff;
  background: #1b203e;
  transform: translateY(-50%) scale(1.06);
}

.project-carousel-arrow.is-previous {
  left: 14px;
}

.project-carousel-arrow.is-next {
  right: 14px;
}

.modal-visual .project-carousel-counter {
  position: absolute;
  z-index: 5;
  top: auto;
  right: auto;
  bottom: 16px;
  left: 50%;
  display: block;
  padding: 7px 10px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  background: rgb(16 22 43 / 82%);
  border: 1px solid rgb(255 255 255 / 20%);
  transform: translateX(-50%);
}

.project-detail-link {
  margin-top: 30px;
}

@media (max-width: 680px) {
  .project-modal .modal-close {
    display: none;
  }

  .mobile-project-close {
    position: fixed;
    z-index: 1000;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 12px;
    display: grid;
    width: 50px;
    height: 50px;
    padding: 0;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    background: #1b203e;
    border: 1px solid rgb(255 255 255 / 35%);
    box-shadow: 0 8px 24px rgb(7 11 24 / 38%);
    place-items: center;
  }

  .modal-visual .editable-video {
    min-height: 230px;
    aspect-ratio: 16 / 9;
  }

  .project-carousel {
    min-height: 260px;
  }

  .project-carousel-arrow {
    width: 42px;
    height: 42px;
  }
}

@media (min-width: 681px) {
  .mobile-project-close {
    display: none;
  }
}

/* Survol discret des filtres du portfolio. */
.filters button {
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.filters button:not(.is-active):hover {
  color: #1b203e;
  background: #eef0f6;
  border-color: #8f96ad;
  transform: translateY(-2px);
}

.filters button.is-active:hover {
  background: #30375c;
  border-color: #30375c;
}

/* Les outils sont des informations, pas des boutons : liste simple et lisible. */
.tool-cloud {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
}

.tool-cloud span {
  position: relative;
  padding: 12px 0 12px 17px;
  font-size: 0.84rem;
  font-weight: 600;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #d8dbe5;
}

.tool-cloud span::before {
  position: absolute;
  top: 50%;
  left: 0;
  width: 7px;
  height: 2px;
  content: "";
  background: #1b203e;
  transform: translateY(-50%);
}

@media (max-width: 680px) {
  .tool-cloud {
    grid-template-columns: 1fr;
  }
}

/* Pagination légère du portfolio : cinq projets maximum par page. */
.portfolio-pagination {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 34px;
}

.portfolio-pagination button {
  min-height: 44px;
  padding: 9px 15px;
  color: #fff;
  font-family: Archivo, Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  background: #1b203e;
  border: 1px solid #1b203e;
}

.portfolio-pagination button:disabled {
  color: #757b90;
  cursor: default;
  background: transparent;
  border-color: #cdd2df;
}

.portfolio-pagination span {
  color: #4c5573;
  font-size: 0.78rem;
  font-weight: 700;
}

@media (max-width: 680px) {
  .portfolio-pagination {
    justify-content: space-between;
    gap: 8px;
  }

  .portfolio-pagination button {
    padding-inline: 11px;
  }
}
