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

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

/* --- ENCARDS --- */

.encart1 { grid-column: 1 / span 8; grid-row: 1; } /* --- au tableau --- */
.encart2 { grid-column: 1 / span 8; grid-row: 2; } /* --- face aux enfants --- */
.encart3 { grid-column: 1 / span 8; grid-row: 3; } /* --- infos --- */

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

.encart h2 {
  margin-top: 0;
  margin-bottom: 8px;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: #7dc8e5;
  text-align: left;
}

h3 {
  font-size: clamp(0.8rem, 1.2vw, 0.9rem);
}

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

/* ============================= */
/*      VIDEOS                   */
/* ============================= */

.encart-video {
  width: 100%;
}

/* ===== ÉCRAN PRINCIPAL ===== */
.video-main-wrapper {
  width: 100%;
  height: 0;
  padding-top: 56.25%; /* 16:9 */
  position: relative;
  background: black;
  overflow: hidden;
  margin-bottom: 10px;
}

.video-main-wrapper video {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ===== MINIATURES ===== */
.video-thumbs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.thumb {
  display: flex;         /* vidéo + légende côte à côte */
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.thumb-video-wrapper {
  width: 130px;
  height: 80px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.thumb-video-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb .overlay {
  display: none;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  color: rgba(255,255,255,0.8);
  font-weight: bold;
  pointer-events: none;
  z-index: 10;
  background: none; /* <- important */
}

.thumb.active .overlay {
  display: block;
}

.thumb {
  display: flex;
  flex-direction: row; /* toujours côte à côte, desktop et mobile */
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.thumb span {
  display: inline-block;
  font-size: clamp(0.8rem, 1.2vw, 0.9rem);
  text-align: left;
  line-height: 1.2;
}

/* ============================= */
/*      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; }
  
}

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

  /* Ordre mobile identique à tablette */
    .encart1 { order: 1; }
    .encart2 { order: 2; }
    .encart3 { order: 3; }

}

