/* ===== NEWS PAGE ===== */

.news-page {
  flex-direction: column;
}

.news-list {
  padding-left: 10%;
  padding-right: 10%;
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 колонки — НЕ трогаем */
  gap: 15px; /* НЕ трогаем */
  box-sizing: border-box; /* чтобы padding не ломал ширину */
}

.news-page-title {
  text-align: center;
  font-size: 34px;
  font-weight: 700;
  color: #003366;
  margin-bottom: 40px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 30px;
}

.news-card {
  background: #ffffff; /* светлый фон */
  padding: 20px;
  border-radius: 15px; /* более округлые углы */
  box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.05); /* мягкая тень */
  max-width: 95%;
  margin: 20px auto; /* отступ сверху/снизу и центрирование */
  box-sizing: border-box;
  transition: transform 0.3s ease, box-shadow 0.3s ease; /* плавная анимация при наведении */
  overflow: hidden;
}

/* при наведении слегка увеличиваем и усиливаем тень */
.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12), 0 20px 40px rgba(0,0,0,0.08);
}

/* Заголовок внутри карточки */
.news-card h2, .news-card h3 {
  margin: 10px 0;
  font-weight: 600;
  color: #333;
}

/* Текст */
.news-card p {
  color: #555;
  line-height: 1.6;
  margin-bottom: 15px;
}

/* Картинки */
.news-card img {
  width: 100%;
  border-radius: 10px;
  object-fit: cover;
  margin-bottom: 15px;
  display: block;
}


/* ===== NEWS PAGE - Typography ===== */

/* Заголовок новости */
.news-title {
  font-family: 'Montserrat', 'Arial', sans-serif; /* красивый шрифт */
  font-weight: 700;
  font-size: 22px; /* чуть крупнее для читаемости */
  color: #003366;
  text-align: center;
  margin-bottom: 8px;
  line-height: 1.3;
}

/* Дата новости */
.news-date {
  font-family: 'Roboto', 'Arial', sans-serif;
  font-size: 18px;
  color: #666666;
  text-align: center;
  margin-bottom: 12px;
}

/* Текст новости */
.news-text {
  font-family: 'Roboto', 'Arial', sans-serif;
  font-size: 16px; /* чуть больше и читаемо */
  line-height: 1.6;
  color: #333333;
  text-align: center;
  margin-bottom: 15px;
}

.news-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.news-images img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 6px;
}

.news-video iframe {
  width: 100%;
  height: 300px;
  border-radius: 8px;
}

.npa-back {
  display: inline-block;
  margin-bottom: 20px;
  color: #003366;
  font-weight: 500;
  text-decoration: none;
  font-size: 16px;
}

.npa-back:hover {
  text-decoration: underline;
}

.news-page-title {
  text-align: center;
  font-size: 34px;
  font-weight: 700;
  color: #003366;
  margin-bottom: 40px;
  font-family: 'Montserrat', sans-serif;
}

.news-header-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center; /* по центру по горизонтали */
  margin-bottom: 40px; /* расстояние до списка новостей */
  width: 100%;
  position: relative;
}

/* Кнопка слева */
.news-header-wrapper .npa-back {
  position: absolute; /* чтобы держать кнопку слева */
  left: 0;
  top: 0;
}

/* Заголовок по центру */
.news-header-wrapper .news-page-title {
  margin-top: 0;
}
/* ===== HEADER FLEX ADAPTATION ===== */
.flex-container.npa-container {
  position: relative;
  width: 100%;
  margin-bottom: 30px; /* расстояние до news-list */
  display: block; /* чтобы не мешало grid news-list */
}

/* Кнопка "Басты бетке қайту" слева */
.flex-container.npa-container .npa-back {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-block;
}

/* Заголовок "Жаңалықтар" по центру, чуть ниже кнопки */
.flex-container.npa-container .news-page-title {
  display: block;
  text-align: center;
  margin: 30px auto 0 auto; /* отступ сверху, auto по бокам */
}

/* ===== ADAPTIVE ===== */
/* Для маленьких экранов — мобильные телефоны */
/* ===== ADAPTIVE NEWS PAGE ===== */

/* Экраны меньше 1200px - плавное уменьшение текста и видео */
@media (max-width: 1200px) {
  .news-page-title {
    font-size: calc(34px - (34 - 30) * ((1200px - 100vw) / (1200 - 992)));
  }

  .news-title {
    font-size: calc(22px - (22 - 18) * ((1200px - 100vw) / (1200 - 992)));
  }

  .news-date {
    font-size: calc(18px - (18 - 14) * ((1200px - 100vw) / (1200 - 992)));
  }

  .news-text {
    font-size: calc(16px - (16 - 14) * ((1200px - 100vw) / (1200 - 992)));
    line-height: 1.5;
  }

  .news-video iframe {
    height: calc(300px - (300 - 220) * ((1200px - 100vw) / (1200 - 992)));
  }
}

