/* ============================================================
   BLOG DETAIL — страница статьи STILS
   Переменные темы (--text, --text-muted, --bg, --bg-card,
   --border, --border-hover, --text-dim, --green, --green-light)
   берутся из base.css.
   ============================================================ */

/* ---------- Прогресс чтения ---------- */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    z-index: 2000;
    background: var(--green, #5C9D7F);
    transition: width .1s linear;
    pointer-events: none;
}

/* ---------- Обёртка страницы ---------- */
.page-wrap {
    padding-top: 0;
}

/* ---------- HERO ---------- */
.article-hero {
    position: relative;
    width: 100%;
    height: clamp(380px, 70vh, 700px);
    overflow: hidden;
}

.article-hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-hero-placeholder {
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse 80% 60% at 30% 40%, rgba(92,157,127,.18) 0%, transparent 55%),
        radial-gradient(ellipse 55% 75% at 80% 75%, rgba(8,26,16,.7) 0%, transparent 50%),
        linear-gradient(155deg, #040d08 0%, #081a10 50%, #040d08 100%);
}

.article-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,.45) 0%,
        rgba(0,0,0,.1) 35%,
        transparent 55%,
        var(--bg, #0e0e0e) 100%
    );
    transition: background .35s ease;
    pointer-events: none;
}

/* ---------- HEADER статьи ---------- */
.article-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 40px 0;
    text-align: left;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted, rgba(240,239,233,.5));
    padding: 7px 14px 7px 10px;
    border: 1px solid var(--border, rgba(255,255,255,.07));
    border-radius: 999px;
    margin-bottom: 32px;
    transition: color .2s ease, border-color .2s ease, background .2s ease;
}

.back-link:hover {
    color: var(--text, #f0efe9);
    border-color: var(--border-hover, var(--green, #5C9D7F));
    background: rgba(92,157,127,.06);
}

.back-link-arrow {
    font-size: 15px;
    line-height: 1;
}

.article-eyebrow {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--green, #5C9D7F);
    margin-bottom: 16px;
}

.article-title {
    font-family: 'Manrope', sans-serif;
    font-size: clamp(28px, 4vw, 48px);
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -.025em;
    color: var(--text, #f0efe9);
    margin: 0 0 20px;
    transition: color .35s ease;
}

.article-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,.07));
    transition: border-color .35s ease;
}

.article-read-time {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--text-muted, rgba(240,239,233,.5));
    transition: color .35s ease;
}

/* ---------- LAYOUT: контент + оглавление ---------- */
.article-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px 120px;
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 64px;
    align-items: start;
}

/* ---------- TOC (боковое оглавление) ---------- */
.article-toc {
    position: sticky;
    top: 100px;
    padding-top: 40px;
    align-self: start;
}

.toc-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim, rgba(240,239,233,.25));
    margin-bottom: 16px;
    transition: color .35s ease;
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.toc-list li {
    margin-bottom: 2px;
}

.toc-link {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-dim, rgba(240,239,233,.25));
    padding: 6px 0 6px 12px;
    border-left: 1px solid var(--border, rgba(255,255,255,.07));
    text-decoration: none;
    transition: color .2s ease, border-color .2s ease;
}

