/* Blog index — modern social feed (vc.ru / Reddit / Pikabu canon). Template 15. Scoped to .bf. */
.bf {
  --bf-ground: #eef1ef;
  --bf-card: #ffffff;
  --bf-ink: #0e1512;
  --bf-text: #26302b;
  --bf-soft: #5f6b65;
  --bf-faint: #808b85;
  --bf-tone: #f2f5f3;
  --bf-tone-2: #e6ebe8;
  --bf-green: #00ab57;
  --bf-green-ink: #00803f;
  --bf-green-tint: #e3f5ea;
  --bf-deep: #003528;
  --bf-like: #e5395b;
  --bf-like-tint: #fdeaee;
  --bf-r: 20px;
  --bf-r-media: 14px;
  --bf-pad: 40px;
  --bf-ease: cubic-bezier(.22, 1, .36, 1);

  background: var(--bf-ground);
  color: var(--bf-ink);
  font-size: 16px;
  line-height: 1.5;
  padding: 28px 0 96px;
  font-variant-numeric: tabular-nums;
}
body.blog-feed { background: #eef1ef; }
.bf *, .bf *::before, .bf *::after { box-sizing: border-box; }
.bf :where(h1, h2, h3, p, ul, ol, li) { margin: 0; padding: 0; }
.bf :where(ul, ol) { list-style: none; }
.bf :where(h1, h2, h3) { color: inherit; }
.bf :where(a) { color: inherit; text-decoration: none; }
.bf :where(img) { display: block; max-width: 100%; }
.bf :where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.bf svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bf ::selection { background: #bfe9d2; color: var(--bf-ink); }
.bf :focus-visible { outline: 2px solid var(--bf-green); outline-offset: 2px; }
.bf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.bf-wrap {
  max-width: 1440px; margin: 0 auto; padding: 0 var(--bf-pad);
  display: grid; grid-template-columns: 232px minmax(0, 680px) 312px; justify-content: center; gap: 28px;
  align-items: start;
}

/* ---------- Pills: one fully round control shape for the whole page ---------- */
.bf-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 999px;
  font-size: 15px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  transition: background-color .2s ease, color .2s ease, transform .15s ease;
}
.bf-pill:active { transform: scale(.97); }
.bf-pill--primary { background: var(--bf-green); color: #fff; }
.bf-pill--primary:hover { background: var(--bf-green-ink); }
.bf-pill--soft { background: var(--bf-tone); color: var(--bf-ink); }
.bf-pill--soft:hover { background: var(--bf-tone-2); }
.bf-pill svg { width: 18px; height: 18px; }

/* ---------- Left navigation ---------- */
.bf-nav__sticky { position: sticky; top: 24px; display: flex; flex-direction: column; }
.bf-nav__group { display: flex; flex-direction: column; gap: 2px; }
.bf-nav__label { margin: 22px 14px 8px; font-size: 13px; font-weight: 600; color: var(--bf-faint); }
.bf-nav__item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 44px; padding: 10px 14px; border-radius: 999px;
  font-size: 15px; font-weight: 500; text-align: left; line-height: 1.25; color: var(--bf-text);
  transition: background-color .2s ease, color .2s ease;
}
.bf-nav__item svg { color: var(--bf-faint); transition: color .2s ease; }
.bf-nav__item span { margin-left: auto; font-size: 13px; color: var(--bf-faint); }
.bf-nav__item:hover { background: var(--bf-tone-2); }
.bf-nav__item.is-active { background: var(--bf-card); color: var(--bf-ink); font-weight: 600; }
.bf-nav__item.is-active svg { color: var(--bf-green); }

/* ---------- Community header ---------- */
.bf-hero { background: var(--bf-card); border-radius: var(--bf-r); overflow: hidden; }
.bf-hero__banner { position: relative; height: 128px; background: var(--bf-deep); overflow: hidden; }
.bf-hero__banner img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 38%; }
.bf-hero__banner::after { content: ""; position: absolute; inset: 0; background: rgba(0, 53, 40, .55); }
.bf-hero__body { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 20px; padding: 0 24px 24px; }
.bf-hero__avatar {
  grid-row: 1; grid-column: 1; margin-top: -36px; width: 84px; height: 84px; border-radius: 26px;
  display: grid; place-items: center; background: var(--bf-green); color: #fff;
  font-size: 30px; font-weight: 700; letter-spacing: -.03em;
  outline: 6px solid var(--bf-card);
}
.bf-hero__text { grid-row: 2; grid-column: 1 / 3; padding-top: 14px; min-width: 0; }
.bf-hero h1 { font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -.025em; }
.bf-hero__text p { margin-top: 8px; font-size: 16px; line-height: 1.5; color: var(--bf-text); max-width: 60ch; }
.bf-hero__stats { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 14px; font-size: 14px; color: var(--bf-soft); }
.bf-hero__stats b { color: var(--bf-ink); font-weight: 700; }
.bf-hero__acts { grid-row: 1; grid-column: 2; justify-self: end; padding-top: 16px; display: flex; gap: 8px; align-items: flex-start; }

