/*
 * BK Agency — Blog Stylesheet
 * Версия: 1.0 - Журнальный стиль записей блога
 * Описание: Стили одиночных записей блога (single): обёртки шаблона,
 *           оглавление (TOC), журнальный поток текста, карточки цен,
 *           CTA-блок, панель «Цены и тренды», навигация по записям, адаптив.
 * Зависимость: требует main.css — использует переменные из :root
 *              (--gold, --dark, --dark-secondary, --dark-tertiary,
 *              --light, --text-muted, --transition).
 * Подключение: только на записях блога (is_singular('post')) — см. functions.php
 *              или MU-плагин. На остальных страницах файл не грузится.
 */

/* ========== Блог: журнальный стиль записей (single) ========== */

/* --- Обёртки (перенесены из инлайн-стилей single.php) --- */
.blog-wrap {
    max-width: 1150px;
    margin: 0 auto;
}

.blog-section {
    padding: 30px 0 0;
}

.blog-content-wrap {
    max-width: 1150px;
    margin: 0 auto;
    background: var(--dark-secondary);
    padding: 60px 40px;
}

/* Заголовок поста в hero (скоуп на single, чтобы не задеть главную) */
body.single .hero-title {
    font-size: clamp(32px, 6vw, 56px);
    margin-bottom: 20px;
}

body.single .hero-subtitle span {
    color: var(--light);
    font-style: normal;
}

.post-category {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    color: var(--text-muted);
}

/* ========== Оглавление статьи (блог) ========== */
.bk-toc {
    background: var(--dark-secondary);
    border: 1px solid rgba(201, 169, 110, 0.15);
    border-radius: 8px;
    padding: 24px 28px;
    margin: 30px 0 40px;
    max-width: 100%;
}

.bk-toc-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 600;
    color: var(--gold);
    margin: 0 0 14px;
    text-indent: 0;                 /* отменяем красную строку журнального стиля */
}

.bk-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bk-toc li {
    margin: 0;
    padding: 5px 0 5px 18px;
    position: relative;
}

.bk-toc li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15px;
    width: 5px;
    height: 5px;
    background: var(--gold);
    transform: rotate(45deg);
}

.bk-toc a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 15px;
    line-height: 1.5;
    border-bottom: none;
    transition: color 0.3s;
}

.bk-toc a:hover {
    color: var(--gold);
}

/* Текущая секция подсвечена */
.bk-toc a.active {
    color: var(--gold);
}

@media (max-width: 767px) {
    .bk-toc {
        padding: 20px;
    }
}

/* --- Журнальный поток текста --- */
.post-content,
.entry-content {
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    line-height: 1.9;
    color: var(--light);
}

.post-content p,
.entry-content p {
    text-indent: 2em;          /* красная строка */
    margin-bottom: 0.5em;      /* плотный журнальный поток */
    text-align: justify;       /* ровный правый край */
}

/* Заголовки — фирменная типографика Cormorant */
.post-content h2,
.entry-content h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 36px;
    font-weight: 600;
    color: var(--light);
    line-height: 1.2;
    margin: 60px 0 25px;
}

.post-content h3,
.entry-content h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    font-weight: 600;
    color: var(--gold);
    line-height: 1.3;
    margin: 40px 0 16px;
}

/* Ссылки — золотые с мягким подчёркиванием */
.post-content a,
.entry-content a {
    color: var(--gold);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid rgba(201, 169, 110, 0.3);
    transition: color 0.3s, border-color 0.3s;
}

.post-content a:hover,
.entry-content a:hover {
    color: var(--gold-light);
    border-color: var(--gold-light);
}

/* Маркированные списки — золотые ромбы */
.post-content ul,
.entry-content ul {
    list-style: none;
    margin: 0 0 25px;
    padding: 0;
}

.post-content ul li,
.entry-content ul li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 12px;
    color: var(--text-muted);
}

.post-content ul li::before,
.entry-content ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 6px;
    height: 6px;
    background: var(--gold);
    transform: rotate(45deg);
}

/* Нумерованные списки — золотые номера 01–05 (по образцу .page-content ol) */
.post-content ol,
.entry-content ol {
    list-style: none;
    counter-reset: step;
    margin: 0 0 25px;
}

.post-content ol li,
.entry-content ol li {
    counter-increment: step;
    position: relative;
    padding-left: 48px;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.post-content ol li::before,
.entry-content ol li::before {
    content: counter(step, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0;
    font-family: 'Cormorant Garamond', serif;
    font-size: 28px;
    font-weight: 600;
    color: var(--gold);
    line-height: 1.2;
}

/* Сильные акценты в списках — светлые (в журнальном потоке не пёстрят) */
.post-content ol strong,
.entry-content ol strong {
    color: var(--light);
}

/* Изображения */
.post-content img,
.entry-content img {
    max-width: 100%;
    height: auto;
}

.post-content figure,
.entry-content figure {
    margin: 30px 0;
}

.post-content figcaption,
.entry-content figcaption {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 10px;
}

/* Цитаты */
.post-content blockquote,
.entry-content blockquote {
    margin: 30px 0;
    padding: 20px 30px;
    border-left: 2px solid var(--gold);
    background: var(--dark);
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-style: italic;
    color: var(--light);
}

/* Таблицы (если вставляются без .bk-compare) */
.post-content table,
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 25px;
    background: var(--dark-secondary);
}

.post-content th,
.post-content td,
.entry-content th,
.entry-content td {
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 14px 16px;
    text-align: left;
    color: var(--light);
}

.post-content th,
.entry-content th {
    background: var(--dark-tertiary);
    color: var(--gold);
    font-weight: 700;
}

/* --- Elementor-записи блога (виджет text-editor) --- */
.elementor-widget-text-editor h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 36px;
    font-weight: 600;
    color: var(--light);
    line-height: 1.2;
    margin: 60px 0 25px;
}

