/**
 * Carousel styles
 * @countermeasure/web-components/overlays/carousel
 */

/* ============================================================================
   CONTAINER
   ============================================================================ */
.cmm-carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
  border-radius: var(--radius-lg);
}

.cmm-carousel:focus-visible {
  outline: 2px solid hsl(var(--focus-ring));
  outline-offset: 2px;
}

/* ============================================================================
   VIEWPORT & TRACK
   ============================================================================ */
.cmm-carousel__viewport {
  overflow: hidden;
  width: 100%;
}

.cmm-carousel__track {
  display: flex;
  transition: transform var(--transition-slow, 300ms) cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

/* ============================================================================
   SLIDES
   ============================================================================ */
.cmm-carousel__slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

/* ============================================================================
   ARROW BUTTONS
   ============================================================================ */
.cmm-carousel__arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid hsl(var(--border));
  border-radius: 50%;
  background-color: hsl(var(--background) / 0.85);
  color: hsl(var(--foreground));
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(4px);
  transition:
    background-color var(--transition-fast, 150ms),
    border-color var(--transition-fast, 150ms),
    opacity var(--transition-fast, 150ms);
}

.cmm-carousel__arrow:hover {
  background-color: hsl(var(--background));
  border-color: hsl(var(--foreground) / 0.3);
}

.cmm-carousel__arrow:focus-visible {
  outline: 2px solid hsl(var(--focus-ring));
  outline-offset: 2px;
}

.cmm-carousel__arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cmm-carousel__arrow--prev {
  left: 0.75rem;
}

.cmm-carousel__arrow--next {
  right: 0.75rem;
}

/* ============================================================================
   DOT INDICATORS
   ============================================================================ */
.cmm-carousel__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
}

.cmm-carousel__dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background-color: hsl(var(--muted-foreground) / 0.3);
  cursor: pointer;
  transition:
    background-color var(--transition-fast, 150ms),
    transform var(--transition-fast, 150ms);
}

.cmm-carousel__dot:hover {
  background-color: hsl(var(--muted-foreground) / 0.6);
}

.cmm-carousel__dot:focus-visible {
  outline: 2px solid hsl(var(--focus-ring));
  outline-offset: 2px;
}

.cmm-carousel__dot--active {
  background-color: hsl(var(--primary));
  transform: scale(1.25);
}

/* ============================================================================
   LIVE REGION (screen reader only)
   ============================================================================ */
.cmm-carousel__live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
