/* PiloteCSE — Pages Cards (Stable)
 * Version: 2.2.1
 * Objectif:
 * - Uniformiser les cartes (hauteur, nb de lignes, meta alignée)
 * - Hover moderne + focus accessible
 * - Scoped (ne pas impacter le reste du site)
 */

/* =========================
   WRAP + LIENS (neutralisés)
   ========================= */
.pcse-pages-cards-wrap{
  max-width:1600px;
  margin:0 auto;
  padding:0 30px;
  width:100%;
}

.pcse-pages-cards-wrap a,
.pcse-pages-cards-wrap a:visited,
.pcse-pages-cards-wrap a:hover,
.pcse-pages-cards-wrap a:focus{
  color:inherit !important;
  text-decoration:none !important;
}

/* =========================
   GRID
   ========================= */
.pcse-pages-cards-grid{
  display:grid !important;
  grid-template-columns: repeat(var(--pcse-cols, 4), minmax(0, 1fr)) !important;
  gap:32px !important;
  margin:40px auto !important;
  padding:0 20px !important;
}

@media (max-width:1300px){
  .pcse-pages-cards-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap:28px !important;
  }
}
@media (max-width:900px){
  .pcse-pages-cards-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap:22px !important;
  }
}
@media (max-width:600px){
  .pcse-pages-cards-grid{
    grid-template-columns: 1fr !important;
    padding:0 10px !important;
    gap:18px !important;
  }
}

/* =========================
   CARD (structure + hauteur homogène)
   ========================= */
.pcse-pages-cards-wrap .pcse-card{
  display:flex !important;
  flex-direction:column !important;
  height:100% !important;

  background:#fff !important;
  border-radius:16px !important;
  border:1px solid #e6e6e6 !important;
  box-shadow:0 3px 10px rgba(0,0,0,0.06) !important;
  overflow:hidden !important;

  padding:10px 0 0 0 !important;
  color:inherit !important;

  /* transitions (hover/focus) */
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease !important;
}

/* Zone image */
.pcse-pages-cards-wrap .pcse-card__media{
  padding:10px 18px 0px 18px !important;
}

.pcse-pages-cards-wrap .pcse-card__img{
  width:100% !important;
  height: var(--pcse-img-h, 230px) !important;
  object-fit:cover !important;
  border-radius:12px !important;
  display:block !important;

  transition: transform .22s ease !important;
}

/* Zone contenu (pour pousser la meta en bas) */
.pcse-pages-cards-wrap .pcse-card__body{
  display:flex !important;
  flex-direction:column !important;
  flex:1 1 auto !important;
  min-height:0 !important;
}

/* =========================
   TITRE + EXCERPT (line clamp)
   ========================= */
.pcse-pages-cards-wrap .pcse-card__title{
  font-size:1.12rem !important;
  font-weight:850 !important;
  margin:10px 18px 4px !important;
  line-height:1.20 !important;
  color:#004c79 !important;

  /* 2 lignes max */
  display:-webkit-box !important;
  -webkit-line-clamp:2 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;
}

.pcse-pages-cards-wrap .pcse-card__excerpt{
  font-size:0.96rem !important;
  line-height:1.42 !important;
  color:#333 !important;
  margin:0 18px 6px !important;
  text-align:left !important;

  /* 4 lignes max (uniformisation) */
  display:-webkit-box !important;
  -webkit-line-clamp:4 !important;
  -webkit-box-orient:vertical !important;
  overflow:hidden !important;

  /* aide à homogénéiser visuellement la hauteur */
  min-height: calc(1.42em * 4) !important;
}

/* =========================
   META (date + logo alignés pareil)
   ========================= */
.pcse-pages-cards-wrap .pcse-card__meta{
  margin-top:auto !important;

  display:flex !important;
  justify-content:space-between !important;
  align-items:center !important;
  flex-wrap:nowrap !important;
  gap:12px !important;

  padding:12px 18px 14px !important;
}

.pcse-pages-cards-wrap .pcse-card__date{
  font-size:0.92rem !important;
  line-height:1 !important;
  color:#444 !important;
  white-space:nowrap !important;
}

.pcse-pages-cards-wrap .pcse-card__brand{
  flex:0 0 auto !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-end !important;
}

/* Logo : lisible, stable */
.pcse-pages-cards-wrap .pcse-card__brandimg{
  width:170px !important;
  height:auto !important;
  max-height:44px !important;
  object-fit:contain !important;
  display:block !important;
  flex-shrink:0 !important;
}

/* =========================
   HOVER / FOCUS (desktop)
   ========================= */
@media (hover:hover) and (pointer:fine){
  .pcse-pages-cards-wrap .pcse-card:hover{
    transform: translateY(-4px) !important;
    box-shadow:0 12px 26px rgba(0,0,0,0.12) !important;
    border-color:#b9d7ea !important;
  }
  .pcse-pages-cards-wrap .pcse-card:hover .pcse-card__img{
    transform: scale(1.015) !important;
  }
}

/* Focus clavier (accessibilité) */
.pcse-pages-cards-wrap .pcse-card:focus,
.pcse-pages-cards-wrap .pcse-card:focus-visible{
  outline:none !important;
}
.pcse-pages-cards-wrap .pcse-card:focus-visible{
  box-shadow:0 0 0 3px rgba(0,115,170,0.18), 0 10px 22px rgba(0,0,0,0.10) !important;
  border-color:#7fbad8 !important;
}

/* Réduction des animations si l’utilisateur le demande */
@media (prefers-reduced-motion: reduce){
  .pcse-pages-cards-wrap .pcse-card,
  .pcse-pages-cards-wrap .pcse-card__img{
    transition:none !important;
  }
}

/* =========================
   PETITES FINITIONS
   ========================= */
/* Sur très petits écrans : logo un peu moins large pour éviter le wrapping */
@media (max-width:420px){
  .pcse-pages-cards-wrap .pcse-card__brandimg{
    width:150px !important;
  }
}

/* Si jamais l’extrait est vide, on évite un “trou” visuel */
.pcse-pages-cards-wrap .pcse-card__excerpt:empty{
  display:none !important;
  min-height:0 !important;
  margin:0 !important;
}
