/**
 * Стили секции последних новостей на главной СертКонтроль.
 * Палитра бренда: #2563eb, #1e293b, #f8fafc.
 * Сдержанный B2B со стеклянной поверхностью, скругления 20px, без JS.
 */

.home-news {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 64px 0;
  background-color: #f8fafc;
  color: #1e293b;
  font-family: inherit;
  box-sizing: border-box;
}

.home-news *,
.home-news *::before,
.home-news *::after {
  box-sizing: border-box;
}

.home-news__container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Шапка секции */
.home-news__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.home-news__header-content {
  max-width: 760px;
}

.home-news__title {
  margin: 0 0 10px 0;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.25;
  color: #1e293b;
  letter-spacing: -0.015em;
  word-break: break-word;
  overflow-wrap: break-word;
}

.home-news__description {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: #475569;
  word-break: break-word;
  overflow-wrap: break-word;
}

.home-news__actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.home-news__link-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #ffffff;
  background-color: #2563eb;
  border: 1px solid #2563eb;
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.home-news__link-all:hover {
  background-color: #1d4ed8;
  border-color: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.32);
}

.home-news__link-arrow {
  display: block;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.home-news__link-all:hover .home-news__link-arrow {
  transform: translateX(2px);
}

.home-news__link-rss {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 12px;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.home-news__link-rss:hover {
  color: #2563eb;
  background-color: #ffffff;
  border-color: rgba(37, 99, 235, 0.4);
}

.home-news__rss-icon {
  display: block;
  flex-shrink: 0;
}

.home-news__rss-text {
  line-height: 1;
}

/* Сетка новостей */
.home-news__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  width: 100%;
}

/* Карточка новости со стеклянной поверхностью */
.home-news__card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 20px;
  box-shadow: 0 4px 20px -2px rgba(30, 41, 59, 0.05);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.home-news__card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 12px 30px -4px rgba(30, 41, 59, 0.09), 0 4px 12px rgba(37, 99, 235, 0.06);
}

/* Акцент у первой карточки */
.home-news__card--featured {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: 0 6px 24px -2px rgba(37, 99, 235, 0.08), 0 2px 8px rgba(30, 41, 59, 0.04);
}

.home-news__card--featured:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 16px 36px -4px rgba(37, 99, 235, 0.14), 0 4px 12px rgba(30, 41, 59, 0.06);
}

/* Единственная ссылка на всю карточку */
.home-news__card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 18px;
  color: inherit;
  text-decoration: none;
  outline: none;
}

/* Изображение / миниатюра */
.home-news__card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 14px;
  background-color: #f1f5f9;
}

.home-news__card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.home-news__card-link:hover .home-news__card-image {
  transform: scale(1.03);
}

/* Тело карточки */
.home-news__card-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding-top: 16px;
}

.home-news__card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.home-news__card-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #2563eb;
  background-color: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.15);
  border-radius: 9999px;
  white-space: nowrap;
}

.home-news__card--featured .home-news__card-badge {
  color: #ffffff;
  background-color: #2563eb;
  border-color: #2563eb;
}

.home-news__card-date {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
}

.home-news__card-title {
  margin: 0 0 10px 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  color: #1e293b;
  word-break: break-word;
  overflow-wrap: break-word;
  transition: color 0.2s ease;
}

.home-news__card-link:hover .home-news__card-title {
  color: #2563eb;
}

.home-news__card-excerpt {
  margin: 0 0 16px 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #475569;
  word-break: break-word;
  overflow-wrap: break-word;
}

.home-news__card-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  font-size: 0.875rem;
  font-weight: 600;
  color: #2563eb;
  transition: gap 0.2s ease;
}

.home-news__card-link:hover .home-news__card-more {
  gap: 9px;
}

.home-news__card-arrow {
  display: block;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.home-news__card-link:hover .home-news__card-arrow {
  transform: translateX(2px);
}

/* Доступность: состояние focus-visible */
.home-news__card-link:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 3px;
  border-radius: 20px;
}

.home-news__link-all:focus-visible,
.home-news__link-rss:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
  border-radius: 12px;
}

/* Планшетная сетка (640px - 991px) */
@media (min-width: 640px) and (max-width: 991px) {
  .home-news__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .home-news__card--featured {
    grid-column: 1 / -1;
  }

  .home-news__card--featured .home-news__card-link {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 20px;
    padding: 20px;
  }

  .home-news__card--featured .home-news__card-body {
    padding-top: 0;
  }

  .home-news__card--featured .home-news__card-title {
    font-size: 1.25rem;
  }
}

/* Десктопная сетка (992px и шире): редакционный акцент первой карточки */
@media (min-width: 992px) {
  .home-news__grid {
    grid-template-columns: 1.25fr 1fr 1fr;
    gap: 24px;
    align-items: stretch;
  }

  .home-news__card-link {
    padding: 20px;
  }

  .home-news__card--featured .home-news__card-media {
    aspect-ratio: 16 / 9;
  }

  .home-news__card--featured .home-news__card-title {
    font-size: 1.3125rem;
    line-height: 1.35;
  }

  .home-news__card--featured .home-news__card-excerpt {
    font-size: 0.9688rem;
  }
}

/* Мобильные экраны: один столбец, без горизонтального скролла */
@media (max-width: 639px) {
  .home-news {
    padding: 40px 0;
  }

  .home-news__container {
    padding: 0 16px;
  }

  .home-news__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
  }

  .home-news__title {
    font-size: 1.5rem;
  }

  .home-news__description {
    font-size: 0.9375rem;
  }

  .home-news__actions {
    width: 100%;
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
  }

  .home-news__card-link {
    padding: 16px;
  }

  .home-news__card-media {
    border-radius: 12px;
  }
}

/* Режим пониженной динамики: prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .home-news,
  .home-news * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .home-news__card:hover,
  .home-news__card-link:hover .home-news__card-image,
  .home-news__card-link:hover .home-news__card-more,
  .home-news__card-link:hover .home-news__card-arrow,
  .home-news__link-all:hover,
  .home-news__link-all:hover .home-news__link-arrow {
    transform: none !important;
  }
}

.sc-news-cover { margin: 24px 0; }
.sc-news-cover img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: cover; border-radius: 18px; }
.sc-news-cover figcaption { color: #64748b; font-size: 12px; margin-top: 8px; }
.sc-news-source { border-left: 3px solid #2563eb; background: #f1f5f9; padding: 18px 22px; margin-top: 32px; overflow-wrap: anywhere; }
.sc-news-source h2 { font-size: 20px; margin-top: 0; }
.sc-news-kind { color: #1d4ed8; font-weight: 600; }

@media (min-width: 640px) {
  .home-news__grid:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
  .home-news__card:only-child .home-news__card-link { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; }
  .home-news__card:only-child .home-news__card-body { padding-top: 8px; }
}
