/* === Dzagurov CSS-only fade carousel v3 2026062424 === */

/* Root */
#dzHomeNewsCarousel.dz-home-css-fade {
  position: relative !important;
  overflow: hidden !important;
  background: transparent !important;
}

/* Stage */
#dzHomeNewsCarousel .dz-home-css-fade-stage {
  position: absolute !important;
  inset: 0 !important;
  z-index: 1 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: inherit !important;
  overflow: hidden !important;
  background: transparent !important;
}

/* Slides */
#dzHomeNewsCarousel .dz-home-css-fade-slide {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: inherit !important;
  opacity: 0;
  pointer-events: none !important;
  transform: none !important;
  animation-duration: 18s;
  animation-iteration-count: infinite;
  animation-timing-function: linear;
  animation-fill-mode: both;
  will-change: opacity;
}

/* Safety: even before animation, first photo must be visible */
#dzHomeNewsCarousel .dz-home-css-fade-slide:first-child {
  opacity: 1;
}

/* Photo layer */
#dzHomeNewsCarousel .dz-home-carousel-photo {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: inherit !important;
  background-position: center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
}

/* 1 photo */
#dzHomeNewsCarousel.dz-fade-count-0 .dz-home-css-fade-slide,
#dzHomeNewsCarousel.dz-fade-count-1 .dz-home-css-fade-slide {
  opacity: 1 !important;
  animation: none !important;
}

/* 2 photos */
#dzHomeNewsCarousel.dz-fade-count-2 .dz-home-css-fade-slide {
  animation-duration: 12s;
}

#dzHomeNewsCarousel.dz-fade-count-2 .dz-home-css-fade-slide:nth-child(1) {
  animation-name: dzFadeTwoOne;
}

#dzHomeNewsCarousel.dz-fade-count-2 .dz-home-css-fade-slide:nth-child(2) {
  animation-name: dzFadeTwoTwo;
}

@keyframes dzFadeTwoOne {
  0%, 42% { opacity: 1; }
  50%, 92% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes dzFadeTwoTwo {
  0%, 42% { opacity: 0; }
  50%, 92% { opacity: 1; }
  100% { opacity: 0; }
}

/* 3 photos: current real case for News id=2 */
#dzHomeNewsCarousel.dz-fade-count-3 .dz-home-css-fade-slide:nth-child(1) {
  animation-name: dzFadeThreeOne;
}

#dzHomeNewsCarousel.dz-fade-count-3 .dz-home-css-fade-slide:nth-child(2) {
  animation-name: dzFadeThreeTwo;
}

#dzHomeNewsCarousel.dz-fade-count-3 .dz-home-css-fade-slide:nth-child(3) {
  animation-name: dzFadeThreeThree;
}

@keyframes dzFadeThreeOne {
  0%, 28% { opacity: 1; }
  36%, 92% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes dzFadeThreeTwo {
  0%, 28% { opacity: 0; }
  36%, 61% { opacity: 1; }
  69%, 100% { opacity: 0; }
}

@keyframes dzFadeThreeThree {
  0%, 61% { opacity: 0; }
  69%, 92% { opacity: 1; }
  100% { opacity: 0; }
}

/* 4 photos */
#dzHomeNewsCarousel.dz-fade-count-4 .dz-home-css-fade-slide {
  animation-duration: 24s;
}

#dzHomeNewsCarousel.dz-fade-count-4 .dz-home-css-fade-slide:nth-child(1) {
  animation-name: dzFadeFourOne;
}

#dzHomeNewsCarousel.dz-fade-count-4 .dz-home-css-fade-slide:nth-child(2) {
  animation-name: dzFadeFourTwo;
}

#dzHomeNewsCarousel.dz-fade-count-4 .dz-home-css-fade-slide:nth-child(3) {
  animation-name: dzFadeFourThree;
}

#dzHomeNewsCarousel.dz-fade-count-4 .dz-home-css-fade-slide:nth-child(4) {
  animation-name: dzFadeFourFour;
}

@keyframes dzFadeFourOne {
  0%, 20% { opacity: 1; }
  27%, 94% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes dzFadeFourTwo {
  0%, 20% { opacity: 0; }
  27%, 44% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@keyframes dzFadeFourThree {
  0%, 44% { opacity: 0; }
  51%, 68% { opacity: 1; }
  75%, 100% { opacity: 0; }
}

@keyframes dzFadeFourFour {
  0%, 68% { opacity: 0; }
  75%, 94% { opacity: 1; }
  100% { opacity: 0; }
}

/* Caption above carousel */
#dzHomeNewsCarousel .dz-home-photo-caption {
  position: absolute;
  z-index: 8 !important;
  pointer-events: none !important;
  transition: none !important;
}

/* === Dzagurov CSS-only fade carousel v3 end === */

/* === Fix zero-height CSS fade carousel 2026062426 === */

#dzHomeNewsCarousel.dz-home-css-fade {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  min-height: 660px !important;
  height: 660px !important;
  overflow: hidden !important;
  background: #eef3f6 !important;
}

#dzHomeNewsCarousel .dz-home-css-fade-stage,
#dzHomeNewsCarousel .dz-home-css-fade-slide,
#dzHomeNewsCarousel .dz-home-carousel-photo {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 660px !important;
}

#dzHomeNewsCarousel .dz-home-carousel-photo {
  background-position: center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
}

