/* CAROUSEL CONTAINER */
.carousel {
  max-width: 700px;
  margin: 2rem auto;
  font-family: system-ui, sans-serif;
}

/* IMAGE VIEWPORT */
.carousel-viewport {
  position: relative;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

/* SLIDE TRACK */
.carousel-track {
  display: flex;
  flex-wrap: nowrap;       
  width: 100%;             
  transform: translate3d(0,0,0); 
  transition: transform 0.2s ease-in-out; 
}

/* SLIDES */
.carousel-slide {
  flex: 0 0 100%;         
  min-width: 100%;         
  box-sizing: border-box;  
}

/* IMAGE AREA */
.carousel-media {
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 736px) {
  .carousel-media {
    height: clamp(240px, 55vw, 360px);
  }
}

.carousel-media img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* MAIN ARROWS — CENTERED ON IMAGE ONLY */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 1.4rem;
  border-radius: 3px;
  z-index: 2;
}

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

/* CAPTIONS */
.carousel-captions {
  margin-top: 0.75rem;
  min-height: 6rem;
}

.carousel-caption {
  display: none;
  text-align: left;
}

.carousel-caption.active {
  display: block;
}

.carousel-caption h3 {
  text-align: center;
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.carousel-caption p {
  margin: 0;
  font-size: 0.95rem;
  color: #444;
  line-height: 1.4;
}

/* THUMBNAILS */
.carousel-thumbnails-wrapper {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 700px;
  margin: 0.75rem auto 0;
}

.carousel-thumbnails {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  flex: 1;
}

.carousel-thumbnails .thumb {
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
  flex: 0 0 auto;
}

.carousel-thumbnails img {
  width: 90px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity 0.2s ease, outline 0.2s ease;
}

/* Active state: always applies (desktop + mobile) */
.carousel-thumbnails .thumb.active img {
  opacity: 1;
  outline: 2px solid #333;
  outline-offset: 2px;
}

/* Hover state: ONLY on devices that truly support hover */
@media (hover: hover) and (pointer: fine) {
  .carousel-thumbnails .thumb:hover img {
    opacity: 1;
    outline: 2px solid #333;
    outline-offset: 2px;
  }
}


/* THUMBNAIL ARROWS */
.thumb-arrow {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem 0.5rem;
  color: #333;
}

.thumb-arrow:hover {
  color: #000;
}

/* Prevent wide images from bleeding into neighboring slides */
.carousel-slide { overflow: hidden; }

.carousel-media img {
  max-width: 100%;
}

/* Prevent double-tap zoom / gesture interference on carousel controls */
.carousel-btn,
.thumb-arrow {
  touch-action: manipulation; /* disables double-tap-to-zoom on supported browsers */
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

/* avoid image being treated as a gesture target */
.carousel-media img {
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
}

