/*
 * Публичные страницы блога (/blog) — рендерит Express из MongoDB.
 * Дизайн-токены повторяют статический сайт: чернила #0a0a0a, акцент
 * #2e31ff, карточки radius 28px (как кейсы), Arial без веб-шрифтов.
 */

:root {
  --bp-ink: #0a0a0a;
  --bp-text: #1c1c1c;
  --bp-muted: rgba(10, 10, 10, 0.52);
  --bp-accent: #2e31ff;
  --bp-accent-dark: #1524cf;
  --bp-border: #e8e8e8;
  --bp-surface: #f2f2f2;
  --bp-footer-bg: #f5f5f5;
  --bp-cta-band: #120821;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #fff;
  color: var(--bp-ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.bp-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

.bp-main { min-height: 60vh; }
.bp-section { margin-top: 64px; }
.bp-section-title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 28px;
}

/* ------------------------------ шапка ------------------------------ */

.bp-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
}
.bp-header-strip { height: 4px; background: #0b0b0b; }
.bp-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.bp-logo {
  color: var(--bp-ink);
  text-decoration: none;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.bp-logo span { color: var(--bp-accent); }
.bp-nav { display: flex; gap: 22px; }
.bp-nav a {
  color: #3d3d3d;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}
.bp-nav a:hover { color: var(--bp-accent); }
.bp-nav a[aria-current="page"] { color: var(--bp-ink); font-weight: 700; }
.bp-cta {
  display: inline-flex;
  align-items: center;
  padding: 12px 20px;
  border-radius: 12px;
  background: #1a2dff;
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s;
}
.bp-cta:hover { background: var(--bp-accent-dark); }

@media (max-width: 860px) {
  .bp-nav { display: none; }
}

/* ------------------------------ hero ------------------------------ */

.bp-hero {
  padding: 72px 0 8px;
  text-align: center;
}
.bp-page-title {
  font-size: clamp(44px, 8vw, 76px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
}
.bp-page-sub {
  font-size: clamp(15px, 1.6vw, 18px);
  color: var(--bp-muted);
  max-width: 640px;
  margin: 16px auto 0;
}

/* --------------------------- сетка карточек --------------------------- */

.bp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 44px 24px;
}
.bp-grid-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1024px) {
  .bp-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .bp-grid { grid-template-columns: 1fr; }
}

.bp-card { display: flex; flex-direction: column; }
.bp-card-visual {
  display: block;
  border-radius: 28px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--bp-surface);
}
.bp-card-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bp-card-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #ececf0 0%, #f7f7f9 100%);
}
.bp-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.bp-meta-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  background: var(--bp-surface);
  color: rgba(10, 10, 10, 0.7);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.bp-card-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 12px 0 0;
}
.bp-card-title a { color: var(--bp-ink); text-decoration: none; }
.bp-card-title a:hover { color: var(--bp-accent); }
.bp-card-desc {
  font-size: 15px;
  color: #3d3d3d;
  line-height: 1.55;
  margin: 8px 0 0;
}

.bp-empty {
  padding: 88px 0;
  text-align: center;
  color: var(--bp-muted);
  font-size: 17px;
}

/* --------------------------- пагинация --------------------------- */

.bp-pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 56px;
}
.bp-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--bp-border);
  border-radius: 10px;
  color: var(--bp-ink);
  text-decoration: none;
  font-size: 15px;
}
.bp-page:hover { border-color: var(--bp-ink); }
.bp-page-active {
  background: var(--bp-ink);
  border-color: var(--bp-ink);
  color: #fff;
  font-weight: 600;
}

/* --------------------------- CTA-полоса --------------------------- */

