/* =========================================
   TEMPLATE — RÉSEAUX SOCIAUX
   Grille propre, centrée, cohérente avec les autres pages
========================================= */

/* =========================
   PAGE
========================= */

body.template-page .page-title{
  margin-top: 2rem;
}

.template-reseau-section{
  padding: 3rem 0 4rem;
  margin-bottom: 4rem;
}

/* =========================
   GRILLE PRINCIPALE
========================= */

#template-gallery.template-reseau-container{
  display: grid;

  /* largeur des cartes (post carré) */
  grid-template-columns: repeat(auto-fit, minmax(320px, 380px));

  justify-content: center;
  gap: 30px;

  max-width: 1320px;
  margin: 1.5rem auto 0;
  padding: 0 20px;
}

/* =========================
   ITEM
========================= */

.template-reseau-item{
  width: 100%;
  max-width: 380px;
  margin: 0 auto;

  position: relative;
  overflow: hidden;

  background: #fff;
  box-shadow: 0 0 12px rgba(0,0,0,0.1);
}

.template-reseau-wrapper{
  position: relative;
}

/* IMPORTANT : empêche plein écran */
.template-reseau-item img{
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease;
}

.template-reseau-wrapper:hover img{
  transform: scale(1.05);
}

/* =========================
   OVERLAY
========================= */

.template-reseau-overlay{
  position: absolute;
  inset: 0;

  background: rgba(0,0,0,0.75);
  color: #fff;

  padding: 20px;
  opacity: 0;

  transition: opacity 0.3s ease;

  display: flex;
  flex-direction: column;

  justify-content: center;
  align-items: center;

  text-align: center;
  gap: 10px;

  box-sizing: border-box;
}

.template-reseau-wrapper:hover .template-reseau-overlay{
  opacity: 1;
}

.template-reseau-wrapper:focus-within .template-reseau-overlay{
  opacity: 1;
}

.template-reseau-wrapper:focus-visible{
  outline: 2px solid var(--cta);
  outline-offset: 4px;
}

.template-reseau-overlay h3{
  font-size: clamp(1rem, 2.2vw, 1.1rem);
  margin: 0;
}

.template-reseau-overlay p{
  font-size: clamp(0.82rem, 1.9vw, 0.95rem);
  margin: 0;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px){

  #template-gallery.template-reseau-container{
    grid-template-columns: minmax(260px, 380px);
    gap: 20px;
    padding: 0 16px;
  }

}

/* =========================
   ACCESSIBILITÉ
========================= */

@media (prefers-reduced-motion: reduce){

  .template-reseau-item img,
  .template-reseau-overlay{
    transition: none;
  }

  .template-reseau-wrapper:hover img{
    transform: none;
  }

}