.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-top: 32px;
}



/* --- Карточка новости с эффектом "листик" (улучшенные тени) --- */
.news-card {
  position: relative;
  overflow: hidden;
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  /* Многослойные тени для объёма, создаём эффект парящего листика */
  box-shadow:
    0 1px 4px rgba(0,0,0,0.06),   /* лёгкая тень сверху */
    0 4px 12px rgba(0,0,0,0.08),  /* средний слой */
    0 10px 20px rgba(0,0,0,0.12), /* основной объём */
    0 18px 35px rgba(0,0,0,0.14); /* мягкая растушёвка */
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  display: flex;
  flex-direction: column;
}

/* Hover — мягкий подъём и усиление теней */
.news-card:hover {
  transform: translateY(-8px);
  box-shadow:
    0 2px 6px rgba(0,0,0,0.08),
    0 8px 20px rgba(0,0,0,0.12),
    0 16px 35px rgba(0,0,0,0.18),
    0 24px 50px rgba(0,0,0,0.22);
}

/* Градиент при наведении (мягкий) */
.news-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255,255,255,0.02), rgba(46,90,172,0.05));
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  border-radius: inherit;
  transform: scale(1);
  z-index: 1;
}

.news-card:hover::before {
  opacity: 1;
  transform: scale(1.03);
}

/* Контент поверх псевдофона */
.news-card * {
  position: relative;
  z-index: 2;
}


/* Категория */
.news-category {
  display: inline-block; /* по ширине текста */
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  background-color: #007bff;
  padding: 4px 10px;
  border-radius: 20px;
  color: #fff;
  position: relative;
  z-index: 10;
  width: auto; /* гарантирует, что не растянется */
  max-width: fit-content; /* предотвращает расширение */
  white-space: nowrap; /* не переносит текст на новую строку */
}


.news-category a {
  color: inherit;
  text-decoration: none;
}

.news-category a:hover {
  text-decoration: underline;
}


/* Заголовок */
.news-card h5 {
  font-size: 1.2em;
  margin-bottom: 12px;
  color: #2e5aac;
  transition: color 0.3s ease;
}

.news-card:hover h5 {
  color: #1f3f8f;
}

/* Текст */
.news-card p {
  font-size: 0.95em;
  color: #555;
  margin-bottom: 16px;
  line-height: 1.6;
  transition: color 0.3s ease;
}

.news-card:hover p {
  color: #333;
}

/* Метаданные */
.news-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85em;
  color: #777;
  margin-bottom: 16px;
}

/* Кнопка "читать далее" */
.news-card .read-more {
  display: inline-block;
  padding: 10px 18px;
  background-color: #0078cc;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,120,204,0.25);
  transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.news-card .read-more:hover {
  background-color: #005fa3;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,95,163,0.35);
}

/* Стрелка при наведении */
.news-card::after {
  content: "→";
  position: absolute;
  right: 20px;
  bottom: 18px;
  font-size: 1.3rem;
  color: #2e5aac;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 2;
}

.news-card:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* --- Футер --- */
.news-footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 24px;
  font-size: 20px;
  font-weight: 500;
  color: #0078cc;
  position: relative;
}

.news-footer-links a {
  position: relative;
  color: #0078cc;
  text-decoration: none;
  padding-bottom: 4px;
}

.news-footer-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background-color: #0078cc;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.news-footer-links a:hover::after {
  transform: scaleX(1);
}


/* Делает всю карточку кликабельной */
.card-link-full {
  position: absolute;
  inset: 0;
  z-index: 5;
}

/* Чтобы ссылки внутри карточки оставались кликабельными поверх */
.news-card a:not(.card-link-full) {
  position: relative;
  z-index: 10;
}


/* Обёртка картинки */
.img-wrapper {
  margin: 10px -28px;       /* компенсирует padding карточки */
  overflow: hidden;    /* обрезает лишнее */
  border-top-left-radius: 0;
  border-top-right-radius: 0; /* скругляем только верх */
}

/* Картинка */
.img-wrapper img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  transition: transform 0.4s ease;
}




/* планшет */
@media (max-width: 1024px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

/* мобильный */
@media (max-width: 640px) {
  .news-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}