/**
 * Image Slider Widget Styles
 *
 * Styling for the image slider with overlapping side images.
 */

/* ========================================
	MAIN CONTAINER
	======================================== */

.jutso-widgets-image-slider {
  position: relative;
  --jutso-widgets-image-slider-slides-per-view: 1.5;
  --jutso-widgets-image-slider-center-width: calc(
    100% / var(--jutso-widgets-image-slider-slides-per-view)
  );
  width: 100%;
  overflow: visible;
  margin-bottom: 8em;
}

/* Ensure Elementor containers don't clip overflow */
.elementor-widget-jutso_widgets_image_slider {
  overflow: visible !important;
}

.elementor-widget-jutso_widgets_image_slider > .elementor-widget-container {
  overflow: visible !important;
}

.jutso-widgets-image-slider__swiper {
  overflow: visible !important;
}

/* ========================================
	SWIPER CONTAINER
	======================================== */

.jutso-widgets-image-slider__swiper {
  width: 100%;
  height: auto;
  overflow: visible !important;
}

.jutso-widgets-image-slider__swiper .swiper-wrapper {
  display: flex;
  align-items: center;
}

/* ========================================
	SLIDES
	======================================== */

.jutso-widgets-image-slider__slide {
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
}

.jutso-widgets-image-slider__slide-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 1.4 / 1;
  overflow: visible;
  transition:
    transform 0.5s ease,
    opacity 0.5s ease;
}

/* Active slide (centered) */
.swiper-slide-active .jutso-widgets-image-slider__slide-inner {
  width: 100%;
  z-index: 2;
}

/* Side slides (left/right) */
.swiper-slide:not(.swiper-slide-active) .jutso-widgets-image-slider__slide-inner {
  width: 100%;
  transform: scale(0.85);
  opacity: 1;
  z-index: 1;
}

/* Overlay for side slides */
.swiper-slide:not(.swiper-slide-active) .jutso-widgets-image-slider__image::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(211, 211, 211, 0.5);
  z-index: 1;
  pointer-events: none;
}

/* ========================================
	IMAGES
	======================================== */

.jutso-widgets-image-slider__image {
  border-radius: 10px !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
  position: relative;
}

/* ========================================
	CAPTION (Subtitle & Copyright)
	======================================== */

.jutso-widgets-image-slider__caption,
.jutso-widgets-image-slider__caption a,
.jutso-widgets-image-slider__caption a:hover {
  position: absolute;
  top: calc(100% + 24px);
  left: 0px;
  font-size: var(--jutso-core-font-paragraph-xs-size);
  line-height: var(--jutso-core-font-paragraph-xs-line-height);
  font-family: var(--jutso-core-font-paragraph-xs-family);
  font-weight: var(--jutso-core-font-paragraph-xs-weight);
  letter-spacing: var(--jutso-core-font-paragraph-xs-letter-spacing);
  word-spacing: var(--jutso-core-font-paragraph-xs-word-spacing);
  color: var(--jutso-core-color-text);
  margin: 0;
  padding: 0 !important;
  width: 70%;
}
.swiper-slide:not(.swiper-slide-active) .jutso-widgets-image-slider__caption {
  opacity: 0;
}

.jutso-widgets-image-slider__caption .jutso-widgets-image-slider__custom-label,
.jutso-widgets-image-slider__caption .jutso-widgets-image-slider__custom-title,
.jutso-widgets-image-slider__caption .jutso-widgets-image-slider__custom-description {
  display: block;
}

/* Typography of the dropped theme utility classes h4 / p-sm / other-tag comes from the theme tokens. */
.jutso-widgets-image-slider__caption .jutso-widgets-image-slider__custom-title {
  margin: 0;
  font-size: var(--jutso-core-font-h4-size);
  line-height: var(--jutso-core-font-h4-line-height);
  font-weight: var(--jutso-core-font-h4-weight);
  font-family: var(--jutso-core-font-h4-family);
  letter-spacing: var(--jutso-core-font-h4-letter-spacing);
  word-spacing: var(--jutso-core-font-h4-word-spacing);
}

.jutso-widgets-image-slider__caption .jutso-widgets-image-slider__custom-description {
  margin: 0;
  font-size: var(--jutso-core-font-paragraph-s-size);
  line-height: var(--jutso-core-font-paragraph-s-line-height);
  font-weight: var(--jutso-core-font-paragraph-s-weight);
  font-family: var(--jutso-core-font-paragraph-s-family);
  letter-spacing: var(--jutso-core-font-paragraph-s-letter-spacing);
  word-spacing: var(--jutso-core-font-paragraph-s-word-spacing);
}

