/* Image Carousel */
.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  margin: 1.5em 0;
  background: var(--bg-surface);
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-y;
}

.carousel-track {
  display: flex;
  transition: transform 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
  will-change: transform;
}

.carousel-slide {
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

video.carousel-img,
.carousel-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  max-height: 80vh;
  border-radius: 0;
}

/* Navigation arrows */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: opacity var(--transition), background var(--transition), transform var(--transition);
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(4px);
}

.carousel-nav:hover {
  background: rgba(0,0,0,0.7);
  transform: translateY(-50%) scale(1.1);
}

.carousel-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.carousel-prev {
  left: 10px;
}

.carousel-next {
  right: 10px;
}

/* Dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 0;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.carousel-dot.active {
  background: white;
  transform: scale(1.2);
}

/* Counter (e.g., "3 / 10") */
.carousel-counter {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(0,0,0,0.5);
  color: white;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 999px;
  z-index: 2;
  backdrop-filter: blur(4px);
}

/* Video Embeds */
.video-embed {
  position: relative;
  width: 100%;
  margin: 0 0 1.5em;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.tiktok-embed {
  /* TikTok vertical video: 9:16 aspect ratio, capped height */
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: 9 / 16;
  max-height: 600px;
}

.ig-reel-embed {
  /* IG Reels: similar vertical format */
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: 9 / 16;
  max-height: 600px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .carousel-nav {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
  }

  .carousel-prev { left: 6px; }
  .carousel-next { right: 6px; }

  .carousel-dots {
    gap: 5px;
    bottom: 6px;
  }

  .carousel-dot {
    width: 6px;
    height: 6px;
  }

  .carousel-counter {
    font-size: 0.65rem;
    top: 8px;
    right: 8px;
  }

  .tiktok-embed,
  .ig-reel-embed {
    max-width: 100%;
    max-height: 70vh;
  }

  .carousel-nav {
    width: 34px;
    height: 34px;
  }
}

/* Dots overflow for many slides */
.carousel-dots:has(.carousel-dot:nth-child(13)) {
  gap: 4px;
}

.carousel-dots:has(.carousel-dot:nth-child(13)) .carousel-dot {
  width: 5px;
  height: 5px;
}
