/**
 * Блок новостей в стиле TailNews: главная карточка + сетка
 * Адаптив: мобилка, планшет, десктоп. Цвета DPA.
 */

.news-block-section {
  padding: 1rem 0 3rem;
  background: linear-gradient(165deg, #fafbfc 0%, #f1f5f9 45%, #e2e8f0 100%);
  position: relative;
  overflow: hidden;
}

.news-block-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--dpa-blue-dark, #003971) 0%, var(--dpa-blue-accent, #0077c8) 100%);
  opacity: 0.9;
}

.news-block-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 max(0.875rem, env(safe-area-inset-left)) max(0.875rem, env(safe-area-inset-right));
}

/* Layout: главная карточка сверху, сетка снизу (моб/планшет); две колонки на десктопе */
.news-block-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@media (min-width: 600px) {
  .news-block-section {
    padding: 1.25rem 0 3.5rem;
  }

  .news-block-container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .news-block-layout {
    gap: 1.5rem;
  }
}

@media (min-width: 900px) {
  .news-block-section {
    padding: 1.5rem 0 4rem;
  }

  .news-block-section::before {
    height: 4px;
  }

  .news-block-container {
    padding-left: max(1.25rem, env(safe-area-inset-left));
    padding-right: max(1.25rem, env(safe-area-inset-right));
  }

  .news-block-layout {
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: stretch;
  }

  .news-block-layout--single {
    grid-template-columns: 1fr;
  }
}

/* Главная (featured) карточка */
.news-block-featured {
  min-height: 0;
}

.news-block-featured__link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 57, 113, 0.04);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  -webkit-tap-highlight-color: transparent;
}

.news-block-featured__link:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0, 57, 113, 0.12);
}

.news-block-featured__img-wrap {
  position: relative;
  width: 100%;
  padding-top: 56%;
  background: #e2e8f0;
  overflow: hidden;
}

.news-block-featured__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.news-block-featured__link:hover .news-block-featured__img {
  transform: scale(1.06);
}

.news-block-featured__badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: linear-gradient(135deg, var(--dpa-blue-dark, #003971), var(--dpa-blue-accent, #0077c8));
  border-radius: 6px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 57, 113, 0.35);
}

.news-block-featured__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 45%);
  pointer-events: none;
  z-index: 1;
}

.news-block-featured__body {
  padding: 1rem 1rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.news-block-featured__date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--dpa-blue-accent, #0077c8);
  margin-bottom: 0.4rem;
  letter-spacing: 0.02em;
}

.news-block-featured__title {
  font-family: var(--dpa-font-family, 'Raleway', sans-serif);
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.3;
  color: #0f172a;
  margin: 0 0 0.5rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  transition: color 0.25s ease;
}

.news-block-featured__link:hover .news-block-featured__title {
  color: var(--dpa-blue-dark, #003971);
}

.news-block-featured__excerpt {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #475569;
  margin: 0 0 0.75rem;
  flex: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.news-block-featured__more {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--dpa-blue-accent, #0077c8);
  transition: gap 0.25s ease, color 0.2s ease;
}

.news-block-featured__link:hover .news-block-featured__more {
  gap: 0.7rem;
  color: var(--dpa-blue-dark, #003971);
}

.news-block-featured__more i {
  font-size: 0.8em;
  transition: transform 0.25s ease;
}

.news-block-featured__link:hover .news-block-featured__more i {
  transform: translateX(3px);
}

@media (min-width: 600px) {
  .news-block-featured__link {
    border-radius: 16px;
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.07), 0 2px 10px rgba(0, 57, 113, 0.05);
  }

  .news-block-featured__img-wrap {
    padding-top: 52%;
  }

  .news-block-featured__badge {
    top: 1rem;
    left: 1rem;
    padding: 0.4rem 0.9rem;
    font-size: 0.75rem;
  }

  .news-block-featured__body {
    padding: 1.35rem 1.25rem 1.5rem;
  }

  .news-block-featured__date {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
  }

  .news-block-featured__title {
    font-size: 1.35rem;
    margin-bottom: 0.6rem;
  }

  .news-block-featured__excerpt {
    font-size: 1rem;
    -webkit-line-clamp: 3;
    margin-bottom: 1rem;
  }

  .news-block-featured__more {
    font-size: 0.95rem;
  }
}

@media (min-width: 900px) {
  .news-block-featured__link {
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 2px 12px rgba(0, 57, 113, 0.06);
  }

  .news-block-featured__title {
    font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  }
}

/* Сетка карточек: 4 карточки + кнопка; компактные отступы */
.news-block-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
  align-content: start;
}

@media (min-width: 480px) {
  .news-block-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }
}

@media (min-width: 600px) and (max-width: 899px) {
  .news-block-grid {
    gap: 0.65rem;
  }
}

