/* Keep the original cover frame; natural proportions apply to the gallery only. */
html body main[data-kitemi-project-page] .projet-cover .cover {
  background-image: none !important;
}

/* The existing ::before sets the original responsive cover height. */
html body main[data-kitemi-project-page] .projet-cover img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center;
}

html body main[data-kitemi-project-page] .contenu-images img {
  display: block;
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
}

html body main[data-kitemi-project-page] .project-gallery-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  margin-bottom: 40px;
}

html body main[data-kitemi-project-page] .project-gallery-row.is-pair {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

html body main.projet.internal[data-kitemi-project-page] .projet-description .left .contenu-images .project-gallery-row img {
  min-width: 0;
  margin-bottom: 0 !important;
}

html body main[data-kitemi-project-page] .project-gallery-row:last-child {
  margin-bottom: 0;
}

@media (max-width: 1023.98px) {
  html body main[data-kitemi-project-page] .project-gallery-row.is-pair {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  html body main[data-kitemi-project-page] .project-gallery-row {
    margin-bottom: 48px;
  }
}

@media (max-width: 767.98px) {
  html body main[data-kitemi-project-page] .project-gallery-row.is-pair {
    gap: 40px;
  }

  html body main[data-kitemi-project-page] .project-gallery-row {
    margin-bottom: 40px;
  }
}
