/* =========================================
   BENTO GRID DCLIK — FINAL V3
   ========================================= */

/* 1. Variables & Base */
.bento-zone {
  --txt: #ffffff;
  --brand-main: #14276D;
  --brand-dark: #0F0122;
  --card-radius: 24px;
  --gap: 24px;
}

.bento-zone * { box-sizing: border-box; }
.bento-zone .visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* 2. Grille Principale */
.bento-zone .bento-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: var(--gap);
  max-width: 1200px;
  margin: clamp(30px, 5vw, 60px) auto;
  padding: 0 clamp(16px, 3vw, 24px);
  list-style: none;
}

/* 3. Style des Cartes */
.bento-zone .bento-card {
  position: relative;
  border-radius: var(--card-radius);
  padding: 28px;
  display: flex;
  flex-direction: column;
  /* IMPORTANT : justify-content flex-start + margin-top auto sur le bouton = bouton en bas */
  justify-content: flex-start;
  min-height: 220px; /* Hauteur min pour laisser respirer */
  
  background-color: var(--brand-main); 
  color: var(--txt);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  isolation: isolate;
}

/* Animation Fond */
.bento-zone .grad {
  background: linear-gradient(135deg, var(--brand-main) 0%, #1e3a8a 50%, var(--brand-dark) 100%);
  background-size: 200% 200%;
  animation: aurora 20s ease infinite alternate;
}
@keyframes aurora { 0% {background-position:0% 50%} 100% {background-position:100% 50%} }

@media (hover: hover) {
  .bento-zone .bento-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.25);
  }
}

/* 4. Typographie */
.bento-zone h3 {
  margin: 0 0 12px;
  font-size: clamp(1.25rem, 1.5vw, 1.5rem);
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  position: relative; z-index: 10;
}

.bento-zone p {
  margin: 0 0 24px;
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  line-height: 1.6;
  color: #e0e0e0;
  max-width: 95%; /* Un peu plus large pour éviter les retours ligne inutiles */
  position: relative; z-index: 10;
}

/* --- MODIF : Boutons alignés tout en bas --- */
.bento-zone .actions { 
  margin-top: auto; /* C'est cette ligne qui pousse le bouton tout en bas */
  position: relative; 
  z-index: 10;
  align-self: flex-start; /* Aligné à gauche */
}

.bento-zone .btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 24px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}
.bento-zone .btn:hover { background: #fff; color: var(--brand-main); }
.bento-zone .bento-card a::after { content:''; position:absolute; inset:0; z-index:20; }

/* 5. Mapping Grille */
.bento-zone .site-web { grid-column: 1/3; grid-row: 1; }
.bento-zone .strategie-social { grid-column: 3; grid-row: 1/3; }
.bento-zone .community-management { grid-column: 1; grid-row: 2; }
.bento-zone .videos-pro { grid-column: 2; grid-row: 2/4; }
.bento-zone .formations-qualiopi { grid-column: 1; grid-row: 3; }
.bento-zone .contact { grid-column: 3; grid-row: 3; }

/* =========================================
   6. IMAGES & RENDU VISUEL (Unifié)
   ========================================= */

.bento-zone .abs-img {
  position: absolute;
  pointer-events: none;
  z-index: 1; /* Derrière le texte et bouton */
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* --- Stratégie Social --- */
.bento-zone .strategie-social { padding-bottom: 28px; } /* Reset padding pour laisser le bouton descendre */
.bento-zone .strategie-social-img {
  width: 100%; height: auto;
  bottom: -40px; right: 0; left: 0; margin: auto;
  mask-image: linear-gradient(to bottom, transparent 0%, black 40%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 40%);
  opacity: 0.8;
}
.bento-zone .strategie-social::before {
  content: ''; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(to bottom, var(--brand-main) 30%, transparent 100%);
  pointer-events: none;
}

/* --- MODIF : Style "Ambiance" partagé pour Community & Vidéo --- */
/* On applique le même style aux deux blocs pour la cohérence */
.bento-zone .community-management,
.bento-zone .videos-pro {
  background-color: var(--brand-main);
  /* On enlève les gros paddings bottom pour que le bouton puisse descendre sur l'image */
  padding-bottom: 28px; 
}

/* Overlay sombre pour garantir la lecture du texte sur l'image */
.bento-zone .community-management::before,
.bento-zone .videos-pro::before {
  content: ''; position: absolute; inset: 0; z-index: 2;
  background: linear-gradient(to bottom, var(--brand-main) 40%, rgba(20, 39, 109, 0.6) 100%);
  pointer-events: none;
}

/* Style de l'image (Monochrome bleuté + transparence) */
.bento-zone .community-img,
.bento-zone .video-img {
  width: 100%;
  bottom: 0; left: 0;
  opacity: 0.5; /* Assez transparent pour le fond */
  mix-blend-mode: luminosity; /* Mode N&B qui prend la couleur du fond bleu */
  object-fit: cover; /* S'assure que l'image remplit bien la zone */
}

/* Specific Vidéo adjustment : on remet l'image droite */
.bento-zone .video-img {
  width: 100%;
  max-width: none; /* On enlève la limite de largeur */
  transform: none; /* On enlève le centrage CSS précédent */
  left: 0; 
}

/* Hover Effect commun */
@media (hover: hover) {
  .bento-zone .community-management:hover .community-img,
  .bento-zone .videos-pro:hover .video-img {
    opacity: 0.7; 
    transform: scale(1.05); 
    mix-blend-mode: normal; /* La couleur revient au survol */
  }
}

/* --- Site Vitrine --- */
.bento-zone .site-web { display: flex; flex-direction: row; align-items: center; }
.bento-zone .site-web .media-wrap { display: flex; width: 100%; gap: 30px; align-items: center; height: 100%; }
.bento-zone .site-web .text-part { flex: 1.2; display: flex; flex-direction: column; height: 100%; }
.bento-zone .site-web .lottie-wrap { flex: 0.8; display: flex; justify-content: center; }

/* =========================================
   7. RESPONSIVE
   ========================================= */

@media (max-width: 1024px) {
  .bento-zone .bento-grid { grid-template-columns: 1fr 1fr; }
  .bento-zone .site-web { grid-column: 1/3; }
  .bento-zone .strategie-social { grid-column: 2; grid-row: 2/4; }
  .bento-zone .community-management { grid-column: 1; grid-row: 2; }
  .bento-zone .videos-pro { grid-column: 1; grid-row: 3; }
  .bento-zone .formations-qualiopi { grid-column: 1; grid-row: 4; }
  .bento-zone .contact { grid-column: 2; grid-row: 4; }
}

@media (max-width: 767px) {
  .bento-zone .bento-grid { display: flex; flex-direction: column; gap: 20px; }
  .bento-zone .bento-card { min-height: auto; padding: 24px 20px; }
  
  .bento-zone .site-web .media-wrap { flex-direction: column-reverse; align-items: flex-start; }
  .bento-zone .lottie-bento { width: 140px; margin-bottom: 15px; }

  /* Ajustement mobile pour garder le texte lisible */
  .bento-zone .community-img, .bento-zone .video-img { opacity: 0.3; }
  .bento-zone .strategie-social-img { opacity: 0.5; }
}