/**
 * ANF Cinemateca - Slideshow Component
 */

.region-slideshow {
  position: relative;
  width: 100%;
  max-width: 950px;
  margin: 0 auto 20px auto;
}

/* Tablet responsive */
@media (min-width: 769px) and (max-width: 950px) {
  .region-slideshow {
    max-width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
  }
}

/* Black gradient shadow around the slideshow - fades on all sides */
.region-slideshow::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1500px;
  max-width: calc(100% + 220px);
  height: 24%;
  background: radial-gradient(ellipse 85% 100% at 50% 38%, #000000e6 18%, rgba(0, 0, 0, 0.2) 48%, transparent 60%);
  pointer-events: none;
}

.slideshow-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.slideshow-slides {
  position: relative;
  width: 100%;
}

.slideshow-slide {
  display: none;
  position: relative;
  width: 100%;
  transition: opacity 0.5s ease-in-out;
}

.slideshow-slide.active {
  display: block !important;
}

.slideshow-slide img {
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
}

/* Navigation buttons */
.slideshow-prev,
.slideshow-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  font-size: 30px;
  padding: 10px 15px;
  cursor: pointer;
  z-index: 10;
  transition: background 0.3s;
}

.slideshow-prev:hover,
.slideshow-next:hover {
  background: rgba(0, 0, 0, 0.8);
}

.slideshow-prev {
  left: 10px;
}

.slideshow-next {
  right: 10px;
}

/* Dots navigation */
.slideshow-dots {
  text-align: center;
  padding: 15px 0;
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  z-index: 10;
}

.slideshow-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  margin: 0 5px;
  cursor: pointer;
  transition: background 0.3s;
}

.slideshow-dot.active {
  background: rgba(255, 255, 255, 1);
}

/* Slide caption/overlay */
.slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  color: #ffffff;
  padding: var(--spacing-lg);
}

.slide-caption h2 {
  color: #ffffff;
  margin: 0 0 var(--spacing-xs);
  border: none;
  font-size: 2rem;
}

.slide-caption p {
  margin: 0;
  font-size: 1.1rem;
}

/* Slick slider overrides */
.slick-slider {
  margin-bottom: 0;
}

.slick-dots {
  bottom: 20px;
  z-index: 10;
}

.slick-dots li button:before {
  font-size: 12px;
  color: #ffffff;
  opacity: 0.5;
}

.slick-dots li.slick-active button:before {
  color: #ffffff;
  opacity: 1;
}

/* Navigation arrows */
.slick-prev,
.slick-next {
  z-index: 10;
  width: 50px;
  height: 50px;
}

.slick-prev {
  left: 20px;
}

.slick-next {
  right: 20px;
}

.slick-prev:before,
.slick-next:before {
  font-size: 40px;
  opacity: 0.7;
}

.slick-prev:hover:before,
.slick-next:hover:before {
  opacity: 1;
}

/* Loading state */
.slideshow-wrapper.is-loading {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slideshow-wrapper.is-loading::after {
  content: "Se încarcă...";
  color: #ffffff;
  font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 768px) {
  .slideshow-wrapper {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin-bottom: 15px;
  }

  .slideshow-slides {
    position: relative;
    width: 100%;
    height: auto;
    padding-bottom: 0;
  }

  .slideshow-slide {
    position: relative;
    width: 100%;
    height: auto;
  }

  .slideshow-slide img {
    position: relative;
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    object-position: center center;
    margin: 0;
    padding: 0;
    display: block;
  }

  .slide-caption {
    padding: var(--spacing-sm);
  }

  .slide-caption h2 {
    font-size: 1.5rem;
  }

  .slide-caption p {
    font-size: 0.9rem;
  }

  .slick-prev,
  .slick-next {
    width: 40px;
    height: 40px;
  }

  .slick-prev {
    left: 10px;
  }

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

/* Extra small screens */
@media (max-width: 480px) {
  .slideshow-wrapper {
    height: auto;
  }

  .slideshow-slides {
    height: auto;
    padding-bottom: 0;
  }

  .slideshow-slide {
    height: auto;
  }

  .slideshow-slide img {
    position: relative;
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    object-position: center center;
    margin: 0;
    padding: 0;
    display: block;
  }

  .slide-caption h2 {
    font-size: 1.2rem;
  }

  .slide-caption p {
    font-size: 0.8rem;
  }

  .slick-prev,
  .slick-next {
    width: 30px;
    height: 30px;
  }

  .slick-prev:before,
  .slick-next:before {
    font-size: 24px;
  }
}

/* Responsive styles */
@media (max-width: 768px) {
  .region-slideshow {
    margin-bottom: 15px;
  }

  .slideshow-prev,
  .slideshow-next {
    font-size: 24px;
    padding: 8px 12px;
  }

  .slideshow-prev {
    left: 5px;
  }

  .slideshow-next {
    right: 5px;
  }

  .slideshow-dots {
    bottom: 5px;
  }

  .slideshow-dot {
    width: 10px;
    height: 10px;
    margin: 0 3px;
  }
}

/* Homepage specific spacing */
body.path-frontpage .region-slideshow,
body.front .region-slideshow {
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  body.path-frontpage .region-slideshow,
  body.front .region-slideshow {
    margin-bottom: 10px;
  }

  /* Adjust gradient shadow for mobile - higher position */
  .region-slideshow::before {
    top: 85%;
    height: 30%;
    background: radial-gradient(ellipse 90% 100% at 50% 30%, #000000e6 15%, rgba(0, 0, 0, 0.2) 45%, transparent 55%);
  }
}