/* =====================================================
   Buzz Carousel — Drag Coverflow Component
   =====================================================
   3D coverflow-style draggable image carousel.
   Center card is prominent; side cards rotate inward.
   A custom DRAG cursor appears on hover.

   Usage:
     <div class="buzz-carousel-wrap" id="...">
       <div class="buzz-carousel-track" id="...">
         <div class="buzz-carousel-slide">
           <img class="buzz-carousel-slide__img" src="...">
           <div class="buzz-carousel-slide__overlay">
             <h3 class="buzz-carousel-slide__title">...</h3>
             <div class="buzz-carousel-slide__tags">
               <span class="buzz-carousel-slide__tag">...</span>
             </div>
           </div>
         </div>
       </div>
       <div class="buzz-carousel-nav">
         <button class="buzz-carousel-btn buzz-carousel-btn--prev">...</button>
         <div class="buzz-carousel-dots">
           <span class="buzz-carousel-dot active"></span>
         </div>
         <button class="buzz-carousel-btn buzz-carousel-btn--next">...</button>
       </div>
     </div>
     <!-- cursor lives outside the wrap, appended by JS -->
     <div class="buzz-carousel-cursor" id="...">DRAG</div>

   Override sizing on .buzz-carousel-track:
     --bzc-card-w    card width   (default 360px)
     --bzc-card-h    card height  (default 440px)
     --bzc-gap       gap between fanned cards (default 24px)
   ===================================================== */

/* ---------- Outer Wrapper ---------- */
.buzz-carousel-wrap {
  position: relative;
  overflow: hidden;
  padding: 1rem 0 3.5rem;
  user-select: none;
  -webkit-user-select: none;
}

/* Stage: clips the whole group of cards into a curved shape */
.buzz-carousel-stage {
  overflow: hidden;
  position: relative;
  padding: 1.75rem 0;
}

/* Only the image track hides the system cursor */
.buzz-carousel-track {
  cursor: none;
  touch-action: pan-y;
}

/* ---------- Track (perspective stage) ---------- */
.buzz-carousel-track {
  --bzc-card-w: 360px;
  --bzc-card-h: 440px;
  --bzc-gap:    24px;
  position: relative;
  height: var(--bzc-card-h);
  perspective: 1100px;
  perspective-origin: 50% 50%;
  overflow: visible;
}

/* ---------- Each Slide ---------- */
.buzz-carousel-slide {
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: calc(var(--bzc-card-w) / -2);   /* center horizontally */
  width: var(--bzc-card-w);
  height: var(--bzc-card-h);
  /* shape controlled by .clip-* utility class on the element */
  overflow: hidden;
  will-change: transform, opacity;
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity   0.45s ease,
              box-shadow 0.45s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

/* Suppress transitions during drag for real-time feel */
.buzz-carousel-wrap.is-dragging .buzz-carousel-slide {
  transition: none;
}

.buzz-carousel-slide.is-active {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
}

/* ---------- Image ---------- */
.buzz-carousel-slide__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  pointer-events: none;
  transition: transform 0.7s ease;
}
.buzz-carousel-slide.is-active .buzz-carousel-slide__img {
  transform: scale(1.03);
}

/* ---------- Info Overlay ---------- */
.buzz-carousel-slide__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  background: linear-gradient(to top, rgba(0,0,0,0.40) 0%, rgba(0,0,0,0.32) 65%, transparent 100%);
}

.buzz-carousel-slide__title {
  color: #fff;
  font-size: 1.55rem;
  font-weight: 800;
  margin: 0 0 0.7rem;
  line-height: 1.3;
}

.buzz-carousel-slide__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.3rem;
}
.buzz-carousel-slide__tag {
  font-size: 0.70rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  background: rgba(255,255,255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #000;
  white-space: nowrap;
}

/* CTA button */
.buzz-carousel-slide__cta {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.4rem 1.1rem;
  border-radius: 9999px;
  background: var(--bs-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.04em;
  cursor: pointer !important;   /* override track's cursor:none */
  transition: background 0.2s, transform 0.2s;
  pointer-events: auto;
}
.buzz-carousel-slide__cta:hover {
  background: hsl(var(--primary) / 0.80);
  color: #fff;
  transform: scale(1.06);
  text-decoration: none;
}

/* ---------- DRAG Cursor ---------- */
.buzz-carousel-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(15, 8, 40, 0.84);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.25s ease;
  z-index: 9999;
  opacity: 0;
}
.buzz-carousel-cursor.is-visible {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
.buzz-carousel-cursor.is-dragging {
  transform: translate(-50%, -50%) scale(0.82);
}

/* ---------- Navigation ---------- */
.buzz-carousel-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2rem;
}

.buzz-carousel-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s, color 0.2s;
  flex-shrink: 0;
}
.buzz-carousel-btn:hover {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: #fff;
  transform: scale(1.1);
}
.buzz-carousel-btn:disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* Dots */
.buzz-carousel-dots {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.buzz-carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: hsl(var(--border));
  cursor: pointer;
  transition: background 0.2s, transform 0.25s;
}
.buzz-carousel-dot.active {
  background: hsl(var(--primary));
  transform: scale(1.5);
}

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  .buzz-carousel-track {
    --bzc-card-w: 260px;
    --bzc-card-h: 320px;
  }
  .buzz-carousel-track {
    cursor: auto;
    touch-action: none;
  }
  .buzz-carousel-cursor { display: none; }
}