.jutso-widgets-image-slider__caption .jutso-widgets-image-slider__custom-label {
  font-size: var(--jutso-core-font-tag-size);
  line-height: var(--jutso-core-font-tag-line-height);
  font-weight: var(--jutso-core-font-tag-weight);
  font-family: var(--jutso-core-font-tag-family);
  letter-spacing: var(--jutso-core-font-tag-letter-spacing);
  word-spacing: var(--jutso-core-font-tag-word-spacing);
  text-transform: uppercase;
}

.jutso-widgets-image-slider__caption--custom {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ========================================
	NAVIGATION ARROWS
	======================================== */

.jutso-widgets-image-slider__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  outline: none;
  transition: all 0.3s ease;
  font-size: 24px;
  padding: 14px !important;
  background-color: #ffffff;
  color: var(--jutso-core-color-text);
  border-radius: 100%;
}

.jutso-widgets-image-slider__nav:hover {
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.jutso-widgets-image-slider__nav:focus {
  outline: 2px solid var(--site-color, #333);
  outline-offset: 2px;
}

.jutso-widgets-image-slider__nav--prev {
  left: 25px;
}

.jutso-widgets-image-slider__nav--next {
  right: 25px;
}

/* Icon styling */
.jutso-widgets-image-slider__nav svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
  display: block;
}

.jutso-widgets-image-slider__nav i {
  display: block;
  line-height: 1;
  width: 24px;
  height: 24px;
}

/* Disabled state */
.jutso-widgets-image-slider__nav.swiper-button-disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* ========================================
	DOT INDICATORS
	======================================== */

.jutso-widgets-image-slider__dots {
  position: absolute;
  top: calc(100% + 24px);
  left: 50%;
  transform: translateX(-50%);
  width: var(--jutso-widgets-image-slider-center-width);
  z-index: 10;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  pointer-events: auto;
}

/* Override Swiper default pagination centering */
.jutso-widgets-image-slider__dots.swiper-pagination-bullets {
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: var(--jutso-widgets-image-slider-center-width) !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center;
}

.jutso-widgets-image-slider__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #000000 !important;
  cursor: pointer;
  transition: opacity 0.3s ease;
  border: none;
  padding: 0 !important;
  margin: 0;
  flex-shrink: 0;
}

.jutso-widgets-image-slider__dot:not(.jutso-widgets-image-slider__dot--active) {
  opacity: 0.2;
}

.jutso-widgets-image-slider__dot--active {
  opacity: 1;
  width: 8px;
  height: 8px;
}

.jutso-widgets-image-slider__dot:hover {
  opacity: 0.6;
}

/* ========================================
	PLACEHOLDER (EDITOR)
	======================================== */

.jutso-widgets-image-slider__placeholder {
  padding: 40px;
  text-align: center;
  background-color: var(--jutso-core-color-white85);
  border: 2px dashed var(--jutso-core-color-borders);
  border-radius: 8px;
  color: var(--jutso-core-color-black85);
  font-size: 14px;
}

@media screen and (max-width: 767px) {
  .jutso-widgets-image-slider {
    --jutso-widgets-image-slider-slides-per-view: 1;
    --jutso-widgets-image-slider-center-width: 100%;
  }

  .jutso-widgets-image-slider__slide.swiper-slide-active {
    width: 100% !important;
  }

  .jutso-widgets-image-slider__slide-inner {
    width: 100% !important;
  }

  .jutso-widgets-image-slider__caption {
    top: auto;
    position: relative;
    margin-top: 12px;
  }

  .jutso-widgets-image-slider__nav,
  .jutso-widgets-image-slider__dots {
    top: calc(100% + 40px);
  }

  .jutso-widgets-image-slider__nav--prev {
    left: 0 !important;
  }
  .jutso-widgets-image-slider__nav--next {
    right: 0 !important;
  }

  .jutso-widgets-image-slider__dots {
    position: absolute;
    top: calc(100% + 40px);
    left: 50%;
    transform: translateX(-50%) !important;
    width: min(100%, var(--jutso-widgets-image-slider-center-width));
    right: auto !important;
    justify-content: center;
  }

  .jutso-widgets-image-slider__dots.swiper-pagination-bullets {
    width: min(100%, var(--jutso-widgets-image-slider-center-width)) !important;
    justify-content: center !important;
  }
}