.elementor-widget-text-editor h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    font-weight: 600;
    color: var(--gold);
    line-height: 1.3;
    margin: 40px 0 16px;
}

/* ========== Карточки с ценой (блог) ========== */
.feature-item .budget-price {
    font-family: 'Cormorant Garamond', serif;
    font-size: 32px;
    font-weight: 600;
    color: var(--gold);
    line-height: 1.1;
    margin: 0 0 12px;
}

.feature-item .budget-hint {
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 16px;
}
/* Карточки бюджетов: отменяем красную строку и justify из журнального потока */
.feature-item p,
.feature-item .budget-hint {
    text-indent: 0;
    text-align: left;
}


/* ========== CTA-блок (блог): «Рассчитаем бюджет» ========== */
.bk-cta {
    background: var(--dark-secondary);
    border: 1px solid rgba(201, 169, 110, 0.15);
    border-radius: 8px;
    padding: 50px 40px;
    max-width: 1150px;
    margin: 48px auto 24px;   /* сверху 48, снизу 24 — низ плотный */
    text-align: center;
}

.bk-cta h2,
.bk-cta h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 36px;
    font-weight: 600;
    color: var(--light);
    margin: 0 0 16px;
    text-align: center;
}

.bk-cta p {
    color: var(--text-muted);
    font-size: 16px;
    line-height: 1.7;
    margin: 0 auto 30px;
    max-width: 700px;
    text-align: center;
}

/* Кнопка: явно переопределяем цвет текста, чтобы .post-content a не перебивал */
.bk-cta .btn-primary,
.bk-cta a.btn-primary {
    display: inline-block;
    text-decoration: none;
    background: var(--gold);
    color: var(--dark);
}

.bk-cta .btn-primary:hover,
.bk-cta a.btn-primary:hover {
    background: var(--gold-light);
    color: var(--dark);
}

/* ========== CTA-кнопка на мобильных: не вылезает за край ========== */
@media (max-width: 767px) {
    .bk-cta .btn-primary,
    .bk-cta a.btn-primary {
        display: block;
        width: fit-content;
        max-width: 100%;
        margin: 0 auto;
        white-space: normal;
        box-sizing: border-box;
    }
}

/* ========== Блог: панель «Цены и тренды» (блок с цифрами) ========== */
.bk-panel {
    background: var(--dark-secondary);
    border: 1px solid rgba(201, 169, 110, 0.15);
    border-radius: 8px;
    padding: 40px 32px;
    margin: 40px 0;
}

/* Заголовок панели — перекрывает .post-content h2 */
.bk-panel h2 {
    font-size: clamp(26px, 3.5vw, 36px);
    line-height: 1.25;
    margin: 0 0 16px;
}

/* Подзаголовки-метки (Manrope, капс) — перекрывают .post-content h3 */
.bk-panel h3 {
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--light);
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Ведущий абзац панели */
.bk-panel-lead {
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    line-height: 1.8;
    color: rgba(245, 240, 235, 0.8);
    margin: 0 0 28px;
}

/* Списки панели */
.bk-panel-list {
    list-style: none;
    padding: 0;
    margin: 0 0 28px;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: rgba(245, 240, 235, 0.85);
}

.bk-panel-list li {
    padding: 6px 0 6px 22px;
    margin: 0;
    position: relative;
    color: rgba(245, 240, 235, 0.85);
}

/* Золотой ромб-маркер (как в .post-content ul) */
.bk-panel-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 14px;
    width: 6px;
    height: 6px;
    background: var(--gold);
    transform: rotate(45deg);
}

/* Обёртка таблицы — скролл на узких экранах */
.bk-panel-table-wrap {
    overflow-x: auto;
    margin-bottom: 28px;
}

/* Таблица панели — перекрывает .post-content table */
.bk-panel table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    color: rgba(245, 240, 235, 0.85);
    background: transparent;
}

.bk-panel th,
.bk-panel td {
    border: none;
    padding: 10px 14px;
    text-align: left;
    color: rgba(245, 240, 235, 0.85);
}

.bk-panel td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.bk-panel th {
    color: var(--gold);
    font-weight: 600;
    border-bottom: 1px solid rgba(201, 169, 110, 0.3);
    background: transparent;
}

/* Шапка таблицы — тёмная полоса */
.bk-panel .bk-panel-head {
    background: var(--dark);
}

/* Последняя строка без разделителя (как в оригинале) */
.bk-panel table tr:last-child td {
    border-bottom: none;
}

@media (max-width: 767px) {
    .bk-panel {
        padding: 30px 20px;
    }
}

/* --- Навигация по записям (prev / все статьи / next) --- */
.post-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    min-height: 40px;
}

.post-nav-prev {
    flex: 1;
    text-align: left;
}

.post-nav-next {
    flex: 1;
    text-align: right;
}

.post-nav-center {
    flex: 0 0 auto;
    text-align: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.post-nav a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.post-nav a:hover {
    color: var(--gold);
}

.post-nav a.post-nav-all {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gold);
    white-space: nowrap;
}

.post-nav a.post-nav-all:hover {
    color: var(--gold-light);
}

@media (max-width: 767px) {
    .post-nav {
        flex-direction: column;
        gap: 15px;
    }

    .post-nav-center {
        position: static;
        transform: none;
        order: -1;
    }
}

/* --- Адаптив блога --- */
@media (max-width: 767px) {
    .blog-content-wrap {
        padding: 30px 20px;
    }

    .post-content h2,
    .entry-content h2 {
        font-size: 28px;
        margin: 40px 0 18px;
    }

    .post-content h3,
    .entry-content h3 {
        font-size: 22px;
    }
}
