/**
 * News slider — стиль в духе atuin.ru/blog/novostnoj-slajder
 * Адаптировано под DPA: цвета #1e40af (blue-800), #3b82f6 (blue-500)
 */

.news-all-count {
  font-weight: 600;
  opacity: 0.95;
}

.news-slider * {
  box-sizing: border-box;
}

.news-slider-wrapper {
  overflow: hidden;
  position: relative;
  min-height: 320px;
}

.news-slider {
  width: 100%;
  margin: 20px 0;
  padding: 25px 30px 20px;
  padding-right: 80px;
  position: relative;
  background: #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.08), 0 8px 22px rgba(0,0,0,0.06);
  border-radius: 1.5rem;
  transition: all 0.3s;
  border: 4px solid #bfdbfe;
}

.news-slider__item {
  display: flex;
  align-items: flex-start;
  overflow: hidden;
  border-radius: 0.5rem;
}

.news-slider__item.swiper-slide-active .news-slider__content > * {
  opacity: 1;
  transform: none;
}

.news-slider__item.swiper-slide-active .news-slider__content > *:nth-child(1) { transition-delay: 0.3s; }
.news-slider__item.swiper-slide-active .news-slider__content > *:nth-child(2) { transition-delay: 0.4s; }
.news-slider__item.swiper-slide-active .news-slider__content > *:nth-child(3) { transition-delay: 0.5s; }
.news-slider__item.swiper-slide-active .news-slider__content > *:nth-child(4) { transition-delay: 0.6s; }
.news-slider__item.swiper-slide-active .news-slider__content > *:nth-child(5) { transition-delay: 0.7s; }
.news-slider__item.swiper-slide-active .news-slider__content > *:nth-child(6) { transition-delay: 0.8s; }
.news-slider__item.swiper-slide-active .news-slider__content > *:nth-child(7) { transition-delay: 0.9s; }
.news-slider__item.swiper-slide-active .news-slider__content > *:nth-child(8) { transition-delay: 1s; }
.news-slider__item.swiper-slide-active .news-slider__content > *:nth-child(9) { transition-delay: 1.1s; }
.news-slider__item.swiper-slide-active .news-slider__content > *:nth-child(10) { transition-delay: 1.2s; }

.news-slider__img {
  width: 260px;
  max-width: 100%;
  height: 260px;
  flex-shrink: 0;
  background: linear-gradient(147deg, #bfdbfe 0%, #1e40af 74%);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12), 0 16px 20px rgba(0,0,0,0.1);
  border-radius: 1rem;
  transform: scale(0);
  overflow: hidden;
  opacity: 0;
  isolation: isolate;
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-slider__img img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 1rem;
  transition: all 0.3s;
}

.news-slider__item.swiper-slide-active .news-slider__img {
  opacity: 1;
  transition-duration: 0.5s;
  transform: scale(1);
}

.news-slider__content {
  flex: 1;
  min-width: 0;
  margin-left: 1.75rem;
  padding-right: 0.5rem;
}

.news-slider__content > * {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s;
}

.news-slider__date {
  color: #64748b;
  margin-bottom: 12px;
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
}

.news-slider__title {
  font-size: 1.5rem;
  line-height: 1.35;
  color: #1e40af;
  margin-bottom: 12px;
  font-weight: 700;
}

.news-slider__content p {
  color: #334155;
  margin-bottom: 16px;
  line-height: 1.6;
  font-size: 0.95rem;
}

.news-slider__button-wrapper {
  text-align: center;
}

.news-slider__button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 8px;
  text-decoration: none;
  position: relative;
  font-size: 1rem;
  padding: 12px 24px;
  color: #fff;
  font-weight: 600;
  background: #1e40af;
  cursor: pointer;
  border: 2px solid #bfdbfe;
  border-radius: 9999px;
  transition: color 0.2s, background 0.2s;
}

.news-slider__button:hover,
.news-slider__button:active,
.news-slider__button:focus {
  color: #fff;
  background: #1e3a8a;
}

.news-slider__button:after,
.news-slider__button:before {
  position: absolute;
  height: 4px;
  left: 50%;
  background: #1e40af;
  bottom: -6px;
  content: "";
  transition: all 0.28s ease-in-out;
  width: 0;
}

.news-slider__button:before {
  top: -6px;
}

.news-slider__button:hover:after,
.news-slider__button:hover:before,
.news-slider__button:active:after,
.news-slider__button:active:before,
.news-slider__button:focus:after,
.news-slider__button:focus:before {
  width: calc(100% - 40px);
  left: 20px;
}

.news-slider .swiper-container-horizontal > .swiper-pagination-bullets,
.news-slider .swiper-pagination-custom,
.news-slider .swiper-pagination-fraction {
  bottom: 10px;
  left: 0;
  width: 100%;
}