.bp-cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding: clamp(28px, 4vw, 44px);
  border-radius: 16px;
  background: var(--bp-cta-band);
}
.bp-cta-title {
  color: #fff;
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.bp-cta-text {
  color: rgba(255, 255, 255, 0.68);
  font-size: 16px;
  margin: 8px 0 0;
}
.bp-cta-band-btn {
  display: inline-flex;
  align-items: center;
  padding: 15px 30px;
  border-radius: 9999px;
  background: #fff;
  color: var(--bp-cta-band);
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  transition: opacity 0.2s;
}
.bp-cta-band-btn:hover { opacity: 0.85; }

/* --------------------------- статья --------------------------- */

.bp-preview-banner {
  padding: 10px 16px;
  background: #b25e00;
  color: #fff;
  text-align: center;
  font-size: 14px;
}

.bp-article { padding-top: 24px; }
.bp-article > * {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.bp-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-top: 16px;
}
.bp-breadcrumbs a { color: var(--bp-muted); text-decoration: none; }
.bp-breadcrumbs a:hover { color: var(--bp-accent); }
.bp-breadcrumbs span[aria-hidden] { color: var(--bp-muted); }
.bp-breadcrumbs-current {
  color: var(--bp-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 40ch;
}

.bp-article-head { margin-top: 20px; }
.bp-article-title {
  font-size: clamp(30px, 5vw, 46px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0 0 16px;
}
.bp-article-head .bp-card-meta { margin-top: 4px; }

.bp-article-cover {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 28px;
  margin: 28px 0 8px;
}

/* текст статьи (вывод markdown) */
.bp-prose {
  font-size: 17px;
  line-height: 1.7;
  color: var(--bp-text);
  margin-top: 24px;
}
.bp-prose h2 {
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 44px 0 16px;
}
.bp-prose h3 {
  font-size: 21px;
  font-weight: 700;
  margin: 36px 0 12px;
}
.bp-prose h4 { font-size: 18px; font-weight: 700; margin: 28px 0 10px; }
.bp-prose p { margin: 0 0 18px; }
.bp-prose a { color: var(--bp-accent); }
.bp-prose a:hover { color: var(--bp-accent-dark); }
.bp-prose ul,
.bp-prose ol { padding-left: 26px; margin: 0 0 18px; }
/* tailwind-preflight выключает маркеры — возвращаем */
.bp-prose ul { list-style: disc; }
.bp-prose ol { list-style: decimal; }
.bp-prose li { margin: 7px 0; }
.bp-prose li::marker { color: var(--bp-accent); }
.bp-prose blockquote {
  margin: 26px 0;
  padding: 10px 22px;
  border-left: 3px solid var(--bp-accent);
  border-radius: 0 14px 14px 0;
  background: #f7f7ff;
  color: #3d3d3d;
}
.bp-prose blockquote p:last-child { margin-bottom: 0; }
.bp-prose code {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--bp-surface);
  border-radius: 6px;
  padding: 2px 7px;
}
.bp-prose pre {
  background: var(--bp-ink);
  color: #ededed;
  border-radius: 16px;
  padding: 20px 22px;
  overflow-x: auto;
  margin: 26px 0;
  line-height: 1.6;
}
.bp-prose pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: 14.5px;
}
.bp-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 20px;
}
.bp-prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 26px 0;
  font-size: 15.5px;
}
.bp-prose th,
.bp-prose td {
  border: 1px solid var(--bp-border);
  padding: 10px 14px;
  text-align: left;
}
.bp-prose th { background: #f7f7f7; font-weight: 700; }
.bp-prose hr {
  border: 0;
  height: 1px;
  background: var(--bp-border);
  margin: 40px 0;
}

/* --------------------------- футер --------------------------- */

.bp-footer {
  background: var(--bp-footer-bg);
  margin-top: 96px;
  padding: 64px 0 32px;
}
.bp-footer-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(200px, 1.2fr) auto;
  gap: 32px;
  align-items: start;
}
.bp-footer-nav a {
  display: block;
  color: var(--bp-ink);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  margin: 9px 0;
}
.bp-footer-nav a:hover { color: var(--bp-accent); }
.bp-footer-contacts a {
  display: block;
  color: var(--bp-ink);
  text-decoration: none;
  font-size: clamp(19px, 2vw, 25px);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 10px 0;
}
.bp-footer-contacts a:hover { color: var(--bp-accent); }
.bp-footer-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 9999px;
  background: var(--bp-accent);
  color: #fff;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  transition: background 0.2s;
}
.bp-footer-pill:hover { background: #1a26d8; }
.bp-footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  border-top: 1px solid #e0e0e0;
  margin-top: 48px;
  padding-top: 24px;
  font-size: 12px;
  color: var(--bp-muted);
}
.bp-footer-legal a { color: var(--bp-muted); }
.bp-footer-legal a:hover { color: var(--bp-ink); }

@media (max-width: 760px) {
  .bp-footer-grid { grid-template-columns: 1fr; }
  .bp-footer { margin-top: 64px; padding: 48px 0 24px; }
  .bp-hero { padding-top: 48px; }
  .bp-section { margin-top: 48px; }
}
