/* Карточки новостей (главная и /news). Подключается из includes/news-section.php,
   поэтому перебивает старые правила из style.css. */

html body .news-section .news-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

html body .news-section .news-card {
  display: flex;
  flex-direction: column;
  width: auto;
  max-width: none;
  min-height: 100%;
  background: #1c1c1c;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
  transform: none;
  box-shadow: none;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

html body .news-section .news-card:hover {
  transform: none;
  background: #212121;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

html body .news-section .news-card__media {
  display: block;
  aspect-ratio: 2 / 1;
  background: #111;
  overflow: hidden;
}

html body .news-section .news-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

html body .news-section .news-card:hover .news-card__media img {
  transform: scale(1.04);
}

html body .news-section .news-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 18px;
  padding: 24px 24px 22px;
}

html body .news-section .news-card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

html body .news-section .news-card__excerpt {
  display: -webkit-box;
  flex: 1;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: #cfcfcf;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

html body .news-section .news-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
  margin-top: 6px;
  padding-top: 0;
}

html body .news-section .news-card__date {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

html body .news-section .news-card__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #ff9a1a;
  white-space: nowrap;
  transition: color 0.2s ease;
}

html body .news-section .news-card__more svg {
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

html body .news-section .news-card__more:hover {
  color: #ffb84d;
}

html body .news-section .news-card__more:hover svg {
  transform: translateX(4px);
}

@media (max-width: 1200px) {
  html body .news-section .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  html body .news-section .news-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  html body .news-section .news-card__body {
    gap: 14px;
    padding: 20px 20px 18px;
  }

  html body .news-section .news-card__title {
    font-size: 17px;
  }

  html body .news-section .news-card__excerpt {
    -webkit-line-clamp: 4;
  }

  /* Главная: горизонтальная лента со свайпом, следующая карточка выглядывает */
  html body .news-section--home .container {
    padding-left: 0;
    padding-right: 0;
  }

  html body .news-section--home .news-section__head {
    padding: 0 16px;
  }

  html body .news-section--home .news-grid {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 16px;
    padding: 0 16px 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  html body .news-section--home .news-grid::-webkit-scrollbar {
    display: none;
  }

  html body .news-section--home .news-card {
    flex: 0 0 82%;
    width: 82%;
    max-width: 340px;
    scroll-snap-align: start;
  }

  html body .news-section--home .news-card__body {
    padding: 18px 18px 16px;
    gap: 12px;
  }

  html body .news-section--home .news-card__title {
    font-size: 16px;
  }

  html body .news-section--home .news-card__excerpt {
    display: -webkit-box;
    font-size: 13px;
    -webkit-line-clamp: 3;
  }

  html body .news-section--home .news-card__date {
    font-size: 13px;
  }

  html body .news-section--home .news-card__more {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body .news-section .news-card__media img,
  html body .news-section .news-card__more svg {
    transition: none;
  }
}
