/* ============================================================
   blog.css — стили блога venchakov.com (агент A7).
   Подключается ПОСЛЕ style.css на blog.html и blog/*.html.
   Использует токены style.css (:root), в т.ч. журнальные из ТЗ:
   --font-display, --accent-2, --accent-2-dim, --ink,
   --shadow-soft, --shadow-lift — их добавляет A8.
   Блоки: 1) индекс блога (blog.html)  2) общая мета статей
          3) страница статьи (blog/*.html)  4) адаптив ≤768px.
   ============================================================ */

/* ---------- 1. Индекс блога (blog.html) ---------- */

.blog-index {
    padding: 140px 0 96px;
}

/* h1 хиро-секции — серифный «журнальный», как заголовки статей */
.blog-index-header h1 {
    font-family: var(--font-display);
    font-size: clamp(38px, 6vw, 64px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 16px 0 0;
}

.blog-index-subtitle {
    max-width: 640px;
    margin: 18px auto 0;
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Сетка карточек: колонки одной ширины, карточки естественной
   (разной) высоты — выравнивание по верху ряда */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    align-items: start;
}

.blog-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
}

/* Каждая третья карточка — на альтернативном фоне, для «журнальной» рваности */
.blog-card:nth-child(3n) {
    background: var(--bg-card-alt);
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lift);
    border-color: var(--border-hover);
}

.blog-card-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin: 14px 0 10px;
}

.blog-card-title a {
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
}

.blog-card-title a:hover {
    color: var(--accent-2);
}

.blog-card-desc {
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-secondary);
    margin: 0;
}

/* ---------- 2. Мета статьи (общая для индекса и страниц статей) ---------- */

.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.post-meta-sep {
    color: var(--text-muted);
}

.post-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    background: var(--accent-2-dim);
    color: var(--accent-2);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ---------- 3. Страница статьи (blog/*.html) ---------- */

.blog-post {
    padding: 140px 0 96px;
}

/* Узкая читабельная колонка внутри общего .container */
.blog-post-container {
    max-width: 760px;
}

.post-breadcrumbs {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.post-breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}

.post-breadcrumbs a:hover {
    color: var(--accent-2);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-header .post-meta {
    margin-bottom: 20px;
}

.post-header h1 {
    font-family: var(--font-display);
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text);
    margin: 0 0 20px;
}

.post-lead {
    font-size: 19px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0 0 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

/* Тело статьи: 17–18px / 1.8 по ТЗ */
.post-body {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text);
}

.post-body h2 {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 48px 0 16px;
}

.post-body h3 {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
    margin: 32px 0 12px;
}

.post-body p {
    margin: 0 0 20px;
}

.post-body ul,
.post-body ol {
    margin: 0 0 20px;
    padding-left: 28px;
}

.post-body li {
    margin-bottom: 10px;
}

/* Ссылки в тексте: тонкое подчёркивание вторым акцентом */
.post-body a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--accent-2);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: var(--transition);
}

.post-body a:hover {
    color: var(--accent-2);
}

/* Цитата: серифный курсив с чернильно-терракотовой линией слева */
.post-body blockquote {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 20px;
    line-height: 1.6;
    color: var(--text);
    border-left: 3px solid var(--accent-2);
    padding: 8px 0 8px 24px;
    margin: 32px 0;
}

/* CTA-карточка в конце статьи */
.post-cta {
    background: var(--bg-card-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    margin: 56px 0 32px;
    box-shadow: var(--shadow-soft);
}

.post-cta h2 {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
    margin: 0 0 12px;
}

.post-cta p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0 0 24px;
}

.post-cta .btn {
    margin: 0 12px 12px 0;
}

/* Подпись автора */
.post-author {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.post-author a {
    color: var(--text);
    text-decoration: underline;
    text-decoration-color: var(--accent-2);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.post-author a:hover {
    color: var(--accent-2);
}

/* ---------- 4. Адаптив ---------- */

@media (max-width: 768px) {
    .blog-index,
    .blog-post {
        padding: 120px 0 64px;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .blog-card {
        padding: 22px;
    }

    .post-body {
        font-size: 17px;
    }

    .post-body h2 {
        font-size: 26px;
    }

    .post-cta {
        padding: 28px 22px;
    }

    .post-cta .btn {
        width: 100%;
        justify-content: center;
        margin: 0 0 12px;
    }
}
