/* ============================================================
   PM Quest — блог. Стили раздела /blog/
   Базовые токены, шапка, футер, кнопки — в ../styles.css
   ============================================================ */

/* ---------- Заголовки раздела ---------- */
.blog-hero {
  position: relative; overflow: hidden;
  padding: 64px 0 40px;
  background: linear-gradient(180deg, #f4f1ff 0%, #e6faf3 55%, var(--bg) 100%);
  text-align: center;
}
.blog-hero h1 { font-size: clamp(30px, 4.4vw, 44px); font-weight: 900; line-height: 1.15; }
.blog-hero .blog-sub {
  max-width: 640px; margin: 14px auto 0;
  color: var(--muted); font-size: 17.5px;
}
.blog-hero-blob {
  position: absolute; border-radius: 50%; filter: blur(60px);
  opacity: 0.55; pointer-events: none;
}
.blog-hero-blob-1 { width: 380px; height: 380px; background: #dcd2ff; top: -140px; left: -120px; }
.blog-hero-blob-2 { width: 320px; height: 320px; background: #c7f3e7; top: 20px; right: -100px; }

/* ---------- Лента: сетка карточек ---------- */
.blog-feed { padding: 48px 0 80px; }
.blog-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px;
}

/* ---------- Карточка статьи ---------- */
.post-card {
  display: flex; flex-direction: column;
  background: var(--card); border: 2px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.post-card:hover {
  transform: translateY(-4px);
  border-color: #d5c9ff;
  box-shadow: var(--shadow);
}
.post-card-cover {
  aspect-ratio: 16 / 9; width: 100%;
  /* min-height: 0 — флекс-элемент в .post-card: без этого карточка растёт
     по высоте контента (фото) вместо кадра 16:9; overflow прячет обрезку */
  min-height: 0; overflow: hidden;
  background: #eef0f6;
}
.post-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-card-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.post-card-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  margin-bottom: 10px;
}
.post-card-tag {
  background: #f1ecff; color: var(--primary-d);
  border-radius: 999px; padding: 3px 12px;
}
.post-card-title {
  font-size: 19px; font-weight: 900; line-height: 1.3;
  margin-bottom: 8px;
}
/* Короткое описание: максимум 3 строки, дальше обрезается */
.post-card-excerpt {
  color: var(--muted); font-size: 15px; line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-more {
  margin-top: auto; padding-top: 16px;
  font-weight: 800; font-size: 15px; color: var(--primary);
}
.post-card:hover .post-card-more { text-decoration: underline; }

/* ---------- Страница статьи ---------- */
.post-page { padding: 44px 0 72px; }
.post-back {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 15px; color: var(--muted);
  text-decoration: none; margin-bottom: 26px;
  transition: color 0.15s;
}
.post-back:hover { color: var(--primary); }

.post-head { max-width: 820px; margin: 0 auto; text-align: center; }
.post-head .post-card-meta { justify-content: center; margin-bottom: 14px; }
.post-head h1 {
  font-size: clamp(28px, 4vw, 40px); font-weight: 900; line-height: 1.2;
}
.post-lead {
  margin-top: 16px; font-size: 18px; color: var(--muted); line-height: 1.6;
}

.post-cover {
  max-width: 920px; margin: 34px auto 0;
  border-radius: 24px; overflow: hidden;
  border: 2px solid var(--line); box-shadow: var(--shadow);
}
.post-cover img { width: 100%; height: auto; }
/* Фото статьи: фиксированный кадр 16:9 (как у карточки в ленте) — размеры и
   пропорции не «гуляют»; видимая область задаётся object-position из админки */
.post-cover-photo { aspect-ratio: 16 / 9; }
.post-cover-photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Текст статьи (типографика) ---------- */
.post-body {
  max-width: 760px; margin: 40px auto 0;
  font-size: 17px; line-height: 1.75;
}
.post-body h2 {
  font-size: 26px; font-weight: 900; line-height: 1.3;
  margin: 44px 0 14px;
}
.post-body h3 {
  font-size: 20px; font-weight: 800; line-height: 1.35;
  margin: 32px 0 10px;
}
.post-body p { margin: 0 0 16px; }
.post-body ul, .post-body ol { margin: 0 0 18px; padding-left: 26px; }
.post-body li { margin-bottom: 8px; }
.post-body li::marker { color: var(--primary); font-weight: 800; }
.post-body strong { font-weight: 800; }
.post-body em { font-style: italic; }
.post-body u { text-decoration-color: #b9a6ff; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.post-body s { color: var(--muted); }
.post-body a { color: var(--primary); font-weight: 700; }

/* Врезка-акцент внутри статьи */
.post-callout {
  background: #f1ecff; border-left: 4px solid var(--primary);
  border-radius: 14px; padding: 18px 22px;
  margin: 24px 0; font-size: 16px;
}
.post-callout p:last-child { margin-bottom: 0; }

/* Навигация между статьями */
.post-prevnext {
  max-width: 760px; margin: 40px auto 0;
  display: flex; justify-content: space-between; gap: 16px;
}
.post-prevnext a {
  font-weight: 800; font-size: 15px; color: var(--primary);
  text-decoration: none;
}
.post-prevnext a:hover { text-decoration: underline; }
.post-prevnext .spacer { flex: 1; }

/* ---------- Адаптив ---------- */
@media (max-width: 1020px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .blog-hero { padding: 44px 0 30px; }
  .blog-feed { padding: 36px 0 60px; }
  .blog-grid { grid-template-columns: 1fr; gap: 20px; }
  .post-page { padding: 30px 0 56px; }
  .post-body { font-size: 16px; margin-top: 30px; }
  .post-body h2 { font-size: 22px; margin-top: 34px; }
  .post-prevnext { flex-direction: column; }
}
