/*
@author UBPartner
*/
/* ==========================================================
   LISTING - colonne de filtres + grille de cartes
   Partagé par blogs.html et events.html
   Colonne de filtres : 250px, collante au scroll.
   Grille : 3 cartes par ligne, 1100px de large au maximum.
   En mobile, les filtres repassent au-dessus de la grille.
   ========================================================== */
.listing {
  display: grid;
  grid-template-columns: 250px minmax(0, 1000px);
  justify-content: center;
  align-items: start;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Colonne de filtres : liste sobre, filets fins, repère violet ── */
.listing-filters {
  position: sticky;
  top: 120px;
  width: 250px;
}

.listing-filters-title {
  margin: 0 0 6px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(36, 27, 61, 0.16);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--ink);
}

.filter-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.filter-list li + li {
  border-top: 1px solid rgba(36, 27, 61, 0.08);
}

.filter-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 13px 0 13px 14px;
  border: none;
  border-left: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--inkSoft);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.25s ease,
    padding-left 0.25s ease;
}

.filter-btn span {
  flex: none;
  padding: 0;
  background: none;
  color: rgba(36, 27, 61, 0.38);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.filter-btn:hover {
  color: var(--ink);
  border-left-color: rgba(115, 71, 179, 0.3);
}

.filter-btn.is-active {
  border-left-color: var(--primary);
  color: var(--ink);
  font-weight: 600;
}

.filter-btn.is-active span {
  color: var(--primary);
}

.filter-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Grille de cartes ── */
/* 3 cartes de 300px par ligne, centrées ; le nombre de colonnes
   se réduit tout seul quand la largeur disponible diminue */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 300px);
  justify-content: center;
  gap: 26px;
}

.post-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 300px;
  max-width: 100%;
  height: 390px;
  overflow: hidden;
  border: 1px solid rgba(115, 71, 179, 0.12);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(36, 27, 61, 0.05);
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease,
    border-color 0.3s ease;
}

.post-card:hover {
  transform: translateY(-6px);
  border-color: rgba(115, 71, 179, 0.28);
  box-shadow: 0 22px 44px rgba(115, 71, 179, 0.14);
}

.post-thumb {
  flex: none;
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.post-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 22px 22px 24px;
}

.post-badge {
  align-self: flex-start;
  margin-bottom: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(115, 71, 179, 0.09);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* titre coupé à 2 lignes */
.post-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
}

/* accroche coupée à 3 lignes */
.post-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--inkSoft);
}

.post-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(36, 27, 61, 0.08);
}

.post-date {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--inkSoft);
}

.post-date i {
  color: var(--primary);
  font-size: 14px;
}

.post-arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(115, 71, 179, 0.09);
  color: var(--primary);
  font-size: 14px;
  transition: background 0.25s ease, color 0.25s ease;
}

.post-card:hover .post-arrow {
  background: var(--primary);
  color: #fff;
}

/* carte masquée par un filtre */
.post-card[hidden] {
  display: none;
}

.listing-empty {
  grid-column: 1 / -1;
  padding: 40px 0;
  text-align: center;
  color: var(--inkSoft);
}

/* ==========================================================
   RESPONSIVE - sous 1200px, les filtres passent au-dessus
   ========================================================== */
@media (max-width: 1199.98px) {
  .listing {
    grid-template-columns: minmax(0, 1100px);
    gap: 28px;
  }
  /* en mobile, la liste devient une rangée d'onglets */
  .listing-filters {
    position: static;
    width: 100%;
  }
  .listing-filters-title {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 12px;
  }
  .filter-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0 28px;
    border-bottom: 1px solid rgba(36, 27, 61, 0.14);
  }
  .filter-list li + li {
    border-top: none;
  }
  .filter-btn {
    width: auto;
    padding: 10px 0;
    border-left: none;
    border-bottom: 2px solid transparent;
  }
  .filter-btn:hover {
    border-left-color: transparent;
  }
  .filter-btn.is-active {
    border-bottom-color: var(--primary);
  }
}

@media (max-width: 575.98px) {
  .filter-list {
    gap: 0 20px;
  }
  .filter-btn {
    font-size: 14px;
  }
}

/* ==========================================================
   RIDEAU AU SURVOL - voile violet qui monte du bas
   ========================================================== */
.post-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.4);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.post-card:hover .post-overlay,
.post-card:focus-visible .post-overlay {
  transform: translateY(0);
}

.post-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  /* le libellé suit le rideau avec un léger retard */
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease 0.12s, transform 0.3s ease 0.12s,
    background 0.25s ease, color 0.25s ease;
}

.post-card:hover .post-more,
.post-card:focus-visible .post-more {
  opacity: 1;
  transform: translateY(0);
}

.post-card:hover .post-more {
  background: #fff;
  color: var(--primary);
}

.post-more i {
  font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
  .post-overlay,
  .post-more {
    transition: none;
  }
}

/* ── Bandeau d'inscription aux invitations ── */
.event-alert {
  display: flex;
  gap: 10px;
  flex: none;
  width: 100%;
  max-width: 420px;
}

.event-alert input {
  flex: 1 1 auto;
  min-width: 0;
  height: 46px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 40px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: inherit;
  font-size: 14.5px;
}

.event-alert input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.event-alert input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.12);
}

@media (max-width: 575.98px) {
  .event-alert {
    flex-direction: column;
  }
  .event-alert .btn {
    justify-content: center;
  }
  
}