@media (min-width: 900px) {
  .news-block-grid {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(4, 1fr) auto;
    gap: 0.5rem;
    min-height: 340px;
  }
}

.news-block-card {
  min-height: 0;
}

.news-block-card__link {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 0.6rem;
  align-items: center;
  padding: 0.5rem 0.6rem;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  border: 1px solid rgba(0, 57, 113, 0.06);
  -webkit-tap-highlight-color: transparent;
  min-height: 56px;
}

.news-block-card__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 57, 113, 0.08);
}

@media (min-width: 480px) {
  .news-block-card__link {
    grid-template-columns: 76px 1fr;
    gap: 0.65rem;
    padding: 0.55rem 0.65rem;
    border-radius: 12px;
    min-height: 62px;
  }
}

@media (min-width: 600px) {
  .news-block-card__link {
    padding: 0.6rem 0.7rem;
  }
}

@media (min-width: 900px) {
  .news-block-card__link {
    grid-template-columns: 82px 1fr;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  }

  .news-block-card__link:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 57, 113, 0.1);
  }
}

.news-block-card__img-wrap {
  position: relative;
  width: 100%;
  padding-top: 75%;
  border-radius: 10px;
  overflow: hidden;
  background: #e2e8f0;
  flex-shrink: 0;
}

@media (min-width: 900px) {
  .news-block-card__img-wrap {
    border-radius: 12px;
  }
}

.news-block-card__img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.news-block-card__link:hover .news-block-card__img {
  transform: scale(1.08);
}

.news-block-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.2), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.news-block-card__link:hover .news-block-card__overlay {
  opacity: 1;
}

.news-block-card__body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.news-block-card__date {
  font-size: 0.7rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.02em;
}

.news-block-card__title {
  font-family: var(--dpa-font-family, 'Raleway', sans-serif);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.35;
  color: #0f172a;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  transition: color 0.25s ease;
}

@media (min-width: 480px) {
  .news-block-card__date {
    font-size: 0.75rem;
  }

  .news-block-card__title {
    font-size: 0.9rem;
  }
}

@media (min-width: 900px) {
  .news-block-card__title {
    font-size: 0.95rem;
  }
}

.news-block-card__link:hover .news-block-card__title {
  color: var(--dpa-blue-dark, #003971);
}

.news-block-card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--dpa-blue-accent, #0077c8);
  margin-top: 0.2rem;
  transition: gap 0.2s ease, color 0.2s ease;
}

@media (min-width: 480px) {
  .news-block-card__more {
    font-size: 0.8rem;
  }
}

.news-block-card__link:hover .news-block-card__more {
  gap: 0.5rem;
  color: var(--dpa-blue-dark, #003971);
}

.news-block-card__more i {
  font-size: 0.75em;
  transition: transform 0.2s ease;
}

.news-block-card__link:hover .news-block-card__more i {
  transform: translateX(2px);
}

/* Крупная кнопка «Все новости» вместо 4-й карточки */
.news-block-all-cell {
  min-height: 0;
  display: flex;
  align-items: stretch;
}

/* Мобилка: кнопка на всю ширину под карточками */
@media (max-width: 599px) {
  .news-block-all-cell {
    grid-column: 1 / -1;
  }
}

/* Планшет: кнопка во 2-й колонке рядом с 3-й карточкой */
@media (min-width: 600px) and (max-width: 899px) {
  .news-block-all-cell {
    grid-column: auto;
  }
}

.news-block-all-btn {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  font-family: var(--dpa-font-family, 'Raleway', sans-serif);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, var(--dpa-blue-dark, #003971) 0%, #004a7a 40%, var(--dpa-blue-accent, #0077c8) 100%);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 57, 113, 0.3), 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.25s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 480px) {
  .news-block-all-btn {
    min-height: 64px;
    padding: 1.1rem 1.35rem;
    font-size: 1.05rem;
    border-radius: 16px;
  }
}

@media (min-width: 900px) {
  .news-block-all-btn {
    min-height: 72px;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
    box-shadow: 0 6px 24px rgba(0, 57, 113, 0.35), 0 2px 8px rgba(0, 0, 0, 0.06);
  }
}

.news-block-all-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.news-block-all-btn:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 12px 36px rgba(0, 57, 113, 0.45), 0 4px 16px rgba(0, 0, 0, 0.08);
  color: #fff;
}

.news-block-all-btn:hover::before {
  opacity: 1;
}

.news-block-all-btn__text {
  position: relative;
  z-index: 1;
}

.news-block-all-btn__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  width: 1.4em;
  height: 1.4em;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: transform 0.25s ease, background 0.25s ease;
}

@media (min-width: 900px) {
  .news-block-all-btn__icon {
    width: 1.5em;
    height: 1.5em;
    background: rgba(255, 255, 255, 0.2);
  }
}

.news-block-all-btn:hover .news-block-all-btn__icon {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.3);
}
