/* The testimonial carousel block. Moves to bundles-content.
 *
 * Split out of assets/css/main.css. Every rule below is verbatim from
 * that file and appears in its original relative order.
 *
 * This sheet loads ONLY on pages carrying the carousel block, so every rule in
 * it must be scoped to the carousel. Two .entry-content layout rules were
 * originally filed here because one of their grouped selectors names
 * .testimonial-carousel; they are page-layout rules that have to apply
 * everywhere, and they live in the theme's patterns.css instead.
 */
/* ── Testimonial Carousel ─────────────────────────────────────────────────── */
.testimonial-carousel {
  background: var(--cream);
  padding: var(--pad-v) var(--pad-h);
}

/* When carousel is nested inside a Columns block, let the outer wrapper own
   the section padding so it matches every other full-bleed row. */
.wp-block-columns:has(.testimonial-carousel) {
  background: var(--cream);
  padding: var(--pad-v) var(--pad-h);
  align-items: center;
  gap: var(--gap-col);
}
.wp-block-columns:has(.testimonial-carousel) .testimonial-carousel {
  padding: 0;
  background: transparent;
}

/* Fade-stack: all slides occupy the same grid cell */
.tc-track {
  display: grid;
}
.tc-slide {
  grid-column: 1;
  grid-row: 1;
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
}
.tc-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

/* Two-column split within each slide */
.tc-split {
  display: flex;
  gap: var(--gap-col);
  align-items: center;
}

/*
 * Polaroid pile — structural note:
 * Ghost cards live on .tc-photo-stack (no transform) so they use plain z-index
 * stacking. Putting them on .tc-photo (which has transform: rotate) creates a
 * stacking context that swallows z-index: -1 and eats the white border.
 */
.tc-photo-stack {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

/* Ghost cards — same footprint as .tc-photo, safely behind it */
.tc-photo-stack::before,
.tc-photo-stack::after {
  content: '';
  position: absolute;
  inset: 20px;   /* matches padding, so ghost = .tc-photo size */
  background: var(--white);
  border-radius: 2px;
  z-index: 0;
}
.tc-photo-stack::before {
  box-shadow: 0 5px 20px rgba(0,0,0,.13);
  transform: rotate(-7deg);
}
.tc-photo-stack::after {
  box-shadow: 0 4px 16px rgba(0,0,0,.10);
  transform: rotate(5deg);
}

/* Polaroid frame — always in front of ghost cards */
.tc-photo {
  position: relative;
  z-index: 1;
  width: 100%;
  background: var(--white);
  padding: 12px 12px 44px;
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,.10), 0 8px 28px rgba(0,0,0,.17);
  transform: rotate(var(--rot, -2deg));
  will-change: transform;
}

/* Per-slide tilt — cycles through 6 values */
.tc-slide:nth-child(1) .tc-photo { --rot: -2.5deg; }
.tc-slide:nth-child(2) .tc-photo { --rot:  3deg;   }
.tc-slide:nth-child(3) .tc-photo { --rot: -1deg;   }
.tc-slide:nth-child(4) .tc-photo { --rot:  2deg;   }
.tc-slide:nth-child(5) .tc-photo { --rot: -3deg;   }
.tc-slide:nth-child(6) .tc-photo { --rot:  1.5deg; }

.tc-photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  border-radius: 0;
  display: block;
}

.tc-content {
  flex: 2;
  display: flex;
  flex-direction: column;
}

/* No-photo: centre text */
.tc-split--no-photo .tc-content {
  flex: none;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}
@media (max-width: 860px) {
  /* No flex-direction override here — WP core's own mobile stacking
     (flex-wrap:wrap + flex-basis:100% !important per .wp-block-column,
     wp-block-columns-inline-css) already stacks this correctly. Forcing
     flex-direction:column fights it: flex-basis governs height instead of
     width once direction is column, so core's 100% stops constraining width
     and the column shrinks to its content size instead of the full row. */
  .testimonial-carousel { padding: var(--pad-v) var(--mob-h); }
  /* No flex-direction override — see the .testimonial-split note above;
     the same core stacking mechanism applies here and forcing column
     direction is what pushed the wide carousel column off-screen. */
  .wp-block-columns:has(.testimonial-carousel) { padding: var(--pad-v) var(--mob-h); }
  .tc-split { flex-direction: column; align-items: center; }
  .tc-photo-stack { padding: 16px; width: 80%; max-width: 260px; }
  .tc-photo-stack::before, .tc-photo-stack::after { inset: 16px; }
  .tc-content { align-items: center; text-align: center; }
}