/* ---------- Sort + rubric bar ---------- */
.bf-bar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 0; background: var(--bf-ground); }
.bf-seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--bf-tone-2); }
.bf-seg__btn { min-height: 38px; padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--bf-soft); transition: background-color .2s ease, color .2s ease; }
.bf-seg__btn:hover { color: var(--bf-ink); }
.bf-seg__btn.is-active { background: var(--bf-card); color: var(--bf-ink); }
.bf-chips { display: none; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.bf-chips::-webkit-scrollbar { display: none; }
.bf-chip {
  flex-shrink: 0; min-height: 38px; padding: 8px 16px; border-radius: 999px;
  background: var(--bf-card); font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}
.bf-chip:hover { background: var(--bf-tone-2); }
.bf-chip.is-active { background: var(--bf-ink); color: #fff; }

/* ---------- Posts ---------- */
.bf-list { display: flex; flex-direction: column; gap: 14px; }
.bf-post { background: var(--bf-card); border-radius: var(--bf-r); padding: 20px 24px 14px; }
.bf-post[hidden], .bf-promo[hidden] { display: none; }

.bf-post__head { display: flex; align-items: center; gap: 10px; font-size: 14px; min-width: 0; }
.bf-post__avatar { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; background: var(--bf-green); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: -.02em; }
.bf-post__author { font-weight: 600; }
.bf-post__date { color: var(--bf-faint); white-space: nowrap; }
.bf-post__date::before { content: "·"; margin-right: 10px; }
.bf-tag {
  margin-left: auto; flex-shrink: 0;
  padding: 5px 12px; border-radius: 999px; background: var(--bf-green-tint); color: var(--bf-green-ink);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background-color .2s ease;
}
.bf-tag:hover { background: #ccecd9; }

.bf-post__title { margin-top: 14px; font-size: 24px; line-height: 1.22; font-weight: 700; letter-spacing: -.022em; text-wrap: balance; }
.bf-post__title a { transition: color .2s ease; }
.bf-post__title a:hover { color: var(--bf-green-ink); }
.bf-post__intro { margin-top: 8px; font-size: 16px; line-height: 1.55; color: var(--bf-text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.bf-media { display: block; margin-top: 16px; aspect-ratio: 16 / 9; border-radius: var(--bf-r-media); overflow: hidden; background: var(--bf-tone); }
.bf-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--bf-ease); }
.bf-media--fit { background: #e8f3ec; }
.bf-media--fit img { object-fit: contain; }
.bf-post:hover .bf-media img { transform: scale(1.025); }
.bf-post:hover .bf-media--fit img { transform: none; }

.bf-post__foot { display: flex; align-items: center; gap: 6px; margin-top: 14px; }
.bf-act {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 8px 14px; border-radius: 999px; background: var(--bf-tone);
  font-size: 14px; font-weight: 600; color: var(--bf-text);
  transition: background-color .2s ease, color .2s ease, transform .15s ease;
}
.bf-act svg { width: 19px; height: 19px; }
.bf-act:hover { background: var(--bf-tone-2); color: var(--bf-ink); }
.bf-act:active { transform: scale(.96); }
.bf-act--icon { width: 40px; padding: 0; justify-content: center; }
.bf-like svg { transition: transform .35s var(--bf-ease), fill .2s ease, stroke .2s ease; }
.bf-like:hover { background: var(--bf-like-tint); color: var(--bf-like); }
.bf-like.active { background: var(--bf-like-tint); color: var(--bf-like); }
.bf-like.active svg { fill: var(--bf-like); stroke: var(--bf-like); animation: bf-pop .4s var(--bf-ease); }
@keyframes bf-pop { 40% { transform: scale(1.3); } }
.bf-views { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; color: var(--bf-faint); }
.bf-views svg { width: 18px; height: 18px; }

/* ---------- Request card (sidebar + inline on phones) ---------- */
.bf-promo { background: var(--bf-deep); color: #fff; border-radius: var(--bf-r); padding: 24px; }
.bf-promo h2 { font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
.bf-promo p { margin-top: 8px; font-size: 15px; line-height: 1.5; color: #c9ddd3; }
.bf-promo .bf-pill { margin-top: 18px; width: 100%; }
.bf-promo__phone { display: block; margin-top: 14px; text-align: center; font-size: 16px; font-weight: 600; color: #fff; transition: color .2s ease; }
.bf-promo__phone:hover { color: #7fe0ae; }
.bf-inline-cta { display: none; }

.bf-more { margin-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.bf-more__btn { min-width: 240px; background: var(--bf-card); }
.bf-more__btn[hidden], .bf-empty[hidden] { display: none; }
.bf-empty { color: var(--bf-soft); padding: 40px 0; }

/* ---------- Right sidebar ---------- */
.bf-side__sticky { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 14px; }
.bf-card { background: var(--bf-card); border-radius: var(--bf-r); padding: 20px; }
.bf-card h2 { font-size: 17px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
.bf-top { margin-top: 12px; display: flex; flex-direction: column; gap: 4px; }
.bf-top__link { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px; margin: 0 -8px; border-radius: 14px; transition: background-color .2s ease; }
.bf-top__link:hover { background: var(--bf-tone); }
.bf-top__link img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--bf-tone); }
.bf-top__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bf-top__title { font-size: 14px; line-height: 1.35; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bf-top .bf-views { margin: 0; font-size: 13px; }
.bf-top .bf-views svg { width: 16px; height: 16px; }

.bf-guides { margin-top: 8px; display: flex; flex-direction: column; }
.bf-guides a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 12px; margin: 0 -12px; border-radius: 12px; font-size: 14px; font-weight: 500; line-height: 1.4; transition: background-color .2s ease; }
.bf-guides a:hover { background: var(--bf-tone); }
.bf-guides__min { font-size: 13px; color: var(--bf-faint); white-space: nowrap; }

/* New posts fade in as the feed grows */
.bf-post.is-new { animation: bf-in .55s var(--bf-ease) both; }
@keyframes bf-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- No left rail: rubrics become chips ---------- */
@media (max-width: 1279px) {
  .bf { --bf-pad: 25px; }
  .bf-wrap { grid-template-columns: minmax(0, 680px) 312px; }
  .bf-nav { display: none; }
  .bf-chips { display: flex; flex: 1 1 100%; margin: 0 calc(-1 * var(--bf-pad)); padding: 0 var(--bf-pad); }
}

/* ---------- Single column ---------- */
@media (max-width: 1023px) {
  .bf-wrap { grid-template-columns: minmax(0, 680px); }
  .bf-side { display: none; }
  .bf-inline-cta { display: block; }
}

@media (max-width: 767px) {
  .bf { --bf-pad: 12px; --bf-r: 18px; padding-top: 12px; font-size: 15px; }
  .bf-hero__banner { height: 96px; }
  .bf-hero__body { padding: 0 16px 18px; gap: 0 14px; }
  .bf-hero__avatar { width: 68px; height: 68px; border-radius: 22px; font-size: 24px; margin-top: -26px; outline-width: 5px; }
  .bf-hero__text { padding-top: 12px; }
  .bf-hero h1 { font-size: 22px; }
  .bf-hero__acts { grid-column: 1 / 3; grid-row: 3; justify-self: stretch; padding-top: 16px; }
  .bf-hero__acts .bf-pill { flex: 1; }
  .bf-bar { padding: 10px 0; gap: 10px; }
  .bf-seg { width: 100%; }
  .bf-seg__btn { flex: 1; }
  .bf-list { gap: 10px; }
  .bf-post { padding: 16px 16px 12px; }
  .bf-post__head { gap: 8px; flex-wrap: wrap; row-gap: 10px; }
  .bf-post__date::before { margin-right: 6px; }
  .bf-tag { margin-left: 0; order: 5; }
  .bf-post__title { font-size: 20px; margin-top: 12px; }
  .bf-post__intro { font-size: 15px; }
  .bf-media { margin-top: 14px; border-radius: 12px; }
  .bf-act { padding: 8px 12px; }
}


@media (prefers-reduced-motion: reduce) {
  .bf *, .bf *::after { transition-duration: .01ms !important; animation: none !important; }
}
