/* ======================================================
   Iliade Digital — Card Post (Premium)
   Fichier : assets/css/card-post.css
   Dépend : variables.css + styles.css
   Scope  : .il-post-card
   ====================================================== */

.il-post-card{
  /* Tokens du thème (fallbacks safe) */
  --line: var(--line, #E6E8EE);
  --line2: var(--line-2, #D6DAE4);

  --text: var(--text, #111827);
  --muted: var(--muted, #666672);

  --surface: var(--surface, #ffffff);
  --panel: var(--panel-bg, rgba(255,255,255,.72));

  --r: var(--r-16, 16px);
  --shadow-sm: var(--shadow-sm, 0 10px 24px rgba(16,19,35,.08));
  --shadow-md: var(--shadow-md, 0 14px 34px rgba(16,19,35,.12));

  --ease: var(--ease, cubic-bezier(.2,.8,.2,1));
  --t-fast: var(--t-fast, .15s);
  --t-med: var(--t-med, .25s);

  /* Accents */
  --brand: var(--brand-green, #17A051);
  --brand-soft: var(--alpha-brand-12, rgba(23,160,81,.12));
  --brand-brd: var(--alpha-brand-18, rgba(23,160,81,.18));

  /* Inks */
  --ink-06: var(--alpha-ink-06, rgba(16,19,35,.06));
  --ink-08: var(--alpha-ink-08, rgba(16,19,35,.08));
  --ink-10: var(--alpha-ink-10, rgba(16,19,35,.10));
  --ink-12: var(--alpha-ink-12, rgba(16,19,35,.12));
}

/* ======================================================
   Card wrapper
   ====================================================== */
.il-post-card__link{
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  border-radius: var(--r);
  overflow: hidden;

  background: rgba(255,255,255,.86);
  border: 1px solid var(--ink-10);
  box-shadow: 0 10px 22px rgba(16,19,35,.06);

  text-decoration: none;
  color: inherit;

  transform: translateZ(0);
  transition:
    transform var(--t-fast) var(--ease),
    box-shadow var(--t-med) var(--ease),
    border-color var(--t-med) var(--ease),
    background var(--t-med) var(--ease);
}

/* léger highlight interne (premium) */
.il-post-card__link::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    radial-gradient(600px 240px at 20% 10%, rgba(255,255,255,.75), transparent 60%),
    linear-gradient(180deg, rgba(16,19,35,.04), rgba(16,19,35,0) 55%);
  opacity: .65;
}

@media (hover:hover){
  .il-post-card__link:hover{
    transform: translateY(-2px);
    background: rgba(255,255,255,.92);
    box-shadow: var(--shadow-md);
    border-color: rgba(23,160,81,.22);
  }
}

.il-post-card__link:active{
  transform: translateY(0);
}

/* Focus clavier */
.il-post-card__link:focus-visible{
  outline: none;
  box-shadow: var(--focus, 0 0 0 3px rgba(23,160,81,.25)), var(--shadow-md);
  border-color: rgba(23,160,81,.35);
}

/* ======================================================
   Media
   ====================================================== */
.il-post-card__media{
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--ink-06);
  overflow: hidden;
}

/* voile très léger pour lisibilité badge */
.il-post-card__media::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background: linear-gradient(180deg, rgba(16,19,35,.10), rgba(16,19,35,0) 55%);
  opacity: .55;
}

.il-post-card__img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;

  transform: scale(1.02);
  transition: transform var(--t-med) var(--ease), filter var(--t-med) var(--ease);
}

@media (hover:hover){
  .il-post-card__link:hover .il-post-card__img{
    transform: scale(1.065);
    filter: saturate(1.04);
  }
}

.il-post-card__placeholder{
  width: 100%;
  height: 100%;
  background:
    radial-gradient(320px 220px at 18% 30%, rgba(23,160,81,.18), transparent 62%),
    radial-gradient(320px 220px at 82% 38%, rgba(47,128,237,.14), transparent 62%),
    linear-gradient(180deg, rgba(16,19,35,.10), rgba(16,19,35,0));
}

/* ======================================================
   Badge
   ====================================================== */
.il-post-card__badge{
  position: absolute;
  left: 12px;
  top: 12px;

  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 6px 10px;
  border-radius: 999px;

  background: rgba(255,255,255,.86);
  border: 1px solid rgba(23,160,81,.16);

  color: var(--text);
  font-family: var(--font-head, inherit);
  font-weight: 900;
  font-size: 12px;

  max-width: calc(100% - 24px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;

  box-shadow: 0 10px 22px rgba(16,19,35,.08);
  backdrop-filter: blur(8px);
}

/* petit point “category” */
.il-post-card__badge::before{
  content:"";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(23,160,81,.60);
  box-shadow: 0 0 0 4px rgba(23,160,81,.14);
}

/* ======================================================
   Body
   ====================================================== */
.il-post-card__body{
  position: relative;
  padding: 14px 14px 16px;
  display: grid;
  gap: 10px;
}

/* Titre */
.il-post-card__title{
  margin: 0;
  font-family: var(--font-head, inherit);
  font-size: 18px;
  line-height: 1.2;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.015em;

  /* clamp 2 lignes sans casser */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Extrait */
.il-post-card__excerpt{
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;

  /* clamp 3 lignes */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Meta */
.il-post-card__meta{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
  font-size: 12px;
}

.il-post-card__dot{
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: rgba(102,102,114,.85);
}

/* ======================================================
   CTA
   ====================================================== */
.il-post-card__cta{
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;

  padding-top: 10px;
  margin-top: 2px;

  border-top: 1px dashed rgba(16,19,35,.16);

  color: var(--text);
  font-family: var(--font-head, inherit);
  font-weight: 900;
}

.il-post-card__cta .dashicons{
  font-size: 18px;
  width: 18px;
  height: 18px;

  /* accent “Iliade” */
  color: rgba(23,160,81,.90);
  transition: transform var(--t-fast) var(--ease);
}

@media (hover:hover){
  .il-post-card__link:hover .il-post-card__cta .dashicons{
    transform: translateX(2px);
  }
}

/* ======================================================
   Mobile polish
   ====================================================== */
@media (max-width: 640px){
  .il-post-card__body{
    padding: 14px 14px 16px;
  }
  .il-post-card__title{
    font-size: 17px;
  }
}


/* ======================================================
   PATCH — Alignement des CTA & hauteurs uniformes
   Scope : .il-post-card (sans toucher au HTML)
   ====================================================== */

/* 1) La card prend toute la hauteur de la cellule grid */
.il-post-card,
.il-post-card__link{
  height: 100%;
}

/* 2) Le body devient une colonne flexible */
.il-post-card__body{
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* 3) Le contenu “texte” prend l’espace disponible */
.il-post-card__title,
.il-post-card__excerpt,
.il-post-card__meta{
  flex: 0 0 auto;
}

/* 4) Le CTA est poussé en bas */
.il-post-card__cta{
  margin-top: auto;
}

/* 5) Sécurité : évite les débordements en grid */
.il-post-card{
  min-width: 0;
}
