.bs_feed-container {
  max-width: 1240px; 
  margin: 0 auto;
  min-height: calc(100vh - 400px);
}

.bs_reports-feed {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.bs_feed-card {
  display: flex;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ya-share2 {
  transform: scale(1.5);
  padding: 20px 0;
}

.bs_feed-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.bs_feed-image {
  width: 50%;
  position: relative;
  min-height: 300px;
}

.bs_feed-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bs_feed-content {
  width: 50%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

/* Блок 1: Название и дата */
.bs_feed-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.bs_feed-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--main-text);
  margin-top: 0;
  padding-top: 0;
}

.bs_feed-date {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 6px;
}

/* Блок 2: Статистика */
.bs_feed-stats {
  display: flex;
  justify-content: space-between;
  background-color: var(--tab-bg);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.bs_feed-item {
  display: flex;
  flex-direction: column;
}

.bs_feed-label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bs_feed-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--main-text);
}

/* Блок 3: Описание */
.bs_feed-description {
  font-size: 0.95rem;
  color: var(--main-text);
  flex-grow: 1; 
}

/* Ограничение текста до 3 строк с многоточием (опционально) */
.bs_feed-description p {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Блок 4: Кнопка */
.bs_feed-footer {
  display: flex;
  justify-content: flex-end;
}

.bs_feed-more {
  display: inline-block;
  background-color: #2563eb;
  color: #ffffff;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}

.bs_feed-more:hover {
  background-color: #1d4ed8;
}

.bs_page {
  width: min(1200px, calc(100% - 32px));
  margin: 36px auto 64px;
  padding-bottom: 30px;
}

.bs_post-footer {
  width: 100%;
  text-align: right;
  padding: 20px 24px;

}

.bs_post-content {
  width: 100%;
  padding: 24px;
}

.bs_post-description p {
  margin: 0 0 18px;
  padding: 24px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.bs_post-description p:last-child {
  margin-bottom: 0;
}

.bs_post {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.bs_post-cover {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 350px;
  aspect-ratio: 16 / 9;
  padding: clamp(24px, 5vw, 48px);
  isolation: isolate;
  background: #244333;
  color: #ffffff;
}

.bs_post-cover__image {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.bs_post-cover::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgb(5 16 11 / 0%) 0%, rgb(5 16 11 / 0%) 60%, rgb(5 16 11 / 94%) 100% );
}

.bs_post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 16px;
  padding: 26px 40px;
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}

.bs_post-gallery {
  display: grid;
  gap: 6px;
  border-radius: 12px;
  overflow: hidden;
  max-width: 100%;
  margin: 15px 0;
}

.bs_post-gallery-item {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #f0f0f0;
}

.bs_post-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Картинка заполняет блок без искажений */
  display: block;
  transition: transform 0.3s ease;
}

.bs_post-gallery-item:hover img {
  transform: scale(1.03);
}

/* Скрываем фото, начиная с 6-го (остаются в коде для лайтбокса) */
.bs_post-gallery-item.is-hidden {
  display: none;
}

.map_yamap {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.more-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 28px;
  font-weight: bold;
  font-family: sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

/* 1 фото: на всю ширину, адекватная высота */
.bs_post-gallery.count-1 {
    grid-template-columns: 1fr;
}
.bs_post-gallery.count-1 .gallery-item {
    max-height: 500px;
}

/* 2 фото: два равных квадрата/прямоугольника рядом */
.bs_post-gallery.count-2 {
    grid-template-columns: repeat(2, 1fr);
    aspect-ratio: 16 / 9;
}

/* 3 фото: одно большое слева, два маленьких справа */
.bs_post-gallery.count-3 {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: repeat(2, 1fr);
    aspect-ratio: 16 / 10;
}
.bs_post-gallery.count-3 .bs_post-gallery-item:first-child {
    grid-row: span 2;
}

/* 4 фото: классическая сетка 2x2 */
.bs_post-gallery.count-4 {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    aspect-ratio: 4 / 3;
}

/* 5 и более фото: 2 больших сверху, 3 поменьше снизу */
.bs_post-gallery.count-5 {
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: 1.3fr 1fr;
    aspect-ratio: 4 / 3;
}
.bs_post-gallery.count-5 .bs_post-gallery-item:nth-child(1),
.bs_post-gallery.count-5 .bs_post-gallery-item:nth-child(2) {
    grid-column: span 3; /* Занимают по половине ширины */
}
.bs_post-gallery.count-5 .bs_post-gallery-item:nth-child(3),
.bs_post-gallery.count-5 .bs_post-gallery-item:nth-child(4),
.bs_post-gallery.count-5 .bs_post-gallery-item:nth-child(5) {
    grid-column: span 2; /* Занимают по трети ширины */
}


.lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    user-select: none;
}

.lightbox-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: opacity 0.15s ease;
}

