/* ── Wrapper: two-column flex ────────────────────── */
.astuces-carousel {
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

/* ── Articles track (left, fills remaining space) ── */
.astuces-carousel .wp-block-post-template {
  display: flex !important;
  flex-wrap: nowrap !important;
  flex: 1 1 0;
  min-width: 0;
  gap: 5px;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
  transform: translateX(0);
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

/* ── Each card — adjust % to control visible count ──
   25%  → 4 cards   |   28% → ~3.5 cards
   33%  → 3 cards   |   50% →  2 cards         ──── */
.astuces-carousel .wp-block-post-template > li {
  flex: 0 0 calc(26% - 4px); /* ~3.8 cards + partial cut */
  min-width: 0;
}

/* ── Nav column (right, fixed width) ─────────────── */
.carousel-nav {
  flex: 0 0 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  z-index: 10;
}

/* ── Toggle button (single › visible by default) ─── */
.carousel-btn-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: var(--wp--preset--color--accent-2);
  color: #111;
  cursor: pointer;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  max-height: 40px;
  overflow: hidden;
  opacity: 1;
  pointer-events: auto;
  transition: max-height 0.3s ease, opacity 0.25s ease, transform 0.2s;
}

.carousel-btn-toggle:hover {
  transform: scale(1.08);
}

/* ── Toggle collapses when nav is open ───────────── */
.carousel-nav.nav-open .carousel-btn-toggle {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

/* ── Arrows wrapper (prev + next, hidden by default) */
.carousel-arrows-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-height: 0;
  overflow: hidden; /* Keeps it hidden while collapsing */
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.35s ease, opacity 0.3s ease;
  
  /* ADD THIS: Prevents horizontal clipping during scale/box-shadow */
  padding: 0 6px; 
}

/* ── Wrapper expands when nav is open ────────────── */
.carousel-nav.nav-open .carousel-arrows-wrapper {
  max-height: 110px;    /* INCREASED: Accommodates padding and hover scale */
  overflow: visible;    /* FIX: Allows the hover scale effect to poke out safely */
  opacity: 1;
  pointer-events: auto;
}

/* ── Shared prev / next style ────────────────────── */
.carousel-btn-prev,
.carousel-btn-next {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: var(--wp--preset--color--accent-2);
  color: #111;
  cursor: pointer;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s, opacity 0.2s;
}

.carousel-btn-prev:hover,
.carousel-btn-next:hover {
  transform: scale(1.08);
}

/* ── Disabled: faded in place, zero layout shift ─── */
.carousel-btn-prev:disabled,
.carousel-btn-next:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
  transform: none !important;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 1024px) {
  .astuces-carousel .wp-block-post-template > li {
    flex: 0 0 calc(33.33% - 4px);
  }
}

@media (max-width: 640px) {
  .astuces-carousel .wp-block-post-template > li {
    flex: 0 0 80%;
  }
  .carousel-nav {
    flex: 0 0 52px;
  }
}