/* --- Modale GrapesJS et surcharges Bootstrap --- */
.gjs-mdl-dialog {
  position: fixed !important;
  display: flex !important;
  flex-direction: column !important;
  transform: translate(-50%, -50%) !important;
  left: 50% !important;
  top: 50% !important;
  z-index: 100000 !important;
}
.gjs-mdl-dialog .modal {
  display: block !important;
  position: static !important;
  margin: 0 !important;
  border: none !important;
}
.gjs-mdl-dialog .modal-content {
  position: static !important;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
}
.gjs-mdl-backdrop {
  z-index: 99999 !important;
}

/* --- Styles GrapesJS génériques --- */
.gjs-highlight {
  border: 1px dashed #007bff;
  position: relative;
}
.gjs-highlight:hover {
  background-color: rgba(0, 123, 255, 0.1);
}
.gjs-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  color: #007bff;
  font-weight: bold;
  text-align: center;
  pointer-events: none;
}

/* --- Grille principale (desktop) --- */
.gjs-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  width: 100%;
  gap: 20px;
}
.gjs-cell {
  flex: 1;
  min-width: 0;
}
.gjs-cell img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Responsive mobile : mode colonne --- */
@media (max-width: 768px) {
  .gjs-row {
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box;
    padding: 0 !important;
    margin: 0 !important;
    gap: 20px !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
  }
  .gjs-row > .gjs-cell {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    box-sizing: border-box;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    background: #fff;
    border-radius: 0;
    min-height: 180px;
    aspect-ratio: 1/1;
  }
  .gjs-cell img, .gjs-cell > * {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
  }
}