.med-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.med-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  display: flex;
  flex-direction: column;
}
.med-cover {
  aspect-ratio: 3/4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffe6f0;
}
.med-cover img { width: 100%; height: 100%; object-fit: cover; }
.med-card figcaption { padding: 10px 12px; }
.med-tag {
  font-size: .8rem;
  background: #f7f7f7;
  border-radius: 999px;
  padding: 4px 8px;
  margin-bottom: 6px;
  display: inline-block;
}
.med-title { font-weight: 700; margin: 2px 0; }
.med-meta  { font-size: .9rem; color: #555; }

.med-filters {
  display:flex; gap:10px; flex-wrap:wrap; justify-content:center;
  margin: 0 0 18px;
}
.med-filters button{
  border:1px solid #e75480; background:#fff; color:#e75480;
  padding:8px 12px; border-radius:999px; cursor:pointer;
}
.med-filters button.is-active{ background:#e75480; color:#fff; }
.med-card.is-hidden{ display:none !important; }

/* 1) Remet à zéro les marges par défaut du figure */
.med-card { margin: 0; }

/* 2) S'assure qu'une carte masquée n'occupe plus de place dans la grille */
.med-card-wrap.is-hidden { display: none !important; }

/* (optionnel, mais utile) évite qu'un enfant ajoute des marges parasites */
.med-grid > * { margin: 0; }

/* 1) Neutraliser le "block gap" WordPress à l’intérieur de la grille */
.wp-block-group.med-grid { --wp--style--block-gap: 0px; }
.wp-block-group.med-grid > * { margin-block-start: 0; margin-block-end: 0; }

/* 2) Zéro marge sur nos items */
.med-card, .med-card-wrap { margin: 0 !important; }

/* 3) S’il y a un bloc paragraphe vide, on l’ignore (il prenait une cellule de la grille) */
.med-grid > p:empty,
.med-grid > .wp-block-paragraph:empty { display: none !important; }

.med-sub{
  margin: 28px 0 8px;
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  color:#2b2b2b;
  font-weight: 700;
}
.med-sublead{
  margin: 0 0 14px;
  color:#555;
}

/* Ligne séparatrice sous le sous-titre */
.med-sub{
  position: relative;
  text-align:center;
  padding-bottom: 8px;      /* petit espace avant la ligne */
  margin-bottom: 10px;
}
.med-sub::after{
  content: "";
  display: block;
  width: 140px;             /* longueur de la ligne */
  height: 3px;              /* épaisseur */
  background: linear-gradient(90deg, #e75480, #ffc2d3);
  border-radius: 999px;
  margin: 8px auto 0;       /* centrée sous le titre */
}
