/* =========================================================
   Карточка новости (teaser)
   ========================================================= */

.news-teaser {
  margin-bottom: 0;
  height: 100%;
}

.news-teaser__inner {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #fff;
  border-radius: 12px;
  padding: 0;
  border: 1px solid #eef0f2;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.news-teaser__inner:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  border-color: #d0d7de;
}

.news-teaser__image {
  flex: 0 0 auto;
  max-width: 100%;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  overflow: hidden;
  align-self: stretch;
  margin: 0;
}

.news-teaser__image img {
  width: 100%;
  height: 100%;
  border-radius: 0;
  display: block;
  object-fit: cover;
}

.news-teaser__content {
  flex: 1;
  min-width: 0;
  padding: 0 1rem 1rem;
  display: flex;
  flex-direction: column;
}

.news-teaser__meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: #6b7280;
}

.news-teaser__date {
  font-size: 0.85rem;
  color: #4b5563;
  margin-bottom: 0;
}

.news-teaser__source {
  font-size: 0.8rem;
  color: #4b5563;
  font-style: italic;
  margin-bottom: 0.5rem;
}

.news-teaser__category {
  color: #0056b3;
  font-weight: 600;
}

.news-teaser__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.news-teaser__events,
.news-teaser__importance {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.news-teaser__events {
  background: #e8f0fe;
  color: #1a56db;
}

.news-teaser__importance {
  background: #fef3c7;
  color: #92400e;
}

.news-teaser__title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  text-transform: none;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.news-teaser__title a {
  color: #1a1a1a;
  text-decoration: none;
}

.news-teaser__title a:hover {
  color: #0056b3;
}

.news-teaser__body {
  color: #1a1a1a;
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 0.75rem;
  flex: 1;
  display: -webkit-box !important;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding-bottom: 2px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.news-teaser__body p {
  color: #1a1a1a !important;
  margin: 0;
}

.news-teaser__more {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #0056b3;
  text-decoration: none;
  margin-top: auto;
}

.news-teaser__more:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .news-teaser__image {
    aspect-ratio: 4 / 3;
  }
  .news-teaser__title {
    font-size: 1.05rem;
  }
}

/* =========================================================
   Сетка списка новостей (Views unformatted)
   ========================================================= */
.views-view-unformatted__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 1000px) {
  .views-view-unformatted__grid {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

.views-view-unformatted__grid .news-teaser {
  margin-bottom: 0 !important;
  height: 100%;
}

.views-view-unformatted__grid .views-view-unformatted__item {
  min-width: 180px;
}

/* =========================================================
   Блок «Популярное» (сайдбар)
   ========================================================= */
.block-views-popular-news {
  background: #fff;
  border: 1px solid #eef0f2;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  margin-right: 2rem !important;
}

.block-views-popular-news .block__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.6rem;
  padding: 0 0 0.5rem;
  border-bottom: 2px solid #0056b3;
  color: #1a1a1a;
  text-transform: none;
}

.block-views-popular-news .views-view-unformatted__grid {
  display: block !important;
  grid-template-columns: none !important;
}

.block-views-popular-news .views-view-unformatted__item {
  display: grid !important;
  grid-template-columns: 72px 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.65rem;
  row-gap: 0.15rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid #eef0f2;
  align-items: start;
  min-width: 0 !important;
}

.block-views-popular-news .views-view-unformatted__item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.block-views-popular-news .views-field-field-image {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 72px;
  height: 54px;
  overflow: hidden;
  border-radius: 6px;
  margin: 0;
}

.block-views-popular-news .views-field-field-image img {
  width: 72px !important;
  height: 54px !important;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.block-views-popular-news .views-field-title {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
}

.block-views-popular-news .views-field-title a {
  color: #1a1a1a;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.25;
  letter-spacing: -0.005em;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}

.block-views-popular-news .views-field-title a:hover {
  color: #0056b3;
}

.block-views-popular-news .views-field-created {
  grid-column: 2;
  grid-row: 2;
  font-size: 0.7rem;
  color: #6b7280;
  margin: 0;
  padding: 0;
  align-self: end;
  line-height: 1;
}

/* =========================================================
   Расширенный сайдбар + фиксированная лента (≥992px)
   ========================================================= */
@media (min-width: 992px) {
  .page-content-wrapper {
    flex: 0 0 calc(100% - 340px);
    max-width: calc(100% - 340px);
    width: calc(100% - 340px);
  }

  .layout-secondary-sidebar {
    flex: 0 0 340px;
    max-width: 340px;
    width: 340px;
    padding-left: 1.5rem;
    padding-right: 1rem;
  }

  .block-views-popular-news {
    margin-right: 0 !important;
    padding: 1rem;
  }
}

@media (max-width: 991px) {
  .layout-secondary-sidebar {
    padding-left: 0;
    padding-right: 0;
    margin-top: 2rem;
  }
  .block-views-popular-news {
    margin-right: 0 !important;
  }
}