/* carousel.css — Far Shore reusable carousel
   Markup and usage: see the comment at the top of js/carousel.js */

.carousel {
  position: relative;
}

.carousel__track {
  position: relative; /* offsetParent for slides, used by carousel.js */
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.carousel__track::-webkit-scrollbar {
  display: none;
}

.carousel__track:focus-visible {
  outline: 1px solid var(--color-teal);
  outline-offset: 4px;
}

.carousel__slide {
  flex: 0 0 100%;
  min-width: 0;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

/* ── Controls (created by carousel.js) ── */
.carousel__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.carousel__arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(46, 46, 46, 0.25);
  color: var(--color-charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    border-color var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out);
}

.carousel__arrow:hover {
  border-color: var(--color-charcoal);
  background: rgba(46, 46, 46, 0.05);
}

.carousel__arrow svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.carousel__dots {
  display: flex;
  gap: var(--space-2);
}

/* 24px tap area around an 8px dot */
.carousel__dot {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.carousel__dot::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-charcoal);
  opacity: 0.25;
  transition:
    opacity var(--duration-fast) var(--ease-out),
    background var(--duration-fast) var(--ease-out);
}

.carousel__dot[aria-current="true"]::before {
  background: var(--color-teal);
  opacity: 1;
}

/* Single slide: nothing to navigate */
.carousel--single .carousel__controls {
  display: none;
}

/* Phone: ≤767px */
@media (max-width: 767px) {
  .carousel__controls {
    margin-top: var(--space-2);
    margin-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .carousel__track {
    scroll-behavior: auto;
  }
}
