/* ============================================================
   БЛОГ — типографика, раскладка, «премиальный» вид
   Использует дизайн-токены из styles.css (--ink, --clay, --gold и т.д.).
   Не переопределяет глобальные стили сайта — только классы блога.
   ============================================================ */

/* Фон всей страницы блога — тёплый stone, на нём «плавают» белые панели */
body.blog-page { background: var(--stone); }

/* ---------- Хлебные крошки ---------- */
.crumbs { font-size: 0.85rem; color: var(--ink-soft); margin: 0 0 16px; }
.crumbs a { color: var(--clay-dark); font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span { color: var(--ink-soft); opacity: 0.55; margin: 0 6px; }

/* ============================================================
   ИНДЕКС БЛОГА
   ============================================================ */
/* Шапка блога: фото интерьера + тёплый тёмный fade (как hero на главной) */
.blog-head {
    position: relative;
    padding: 88px 0 48px;
    background:
        linear-gradient(100deg, rgba(18,15,10,0.82) 0%, rgba(18,15,10,0.48) 40%, rgba(18,15,10,0.18) 72%, rgba(18,15,10,0.04) 100%),
        url("/assets/img/blog/blog-cover.jpg") center center / cover no-repeat;
    border-bottom: 1px solid var(--line);
}
.blog-head .crumbs { color: rgba(255,255,255,0.82); }
.blog-head .crumbs a { color: #fff; }
.blog-head .crumbs span { color: rgba(255,255,255,0.55); }
.blog-head .eyebrow { color: var(--gold); }
.blog-head h1 { font-size: clamp(1.9rem, 3.6vw, 2.7rem); line-height: 1.1; letter-spacing: -0.01em; color: #fff; margin: 8px 0 0; text-shadow: 0 2px 14px rgba(0,0,0,0.55); }
.blog-head p { color: rgba(255,255,255,0.92); line-height: 1.6; max-width: 620px; margin: 14px 0 0; text-shadow: 0 1px 10px rgba(0,0,0,0.45); }
.blog-head .eyebrow { text-shadow: 0 1px 8px rgba(0,0,0,0.4); }

.blog-list { padding: 40px 0 24px; }
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }

.blog-card { position: relative; display: flex; flex-direction: column; background: var(--white); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-soft); transition: transform var(--transition), box-shadow var(--transition); }
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

/* Вся карточка кликабельна: ссылка-заголовок растягивается на всю карточку.
   Доступно (реальная ссылка, фокус с клавиатуры), без вложенных ссылок. */
.blog-card-link { color: inherit; }
.blog-card-link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.blog-card-link:focus-visible { outline: none; }
.blog-card:has(.blog-card-link:focus-visible) { outline: 2px solid var(--clay); outline-offset: 3px; }

/* Заглушка превью: нейтральный фон + плиточный паттерн + лого-знак.
   Читается как «фото будет», а не как «сломано». Позже заменить на <img>. */
.blog-card-thumb { position: relative; aspect-ratio: 16 / 9; background: var(--stone-2); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.blog-card-thumb::before {
    content: ''; position: absolute; inset: 0; opacity: 0.5;
    background:
        repeating-linear-gradient(0deg, transparent 0 31px, rgba(40,33,22,0.06) 31px 32px),
        repeating-linear-gradient(90deg, transparent 0 31px, rgba(40,33,22,0.06) 31px 32px);
}
.blog-card-thumb::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--gold); }
.blog-card-thumb span { position: relative; font-weight: 800; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(40, 33, 22, 0.34); }
.blog-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-card-thumb:has(img)::before, .blog-card-thumb:has(img)::after { display: none; }

.blog-card-body { display: flex; flex-direction: column; flex: 1; padding: 20px; }
.blog-card-cat { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--clay); margin: 0 0 8px; }
.blog-card h2 { font-size: 1.12rem; line-height: 1.3; color: var(--ink); margin: 0 0 10px; }
.blog-card h2 a { color: inherit; }
.blog-card:hover h2 a { color: var(--clay-dark); }
.blog-card p { font-size: 0.92rem; line-height: 1.55; color: var(--ink-soft); margin: 0 0 16px; }
.blog-card-more { margin-top: auto; font-weight: 700; font-size: 0.9rem; color: var(--clay-dark); }

