<template>
  <div class="textleft-card-list">
    <slot />
  </div>
</template>

<style lang="scss">
  .textleft-card-list {
    display: flex;
    flex-wrap: wrap;
    gap: var(--gap-cards);
    justify-content: flex-start;
  }
  @media (max-width: 572px) {
    .textleft-card-list {
      justify-content: center;
    }
  }

  // Afficher seulement 1 cards < 600px
  @media (max-width: 599px) {
    .textleft-card-list > .textleft-card:nth-child(2) {
      display: none;
    }
    .textleft-card-list > .textleft-card:nth-child(3) {
      display: none;
    }
  }
  // Afficher seulement 2 cards < 900px
  @media (max-width: 799px) {
    .textleft-card-list > .textleft-card:nth-child(3) {
      display: none;
    }
  }


  // Taille des cards
  @media (max-width: 599px) {
    .textleft-card-list > .textleft-card {
      max-width: 260px;
      flex: 1 1 260px;
      max-width: 90%;
    }
  }
  @media (min-width: 600px) {
    .textleft-card-list > .textleft-card {
      max-width: 247px;
      flex: 1 1 247px;
    }
  }
  @media (min-width: 700px) {
    .textleft-card-list > .textleft-card {
      max-width: 280px;
      flex: 1 1 280px;
    }
  }
  @media (min-width: 800px) {
    .textleft-card-list > .textleft-card {
      max-width: 231px;
      flex: 1 1 231px;
    }
  }
  @media (min-width: 900px) {
    .textleft-card-list > .textleft-card {
      max-width: 258px;
      flex: 1 1 258px;
    }
  }

  @media (min-width: 1000px) {
    .textleft-card-list > .textleft-card {
      max-width: 288px;
      flex: 1 1 288px;
    }
  }

  @media (min-width: 1100px) {
    .textleft-card-list > .textleft-card {
      max-width: 311px;
      flex: 1 1 311px;
    }
  }

  @media (min-width: 1200px) {
    .textleft-card-list > .textleft-card {
      max-width: 334px;
      flex: 1 1 334px;
    }
  }

  @media (min-width: 1300px) {
    .textleft-card-list > .textleft-card {
      max-width: 367px;
      flex: 1 1 367px;
    }
  }

  @media (min-width: 1400px) {
    // style appliqué au composant enfant via sa classe
    .textleft-card-list > .textleft-card {
      max-width: 400px;
      flex: 1 1 400px;
    }
  }



</style>
