/**
 * Content Block 9 Section - Dioqa UI Kit
 * Layout avec image et carrés décoratifs + contenu texte
 *
 * @package Dioqa_UI_Kit
 */

/* Background Colors */
.content-section-9.bg-white {
  background-color: #ffffff;
}

.content-section-9.bg-gray-light {
  background-color: var(--bs-gray-light);
}

.content-section-9.bg-primary {
  background-color: var(--bs-primary);
}

.content-section-9.bg-primary .content-9-title,
.content-section-9.bg-primary .content-9-title h1,
.content-section-9.bg-primary .content-9-title h2,
.content-section-9.bg-primary .content-9-title h3,
.content-section-9.bg-primary .content-9-title h4,
.content-section-9.bg-primary .content-9-description p {
  color: #ffffff;
}

.content-section-9.bg-secondary {
  background-color: var(--bs-secondary);
}

.content-section-9.bg-secondary .content-9-title,
.content-section-9.bg-secondary .content-9-title h1,
.content-section-9.bg-secondary .content-9-title h2,
.content-section-9.bg-secondary .content-9-title h3,
.content-section-9.bg-secondary .content-9-title h4,
.content-section-9.bg-secondary .content-9-description p {
  color: var(--bs-primary);
}

/* ===============================================
   DESKTOP LAYOUT (min-width: 992px)
   =============================================== */

@media (min-width: 992px) {
  /* Section avec overflow hidden pour gérer le débordement */
  .content-section-9 {
    overflow: hidden;
  }

  /* Wrapper principal : display flex */
  .content-9-wrapper {
    display: flex;
    align-items: stretch; /* Les éléments prennent toute la hauteur */
    gap: 8.333333%; /* 1 col offset entre image et texte */
  }

  /* Partie texte - col-5 */
  .content-9-text {
    padding: 100px 0;
    flex-shrink: 0;
    width: 41.666667%; /* col-5 */
    display: flex;
    align-items: center;
  }

  /* Image à droite : offset à gauche du texte, texte col-5 */
  .content-9-wrapper:not(.flex-row-reverse) .content-9-text {
    margin-left: 8.333333%; /* 1 col offset */
    width: 41.666667%; /* col-5 */
  }

  /* Image à gauche : offset à droite du texte, texte col-5 */
  .content-9-wrapper.flex-row-reverse .content-9-text {
    margin-right: 8.333333%; /* 1 col offset */
    width: 41.666667%; /* col-5 */
  }

  .content-9-content {
    max-width: 100%;
    width: 80%;
  }

  /* Partie image - col-5 + déborde jusqu'au bord */
  .content-9-image-side {
    /* flex-shrink retiré pour permettre à l'image de s'afficher en entier */
  }

  /* Image à droite : déborde vers la droite */
  .content-9-wrapper:not(.flex-row-reverse) .content-9-image-side {
    width: calc(41.666667% + 8.333333%);
  }

  /* Image à gauche : déborde vers la gauche */
  .content-9-wrapper.flex-row-reverse .content-9-image-side {
    width: calc(41.666667% + 8.333333%);
  }

  /* Image Wrapper avec position relative pour les carrés décoratifs */
  .content-9-image-wrapper {
    position: relative;
    overflow: visible;
    width: 100%;
    height: 100%; /* Prend toute la hauteur du parent (image-side) */
    min-height: 400px;
    display: flex;
    align-items: flex-end; /* Image collée en bas */
    justify-content: center;
  }

  .content-9-image {
    max-width: 100%; /* Au lieu de width: 100% */
    max-height: 650px;
    width: auto; /* Laisse l'image prendre sa largeur naturelle */
    height: auto;
    object-fit: contain; /* Affiche l'image complète */
    border-radius: var(--img-radius, var(--radius-lg));
    display: block;
  }
}

/* Carrés décoratifs - toujours vers l'intérieur de la page */
.content-9-decorative-squares {
  position: absolute;
  bottom: 0;
  width: 80px;
  height: 160px;
  pointer-events: none;
}

/* Image à droite : carrés à gauche (vers le centre) */
.content-9-wrapper:not(.flex-row-reverse) .content-9-decorative-squares {
  left: 0;
}

/* Image à gauche : carrés à droite (vers le centre) */
.content-9-wrapper.flex-row-reverse .content-9-decorative-squares {
  right: 0;
}

.content-9-decorative-squares .square {
  position: absolute;
  width: 40px;
  height: 40px;
  background-color: #ffffff;
  display: block;
}

