/**
 * Idées Reçues Grid Block Styles
 * Responsive grid: 3 columns, 2 on tablet, 1 on mobile.
 *
 * The cards themselves (front/back, flip, colours) are styled once for the
 * whole site in resources/css/ideas.css, so block cards look and behave like
 * the homepage listing on every screen size — no separate mobile carousel
 * (869e223fv).
 */

/* Main block container */
.idees-recues-grid-block {
  margin: 2rem 0;
}

.idees-recues-grid-block .container {
  max-width: 1200px;
}

.idees-recues-desktop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) {
  .idees-recues-desktop-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  .idees-recues-grid-block {
    margin: 1rem 0;
  }

  .idees-recues-desktop-grid {
    grid-template-columns: 1fr;
  }
}

/* Centre the grid when it holds fewer cards than the column count, so a block
   with 1–2 manually-selected idées reçues sits centred instead of flush-left.
   Cards keep their normal (1/3 or 1/2) width; only the track placement changes. */
@media (min-width: 1025px) {
  .idees-recues-desktop-grid:has(.idee-card:nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(0, calc((100% - 40px) / 3)));
    justify-content: center;
  }
  .idees-recues-desktop-grid:has(.idee-card:only-child) {
    grid-template-columns: minmax(0, calc((100% - 40px) / 3));
    justify-content: center;
  }
}
@media (min-width: 768px) and (max-width: 1024px) {
  .idees-recues-desktop-grid:has(.idee-card:only-child) {
    grid-template-columns: minmax(0, calc((100% - 20px) / 2));
    justify-content: center;
  }
}

/* Empty state */
.idees-recues-grid-block .empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #666;
}

.idees-recues-grid-block .empty-state p {
  font-size: 1.1rem;
  margin: 0;
}
