/* =========================================================
   ЛЕНТА НОВОСТЕЙ И ПОСТОВ СООБЩЕСТВА
========================================================= */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.news-widget {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 255px;
  padding: 18px 20px;
  border-radius: 20px;
  background: var(--card-surface);
  border: 1px solid var(--glass-border);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  overflow: hidden;
  will-change: transform, opacity;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s ease, box-shadow 0.3s ease;
}

.news-widget:hover {
  transform: translate3d(0, -4px, 0);
  border-color: var(--violet-bright);
  box-shadow: 0 16px 38px rgba(124, 82, 212, 0.22);
}

/* Единый медиа-блок: одинаковая высота 128px и для фото, и для поста без фото */
.news-media-box {
  position: relative;
  width: 100%;
  height: 128px;
  border-radius: 13px;
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: linear-gradient(135deg, rgba(124, 82, 212, 0.16) 0%, rgba(45, 25, 80, 0.36) 55%, rgba(18, 11, 34, 0.55) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body.light-theme .news-media-box,
body.theme-morning .news-media-box {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.24) 0%, rgba(221, 214, 254, 0.55) 55%, rgba(243, 238, 255, 0.85) 100%);
}

.news-media-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Декоративный минималистичный узор для постов без фотографии */
.news-media-placeholder {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.news-media-placeholder::before {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 1px dashed rgba(191, 164, 247, 0.24);
}

.news-media-placeholder span {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--violet);
  opacity: 0.72;
}

/* Верхняя строка карточки: слева ник автора (или бейдж), справа категория */
.news-widget-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.news-author-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--violet-bright);
  opacity: 0.9;
  max-width: 65%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.news-author-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--violet-bright);
  flex-shrink: 0;
}

.news-badge {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--violet-bright);
  background: rgba(154, 132, 199, 0.14);
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.news-title {
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-excerpt {
  font-size: 0.84rem;
  line-height: 1.48;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Нижняя строка карточки: слева кнопка чтения, справа снизу дата и время */
.news-widget-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid rgba(191, 164, 247, 0.1);
}

.news-read-more {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--violet-bright);
}

.news-time-right {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-dim);
  opacity: 0.85;
  white-space: nowrap;
  margin-left: auto;
}

@media (max-width: 640px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}