@media (max-width: 991.98px) {
  #dzHomeNewsCarousel.dz-home-css-fade {
    min-height: 500px !important;
    height: 500px !important;
  }

  #dzHomeNewsCarousel .dz-home-css-fade-stage,
  #dzHomeNewsCarousel .dz-home-css-fade-slide,
  #dzHomeNewsCarousel .dz-home-carousel-photo {
    min-height: 500px !important;
  }
}

@media (max-width: 575.98px) {
  #dzHomeNewsCarousel.dz-home-css-fade {
    min-height: 340px !important;
    height: 340px !important;
  }

  #dzHomeNewsCarousel .dz-home-css-fade-stage,
  #dzHomeNewsCarousel .dz-home-css-fade-slide,
  #dzHomeNewsCarousel .dz-home-carousel-photo {
    min-height: 340px !important;
  }
}

/* === Fix zero-height CSS fade carousel end === */

/* === Carousel final geometry + bottom readability overlay 2026062429 === */

#dzHomeNewsCarousel.dz-home-css-fade {
  min-height: 546px !important;
  height: 546px !important;
}

#dzHomeNewsCarousel .dz-home-css-fade-stage,
#dzHomeNewsCarousel .dz-home-css-fade-slide,
#dzHomeNewsCarousel .dz-home-carousel-photo {
  min-height: 546px !important;
  height: 100% !important;
}

/* Нижнее затемнение для читаемости текста */
#dzHomeNewsCarousel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48%;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, .48) 0%,
    rgba(0, 0, 0, .28) 42%,
    rgba(0, 0, 0, 0) 100%
  );
  border-radius: inherit;
}

/* Подпись должна быть поверх затемнения */
#dzHomeNewsCarousel .dz-home-photo-caption {
  z-index: 8 !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .36);
}

/* Tablet */
@media (max-width: 991.98px) {
  #dzHomeNewsCarousel.dz-home-css-fade {
    min-height: 430px !important;
    height: 430px !important;
  }

  #dzHomeNewsCarousel .dz-home-css-fade-stage,
  #dzHomeNewsCarousel .dz-home-css-fade-slide,
  #dzHomeNewsCarousel .dz-home-carousel-photo {
    min-height: 430px !important;
  }
}

/* Mobile */
@media (max-width: 575.98px) {
  #dzHomeNewsCarousel.dz-home-css-fade {
    min-height: 340px !important;
    height: 340px !important;
  }

  #dzHomeNewsCarousel .dz-home-css-fade-stage,
  #dzHomeNewsCarousel .dz-home-css-fade-slide,
  #dzHomeNewsCarousel .dz-home-carousel-photo {
    min-height: 340px !important;
  }

  #dzHomeNewsCarousel::after {
    height: 58%;
  }
}

/* === Carousel final geometry + bottom readability overlay end === */

/* === Carousel soft bottom-only overlay 2026062430 === */

/* Переопределяем старое затемнение: только низ, без резкой границы */
#dzHomeNewsCarousel::after {
  content: "";
  position: absolute !important;
  top: auto !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 34% !important;
  z-index: 3 !important;
  pointer-events: none !important;
  border-radius: 0 0 inherit inherit;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, .38) 0%,
    rgba(0, 0, 0, .24) 34%,
    rgba(0, 0, 0, .10) 68%,
    rgba(0, 0, 0, 0) 100%
  ) !important;
}

/* Текст поверх нижнего затемнения */
#dzHomeNewsCarousel .dz-home-photo-caption {
  z-index: 8 !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .28);
}

/* На мобильных затемнение чуть выше, потому что текст занимает больше места */
@media (max-width: 575.98px) {
  #dzHomeNewsCarousel::after {
    height: 44% !important;
    background: linear-gradient(
      0deg,
      rgba(0, 0, 0, .42) 0%,
      rgba(0, 0, 0, .25) 36%,
      rgba(0, 0, 0, .10) 72%,
      rgba(0, 0, 0, 0) 100%
    ) !important;
  }
}

/* === Carousel soft bottom-only overlay end === */

/* === Carousel soft photo dim overlay 2026062433 === */

/* Не используем общий overlay контейнера */
#dzHomeNewsCarousel::after {
  display: none !important;
  content: none !important;
}

/* Затемняем именно саму фотографию, равномерно и мягко */
#dzHomeNewsCarousel .dz-home-carousel-photo {
  position: relative !important;
}

#dzHomeNewsCarousel .dz-home-carousel-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: rgba(0, 0, 0, .14);
  border-radius: inherit;
}

/* Стеклянная табличка должна быть выше затемнения */
#dzHomeNewsCarousel .dz-home-photo-caption {
  position: absolute;
  z-index: 20 !important;
}

/* Текст чуть читаемее, но без грубой тени */
#dzHomeNewsCarousel .dz-home-photo-caption strong,
#dzHomeNewsCarousel .dz-home-photo-caption span {
  text-shadow: 0 2px 8px rgba(0, 0, 0, .22);
}

/* === Carousel soft photo dim overlay end === */

/* === Carousel stronger photo dim overlay 2026062434 === */

#dzHomeNewsCarousel .dz-home-carousel-photo::after {
  background: rgba(0, 0, 0, .24) !important;
}

/* === Carousel stronger photo dim overlay end === */
