/* ============================= */
/*        GRILLE PRINCIPALE      */
/* ============================= */

.grille-encart {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 20px;
  box-sizing: border-box;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 10px;
}

/* --- ENCARDS --- */
.encart1 { grid-column: 1 / span 6; grid-row: 1 / span 2; } /* famille sacree */
.encart2 { grid-column: 7 / span 3; grid-row: 1; } /* parents */
.encart3 { grid-column: 7 / span 3; grid-row: 2 / span 2; } /* fratrie */
.encart4 { grid-column: 1 / span 3; grid-row: 3; } /* couple */
.encart5 { grid-column: 4 / span 3; grid-row: 3; } /* enfants */

/* --- STYLE GENERAL DES ENCARDS --- */
.encart {
  background-color: #fff;
  border-radius: 16px;
  padding: 20px;
  box-sizing: border-box;
  box-shadow: 0 4px 10px rgba(0,0,0,0.07);
}

.encart h2 {
  margin-top: 0;
  margin-bottom: 8px;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: #7dc8e5;
}

.encart img {
  width: 100%;
  height: auto;
  display: block;
}

/* ============================= */
/*        ENCARDS FAMILLE        */
/* ============================= */

/* Grille interne pour les polaroids */
.famille-grid{
  display:flex;
  gap:20px;
  justify-content:center;
}

/* --- Desktop --- */
.parents-debbouze .famille-grid,
.couple-debbouze .famille-grid,
.enfants-debbouze .famille-grid {
  flex-wrap: nowrap;       /* 1 ligne fixe */
  justify-content: center; /* alignés au début */
}

.fratrie-debbouze .famille-grid{
  flex-wrap:wrap;
  justify-content:center;
}

.fratrie-debbouze .polaroid{
  flex:1 1 calc(50% - 20px);
  max-width:145px;
}

/* Polaroids */
.polaroid {
  flex: 1 1 145px;
  max-width:145px;
  background:#fff;
  padding:10px 10px 20px;
  text-align:center;
  text-decoration:none;
  color:#000;
  box-shadow:0 6px 15px rgba(0,0,0,0.2);
  transition:transform .25s ease;
}

.polaroid img {
  width: 100%;
  display: block;
}

.polaroid span {
  display: block;
  margin-top: 10px;
  font-weight: 600;
  font-size: 15px;
}

.polaroid:hover {
  transform: scale(1.05) rotate(-1deg);
}



/* ============================= */
/*      TABLETTE ET MOBILE       */
/* ============================= */

@media (max-width: 992px) {
  .grille-encart {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0 10px;
  }

  /* Ordre tablette */
  .encart1 { order: 1; }
  .encart2 { order: 2; }
  .encart3 { order: 3; }
  .encart4 { order: 4; }
  .encart5 { order: 5; }

  /* Polaroids s'adaptent à 3 par ligne */
  .famille-grid {
    flex-wrap: wrap;
    justify-content: center;
  }

  .polaroid {
    width: calc((100% / 3) - 13.33px);
  }
}

@media (max-width: 600px) {
  .polaroid {
    width: calc((100% / 2) - 10px);
  }
}