/* === Telegram News Section === */
.news-page-title {
  text-align: center;
  margin: 40px auto;
  max-width: 700px;
}

.telegram-news-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Карточка поста --- */
.telegram-post {
  width: 100%;
  max-width: 900px;
  margin: 8px 0;
  padding: 14px 16px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .03);
  transition: box-shadow 0.2s;
  overflow: hidden;
}

.telegram-post:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, .08);
}

.telegram-post-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}

/* --- Медиа (фото / видео) --- */
.telegram-post-thumb,
.telegram-post-media {
  flex: 0 0 280px;
  max-width: 280px;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.telegram-post-thumb img,
.telegram-post-media img,
.telegram-post-media video {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
}

/* --- Контент --- */
.telegram-post-content {
  flex: 1 1 0;
  min-width: 300px;
}

.telegram-post-content h3 {
  margin: 0 0 6px;
  font: 600 18px/1.4 "Georgia", "Times New Roman", serif;
  color: #004466;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

/* --- Основной текст --- */
.telegram-content {
  font: 15px/1.6 Georgia, "Times New Roman", serif;
  white-space: normal;
  word-wrap: break-word;
}

.telegram-content p {
  margin: 0 0 0.6em;
}

.telegram-content p:last-child {
  margin-bottom: 0;
}

.telegram-content br {
  display: inline;
}

.telegram-content strong,
.telegram-content b {
  font-weight: 600;
}

.telegram-content em,
.telegram-content i {
  font-style: italic;
}

.telegram-content span {
  white-space: pre-wrap;
}

/* --- Списки --- */
.telegram-content ul,
.telegram-content ol {
  margin: 0 0 0.8em 1.2em;
  padding: 0;
  font-size: 15px;
  line-height: 1.6;
}

.telegram-content ul {
  list-style-type: disc;
}

.telegram-content ol {
  list-style-type: decimal;
}

.telegram-content li {
  margin-bottom: 0.4em;
  padding-left: 4px;
}

.telegram-content li::marker {
  color: #00596d;
  font-size: 0.9em;
}

/* --- Источник и дата --- */
.telegram-source {
  margin-top: 12px;
}

.telegram-source-item {
  margin-bottom: 5px;
}

.telegram-source a {
  font-size: 14px;
  color: #00596d;
  text-decoration: none;
}

.telegram-source a:hover {
  color: #003d4a;
  text-decoration: underline;
}

.telegram-date {
  display: block;
  margin-top: 6px;
  font: 13px/1 Arial, Helvetica, sans-serif;
  color: #777;
}

/* --- Кнопка «Показать все» --- */
#show-more-news {
  background: none;
  border: none;
  padding: 0;
  font: 16px/1 inherit;
  color: #00596d;
  text-decoration: underline;
  cursor: pointer;
}

#show-more-news:hover {
  color: #003d4d;
}

/* --- Кнопка «Читать полностью» --- */
.tg-read-more {
  display: inline-block;
  margin: 6px 0;
  cursor: pointer;
  text-decoration: underline;
  color: #00596d;
}

.tg-read-more:hover {
  color: #003d4d;
}

/* --- Видео: предупреждение --- */
.telegram-video-warning {
  font-size: 14px;
  color: #777;
  font-style: italic;
  margin-top: 10px;
}

/* --- Галерея --- */
.telegram-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.telegram-gallery img {
  flex: 1 1 calc(33% - 10px);
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

@media (max-width: 768px) {
  .telegram-gallery img {
    flex: 0 0 calc(50% - 10px);
    max-width: calc(50% - 10px);
  }
}

/* --- Слайдер --- */
.telegram-swiper {
  width: 100%;
  max-width: 600px;
  margin-bottom: 15px;
  border-radius: 8px;
  overflow: hidden;
}

.telegram-swiper img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.swiper-button-next,
.swiper-button-prev {
  color: #333;
}

.swiper-pagination-bullet {
  background: #333;
}

/* --- Фильтрация и скрытие --- */
.telegram-post.hidden-post {
  display: none;
}

.telegram-news-wrapper.filtered-active .telegram-post:not(.filtered-post) {
  display: none;
}

#telegram-posts.filtered-active .telegram-post:not(.filtered-post) {
  display: none;
}

/* ---  адаптация --- */
@media (max-width: 1024px) {
  .news-page-title {
    margin: 30px auto;
    padding: 0 20px;
  }

  .telegram-post {
    margin: 10px 12px;
    padding: 12px 14px;
  }

  .telegram-post-content h3 {
    font-size: 17px;
  }
}

@media (max-width: 768px) {
  .telegram-post-inner {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px;
    width: 100%;
  }

  .telegram-post-thumb,
  .telegram-post-media {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    flex-shrink: 0;
    flex-grow: 0;
  }

  .telegram-post-thumb img,
  .telegram-post-media img,
  .telegram-post-media video {
    display: block;
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
    border-radius: 6px;
  }

  .telegram-post-content {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;
    word-break: break-word;
  }

  .telegram-post-content h3,
  .telegram-content,
  .telegram-content p {
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
  }
}


@media (max-width: 600px) {
  .telegram-post {
    margin: 10px 12px;
    padding: 10px 12px;
  }

  .telegram-post-content h3 {
    font-size: 15.5px;
    line-height: 1.3;
  }

  .telegram-content {
    font-size: 13.8px;
    line-height: 1.5;
  }
}

@media (max-width: 400px) {
  .telegram-post {
    padding: 8px 10px;
  }

  .telegram-post-content h3 {
    font-size: 15px;
  }

  .telegram-content {
    font-size: 13.5px;
  }

  .telegram-date,
  .telegram-source a {
    font-size: 13px;
  }

  .swiper-button-next,
  .swiper-button-prev {
    display: none;
  }
}
