/* Custom Swiper Style - Full Image Background with Bottom Text Mask */

/* Container Setup */
div#swiper_container {
  width: 100%;
  max-width: 100%;
  height: 280px; /* Fixed height */
  margin: 0 auto 20px;
  padding: 0;
  background: transparent;
  box-sizing: border-box;
}

.blog-slider {
  width: 100%;
  height: 100%;
  background: #333; /* Fallback */
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  overflow: hidden;
  position: relative;
}

/* Individual Slide Item (Image Background) */
.blog-slider__item {
  width: 100% !important; /* Force width to match container */
  max-width: 100% !important;
  height: 100%;
  display: flex;
  /* Align content to bottom */
  align-items: flex-end; 
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: 0 !important; /* Make slides square/rectangular */
  
  /* Background Image Settings */
  background-size: cover !important;
  background-position: top center !important; /* "Height use upper part" */
  background-repeat: no-repeat !important;
}

/* Text Content Container */
.blog-slider__content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px 40px 35px; /* Extra bottom padding for pagination */
  z-index: 3;
  text-align: center;
  
  /* Black Transparent Mask */
  background: rgba(0, 0, 0, 0.6); /* Higher transparency */
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center; /* Center horizontally too */
  padding: 0 40px; /* Reset padding-top, keep side padding */
  
  /* Reset transforms/opacity */
  opacity: 1 !important;
  transform: none !important;
}

/* Elements inside content - Initial State (Hidden & Moved) */
.blog-slider__content > * {
  opacity: 0;
  transform: translateY(15px); /* Reduced distance for smoother feel */
  transition: all 0.5s ease-out; /* Smoother easing */
}

/* Active State - Show & Reset Position */
.swiper-slide-active .blog-slider__content > * {
  opacity: 1;
  transform: none;
}

/* Staggered Animation Delays - Optimized for Slide */
.blog-slider__item.swiper-slide-active .blog-slider__code {
  transition-delay: 0.1s;
}
.blog-slider__item.swiper-slide-active .blog-slider__title {
  transition-delay: 0.2s;
}
.blog-slider__item.swiper-slide-active .blog-slider__text {
  transition-delay: 0.3s;
}
.blog-slider__item.swiper-slide-active .blog-slider__pagination {
  transition-delay: 0.4s;
}

/* Hardware Acceleration for Smoother Slides */
.blog-slider__item {
  transform: translate3d(0,0,0);
  backface-visibility: hidden;
  perspective: 1000px;
  will-change: transform; /* Hint browser to optimize */
}

.swiper-wrapper {
  will-change: transform; /* Optimize wrapper movement */
}

/* Container Background Fix */
.blog-slider {
  background: #000; /* Force black background to hide any glass effect leaks */
}

/* Date/Code */
.blog-slider__code {
  color: #ddd;
  font-size: 12px;
  margin-bottom: 5px;
  display: block;
}

/* Title */
.blog-slider__title {
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 8px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  line-height: 1.3;
  display: block;
  text-decoration: none;
}

.blog-slider__title:hover {
  color: #FF7242; /* Orange hover */
}

/* Description Text */
.blog-slider__text {
  font-size: 14px;
  color: #eee;
  margin-bottom: 0;
  line-height: 1.5;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  
  /* Truncate to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Navigation Arrows - Orange */
.swiper-button-prev,
.swiper-button-next {
  color: #FF7242 !important; /* Global Orange */
  opacity: 0.8;
  transition: all 0.3s;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Pagination Dots - Orange */
.blog-slider__pagination {
  position: absolute;
  bottom: 10px !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  text-align: center !important;
  z-index: 4;
  transform: none !important;
  display: flex;
  justify-content: center;
  align-items: center;
}

.swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  margin: 0 4px !important;
  transition: all 0.3s;
  opacity: 1;
}

.swiper-pagination-bullet-active {
  background: #FF7242 !important; /* Global Orange */
  width: 20px;
  border-radius: 4px;
}

/* Mobile Adjustments */
@media screen and (max-width: 768px) {
  div#swiper_container {
    height: 220px;
  }
  
  .blog-slider__title {
    font-size: 18px;
  }
  
  .blog-slider__text {
    -webkit-line-clamp: 1; /* Less text on mobile */
  }
  
  .blog-slider__content {
    padding: 15px 20px 30px;
  }
}

/* Hide Random Post if any remains */
#random {
  display: none !important;
}