/* CTA-полоса на индексе блога */
.blog-cta { margin: 28px 0 8px; padding: 30px; border-radius: 14px; background: linear-gradient(135deg, #2a2117, #6d3a26); color: #fff; text-align: center; }
.blog-cta h2 { color: #fff; font-size: clamp(1.3rem, 2.6vw, 1.7rem); margin: 0 0 8px; }
.blog-cta p { color: rgba(255,255,255,0.82); line-height: 1.6; margin: 0 auto 18px; max-width: 520px; }
.blog-cta .btn-primary { background: var(--gold); color: var(--ink); }
.blog-cta .btn-primary:hover { background: #e3c596; }
.blog-cta-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ============================================================
   СТРАНИЦА СТАТЬИ — узкая колонка на белой «плавающей» панели
   ============================================================ */
.article-main { padding: 32px 0 56px; }
.article-panel {
    max-width: 800px; margin: 0 auto;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: 40px clamp(20px, 4vw, 52px) 44px;
}

.article-eyebrow { color: var(--clay); }
.article-panel h1 { font-size: clamp(1.85rem, 3.6vw, 2.5rem); line-height: 1.12; letter-spacing: -0.01em; color: var(--ink); margin: 8px 0 0; }

/* Подпись автора — одна скромная строка */
.article-byline { margin: 16px 0 0; font-size: 0.9rem; font-weight: 600; color: var(--ink-soft); }

.article-lead { font-size: 1.12rem; line-height: 1.6; color: var(--ink-soft); margin: 22px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line); }

.article-body { margin-top: 8px; }
.article-body h2 { font-size: clamp(1.35rem, 2.8vw, 1.85rem); line-height: 1.2; color: var(--ink); margin: 32px 0 12px; }
.article-body h3 { font-size: 1.12rem; color: var(--ink); margin: 24px 0 8px; }
.article-body p { color: var(--ink-soft); line-height: 1.75; margin: 0 0 15px; }
.article-body strong { color: var(--ink); font-weight: 700; }

/* P0-фикс: стиль ссылок — ТОЛЬКО в прозе (не трогаем .btn внутри CTA) */
.article-body :where(p, li) a { color: var(--clay-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.article-body :where(p, li) a:hover { color: var(--clay); }

.article-body ul { margin: 0 0 16px; padding: 0; list-style: none; }
.article-body ul li { position: relative; padding: 5px 0 5px 22px; color: var(--ink-soft); line-height: 1.6; }
.article-body ul li::before { content: ''; position: absolute; left: 0; top: 13px; width: 8px; height: 8px; border-radius: 2px; background: var(--clay); }

/* P0-фикс: нумерованный список на grid — цифра всегда на уровне первой строки */
.article-body ol { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: li; }
.article-body ol li { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 12px; padding: 6px 0; color: var(--ink-soft); line-height: 1.6; counter-increment: li; }
.article-body ol li::before { content: counter(li); grid-column: 1; margin-top: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--stone-2); color: var(--clay-dark); font-size: 0.8rem; font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* ---------- Изображение в статье ---------- */
.article-figure { margin: 24px auto; max-width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--white); box-shadow: var(--shadow-soft); }
.article-figure.is-portrait { max-width: 440px; }
.article-figure.is-compact { max-width: 500px; }
.article-figure picture { display: block; }
.article-figure img { width: 100%; height: auto; display: block; }
.article-figure figcaption { padding: 10px 14px; font-size: 0.85rem; color: var(--ink-soft); }
/* Обтекание текстом: небольшие фото сбоку (десктоп) */
.article-figure.is-float-right, .article-figure.is-float-left { width: clamp(220px, 36%, 300px); margin-block: 4px 16px; }
.article-figure.is-float-right { float: right; margin-left: 26px; }
.article-figure.is-float-left { float: left; margin-right: 26px; }
.article-figure.is-wide { max-width: 560px; clear: both; }
/* блоки, которые не должны обтекать плавающее фото */
.article-body .article-cta, .article-body .article-related-block, .article-body .article-inline-cta, .article-body .article-back, .article-figure.is-wide { clear: both; }
@media (max-width: 620px) {
    .article-figure.is-float-right, .article-figure.is-float-left { float: none; width: auto; max-width: 100%; margin: 20px auto; }
}

/* ---------- FAQ ---------- */
.article-faq { margin: 8px 0 4px; }
.article-faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.article-faq summary { font-weight: 800; cursor: pointer; color: var(--ink); list-style: none; line-height: 1.4; }
.article-faq summary::-webkit-details-marker { display: none; }
.article-faq summary::before { content: '+ '; color: var(--clay); font-weight: 900; }
.article-faq details[open] summary::before { content: '– '; }
.article-faq p { margin: 10px 0 0; color: var(--ink-soft); line-height: 1.65; }

/* ---------- CTA-блок внутри статьи ---------- */
.article-cta { margin: 30px 0 8px; padding: 26px; border-radius: 12px; background: linear-gradient(135deg, #2a2117, #6d3a26); color: #fff; }
.article-cta h2 { color: #fff; font-size: 1.3rem; margin: 0 0 8px; }
.article-cta p { color: rgba(255, 255, 255, 0.86); line-height: 1.6; margin: 0 0 18px; }
.article-cta .btn { text-decoration: none; font-weight: 900; }        /* P0-фикс: кнопки не подчёркнуты */
.article-cta .btn-primary { background: var(--gold); color: var(--ink); }
.article-cta .btn-primary:hover { background: #e3c596; }
.article-cta-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.article-cta .article-related { margin: 18px 0 0; font-size: 0.95rem; color: rgba(255,255,255,0.86); }
.article-cta .article-related a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

/* Промежуточный (inline) CTA в длинных статьях */
.article-inline-cta { margin: 26px 0; padding: 16px 20px; border-left: 3px solid var(--gold); background: var(--stone); border-radius: 0 10px 10px 0; font-size: 0.98rem; color: var(--ink-soft); }
.article-inline-cta a { color: var(--clay-dark); font-weight: 700; }

/* ---------- Похожие статьи ---------- */
.article-related-block { margin: 36px 0 0; padding: 26px 0 0; border-top: 1px solid var(--line); }
.article-related-block h2 { font-size: 1.2rem; color: var(--ink); margin: 0 0 16px; }
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.related-card { position: relative; display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--white); transition: transform var(--transition), box-shadow var(--transition); }
.related-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.related-card .related-cat { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--clay); }
.related-card .related-title { display: block; margin-top: 6px; font-weight: 700; color: var(--ink); line-height: 1.35; }
.related-card:hover .related-title { color: var(--clay-dark); }

.article-back { display: inline-block; margin: 28px 0 0; font-weight: 700; color: var(--clay-dark); }

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 900px) {
    .blog-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
    .blog-grid { grid-template-columns: 1fr; }
    .blog-head { padding: 40px 0 22px; }
    .blog-card-thumb { aspect-ratio: 3 / 1; }        /* заглушка не занимает целый экран на мобильном */
    .related-grid { grid-template-columns: 1fr; }
    .article-main { padding: 20px 0 44px; }
    .article-panel { border-radius: 12px; padding: 28px 20px 32px; }
    .article-cta { padding: 22px; }
}
