/**
 * Content Block 2 Section - Dioqa UI Kit
 * Layout avec 3 images en 2 colonnes (Bootstrap Grid)
 *
 * @package Dioqa_UI_Kit
 */

/* fb-7552863: reduce excess vertical space */
.content-section-2.bg-white {
  padding-top: 60px;
  padding-bottom: 60px;
}

/* Backgrounds colors */
.content-section-2.bg-white {
  background-color: #ffffff;
}

.content-section-2.bg-gray-light {
  background-color: var(--bs-gray-light);
}

.content-section-2.bg-primary {
  background-color: var(--bs-primary);
}

.content-section-2.bg-primary .content-title,
.content-section-2.bg-primary .content-title h1,
.content-section-2.bg-primary .content-title h2,
.content-section-2.bg-primary .content-title h3,
.content-section-2.bg-primary .content-title h4,
.content-section-2.bg-primary .content-description p {
  color: #ffffff;
}

.content-section-2.bg-secondary {
  background-color: var(--bs-secondary);
}

.content-section-2.bg-secondary .content-title,
.content-section-2.bg-secondary .content-title h1,
.content-section-2.bg-secondary .content-title h2,
.content-section-2.bg-secondary .content-title h3,
.content-section-2.bg-secondary .content-title h4,
.content-section-2.bg-secondary .content-description p {
  color: var(--bs-primary);
}

/* Container des images */
.content-2-image {
  overflow: hidden;
  position: relative;
}

.content-2-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--img-radius, var(--radius-lg));
}

/* Desktop : split des colonnes principales */
@media (min-width: 1025px) {
  .content-section-2 .col-12.col-lg-6:first-child {
    flex: 0 0 auto;
    width: 45%;
  }

  .content-section-2 .col-12.col-lg-6:last-child {
    flex: 0 0 auto;
    width: 55%;
  }

  /* Images à DROITE (défaut) : Image 1+2 à gauche, Image 3 à droite */
  .content-section-2 .images-right .col-7 {
    align-items: flex-end;
  }

  /* Images à GAUCHE (inversé) : Image 3 à gauche, Image 1+2 à droite */
  .content-section-2 .images-left {
    flex-direction: row-reverse;
  }

  .content-section-2 .images-left .col-7 {
    align-items: flex-start;
  }
}

/* Desktop intermédiaire (1025px–1400px) : bento responsive sans px fixes */
@media (min-width: 1025px) and (max-width: 1400px) {
  .content-section-2 .content-2-images-row {
    align-items: stretch;
  }

  .content-section-2 .content-2-images-row .col-7 {
    flex: 0 0 auto;
    width: 58.333%;
  }

  .content-section-2 .content-2-images-row .col-5 {
    flex: 0 0 auto;
    display: flex;
    align-items: stretch;
  }

  .content-2-image-1,
  .content-2-image-2 {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .content-2-image-3 {
    flex: 1;
    width: 100%;
    height: auto;
    min-height: 200px;
  }
}

/* Grand desktop (1401px+) : dimensions fixes d'origine */
@media (min-width: 1401px) {
  .content-section-2 .content-2-images-row .col-7 {
    flex: 0 0 auto;
    width: 290px;
  }

  .content-section-2 .content-2-images-row .col-5 {
    flex: 0 0 auto;
    width: 210px;
  }

  .content-2-image-1 {
    width: 210px;
    height: 210px;
  }

  .content-2-image-2 {
    width: 290px;
    height: 290px;
  }

  .content-2-image-3 {
    width: 210px;
    height: 350px;
  }
}

/* Typography - identique à content-1 */
.content-title h1,
.content-title h2,
.content-title h3,
.content-title h4 {
  color: var(--bs-gray-dark);
  font-family: var(--font-heading);
  font-size: var(--display-md);
  font-weight: 600;
  line-height: normal;
  margin-bottom: 0;
}

.content-description p {
  color: var(--bs-gray-medium);
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 0;
}

/* Responsive - Mobile & Tablette */
@media (max-width: 1024px) {
  .content-title h1,
  .content-title h2,
  .content-title h3,
  .content-title h4 {
    font-size: var(--display-2sm);
  }

  /* Espacement bouton → images */
  .content-section-2 .content-button {
    margin-bottom: 2.5rem;
  }

  /* Espacement entre le contenu et les images */
  .content-section-2 .col-lg-7.mb-4 {
    margin-top: 2rem;
  }

  /* Cacher image 1 et 3 en mobile */
  .content-2-image-1,
  .content-2-image-3 {
    display: none;
  }

  /* Sur mobile, l'image 2 a un ratio 16/9 */
  .content-2-image-2 {
    aspect-ratio: 16 / 9;
  }

  /* Container image 2 prend toute la largeur */
  .content-section-2 .content-2-images-row .col-7 {
    width: 100%;
  }

}

/* Mobile paysage : supprimer la marge basse de la colonne images */
@media (max-width: 1024px) and (orientation: landscape) {
  .content-section-2 .col-lg-6.mb-4 {
    margin-bottom: 0 !important;
  }
}

/* Tablette : layout bento avec les 3 images */
@media (min-width: 768px) and (max-width: 1024px) {
  /* Afficher les images 1 et 3 */
  .content-2-image-1,
  .content-2-image-3 {
    display: block;
  }

  /* Reset col-7 à sa largeur Bootstrap */
  .content-section-2 .content-2-images-row .col-7 {
    width: 58.333%;
  }

  /* Stretch pour que image-3 remplisse la hauteur */
  .content-section-2 .content-2-images-row {
    align-items: stretch;
  }

  .content-section-2 .content-2-images-row .col-5 {
    display: flex;
    align-items: stretch;
  }

  /* Images 1 et 2 en ratio 4/3 */
  .content-2-image-1,
  .content-2-image-2 {
    aspect-ratio: 4 / 3;
    width: 100%;
    height: auto;
  }

  /* Image 3 : portrait, remplit toute la hauteur de la colonne */
  .content-2-image-3 {
    flex: 1;
    width: 100%;
    min-height: 200px;
    height: auto;
  }
}

/* Mobile : image avant le texte */
@media (max-width: 767.98px) {
  .content-section-2 .row > .col-12:has(.content-2-images-row) {
    order: 1 !important;
  }

  .content-section-2 .row > .col-12:has(.content-text) {
    order: 2 !important;
  }
}
