/* ===== Контейнеры ленты и панели фильтров (на всю ширину экрана) ===== */
.agg-toolbar,
#agg-feed{
  width: 100%;
  max-width: none;          /* не ограничиваем контейнер */
  margin: 0;                /* прижато к странице */
  padding: 0 24px;          /* внутренние поля у краёв экрана */
  box-sizing: border-box;
}

#agg-feed{ display:block; }
#agg-feed > .tgcard{ margin: 20px auto; } /* центрируем сами карточки */

/* ===== Чипы фильтров (слева) ===== */
.agg-pools{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:flex-start;  /* слева */
  margin: 0 0 16px 0;
}

.agg-chip{
  border:1px solid #e5e7eb;
  padding:7px 14px;
  border-radius:999px;
  text-decoration:none;
  color:#111;
  background:#f7f7f7;
  font-size:14px;
  transition: background-color .15s, color .15s, border-color .15s;
}
.agg-chip:hover{ background:#efefef; }
.agg-chip.is-active{
  background:#e6e6e6;   /* активный — светло-серый */
  color:#000;
  border-color:#e1e1e1;
}

/* ===== Карточка поста ===== */
.tgcard{
  background:#fff;
  border-radius:14px;
  border:1px solid #eef1f4;
  box-shadow:0 8px 24px rgba(20,29,37,.06);
  padding:16px 16px 14px;
  display:flex;
  flex-direction:column;

  /* важное: читаемая ширина карточки и центрирование */
  width: 100%;
  max-width: 1080px;       /* комфортная ширина текста на десктопе */
}

/* Шапка */
.tgcard__head{ display:flex; align-items:center; margin-bottom:8px; }

.tgcard__avatar{
  width:42px;height:42px;border-radius:50%;
  background:#e8eef3;color:#486e8e;
  display:inline-flex;align-items:center;justify-content:center;
  font-weight:700;margin-right:10px;flex:0 0 42px;
  overflow:hidden;background-size:cover;background-position:center;
}
.tgcard__avatar--img{ color:transparent; text-indent:-9999px; }

.tgcard__meta{
  display:flex;
  flex-direction:column;   /* в колонку: сверху источник, ниже дата */
  align-items:flex-start;  /* всё к левому краю */
  gap:2px;                 /* маленький зазор между названием и датой */
}

.tgcard__source{
  font-weight:700;
  font-size:15px;
  color:#0f172a;
}

.tgcard__date{
  font-size:12px;
  color:#6b7280;
  margin:0;                /* убираем отступы */
}


/* Заголовок — скрываем полностью */
.tgcard__title{ display:none !important; }

/* Медиа */
.tgcard__media{ border:0; padding:0; background:none; cursor:pointer; margin:6px 0 12px; }
.tgcard__media img{ width:100%; height:auto; border-radius:12px; display:block; }

/* Текст */
.tgcard__text{
  font-size:16px; line-height:1.6; color:#111;
  word-wrap:break-word; white-space:pre-wrap;
}
.tgcard__text a{ color:#1b8abf; text-decoration:underline; }

/* Кнопка (серая и по центру) */
.tgcard__actions{
  margin-top:12px;
  display:flex;
  justify-content:center;
}
.tgbtn{ display:inline-block; padding:9px 14px; border-radius:10px; text-decoration:none; font-size:14px; }
.tgbtn--primary{ background:#f0f2f5; color:#1f2937; }
.tgbtn--primary:hover{ background:#e5e7eb; }

/* Лайтбокс */
.lb { position: fixed; inset: 0; display: none; z-index: 9999; }
.lb.is-open { display: block; }
.lb__backdrop { position:absolute; inset:0; background: rgba(0,0,0,.72); }
.lb__figure { position:relative; z-index:1; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.lb__img { max-width:92%; max-height:84%; border-radius:8px; }
.lb__cap { color:#fff; margin-top:8px; text-align:center; }
.lb__close { position:absolute; top:16px; right:16px; background:none; border:0; color:#fff; font-size:28px; cursor:pointer; }

/* Адаптив */
@media (max-width: 1280px){
  .tgcard{ max-width: 980px; }
}
@media (max-width: 1100px){
  .tgcard{ max-width: 900px; }
}
@media (max-width: 900px){
  .tgcard{ max-width: 100%; }
}
@media (max-width:540px){
  .tgcard{ padding:14px; }
}