/* Экраны меньше 992px - одна колонка, падение карточек */
@media (max-width: 992px) {
  .news-list {
    grid-template-columns: 1fr;
    gap: 30px;
    padding-left: 10%;
    padding-right: 10%;
  }

  .news-card {
    max-width: 100%;
    margin: 0 auto;
  }

  .news-title {
    font-size: 20px;
  }

  .news-date {
    font-size: 16px;
  }

  .news-text {
    font-size: 15px;
  }

  .news-video iframe {
    height: 250px;
  }
}

/* Планшеты < 768px */
@media (max-width: 768px) {
  .news-list {
    grid-template-columns: 1fr;
    gap: 25px;
    padding-left: 7%;
    padding-right: 7%;
  }

  .news-card {
    max-width: 100%;
    margin: 0 auto;
  }

  .news-title {
    font-size: 16px;
  }

  .news-date {
    font-size: 14px;
  }

  .news-text {
    font-size: 13px;
    line-height: 1.4;
  }

  .news-video iframe {
    height: 180px;
  }

  .news-images {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Мобильные телефоны < 480px */
@media (max-width: 480px) {
  .news-list {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-left: 5%;
    padding-right: 5%;
  }

  .news-card {
    max-width: 100%;
    margin: 0 auto;
  }

  .news-page-title {
    font-size: 24px;
  }

  .news-title {
    font-size: 14px;
  }

  .news-date {
    font-size: 12px;
  }

  .news-text {
    font-size: 12px;
    line-height: 1.3;
  }

  .news-video iframe {
    height: 160px;
  }

  .news-images {
    grid-template-columns: 1fr;
  }
}

.news-images.single-image {
  display: flex;
  justify-content: center; 
}

.news-images.single-image img {
  width: auto;           
  max-width: 30%;        
  height: auto;  
}
/* ===== Одна новость (переход с главной) ===== */
.news-list.single-news {
  grid-template-columns: 1fr;       /* одна колонка */
  justify-items: center;            /* центрируем карточку */
}

/* сама карточка по центру и не растягивается */
.news-list.single-news .news-card {
  max-width: 1200px;                 /* можно регулировать */
  width: 100%;
  margin: 0 auto;
}
/* ========================================================= */
/* ===== Превью текста в СПИСКЕ новостей (/news) ===== */
/* ========================================================= */

.news-preview {
  overflow: hidden;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;   /* desktop */

  line-height: 1.6;
  max-height: calc(1.6em * 4);
}

/* ... далее / ... ары қарай */
.news-more {
  font-weight: 600;
  color: #003366;
  white-space: nowrap;
}


/* ========================================================= */
/* ===== Кликабельная карточка новости ===== */
/* ========================================================= */

.news-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.news-link:hover .news-title {
  color: #003366;
}

/* hover-эффект сохраняем твой */
.news-link:hover {
  transform: translateY(-5px);
}


/* ========================================================= */
/* ===== АДАПТИВ ДЛЯ ПРЕВЬЮ ТЕКСТА ===== */
/* ========================================================= */

@media (max-width: 992px) {
  .news-preview {
    -webkit-line-clamp: 3;
    max-height: calc(1.6em * 3);
  }
}

@media (max-width: 768px) {
  .news-preview {
    -webkit-line-clamp: 3;
    max-height: calc(1.6em * 3);
  }
}

@media (max-width: 480px) {
  .news-preview {
    -webkit-line-clamp: 2;
    max-height: calc(1.6em * 2);
  }
}

@media (max-width: 320px) {
  .news-preview {
    -webkit-line-clamp: 2;
  }
}
.news-page {
  max-width: 1350px;
  margin: 40px auto;
  padding: 0 20px;
  box-sizing: border-box;
} /* ================================================= */
/* ===== FIX: реальный адаптив как на index ===== */
/* ================================================= */

/* <= 992px */
@media (max-width: 992px) {
  .news-list {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* <= 768px */
@media (max-width: 768px) {
  .news-list {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* <= 480px */
@media (max-width: 480px) {
  .news-list {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* <= 320px */
@media (max-width: 320px) {
  .news-list {
    padding-left: 8px;
    padding-right: 8px;
  }
}