/* Счетчик кадров (например: 3 / 12) */
.lightbox-counter {
    position: absolute;
    top: 20px;
    left: 24px;
    color: #fff;
    font-family: sans-serif;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 14px;
    border-radius: 20px;
}

/* Кнопки управления */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    border-radius: 50%;
    width: 48px;
    height: 48px;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-close {
    top: 16px;
    right: 20px;
    font-size: 32px;
}

.lightbox-prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

/* Скрываем стрелки, если фото в посте всего одно */
.lightbox-modal.single-photo .lightbox-prev,
.lightbox-modal.single-photo .lightbox-next {
    display: none;
}

.route-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background-color: #ffffff;
  border-top: 1px solid #f0f0f0;
}

/* Группа характеристик */
.route-stats {
  display: flex;
  align-items: center;
  gap: 24px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
}

.stat-value {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}

/* Кнопка скачивания */
.btn-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background-color: #2563eb;
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  white-space: nowrap; /* Запрещает перенос текста кнопки на новую строку */
  transition: background-color 0.2s ease;
}

.btn-download:hover {
  background-color: #1d4ed8;
}



/* Адаптивность для планшетов и смартфонов (ширина экрана меньше 768px) */
@media (max-width: 768px) {
  .bs_feed-container {
    display: block;
  }

  .bs_feed-title {
    font-size: 1.1rem;
    text-align: center;
    width: 100%;
  }

  .bs_reports-feed {
    display: block;
  }

  .bs_page {
     width: calc(100% - 20px);
     margin: 12px auto 32px;
  }
  .bs_post-cover {
    min-height: 320px;
    aspect-ratio: auto;
    padding: 24px;
  }

  .bs_post-content {
    padding: 24px 10px;
  }

  .bs_feed-card {
    flex-direction: column; /* Картинка сверху, текст снизу */
    margin-bottom: 20px;
  }

  .bs_feed-image,
  .bs_feed-content {
     width: 100%;
  }

  .bs_feed-image {
    min-height: 120px;
    max-height: 260px;
  }

  .bs_feed-content {
    padding: 18px;
  }

  .bs_feed-header {
    flex-direction: column;
    gap: 6px;
  }

  .bs_feed-stats {
    flex-wrap: wrap;
    gap: 12px;
  }

  .bs_feed-more {
    width: 100%;
    text-align: center;
  }
}


@media (max-width: 576px) {

  .bs_post-gallery {
    gap: 4px;
    border-radius: 8px;
  }

  .more-overlay {
    font-size: 20px;
  }

  .bs_post-gallery.count-2,
  .bs_post-gallery.count-3,
  .bs_post-gallery.count-4,
  .bs_post-gallery.count-5 {
     aspect-ratio: 1 / 1;
  }

  .lightbox-prev,
  .lightbox-next {
    width: 38px;
    height: 38px;
    font-size: 22px;
  }
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }

  .route-panel {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px;
    gap: 14px;
  }

  .route-stats {
    justify-content: space-between;
    gap: 12px;
  }

  .stat-item {
    align-items: center;
    text-align: center;
  }

  .btn-download {
    width: 100%;
    padding: 10px 16px;
  }
}

