/* ============================================================================
   core_card_carousel — reusable equal-width card carousel (skeleton styles).
   Pairs with core_card_carousel.js, which clones the card set once and drives a
   seamless auto-scrolling / draggable loop. CSP-strict: external CSS only.

   Markup contract:
     .ce-carousel[data-card-carousel]
       .ce-carousel__viewport
         .ce-carousel__track   > one or more cards (any card class)
       .ce-carousel__controls  > [data-dir="prev"] [data-playpause] [data-dir="next"]

   Card LOOK stays with each page's own card class (.ce-model, .fa-core, …).
   This module only sets the carousel mechanics: fixed card WIDTH, equal heights
   via the stretching flex row, viewport clipping, and the controls bar.
   Tune width per instance via --ce-card-w on .ce-carousel.
   ========================================================================== */

.ce-carousel {
  --ce-card-w: 320px;
  position: relative;
  margin-top: 1rem;
}
.ce-carousel__viewport {
  overflow: hidden;
  touch-action: pan-y;          /* allow vertical page scroll; JS handles horizontal drag */
  /* Vertical breathing room so card drop-shadows / hover lift aren't clipped by
     the horizontal overflow:hidden. Negative side margins keep the visible band
     flush with the section edges while the fade still tracks the viewport. */
  padding: 6px 0 26px;
}
.ce-carousel__track {
  display: flex;
  gap: 1rem;
  align-items: stretch;         /* every card stretches to the tallest card's height */
  will-change: transform;
}
.ce-carousel.is-dragging,
.ce-carousel__viewport.is-dragging { cursor: grabbing; }
.ce-carousel__viewport.is-dragging { user-select: none; }

/* Every card in the track gets a fixed width; height comes from the tallest
   card (no clipping). Targets direct children so any card class works. */
.ce-carousel__track > * {
  flex: 0 0 var(--ce-card-w);
  width: var(--ce-card-w);
  margin: 0;
  box-sizing: border-box;
}

/* Controls bar — reachable on every breakpoint. */
.ce-carousel__controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.ce-carousel__btn {
  display: inline-grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  color: var(--brand);
  background: rgba(201, 71, 225, 0.10);
  border: 1px solid rgba(201, 71, 225, 0.35);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}
.ce-carousel__btn:hover {
  background: rgba(201, 71, 225, 0.20);
  border-color: var(--brand);
  transform: translateY(-1px);
}
.ce-carousel__btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.ce-carousel__btn svg { width: 1.25rem; height: 1.25rem; }
.ce-carousel__ico--play { display: none; }
/* When paused, show play instead of pause. */
.ce-carousel__toggle.is-paused .ce-carousel__ico--pause { display: none; }
.ce-carousel__toggle.is-paused .ce-carousel__ico--play { display: block; }

@media (max-width: 1023px) {
  .ce-carousel { --ce-card-w: 300px; }
}
@media (max-width: 639px) {
  /* ~1.1 cards visible: a peek of the next card signals scrollability. */
  .ce-carousel { --ce-card-w: min(82vw, 360px); }
}
