/* =========================================
   GRILLE ARTICLE
========================================= */

.ypl-grille-article,
.ypl-grille-article * {
  box-sizing: border-box;
}

.ypl-grille-article {
  width: 100%;
}

/* =========================================
   GRILLE / SLIDER
========================================= */

.ypl-grille-article .custom-article-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: stretch;
}

.ypl-grille-article .article-card {
  position: relative;
  width: calc((100% - 80px) / 3);
  max-width: calc((100% - 80px) / 3);
  flex: 0 0 calc((100% - 80px) / 3);
}

/* Slider activé */
.ypl-grille-article.ypl-slider-enabled {
  overflow: hidden;
}

.ypl-grille-article.ypl-slider-enabled .custom-article-grid {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.ypl-grille-article.ypl-slider-enabled
  .custom-article-grid::-webkit-scrollbar {
  display: none;
}

.ypl-grille-article.ypl-slider-enabled .article-card {
  scroll-snap-align: start;
}

/* =========================================
   IMAGE
========================================= */

.ypl-grille-article .article-card-image {
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
}

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

/* =========================================
   CONTENU
========================================= */

.ypl-grille-article .article-card-content {
  background-color: #f3f3f3;
}

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

.ypl-grille-article .article-card .category {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 20px;
  border: 0;
  border-radius: 999px;
  background-color: #1d1d1d;
  color: #ffffff;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.ypl-grille-article .article-card .date {
  color: #1d1d1d;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
}

.ypl-grille-article .article-card .title {
  margin: 0;
}

.ypl-grille-article .article-card .title a {
  color: #1d1d1d;
  font-size: 30px;
  font-weight: 800;
  line-height: 0.98;
  text-decoration: none;
}

/* =========================================
   VARIANTE : CONTENU SUR IMAGE
========================================= */

.ypl-grille-article .article-card--over {
  overflow: hidden;
  border-radius: 8px;
}

.ypl-grille-article .article-card--over .article-card-image {
  height: 100%;
}

.ypl-grille-article .article-card--over img {
  height: 100%;
  min-height: 500px;
}

.ypl-grille-article .article-card--over .article-card-content {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 2;
  padding: 18px;
  border-radius: 8px;
}

/* =========================================
   VARIANTE : CONTENU SOUS IMAGE
========================================= */

.ypl-grille-article .article-card--under {
  display: flex;
  flex-direction: column;
}

.ypl-grille-article .article-card--under .article-card-content {
  padding: 18px 0 0;
  background-color: transparent;
}

.ypl-grille-article .article-card--under .category {
  background-color: #1d1d1d;
  color: #ffffff;
}

/* =========================================
   NAVIGATION SLIDER
========================================= */

/* Flèches en haut à droite */
.ypl-grille-article .ypl-article-slider-arrows {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 20px;
}

.ypl-grille-article .ypl-article-slider-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #1d1d1d;
  border-radius: 50%;
  background-color: transparent;
  color: #1d1d1d;
  line-height: 1;
  cursor: pointer;
}

.ypl-grille-article .ypl-article-slider-arrow img {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
  border-radius: 0;
}

.ypl-grille-article .ypl-article-slider-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

/* Dots sous les articles */
.ypl-grille-article .ypl-article-slider-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin-top: 54px;
}

.ypl-grille-article .ypl-article-slider-dot {
  width: 30px;
  height: 3px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background-color: rgba(29, 29, 29, 0.22);
  cursor: pointer;
  transition:
    width 0.25s ease,
    background-color 0.25s ease;
}

.ypl-grille-article .ypl-article-slider-dot.is-active {
  width: 30px;
  background-color: #1d1d1d;
}

/* =========================================
   TABLETTE
========================================= */

@media (max-width: 1024px) {
  .ypl-grille-article .article-card {
    width: calc((100% - 30px) / 2);
    max-width: calc((100% - 30px) / 2);
    flex-basis: calc((100% - 30px) / 2);
  }
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 767px) {
  .ypl-grille-article .custom-article-grid {
    gap: 16px;
  }

  .ypl-grille-article .article-card {
    width: 82%;
    max-width: 82%;
    flex-basis: 82%;
  }

  .ypl-grille-article:not(.ypl-slider-enabled) .article-card {
    width: 100%;
    max-width: 100%;
    flex-basis: 100%;
  }

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

  .ypl-grille-article .article-card--over img {
    min-height: 420px;
  }

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

  .ypl-grille-article .article-card .title a {
    font-size: 24px;
  }

  .ypl-grille-article .ypl-article-slider-navigation {
    margin-bottom: 16px;
  }

  .ypl-grille-article .ypl-article-slider-dot {
    width: 18px;
  }

  .ypl-grille-article .ypl-article-slider-dot.is-active {
    width: 32px;
  }

  .ypl-grille-article .ypl-article-slider-arrow {
    width: 34px;
    height: 34px;
  }

  .ypl-grille-article.ypl-grid-enabled .custom-article-grid {
  gap: 16px;
}
}

/* =========================================
   ALIGNEMENT DES BLOCS CONTENU
========================================= */

.ypl-grille-article .article-card--over .article-card-content {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* La meta reste en haut du bloc */
.ypl-grille-article .article-card--over .meta {
  margin-bottom: 42px;
}

/* Le titre ne doit plus être poussé artificiellement */
.ypl-grille-article .article-card .title {
  margin: 0;
}

/* =========================================
   FLÈCHES
========================================= */

.ypl-grille-article {
  position: relative;
}

.ypl-grille-article.ypl-slider-enabled {
  padding-top: 70px;
}

.ypl-grille-article .ypl-article-slider-arrows {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}


/* =========================================
   GRILLE / SLIDER
========================================= */

/* Grille activée */
.ypl-grille-article.ypl-grid-enabled .custom-article-grid {
  display: grid;
  grid-template-columns:
    repeat(var(--ypl-grid-columns, 3), minmax(0, 1fr));
  gap: 40px;
  align-items: stretch;
}

.ypl-grille-article.ypl-grid-enabled .article-card {
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  flex: none !important;
}