/* ============================================================
   Michael Bowles Portfolio — Carousel Styles
   ============================================================ */

/* ------------------------------------------------------------
   1. Carousel Container
   ------------------------------------------------------------ */
.carousel {
  position: relative;
  width: 100%;
  height: 40vh;
  overflow: hidden;
  background-color: #000;
}

@media (min-width: 768px) {
  .carousel {
    height: 50vh;
  }
}

@media (min-width: 1024px) {
  .carousel {
    height: 60vh;
  }
}

/* ------------------------------------------------------------
   2. Slides — Absolute Positioned, Fade Transition
   ------------------------------------------------------------ */
.carousel__track {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  z-index: 1;
}

.carousel__slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 2;
}

.carousel__slide {
  background-position: right center;
  background-size: cover;
  background-repeat: no-repeat;
}

.carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  display: block;
}

/* Optional slide-and-fade variant */
.carousel--slide-fade .carousel__slide {
  transform: scale(1.02);
  transition: opacity 0.8s ease, visibility 0.8s ease, transform 5s ease-out;
}

.carousel--slide-fade .carousel__slide.active {
  transform: scale(1);
}

/* ------------------------------------------------------------
   3. Navigation Arrows
   ------------------------------------------------------------ */
.carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.4);
  color: #FFFFFF;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
  backdrop-filter: blur(4px);
}

.carousel__arrow:hover {
  background-color: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.05);
}

.carousel__arrow:active {
  transform: translateY(-50%) scale(0.98);
}

.carousel__arrow--prev {
  left: 16px;
}

.carousel__arrow--next {
  right: 16px;
}

/* Arrow icons — using CSS borders for zero-dependency arrows */
.carousel__arrow-icon {
  display: block;
  width: 10px;
  height: 10px;
  border-top: 2px solid #FFFFFF;
  border-right: 2px solid #FFFFFF;
}

.carousel__arrow--prev .carousel__arrow-icon {
  transform: rotate(-135deg);
  margin-left: 3px;
}

.carousel__arrow--next .carousel__arrow-icon {
  transform: rotate(45deg);
  margin-right: 3px;
}

/* Smaller arrows on mobile */
@media (max-width: 767px) {
  .carousel__arrow {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }

  .carousel__arrow--prev {
    left: 10px;
  }

  .carousel__arrow--next {
    right: 10px;
  }

  .carousel__arrow-icon {
    width: 8px;
    height: 8px;
  }
}

/* ------------------------------------------------------------
   4. Dot Indicators
   ------------------------------------------------------------ */
.carousel__dots {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
}

.carousel__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background-color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease,
    transform 0.3s ease;
  padding: 0;
}

.carousel__dot:hover {
  background-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.15);
}

/* Active dot — gold */
.carousel__dot.active {
  background-color: #C5A258;
  border-color: #C5A258;
  transform: scale(1.2);
}

/* Slightly larger hit area on mobile */
@media (max-width: 767px) {
  .carousel__dots {
    bottom: 14px;
    gap: 8px;
  }

  .carousel__dot {
    width: 9px;
    height: 9px;
  }
}

/* ------------------------------------------------------------
   5. Text Overlay — Left-Aligned Black Box
   ------------------------------------------------------------ */
.carousel__text-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem;
  pointer-events: none;
}

.carousel__text-box {
  background-color: rgba(0, 0, 0, 0.78);
  padding: 2rem 1.75rem;
  border-radius: 8px;
  max-width: 90%;
  pointer-events: auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.carousel__cta {
  margin-top: 0.75rem;
}

@media (min-width: 768px) {
  .carousel__text-overlay {
    padding: 2.5rem;
  }
  .carousel__text-box {
    max-width: 50%;
    padding: 2.5rem 2rem;
  }
}

@media (min-width: 1024px) {
  .carousel__text-overlay {
    padding: 3rem;
  }
  .carousel__text-box {
    max-width: 45%;
    padding: 3rem 2.5rem;
  }
}

/* ------------------------------------------------------------
   6. Hero Text Overlay
   ------------------------------------------------------------ */
.carousel__content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 5;
  padding: 3rem 1.5rem 3.5rem;
  pointer-events: none;
}

.carousel__content > * {
  pointer-events: auto;
}

.carousel__headline {
  font-family: "Inter", "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.15;
  margin-bottom: 0.6rem;
}

.carousel__subtitle {
  font-size: 1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 0;
}

/* Desktop hero text sizing */
@media (min-width: 768px) {
  .carousel__content {
    padding: 3rem 2.5rem 4rem;
  }

  .carousel__headline {
    font-size: 2.75rem;
  }

  .carousel__subtitle {
    font-size: 1.15rem;
  }
}

@media (min-width: 1024px) {
  .carousel__content {
    padding: 3rem 3rem 4.5rem;
  }

  .carousel__headline {
    font-size: 3.25rem;
  }

  .carousel__subtitle {
    font-size: 1.25rem;
  }
}

/* ------------------------------------------------------------
   7. Smooth CSS Transitions — Slide Variants
   ------------------------------------------------------------ */

/* Horizontal slide transition (alternative to default fade) */
.carousel--horizontal .carousel__slide {
  opacity: 1;
  visibility: visible;
  transform: translateX(100%);
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.carousel--horizontal .carousel__slide.active {
  transform: translateX(0);
}

.carousel--horizontal .carousel__slide.prev {
  transform: translateX(-100%);
}

/* Scale-up transition */
.carousel--zoom .carousel__slide {
  transform: scale(0.92);
  transition: opacity 0.7s ease, transform 0.7s ease, visibility 0.7s ease;
}

.carousel--zoom .carousel__slide.active {
  transform: scale(1);
}

/* ------------------------------------------------------------
   8. Pause on Hover
   ------------------------------------------------------------ */
.carousel.paused .carousel__slide {
  /* Extend transition duration when paused to prevent mid-animation jumps */
  transition-duration: 0s;
}

/* Visual indicator that autoplay is paused */
.carousel__pause-indicator {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 32px;
  height: 32px;
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.carousel.paused .carousel__pause-indicator {
  opacity: 1;
}

.carousel__pause-indicator::before,
.carousel__pause-indicator::after {
  content: "";
  display: block;
  width: 3px;
  height: 12px;
  background-color: #FFFFFF;
  border-radius: 1px;
}

.carousel__pause-indicator::before {
  margin-right: 3px;
}

/* ------------------------------------------------------------
   9. Accessibility — Reduced Motion
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .carousel__slide {
    transition-duration: 0.01s !important;
  }

  .carousel--slide-fade .carousel__slide {
    transform: none !important;
    transition: opacity 0.01s ease, visibility 0.01s ease;
  }

  .carousel__arrow,
  .carousel__dot {
    transition-duration: 0.01s !important;
  }
}