/* Positionnement des 4 carrés - Image à droite (carrés à gauche) */
.content-9-wrapper:not(.flex-row-reverse)
  .content-9-decorative-squares
  .square-1 {
  bottom: 120px;
  left: 40px;
}

.content-9-wrapper:not(.flex-row-reverse)
  .content-9-decorative-squares
  .square-2 {
  bottom: 80px;
  left: 0;
}

.content-9-wrapper:not(.flex-row-reverse)
  .content-9-decorative-squares
  .square-3 {
  bottom: 40px;
  left: 40px;
}

.content-9-wrapper:not(.flex-row-reverse)
  .content-9-decorative-squares
  .square-4 {
  bottom: 0;
  left: 0;
}

/* Positionnement des 4 carrés - Image à gauche (carrés à droite) */
.content-9-wrapper.flex-row-reverse .content-9-decorative-squares .square-1 {
  bottom: 120px;
  right: 40px;
}

.content-9-wrapper.flex-row-reverse .content-9-decorative-squares .square-2 {
  bottom: 80px;
  right: 0;
}

.content-9-wrapper.flex-row-reverse .content-9-decorative-squares .square-3 {
  bottom: 40px;
  right: 40px;
}

.content-9-wrapper.flex-row-reverse .content-9-decorative-squares .square-4 {
  bottom: 0;
  right: 0;
}

/* Titre */
.content-9-title h1,
.content-9-title h2,
.content-9-title h3,
.content-9-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-9-title p {
  color: var(--bs-gray-dark);
  font-family: var(--font-heading);
  font-size: var(--display-md);
  font-weight: 600;
  line-height: normal;
  margin-bottom: 0;
}

/* Description */
.content-9-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;
}

/* Bouton */
.content-9-button {
  margin-top: 0;
}

/* ===============================================
   MOBILE LAYOUT (max-width: 991px)
   =============================================== */

@media (max-width: 991px) {
  /* Section : retirer padding horizontal en mobile */
  .content-section-9 {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
  }

  /* Wrapper : layout simple vertical */
  .content-9-wrapper {
    display: block;
  }

  /* Partie texte avec padding */
  .content-9-text {
    padding: 2rem 15px;
    margin-bottom: 1rem;
  }

  .content-9-content {
    width: 100%;
  }

  /* Image : full width, pas de padding */
  .content-9-image-side {
    display: block;
    width: 100%;
  }

  .content-9-image-wrapper {
    width: 100%;
  }

  .content-9-image {
    width: 100%;
    height: auto;
    display: block;
  }

  /* Mobile : réduire la taille du titre */
  .content-9-title h1,
  .content-9-title h2,
  .content-9-title h3,
  .content-9-title h4,
  .content-9-title p {
    font-size: var(--display-2sm);
  }

  /* Mobile : réduire les carrés décoratifs */
  .content-9-decorative-squares {
    width: 60px;
    height: 120px;
  }

  .content-9-decorative-squares .square {
    width: 30px;
    height: 30px;
  }

  /* Sur mobile - Image à droite : carrés à gauche */
  .content-9-wrapper:not(.flex-row-reverse)
    .content-9-decorative-squares
    .square-1 {
    bottom: 90px;
    left: 30px;
  }

  .content-9-wrapper:not(.flex-row-reverse)
    .content-9-decorative-squares
    .square-2 {
    bottom: 60px;
    left: 0;
  }

  .content-9-wrapper:not(.flex-row-reverse)
    .content-9-decorative-squares
    .square-3 {
    bottom: 30px;
    left: 30px;
  }

  .content-9-wrapper:not(.flex-row-reverse)
    .content-9-decorative-squares
    .square-4 {
    bottom: 0;
    left: 0;
  }

  /* Sur mobile - Image à gauche : carrés à droite */
  .content-9-wrapper.flex-row-reverse .content-9-decorative-squares .square-1 {
    bottom: 90px;
    right: 30px;
  }

  .content-9-wrapper.flex-row-reverse .content-9-decorative-squares .square-2 {
    bottom: 60px;
    right: 0;
  }

  .content-9-wrapper.flex-row-reverse .content-9-decorative-squares .square-3 {
    bottom: 30px;
    right: 30px;
  }

  .content-9-wrapper.flex-row-reverse .content-9-decorative-squares .square-4 {
    bottom: 0;
    right: 0;
  }
}

/* Petits mobiles */
@media (max-width: 575.98px) {
  .content-9-title h1,
  .content-9-title h2,
  .content-9-title h3,
  .content-9-title h4,
  .content-9-title p {
    font-size: var(--display-sm);
  }

  .content-9-description p {
    font-size: var(--text-sm);
  }
}
