/* Grille d'article */
.ypl-grille-article,
.ypl-grille-article * {
  box-sizing: border-box;
}

.custom-article-grid {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.article-card {
  width: calc((100% - 90px) / 4);
  max-width: calc((100% - 90px) / 4);
  flex: 0 0 calc((100% - 90px) / 4);
  position: relative;
}

.article-card-image {
  display: block;
  width: 100%;
  position: relative;
}

.article-card img {
  width: 100%;
  height: 400px;
  max-width: 100%;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}

.article-card-content {
  background: #fff7f2;
}

.article-card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
}

.article-card .category {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  background: transparent;
  color: #ff4b3e;
  border: 1px solid #ff4b3e;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12px;
  line-height: 1;
}

.article-card .date {
  color: #01234F;
  font-size: 12px;
  white-space: nowrap;
}

.article-card .title {
  margin: 0;
  line-height: 1.25;
}

.article-card .title a {
  color: #01234F;
  font-weight: 400;
  font-size: 18px;
  text-decoration: none;
}

/* Variante : Titre / métadonnée sous image */
.article-card--under .article-card-content {
  padding: 18px 0 0;
  box-shadow: none;
}

.article-card--under .category {
  background-color: #f65c2b;
  color: #fff;
  border: none;
}

/* Variante : Titre / métadonnée sur image */
.article-card--over {
  overflow: hidden;
  border-radius: 4px;
}

.article-card--over .article-card-content {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 2;
  padding: 20px 24px 22px;
  border-radius: 3px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.article-card--over img {
  min-height: 400px;
}

/* Responsive */
@media (max-width: 1024px) {
  .article-card {
    width: calc((100% - 30px) / 2);
    max-width: calc((100% - 30px) / 2);
    flex: 0 0 calc((100% - 30px) / 2);
  }
}

@media (max-width: 767px) {
  .article-card {
    width: 100%;
    max-width: 100%;
    flex: 0 0 100%;
  }

  .article-card img {
    height: 320px;
  }

  .article-card--over .article-card-content {
    left: 10px;
    right: 10px;
    bottom: 10px;
    padding: 16px;
  }

  .article-card .meta {
    gap: 10px;
  }

  .article-card .title a {
    font-size: 16px;
  }
}


/* Mobile : slider horizontal */
@media (max-width: 767px) {
  .custom-article-grid {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 16px;
    padding: 0 18px 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .custom-article-grid::-webkit-scrollbar {
    display: none;
  }

  .article-card {
    width: 78%;
    max-width: 78%;
    flex: 0 0 78%;
    scroll-snap-align: start;
  }

  .article-card img {
    height: 330px;
  }

  .article-card--over .article-card-content {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
}