/* ===========================
   Блог — сторінка статті (на всю ширину, .container-wide з header-v2.css)
   Десктоп: популярне | текст | всі статті. Від 1400px вниз — 2 колонки, телефон — 1.
   =========================== */
.bp { --bp-ink: #1f2133; --bp-text: #374151; --bp-muted: #6b6f86; --bp-line: #eceef5; position: relative; padding-bottom: 20px; }
.bp a { text-decoration: none; }
.bp a:hover { text-decoration: none; }
.bp a:focus-visible, .bp button:focus-visible { outline: 3px solid #667eea; outline-offset: 2px; border-radius: 10px; }

.bp-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1100;
  height: 4px;
  width: 0;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 0 4px 4px 0;
}

.bp-noimg { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #667eea, #764ba2); }

/* ---- обкладинка ---- */
.bp-hero { position: relative; min-height: 460px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; overflow: hidden; }
.bp-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bp-hero-shade { position: absolute; inset: 0; background: linear-gradient(rgba(10, 8, 25, .15), rgba(10, 8, 25, .88)); }
.bp-hero-in { position: relative; z-index: 1; width: 100%; padding-top: 34px; padding-bottom: 34px; }
/* крихти — угорі обкладинки, заголовок — унизу */
.bp-crumbs-in { position: relative; z-index: 1; width: 100%; padding-top: 22px; }
.bp-crumbs { font-size: 13px; opacity: .85; }
.bp-crumbs a { color: #fff; }
.bp-crumbs a:hover { text-decoration: underline; }
.bp-cat { display: inline-block; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; color: #fff; margin-bottom: 14px; }
.bp-cat:hover { color: #fff; filter: brightness(1.08); }
.bp-title { margin: 0; max-width: 1100px; font-family: Georgia, 'Times New Roman', serif; font-size: 46px; font-weight: 700; line-height: 1.08; letter-spacing: -.01em; color: #fff; text-wrap: balance; }
.bp-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 18px; font-size: 15px; opacity: .92; }
.bp-author { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.bp-ava {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: 2px solid rgba(255, 255, 255, .6);
}

.bp-msg { margin-top: 18px; padding: 14px 18px; border-radius: 12px; font-weight: 600; color: #fff; background: #3b82f6; }
.bp-msg--success { background: #10b981; }
.bp-msg--error { background: #ef4444; }
.bp-msg--warning { background: #f59e0b; }

/* ---- три колонки ---- */
.bp-body {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 380px;
  gap: 36px;
  padding-top: 36px;
  padding-bottom: 36px;
}
.bp-main { min-width: 0; width: 100%; max-width: 900px; justify-self: center; }
.bp-lrail, .bp-rrail { align-self: start; display: grid; gap: 16px; position: sticky; top: 20px; min-width: 0; }

.bp-tg {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, #229ed9, #2aabee 45%, #667eea);
  box-shadow: 0 10px 24px rgba(34, 158, 217, .28);
  transition: transform .2s ease;
}
.bp-tg:hover { color: #fff; transform: translateY(-2px); }
.bp-tg-label { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; opacity: .85; }
.bp-tg-title { font-size: 17px; font-weight: 800; }
.bp-tg-btn { justify-self: start; padding: 8px 14px; border-radius: 10px; background: #fff; color: #229ed9; font-weight: 800; font-size: 14px; }

.bp-wid { background: #fff; border: 1px solid var(--bp-line); border-radius: 18px; padding: 16px; }
.bp-wid-title { margin: 0 0 10px; font-size: 17px; font-weight: 800; color: var(--bp-ink); }
.bp-pi {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  color: var(--bp-ink);
  transition: background .2s ease;
}
.bp-pi:hover { background: #f6f7fd; color: #764ba2; }
.bp-pi-th { width: 84px; height: 64px; border-radius: 10px; object-fit: cover; display: block; }
.bp-pi-t { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; font-weight: 700; line-height: 1.3; }
.bp-pi-m { display: block; margin-top: 3px; font-size: 12px; color: #9a9eb8; }
.bp-all-list { max-height: calc(100vh - 140px); overflow-y: auto; scrollbar-width: thin; }

/* ---- зміст ---- */
.bp-toc { margin: 0 0 26px; padding: 16px 18px; border-radius: 16px; background: #fff; border: 1px solid var(--bp-line); }
.bp-toc-label { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #9a9eb8; }
.bp-toc-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.bp-toc-list a { padding-left: 12px; border-left: 2px solid #e6e8f0; font-size: 14.5px; line-height: 1.35; color: #4b4f66; }
.bp-toc-list a:hover { border-left-color: #764ba2; color: #764ba2; }

/* ---- текст статті ---- */
.bp-content { color: var(--bp-text); font-size: 18px; line-height: 1.75; }
.bp-content > :first-child { margin-top: 0; }
.bp-content p { margin: 0 0 18px; }
.bp-content h2 { margin: 38px 0 14px; font-family: Georgia, 'Times New Roman', serif; font-size: 30px; line-height: 1.2; color: var(--bp-ink); scroll-margin-top: 90px; }
.bp-content h3 { margin: 28px 0 10px; font-size: 22px; line-height: 1.3; color: var(--bp-ink); }
.bp-content h4 { margin: 22px 0 8px; font-size: 19px; color: var(--bp-ink); }
.bp-content ul, .bp-content ol { margin: 0 0 18px; padding-left: 24px; }
.bp-content li { margin-bottom: 8px; }
.bp-content a { color: #667eea; border-bottom: 1px solid rgba(102, 126, 234, .35); }
.bp-content a:hover { color: #764ba2; border-bottom-color: #764ba2; }
.bp-content img { max-width: 100%; height: auto; border-radius: 14px; }
.bp-content strong { color: var(--bp-ink); }
.bp-content blockquote {
  margin: 22px 0;
  padding: 16px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(102, 126, 234, .08), rgba(118, 75, 162, .08));
  border-left: 4px solid #667eea;
}

/* ---- поділитися ---- */
.bp-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--bp-line); font-size: 15px; color: var(--bp-muted); }
.bp-sh {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: transform .2s ease;
}
.bp-sh:hover { color: #fff; transform: translateY(-2px); }
.bp-sh--tg { background: #2aabee; }
.bp-sh--viber { background: #7360f2; }
.bp-sh--fb { background: #1877f2; }
.bp-sh--copy { background: #6b6f86; }
.bp-copied { font-size: 13px; color: #10b981; }

/* ---- читайте також ---- */
.bp-related { padding-top: 10px; padding-bottom: 30px; }
.bp-sec-title { margin: 0 0 14px; font-family: Georgia, 'Times New Roman', serif; font-size: 26px; color: var(--bp-ink); }
.bp-rel-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.bp-rcard {
  display: grid;
  grid-template-rows: auto 1fr;
  background: #fff;
  border: 1px solid var(--bp-line);
  border-radius: 18px;
  overflow: hidden;
  color: var(--bp-ink);
  box-shadow: 0 4px 14px rgba(30, 20, 80, .05);
  transition: transform .2s ease, box-shadow .2s ease;
}
.bp-rcard:hover { color: var(--bp-ink); transform: translateY(-4px); box-shadow: 0 16px 32px rgba(30, 20, 80, .13); }
.bp-rcard-cv { display: block; aspect-ratio: 16 / 10; overflow: hidden; }
.bp-rcard-cv img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bp-rcard-b { display: grid; gap: 6px; align-content: start; padding: 14px; }
.bp-rcard-t { font-size: 16px; font-weight: 700; line-height: 1.3; }

/* ---- коментарі ---- */
.bp-comments { padding-bottom: 30px; }
.bp-com-box { max-width: 900px; margin: 0 auto; padding: 24px; border-radius: 18px; background: #fff; border: 1px solid var(--bp-line); display: grid; gap: 14px; }
.bp-cm { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid #f0f1f6; }
.bp-cm-a { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #4f46e5; background: #e0e7ff; }
.bp-cm b { color: var(--bp-ink); }
.bp-cm small { color: #9a9eb8; margin-left: 6px; }
.bp-cm p { margin: 4px 0 0; color: #4b4f66; font-size: 15px; line-height: 1.55; }
.bp-cm-empty { margin: 0; padding: 10px 0; color: var(--bp-muted); text-align: center; }
.bp-cm-form { display: grid; gap: 12px; }
.bp-cm-form h3 { margin: 6px 0 0; font-size: 19px; color: var(--bp-ink); }
.bp-cm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bp-cm-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; color: #4b4f66; }
.bp-cm-form input,
.bp-cm-form textarea {
  width: 100%;
  border: 1px solid #e1e4ef;
  border-radius: 12px;
  padding: 11px 14px;
  font: inherit;
  font-weight: 400;
  color: var(--bp-ink);
  background: #fafbff;
}
.bp-cm-form input:focus,
.bp-cm-form textarea:focus { outline: none; border-color: #667eea; box-shadow: 0 0 0 4px rgba(102, 126, 234, .15); background: #fff; }
.bp-cm-send {
  justify-self: start;
  padding: 12px 22px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(120deg, #667eea, #764ba2);
  box-shadow: 0 8px 18px rgba(118, 75, 162, .3);
}
.bp-cm-note { margin: 0; font-size: 13px; color: #9ca3af; }
.bp-back { display: inline-block; margin-top: 18px; font-weight: 700; color: #667eea; }
.bp-comments .bp-back { display: block; max-width: 900px; margin: 18px auto 0; }

/* ---- адаптив ---- */
@media (max-width: 1399px) {
  /* 2 колонки: текст | права колонка (Telegram + популярне + всі статті) */
  .bp-body { grid-template-columns: minmax(0, 1fr) 360px; }
  .bp-lrail { grid-column: 2; grid-row: 1; position: static; }
  .bp-main { grid-column: 1; grid-row: 1 / span 2; }
  .bp-rrail { grid-column: 2; grid-row: 2; }
  .bp-rel-grid { grid-template-columns: repeat(3, 1fr); }
  .bp-rel-grid .bp-rcard:nth-child(4) { display: none; }
}
@media (max-width: 991px) {
  .bp-hero { min-height: 380px; }
  .bp-crumbs-in { padding-top: 80px; }
  .bp-hero-in { padding-top: 20px; }
  .bp-title { font-size: 34px; }
  .bp-body { grid-template-columns: 1fr; }
  .bp-main { grid-column: 1; grid-row: auto; max-width: none; }
  .bp-lrail, .bp-rrail { display: none; }
  .bp-rel-grid { grid-template-columns: repeat(2, 1fr); }
  .bp-rel-grid .bp-rcard:nth-child(4) { display: grid; }
}
@media (max-width: 575px) {
  .bp-hero { min-height: 320px; }
  .bp-crumbs-in { padding-top: 70px; }
  .bp-hero-in { padding-top: 16px; padding-bottom: 22px; }
  .bp-title { font-size: 26px; }
  .bp-hero-meta { gap: 12px; font-size: 13px; }
  .bp-body { padding-top: 20px; }
  .bp-content { font-size: 17px; }
  .bp-content h2 { font-size: 24px; }
  .bp-toc-list { grid-template-columns: 1fr; }
  .bp-rel-grid { gap: 10px; }
  .bp-cm-row { grid-template-columns: 1fr; }
  .bp-com-box { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .bp-tg, .bp-pi, .bp-sh, .bp-rcard { transition: none; }
  .bp-tg:hover, .bp-sh:hover, .bp-rcard:hover { transform: none; }
}
