/* ===== СЕТКА НОВОСТЕЙ ===== */
.t854__news-content {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 24px !important;
}

/* ===== КАРТОЧКА НОВОСТИ (только в основном блоке, НЕ в попапе) ===== */
.t854__news-wrap .t854__news-content > .t854__news-message {
  display: flex !important;
  flex-direction: column !important;
  background: #fff !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08) !important;
  padding: 0 !important;
  margin: 0 !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
  cursor: pointer !important;
  position: relative !important;
}

.t854__news-wrap .t854__news-content > .t854__news-message:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
}

.t854__news-wrap .t854__news-content > .t854__news-message .t854__news-message-flex {
  display: flex !important;
  flex-direction: column !important;
}

/* ===== ПЛЕЙСХОЛДЕР ДЛЯ НОВОСТЕЙ БЕЗ КАРТИНОК ===== */
.t854__news-wrap .t854__news-content > .t854__news-message::before {
  content: "" !important;
  width: 100% !important;
  height: 200px !important;
  background: #f4f4f5 !important;
  display: block !important;
  order: -1 !important;
  position: relative !important;
}

.t854__news-wrap .t854__news-content > .t854__news-message::after {
  content: "" !important;
  position: absolute !important;
  left: calc(50% - 24px) !important;
  top: 76px !important;
  width: 48px !important;
  height: 48px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a1a1aa'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M19 20H5a2 2 0 01-2-2V6a2 2 0 012-2h10a2 2 0 012 2v1m2 13a2 2 0 01-2-2V7m2 13a2 2 0 002-2V9a2 2 0 00-2-2h-2m-4-3H9M7 16h6M7 8h6v4H7V8z'/%3E%3C/svg%3E") !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  opacity: 0.6 !important;
  z-index: 1 !important;
}

/* Скрываем плейсхолдер если есть картинки */
.t854__news-wrap .t854__news-content > .t854__news-message:has(.t854__news-images)::before,
.t854__news-wrap .t854__news-content > .t854__news-message:has(.t854__news-images)::after {
  display: none !important;
}

/* ===== ИЗОБРАЖЕНИЯ В КАРТОЧКАХ ===== */
.t854__news-wrap .t854__news-content > .t854__news-message .t854__news-images {
  width: 100% !important;
  height: 200px !important;
  position: relative !important;
  overflow: hidden !important;
  display: flex !important;
  gap: 2px !important;
  order: -1 !important;
}

.t854__news-wrap .t854__news-content > .t854__news-message .t854__news-image-wrap {
  flex: 1 !important;
  height: 100% !important;
  overflow: hidden !important;
}

.t854__news-wrap .t854__news-content > .t854__news-message .t854__news-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* ===== ДАТА И ТЕКСТ В КАРТОЧКАХ ===== */
.t854__news-wrap .t854__news-content > .t854__news-message .t854__news-time {
  padding: 16px 16px 8px 16px !important;
  font-size: 12px !important;
  color: #a1a1aa !important;
  order: 1 !important;
}

.t854__news-wrap .t854__news-content > .t854__news-message .t854__news-text {
  padding: 0 16px 16px 16px !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
  color: #3f3f46 !important;
  order: 2 !important;
}

.t854__news-wrap .t854__news-content > .t854__news-message .t854__news-text_short-hide {
  display: none !important;
}

/* ===== ОБЁРТКА БЛОКА ===== */
.t854__news-wrap {
  background: transparent !important;
  padding: 40px 0 !important;
}

.t854__news-header {
  margin-bottom: 30px !important;
}

/* ===== ПОПАП (открытая новость) ===== */
.t854__news-popup-bg {
  background: rgba(0,0,0,0.6) !important;
}

.t854__news-popup {
  background: #fff !important;
  border-radius: 16px !important;
  padding: 30px !important;
  max-width: 800px !important;
  max-height: 90vh !important;
  overflow-y: auto !important;
}

.t854__news-popup .t854__news-popup-message-wrap {
  display: block !important;
}

.t854__news-popup::before,
.t854__news-popup::after {
  display: none !important;
}

/* Дата в попапе */
.t854__news-popup .t854__news-time {
  padding: 0 0 16px 0 !important;
  font-size: 13px !important;
  color: #a1a1aa !important;
}

/* Изображения в попапе */
.t854__news-popup .t854__news-images {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  height: auto !important;
  margin-bottom: 20px !important;
}

.t854__news-popup .t854__news-image-wrap {
  flex: 1 1 calc(50% - 4px) !important;
  min-width: 150px !important;
  height: auto !important;
  cursor: pointer !important;
  border-radius: 8px !important;
  overflow: hidden !important;
  transition: transform 0.2s ease !important;
}

.t854__news-popup .t854__news-image-wrap:hover {
  transform: scale(1.02) !important;
}

.t854__news-popup .t854__news-image {
  width: 100% !important;
  height: auto !important;
  object-fit: cover !important;
  cursor: pointer !important;
  pointer-events: auto !important;
}

/* Текст в попапе — показываем полную версию */
.t854__news-popup .t854__news-text {
  display: none !important;
}

.t854__news-popup .t854__news-text_short-hide {
  display: block !important;
  padding: 0 !important;
  font-size: 15px !important;
  line-height: 1.7 !important;
  color: #3f3f46 !important;
}

/* Кнопка закрытия */
.t854__news-popup-close {
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  width: 30px !important;
  height: 30px !important;
  cursor: pointer !important;
  opacity: 0.6 !important;
  transition: opacity 0.2s !important;
  background: transparent !important;
  border: none !important;
}

.t854__news-popup-close:hover {
  opacity: 1 !important;
}

/* ===== ЛАЙТБОКС (увеличенное фото) ===== */
.t854__news-lightbox,
.t-zoomer__wrapper,
.t-zoomer__container {
  z-index: 99999 !important;
  pointer-events: auto !important;
}

.t-zoomer__bg {
  background: rgba(0,0,0,0.9) !important;
}

.t-zoomer__close {
  opacity: 0.8 !important;
  cursor: pointer !important;
}

.t-zoomer__close:hover {
  opacity: 1 !important;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 960px) {
  .t854__news-content {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 640px) {
  .t854__news-content {
    grid-template-columns: 1fr !important;
  }
  
  .t854__news-wrap .t854__news-content > .t854__news-message .t854__news-images {
    height: 180px !important;
  }
  
  .t854__news-wrap .t854__news-content > .t854__news-message::before {
    height: 180px !important;
  }
  
  .t854__news-wrap .t854__news-content > .t854__news-message::after {
    top: 66px !important;
  }
  
  .t854__news-popup {
    padding: 20px !important;
    margin: 10px !important;
    border-radius: 12px !important;
  }
  
  .t854__news-popup .t854__news-image-wrap {
    flex: 1 1 100% !important;
  }
}