/* Блок справа: ⬆ сверху, точки компактно, ⬇ снизу — привязан к низу видимой области */
.news-slider__nav {
  position: absolute;
  z-index: 21;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  bottom: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.news-slider__pagination {
  position: relative !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  width: 12px !important;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  max-height: 120px;
  overflow-y: auto;
  overflow-x: hidden;
}

.news-slider__pagination.swiper-pagination-bullets {
  flex-direction: column;
}

/* Динамические буллеты Swiper (dynamicBullets) — компактный столбик */
.news-slider__pagination.swiper-pagination-dynamic {
  max-height: 80px;
}

.news-slider__pagination.swiper-pagination-bullets .swiper-pagination-bullet {
  margin: 4px 0;
}

.news-slider__pagination .swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  min-width: 8px;
  min-height: 8px;
  display: block;
  border-radius: 50%;
  background: #1e293b;
  opacity: 0.25;
  transition: all 0.25s;
}

.news-slider__pagination .swiper-pagination-bullet-active {
  opacity: 1;
  background: #1e40af;
  height: 20px;
  width: 8px;
  min-height: 20px;
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(30, 64, 175, 0.35);
}

/* Кнопки ⬆ и ⬇ — только наши, без оформления Swiper */
.news-slider .swiper-button-prev,
.news-slider .swiper-button-next {
  position: relative !important;
  margin: 0 !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  width: 40px !important;
  height: 40px !important;
  min-width: 40px !important;
  min-height: 40px !important;
  max-width: 40px !important;
  max-height: 40px !important;
  border-radius: 50% !important;
  background: #1e40af !important;
  color: #fff !important;
  border: none;
  padding: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  flex-shrink: 0;
}
/* Убираем стрелку Swiper (псевдоэлемент), остаётся только наша иконка */
.news-slider .swiper-button-prev::after,
.news-slider .swiper-button-next::after {
  content: none !important;
  display: none !important;
}

.news-slider__prev:hover,
.news-slider__next:hover,
.news-slider .swiper-button-prev:hover,
.news-slider .swiper-button-next:hover {
  background: #1e3a8a !important;
}

.news-slider__prev:active,
.news-slider__next:active,
.news-slider .swiper-button-prev:active,
.news-slider .swiper-button-next:active {
  transform: scale(0.95);
}

.news-slider__prev i,
.news-slider__next i,
.news-slider .swiper-button-prev i,
.news-slider .swiper-button-next i {
  font-size: 1.125rem;
  line-height: 1;
  display: block;
}

.news-slider__prev.swiper-button-disabled,
.news-slider__next.swiper-button-disabled,
.news-slider .swiper-button-prev.swiper-button-disabled,
.news-slider .swiper-button-next.swiper-button-disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* Подсказка «свайп» — только на мобильных */
.news-swipe-hint {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  z-index: 20;
  color: #64748b;
  font-size: 0.75rem;
  pointer-events: none;
}

.news-swipe-hint i {
  font-size: 1rem;
  margin-right: 4px;
}

@media screen and (max-width: 768px) {
  .news-slider-wrapper {
    padding-bottom: 36px;
    overflow: visible;
  }

  .news-swipe-hint {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .news-slider {
    width: 100%;
    margin: 20px 0;
    padding: 20px 16px;
    padding-bottom: 48px;
    overflow: visible;
  }

  .news-slider__item {
    flex-direction: column;
    align-items: stretch;
  }

  .news-slider__img {
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    height: 200px;
    flex-shrink: 0;
    transform: scale(0);
    border-radius: 0.75rem;
  }

  .news-slider__img img {
    object-fit: cover;
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 0.75rem;
  }

  .news-slider__item.swiper-slide-active .news-slider__img {
    opacity: 1;
    transition-duration: 0.5s;
    transform: scale(1);
  }

  .news-slider__content {
    margin-left: 0;
    margin-top: 1rem;
    text-align: center;
    padding: 0 4px;
    padding-right: 4px;
  }

  .news-slider__button-wrapper {
    text-align: center;
  }

  .news-slider__nav .swiper-button-prev,
  .news-slider__nav .swiper-button-next,
  .news-slider__prev,
  .news-slider__next {
    display: none !important;
  }

  .news-slider__nav {
    flex-direction: row;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    top: auto;
    bottom: 28px;
    gap: 8px;
  }

  .news-slider__pagination {
    flex: 0;
    flex-direction: row;
    width: auto !important;
    max-height: 32px;
    justify-content: center;
  }

  .news-slider__pagination .swiper-pagination-bullet-active {
    height: 10px;
    width: 24px;
  }

  .news-slider__pagination.swiper-pagination-bullets .swiper-pagination-bullet {
    margin: 0 4px;
  }
}

@media screen and (max-width: 576px) {
  .news-slider__img {
    max-width: 100%;
    height: 180px;
  }

  .news-slider__content {
    padding: 0 4px;
  }
}