.toc-link:hover {
    color: var(--text, #f0efe9);
    border-color: var(--green, #5C9D7F);
}

.toc-link.active {
    color: var(--green, #5C9D7F);
    border-color: var(--green, #5C9D7F);
}

/* ============================================================
   PROSE — типографика тела статьи (рендер из Markdown)
   ============================================================ */
.prose {
    min-width: 0;
    padding-top: 40px;
    font-family: 'Inter', sans-serif;
}

.prose .lead {
    font-size: 20px;
    line-height: 1.7;
    color: var(--text, #f0efe9);
    font-weight: 400;
    margin: 0 0 32px;
}

.prose p {
    font-size: 17px;
    line-height: 1.85;
    color: var(--text-muted, rgba(240,239,233,.5));
    margin: 0 0 24px;
    transition: color .35s ease;
}

.prose p:last-child {
    margin-bottom: 0;
}

.prose h2 {
    font-family: 'Manrope', sans-serif;
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -.015em;
    color: var(--text, #f0efe9);
    margin: 56px 0 20px;
    padding-top: 8px;
    scroll-margin-top: 100px;
    transition: color .35s ease;
}

.prose h3 {
    font-family: 'Manrope', sans-serif;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--text, #f0efe9);
    margin: 40px 0 16px;
    scroll-margin-top: 100px;
    transition: color .35s ease;
}

.prose > h2:first-child,
.prose > h3:first-child {
    margin-top: 0;
}

.prose a {
    color: var(--green, #5C9D7F);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color .2s ease;
}

.prose a:hover {
    color: var(--green-light, #7AB69A);
}

.prose strong {
    color: var(--text, #f0efe9);
    font-weight: 700;
}

.prose ul,
.prose ol {
    padding-left: 1.4em;
    margin: 0 0 24px;
    color: var(--text-muted, rgba(240,239,233,.5));
}

.prose li {
    margin-top: .5em;
    line-height: 1.75;
}

.prose li::marker {
    color: var(--green, #5C9D7F);
}

.prose blockquote {
    margin: 36px 0;
    padding: 4px 0 4px 24px;
    border-left: 2px solid var(--green, #5C9D7F);
}

.prose blockquote p {
    font-family: 'Manrope', sans-serif;
    font-size: 20px;
    line-height: 1.6;
    font-style: italic;
    font-weight: 500;
    color: var(--text, #f0efe9);
    margin: 0;
}

.prose img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 36px 0;
}

.prose figure {
    margin: 36px 0;
}

.prose figcaption {
    margin-top: 10px;
    font-size: 13px;
    text-align: center;
    color: var(--text-muted, rgba(240,239,233,.5));
}

.prose hr {
    border: none;
    height: 1px;
    background: var(--border, rgba(255,255,255,.07));
    margin: 48px 0;
}

/* ---------- Код ---------- */
.prose code {
    font-family: 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
    font-size: .88em;
    background: var(--bg-elevated, rgba(255,255,255,.06));
    padding: .15em .4em;
    border-radius: 5px;
    color: var(--text, #f0efe9);
}

.prose pre {
    background: #0c1210;
    border: 1px solid var(--border, rgba(255,255,255,.07));
    border-radius: 14px;
    padding: 22px 24px;
    overflow-x: auto;
    font-size: 15px;
    line-height: 1.6;
    margin: 36px 0;
}

.prose pre code {
    background: none;
    padding: 0;
    color: #e8e8ef;
    font-size: inherit;
}

/* ---------- Таблицы (обёрнуты в .table-wrap рендерером) ---------- */
.table-wrap {
    margin: 36px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.prose table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.prose th,
.prose td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border, rgba(255,255,255,.07));
    color: var(--text, #f0efe9);
}

.prose th {
    font-weight: 600;
    background: var(--bg-elevated, rgba(255,255,255,.04));
}

/* ============================================================
   CTA-блок внутри статьи
   ============================================================ */
.cta-try {
    position: relative;
    overflow: hidden;
    margin: 48px 0;
    padding: 36px 40px;
    border-radius: 16px;
    border: 1px solid rgba(92,157,127,.25);
    background: linear-gradient(135deg, rgba(92,157,127,.12) 0%, rgba(92,157,127,.05) 100%);
}

.cta-try::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 100%;
    background: radial-gradient(ellipse at right center, rgba(92,157,127,.1) 0%, transparent 70%);
    pointer-events: none;
}

.cta-try-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--green, #5C9D7F);
    margin-bottom: 10px;
}

.cta-try h3 {
    font-family: 'Manrope', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--text, #f0efe9);
    margin-bottom: 8px;
    transition: color .35s ease;
}

.cta-try p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted, rgba(240,239,233,.5));
    margin-bottom: 20px;
    transition: color .35s ease;
}

.cta-try .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--green, #5C9D7F);
    padding: 12px 24px;
    border-radius: 999px;
    text-decoration: none;
    transition: background .2s ease, transform .2s ease;
}

.cta-try .btn:hover {
    background: var(--green-light, #7AB69A);
    transform: translateY(-2px);
}

/* ============================================================
   CALLOUT-блоки (рендерятся как <div class="callout ...">)
   Разметка рендерера:
   <div class="callout callout-info">
     <i class="fas fa-..."></i>
     <div> <strong>Заголовок</strong> <p>...</p> </div>
   </div>
   ============================================================ */
.callout {
    display: flex;
    gap: 14px;
    margin: 36px 0;
    padding: 20px 24px;
    border-radius: 14px;
    border: 1px solid var(--border, rgba(255,255,255,.07));
    background: var(--bg-card, #161616);
    color: var(--text, #f0efe9);
}

.callout > i {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 18px;
    line-height: 1.4;
}

.callout > div {
    min-width: 0;
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-muted, rgba(240,239,233,.5));
}

.callout > div > strong,
.callout > div > :first-child {
    display: block;
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    font-size: 15px;
    margin: 0 0 6px;
    color: var(--text, #f0efe9);
}

.callout p {
    margin: 0;
}

.callout p + p {
    margin-top: .6em;
}

.callout a {
    color: var(--green, #5C9D7F);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.callout-info {
    border-left: 3px solid #4a9eff;
    background: rgba(74, 158, 255, .07);
}
.callout-info > i { color: #4a9eff; }

.callout-warn {
    border-left: 3px solid #e0952f;
    background: rgba(224, 149, 47, .08);
}
.callout-warn > i { color: #e0952f; }

.callout-success {
    border-left: 3px solid var(--green, #5C9D7F);
    background: rgba(92, 157, 127, .08);
}
.callout-success > i { color: var(--green, #5C9D7F); }

/* ============================================================
   ФИНАЛЬНЫЙ БЛОК: разделитель, теги, related
   ============================================================ */
.article-end {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px 80px;
}

.article-divider {
    height: 1px;
    background: var(--border, rgba(255,255,255,.07));
    margin-bottom: 48px;
    transition: background .35s ease;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 48px;
}

.article-tag {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--border, rgba(255,255,255,.07));
    color: var(--text-muted, rgba(240,239,233,.5));
    transition: border-color .2s ease, color .2s ease;
}

.article-tag:hover {
    color: var(--green, #5C9D7F);
    border-color: var(--border-hover, var(--green, #5C9D7F));
}

.related-label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim, rgba(240,239,233,.25));
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.related-card {
    display: block;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border, rgba(255,255,255,.07));
    background: var(--bg-card, #161616);
    text-decoration: none;
    transition: border-color .3s ease, transform .3s ease, background .35s ease;
}

.related-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover, var(--green, #5C9D7F));
}

.related-thumb {
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
}

.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
}

.related-card:hover .related-thumb img {
    transform: scale(1.05);
}

.related-thumb .article-hero-placeholder {
    position: relative;
    width: 100%;
    height: 100%;
}

.related-body {
    padding: 16px 18px 20px;
}

.related-cat {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--text-dim, rgba(240,239,233,.25));
    margin-bottom: 8px;
}

.related-title {
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 600;
    color: var(--text, #f0efe9);
    transition: color .2s ease;
}

.related-card:hover .related-title {
    color: var(--green, #5C9D7F);
}

/* ============================================================
   REVEAL (плавное появление)
   ============================================================ */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .6s cubic-bezier(.19,1,.22,1), transform .6s cubic-bezier(.19,1,.22,1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .article-toc {
        display: none;
    }
}

@media (max-width: 768px) {
    .article-header {
        padding: 32px 24px 0;
    }
    .article-layout {
        padding: 0 24px 80px;
    }
    .article-end {
        padding: 0 24px 60px;
    }
    .prose {
        padding-top: 32px;
    }
    .prose p {
        font-size: 16px;
    }
    .prose .lead {
        font-size: 18px;
    }
    .prose h2 {
        margin-top: 44px;
    }
    .cta-try {
        padding: 28px 24px;
    }
    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .progress-bar { transition: none; }
    .related-card:hover .related-thumb img { transform: none; }
}
.article-views {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: var(--text-muted, rgba(240,239,233,.5));
}

.article-views i {
    font-size: 13px;
    color: var(--text-dim, rgba(240,239,233,.25));
}
.article-author-block {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.article-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.article-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--green, #5C9D7F);
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
}
.article-author-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}
.article-author-name {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #f0efe9);
}
.article-author-role {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: var(--text-muted, rgba(240,239,233,.5));
}
.article-dot {
    color: var(--text-dim, rgba(240,239,233,.25));
}
