section.news {
  background-color: #ffffff;
  overflow: hidden;
  margin-bottom: 0px;;
}

section.news > .main-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
  width: 100%; /* Важно: база на 100% */
}

/* ЗАЩИТА ОТ СТАРОЙ ТЕМЫ: Принудительно растягиваем обертки на 100% ширины */
section.news .news-layout,
section.news .news-grid-featured,
section.news .news-grid-text {
  width: 100% !important;
  max-width: 100% !important;
  display: block; /* Сбрасываем старый flex-center, если он есть */
  float: none !important;
}

/* Шапка секции */
section.news .news-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  width: 100% !important;
}

section.news .section-title {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  color: #132134;
  text-transform: none !important;
  text-align: left !important;
}

/* Кнопка "Все статьи" */
section.news .btn-all-news {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 24px;
  font-size: 15px;
  font-weight: 500;
  color: #2563eb;
  background-color: #eff6ff;
  border-radius: 8px;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

section.news .btn-all-news:hover {
  background-color: #dbeafe;
  color: #1d4ed8;
}

/* Навигация слайдера */
section.news .news-arrows {
  display: none;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

section.news .news-prev,
section.news .news-next {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #f4f6f9;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

section.news .news-prev:hover,
section.news .news-next:hover {
  background-color: #e5e9f0;
}

section.news .news-prev::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 12L6 8L10 4' stroke='%232563EB' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

section.news .news-next::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 12L10 8L6 4' stroke='%232563EB' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

section.news .slick-disabled {
  opacity: 0.5;
  cursor: default;
}


/* ========================================================
   ВЕРХНИЙ БЛОК: СЕТКА И ЖЕСТКОЕ РАСПРЕДЕЛЕНИЕ КАРТОЧЕК
   ======================================================== */
section.news .news-grid-featured {
  display: grid !important;
  grid-template-columns: 1.5fr 1fr !important; /* Левая карточка шире */
  grid-template-rows: 240px 240px !important;
  gap: 20px !important;
  margin-bottom: 32px !important;
}

/* БРОНЕЖИЛЕТ ОТ SLICK SLIDER: Если скрипт сработает на десктопе, мы стираем его обертки из сетки! */
@media screen and (min-width: 1024px) {
  section.news .news-grid-featured.slick-initialized .slick-list,
  section.news .news-grid-featured.slick-initialized .slick-track {
    display: contents !important;
  }
}

section.news .news-main-card,
section.news .news-sub-card {
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 16px !important;
  overflow: hidden !important;
}

/* Левая большая карточка */
section.news .news-main-card {
  grid-column: 1 / 2 !important;
  grid-row: 1 / 3 !important;
}

/* Правая верхняя карточка */
section.news .news-sub-card:nth-child(2),
section.news .news-sub-card:nth-of-type(2) {
  grid-column: 2 / 3 !important;
  grid-row: 1 / 2 !important;
}

/* Правая нижняя карточка */
section.news .news-sub-card:nth-child(3),
section.news .news-sub-card:nth-of-type(3) {
  grid-column: 2 / 3 !important;
  grid-row: 2 / 3 !important;
}

/* Картинка и фон внутри сетки */
section.news .post-card-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  text-decoration: none !important;
}

section.news .post-card-image img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  z-index: 1 !important;
  transition: transform 0.3s ease;
}

section.news .post-card-image:hover img {
  transform: scale(1.05);
}

/* Затемнение и текст поверх картинки */
section.news .post-overlay {
  position: absolute !important;
  inset: 0 !important;
  background: linear-gradient(180deg, rgba(19,33,52,0) 10%, rgba(19,33,52,0.9) 100%) !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  padding: 32px !important;
  z-index: 2 !important;
  text-align: left !important;
}

section.news .news-sub-card .post-overlay {
  padding: 24px !important;
}

section.news .post-overlay .post-title {
  margin: 0 0 10px !important;
  font-size: 24px !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  line-height: 1.25 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

section.news .news-sub-card .post-overlay .post-title {
  font-size: 18px !important;
  -webkit-line-clamp: 2 !important;
}

section.news .post-overlay p:not(.post-date) {
  margin: 0 0 12px !important;
  font-size: 14px !important;
  color: rgba(255,255,255,0.8) !important;
  line-height: 1.4 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

section.news .post-overlay .post-date {
  margin: 0 !important;
  font-size: 13px !important;
  color: #cbd5e1 !important;
}

/* Нижние блоки */
section.news .news-grid-text {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 20px !important;
  padding-top: 24px !important;
}

section.news .news-text-card {
  width: 100% !important;
  height: 100% !important;
}

section.news .post-card-text {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  text-decoration: none !important;
  padding-right: 20px !important;
  border-right: 1px solid #e5e9f0 !important;
  text-align: left !important;
}

/* Убираем рамку у последней карточки */
section.news .news-text-card:last-child .post-card-text {
  border-right: none !important;
  padding-right: 0 !important;
}

section.news .post-card-text .post-title {
  margin: 0 0 12px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #132134 !important;
  line-height: 1.4 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  transition: color 0.2s;
}

section.news .post-card-text:hover .post-title {
  color: #2563eb !important;
}

section.news .post-card-text p:not(.post-date) {
  margin: 0 0 16px !important;
  font-size: 14px !important;
  color: #5b6777 !important;
  line-height: 1.45 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}

section.news .post-card-text .post-date {
  margin-top: auto !important; /* Ровняет даты по низу */
  font-size: 13px !important;
  color: #64748b !important;
}

section.news .mobile-only {
  display: none !important;
}

/* === АДАПТИВ === */
@media screen and (max-width: 1320px) {
  section.news > .main-container {
    padding: 0 20px;
  }
}

@media screen and (max-width: 1023px) {
  section.news .news-grid-text,
  section.news .desktop-only {
    display: none !important;
  }
  
  section.news .news-arrows {
    display: flex !important;
  }
  section.news .mobile-only {
    display: flex !important;
    margin-top: 32px;
  }
  section.news .btn-all-news {
    width: 100%;
  }

  section.news .news-grid-featured {
    display: block !important;
    height: auto !important;
    margin-bottom: 0 !important;
  }
  
  section.news > .main-container {
    padding-left: 20px;
    padding-right: 0;
  }
  section.news .news-header,
  section.news .news-more {
    padding-right: 20px;
  }

  section.news .news-main-card,
  section.news .news-sub-card {
    width: 320px !important;
    height: 380px !important;
    margin: 0 16px 0 0 !important;
    display: block !important;
  }
  section.news .post-overlay {
    padding: 24px !important;
  }
  section.news .news-main-card .post-overlay .post-title,
  section.news .news-sub-card .post-overlay .post-title {
    font-size: 20px !important;
    -webkit-line-clamp: 4 !important;
  }
}

@media screen and (max-width: 576px) {
  section.news > .main-container {
    padding-left: 16px;
  }
  section.news .news-header, 
  section.news .news-more {
    padding-right: 16px;
  }
  section.news .news-main-card, 
  section.news .news-sub-card {
    width: 280px !important;
    height: 320px !important;
  }
}