/* ========== Блок 8: Новости и статьи (Embla) ========== */

.news-section {
  background: var(--c-white);
  padding: 70px 0 80px;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  overflow: hidden;
}

.news-header {
  max-width: 1800px;
  margin: 0 auto ;
  
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.news-title {
  font-size: clamp(26px, 2.8vw, 36px);
  font-weight: 700;
  color: var(--c-navy-900);
  line-height: 1.2;
  border-bottom: none;
}

.news-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--c-navy-600);
  transition: opacity .2s;
  white-space: nowrap;
}

.news-link:hover { opacity: .75; }
.news-link svg { width: 18px; height: 18px; }

.news-wrapper {
  position: relative;
}

/* Стрелки */
.news-arrow {
  position: absolute;
  top: 38%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--c-white);
  color: var(--c-navy-600);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(11, 31, 74, 0.12);
  border: none;
  cursor: pointer;
  transition: opacity .25s, visibility .25s, background .2s;
}

@media (hover: hover) and (pointer: fine) {
  .news-arrow {
    opacity: 0;
    visibility: hidden;
  }
  .news-wrapper:hover .news-arrow:not(:disabled) {
    opacity: 1;
    visibility: visible;
  }
}

.news-arrow:hover {
  background: var(--c-navy-600);
  color: var(--c-white);
}

.news-arrow:disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.news-arrow svg {
  width: 22px;
  height: 22px;
}

.news-arrow--prev { left: 8px; }
.news-arrow--next { right: 8px; }

/* ===== Embla ===== */
.news-section .embla {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.news-section .embla__viewport {
  overflow: hidden;
  width: 100%;
  padding: 15px 0;
  margin: -15px 0;
}

.news-section .embla__container {
  display: flex;
  align-items: stretch;
  touch-action: pan-y pinch-zoom;
}

.news-section .embla__slide {
  flex: 0 0 auto;
  min-width: 0;
  height: auto;
  /* gap между слайдами — задаём padding-right у slide */
  padding-right: 20px;
  box-sizing: border-box;
}

.news-section .embla__slide .news-card {
  height: 100%;
}

/* Адаптивная ширина слайдов — аналог perPage из Splide.
   Формула: flex-basis = 100% / perPage
   Учёт gap: чтобы визуально влезало ровно perPage карточек,
   используем calc() с вычетом доли gap. */

/* По умолчанию ~5.2 слайда (perPage: 5.2, gap: 20px) */
.news-section .embla__slide {
  flex: 0 0 calc(100% / 5.2 - 20px + 20px / 5.2);
}

/* ===== Карточка ===== */
.news-card {
  display: flex;
  flex-direction: column;
  background: var(--c-white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(11, 31, 74, 0.07);
  border: 1px solid var(--c-border-soft);
  transition: box-shadow .25s, transform .25s;
  height: 100%;
}

.news-card:hover {
  box-shadow: 0 10px 28px rgba(11, 31, 74, 0.12);
}

.news-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.news-card__image {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: var(--c-bg-soft);
  flex-shrink: 0;
}

.news-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.news-card:hover .news-card__image img {
  transform: scale(1.04);
}

.news-card__date {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--c-blue);
  color: var(--c-white);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
}

.news-card__body {
  padding: 18px 18px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-navy-900);
  line-height: 1.35;
  margin-bottom: 10px;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;

  min-height: calc(16px * 1.35 * 2);
}

.news-card__text {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--c-muted);

  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;

  min-height: calc(13.5px * 1.5 * 4);
}

/* ===== Адаптив ===== */

/* perPage: 4.2, gap: 20px */
@media (max-width: 1400px) {
  .news-section .embla__slide {
    flex: 0 0 calc(100% / 4.2 - 20px + 20px / 4.2);
  }
}

/* perPage: 3.2, gap: 16px */
@media (max-width: 1199px) {
  .news-section .embla__slide {
    flex: 0 0 calc(100% / 3.2 - 16px + 16px / 3.2);
    padding-right: 16px;
  }
}

/* perPage: 2.2, gap: 16px */
@media (max-width: 991px) {
  .news-section .embla__slide {
    flex: 0 0 calc(100% / 2.2 - 16px + 16px / 2.2);
    padding-right: 16px;
  }
}

/* perPage: 1.2, gap: 12px */
@media (max-width: 767px) {
  .news-section .embla__slide {
    flex: 0 0 calc(100% / 1.2 - 12px + 12px / 1.2);
    padding-right: 12px;
  }
}

@media (max-width: 1200px) {
  .news-header { padding: 0 28px; }
  .news-wrapper { padding: 0 28px; }
}

@media (max-width: 768px) {
  .news-section { padding: 50px 0 60px; }

  .news-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 0 20px;
    margin-bottom: 24px;
  }

  .news-wrapper { padding: 0 20px; }

  .news-arrow {
    width: 40px;
    height: 40px;
  }
  .news-arrow--prev { left: 4px; }
  .news-arrow--next { right: 4px; }
}
/* Убираем подчёркивание у всей ссылки-карточки и её содержимого */
.news-card__link,
.news-card__link:hover,
.news-card__link:focus,
.news-card__link:visited,
.news-card__link:active {
  text-decoration: none;
}

.news-card__link *,
.news-card__link:hover *,
.news-card__link:focus * {
  text-decoration: none;
}

/* На всякий случай — для заголовка и текста внутри */
.news-card__title,
.news-card__title:hover,
.news-card__text,
.news-card__text:hover {
  text-decoration: none;
}