/* ========================================
   BLOG PAGE STYLES — blog.css
   Подключается поверх основного style.css
   ======================================== */

/* --- Хедер на странице блога (не абсолютный, а обычный) --- */
.blog-page-header {
    position: relative !important;
    width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    max-width: 100% !important;
    padding: 25px 0;
}

/* --- Blog Hero (шапка страницы) --- */
.blog-hero {
    padding: 60px 0 50px;
    background: linear-gradient(180deg, #222831 0%, #1e232b 100%);
    border-bottom: 1px solid #3a414c;
}

.blog-hero h1 {
    font-size: 2.8rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 10px;
}

.blog-hero p {
    color: #888;
    font-size: 1.1rem;
    max-width: 550px;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.breadcrumbs a {
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumbs a:hover {
    color: var(--primary-yellow);
}

.breadcrumbs span {
    color: #555;
}

.breadcrumbs .current {
    color: var(--primary-yellow);
    font-weight: 600;
}


/* ========== LAYOUT: Sidebar + Content ========== */
.blog-main {
    padding: 60px 0 80px;
    background-color: var(--dark-blue-bg);
}

.blog-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 50px;
    align-items: start;
}


/* ========== SIDEBAR ========== */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
    position: sticky;
    top: 30px;
}

.sidebar-block {
    background: var(--card-bg);
    border: 1px solid #3a414c;
    border-radius: 12px;
    padding: 25px;
}

.sidebar-block h3 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-block h3 svg {
    width: 18px;
    height: 18px;
    color: var(--primary-yellow);
}

/* Список категорий */
.sidebar-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-list li {
    margin-bottom: 4px;
}

.sidebar-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.sidebar-list a:hover {
    background: rgba(253, 203, 70, 0.06);
    color: #fff;
    padding-left: 16px;
}

.sidebar-list a.active {
    background: rgba(253, 203, 70, 0.1);
    color: var(--primary-yellow);
    font-weight: 600;
}

.sidebar-list .count {
    background: rgba(255, 255, 255, 0.05);
    color: #666;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

.sidebar-list a.active .count {
    background: rgba(253, 203, 70, 0.15);
    color: var(--primary-yellow);
}

/* Облако тегов */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid #3a414c;
    border-radius: 6px;
    color: #aaa;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tag:hover {
    border-color: var(--primary-yellow);
    color: var(--primary-yellow);
    background: rgba(253, 203, 70, 0.06);
}

/* Sidebar CTA */
.sidebar-cta {
    text-align: center;
    border-color: rgba(253, 203, 70, 0.2);
    background: linear-gradient(180deg, var(--card-bg) 0%, rgba(253, 203, 70, 0.03) 100%);
}

.sidebar-cta > svg {
    width: 36px;
    height: 36px;
    color: var(--primary-yellow);
    margin-bottom: 10px;
}

.sidebar-cta h3 {
    justify-content: center;
    margin-bottom: 8px;
}

.sidebar-cta p {
    color: #888;
    font-size: 0.85rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.sidebar-cta .btn {
    margin-top: 5px;
}


/* ========== ARTICLE CARDS (Список) ========== */
.blog-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.blog-list-card {
    display: block;
    background: var(--card-bg);
    border: 1px solid #3a414c;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: all 0.35s ease;
    overflow: hidden;
    position: relative;
}

/* Линия слева — акцент */
.blog-list-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-yellow), #4ecdc4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.blog-list-card:hover {
    transform: translateX(6px);
    border-color: rgba(253, 203, 70, 0.25);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.3);
}

.blog-list-card:hover::before {
    opacity: 1;
}

.blog-list-card-body {
    padding: 30px 35px;
}

/* Мета-строка (дата + категория) */
.blog-list-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 14px;
}

.blog-list-meta time {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
    font-size: 0.8rem;
    font-weight: 500;
}

.blog-list-meta time svg {
    width: 14px;
    height: 14px;
    color: #555;
}

.blog-list-category {
    padding: 3px 10px;
    background: rgba(253, 203, 70, 0.1);
    color: var(--primary-yellow);
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Заголовок статьи */
.blog-list-card h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.blog-list-card:hover h2 {
    color: var(--primary-yellow);
}

/* Превью */
.blog-list-card p {
    color: #999;
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* Read more */
.blog-list-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-yellow);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: gap 0.3s ease;
}

.blog-list-readmore svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.blog-list-card:hover .blog-list-readmore {
    gap: 10px;
}

.blog-list-card:hover .blog-list-readmore svg {
    transform: translateX(3px);
}


/* ========== PAGINATION ========== */
.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #3a414c;
}

.page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--card-bg);
    border: 1px solid #3a414c;
    color: #aaa;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-num:hover {
    border-color: var(--primary-yellow);
    color: var(--primary-yellow);
}

.page-num.active {
    background: var(--primary-yellow);
    color: var(--text-dark);
    border-color: var(--primary-yellow);
    font-weight: 800;
}

.page-next {
    width: auto;
    padding: 0 18px;
    gap: 6px;
    font-size: 0.85rem;
}

.page-next svg {
    width: 16px;
    height: 16px;
}


/* ========== RESPONSIVE ========== */
@media (max-width: 992px) {
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    /* Сайдбар уходит наверх, перестаёт быть sticky */
    .blog-sidebar {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
    }

    .sidebar-block {
        flex: 1;
        min-width: 250px;
    }

    .blog-hero h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 600px) {
    .blog-sidebar {
        flex-direction: column;
    }

    .sidebar-block {
        min-width: 100%;
    }

    .blog-list-card-body {
        padding: 22px 20px;
    }

    .blog-list-card h2 {
        font-size: 1.1rem;
    }

    .blog-hero h1 {
        font-size: 1.8rem;
    }

    .blog-hero {
        padding: 40px 0 30px;
    }
}


/* ==============================================
   SINGLE ARTICLE PAGE STYLES
   ============================================== */

/* --- Article Hero --- */
.article-hero h1 {
    font-size: 2.4rem;
    max-width: 700px;
    line-height: 1.25;
}

.article-hero-meta {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.article-hero-meta time,
.article-reading-time {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #777;
    font-size: 0.85rem;
}

.article-hero-meta time svg,
.article-reading-time svg {
    width: 15px;
    height: 15px;
    color: #555;
}


/* --- Table of Contents (sidebar) --- */
.sidebar-toc nav {
    margin: 0;
}

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

.toc-list li {
    margin-bottom: 2px;
}

.toc-list a {
    display: block;
    padding: 8px 12px;
    color: #aaa;
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 6px;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.toc-list a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.03);
    border-left-color: var(--primary-yellow);
    padding-left: 16px;
}


/* --- Article Content (Typography) --- */
.article-content {
    max-width: 100%;
    min-width: 0;
}

.article-lead {
    font-size: 1.15rem;
    color: #ccc;
    line-height: 1.7;
    margin-bottom: 35px;
    padding-bottom: 30px;
    border-bottom: 1px solid #3a414c;
}

.article-content h2 {
    font-size: 1.6rem;
    color: #fff;
    margin-top: 45px;
    margin-bottom: 18px;
    padding-top: 15px;
    line-height: 1.3;
    scroll-margin-top: 30px;
}

.article-content h3 {
    font-size: 1.2rem;
    color: #fff;
    margin-top: 30px;
    margin-bottom: 12px;
    line-height: 1.35;
}

.article-content p {
    color: #bbb;
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 18px;
}

.article-content ul,
.article-content ol {
    color: #bbb;
    padding-left: 20px;
    margin-bottom: 22px;
    line-height: 1.7;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content li strong {
    color: #fff;
}

.article-content a {
    color: var(--primary-yellow);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.article-content a:hover {
    color: #fff;
}

/* Blockquote */
.article-content blockquote {
    margin: 30px 0;
    padding: 25px 30px;
    background: rgba(253, 203, 70, 0.04);
    border-left: 4px solid var(--primary-yellow);
    border-radius: 0 12px 12px 0;
}

.article-content blockquote p {
    color: #ddd;
    font-size: 1.05rem;
    font-style: italic;
    margin-bottom: 0;
    line-height: 1.65;
}

/* Images in article */
.article-content img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid #3a414c;
    margin: 25px 0;
}

/* Code blocks */
.article-content code {
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #4ecdc4;
}

.article-content pre {
    background: #15191f;
    border: 1px solid #3a414c;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    overflow-x: auto;
}

.article-content pre code {
    background: none;
    padding: 0;
    font-size: 0.88rem;
    line-height: 1.6;
}


/* --- Article Footer --- */
.article-footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #3a414c;
}

.article-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #888;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.article-back-link svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.article-back-link:hover {
    color: var(--primary-yellow);
}

.article-back-link:hover svg {
    transform: translateX(-4px);
}


/* --- Related Posts --- */
.related-posts {
    margin-top: 50px;
}

.related-posts h3 {
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 25px;
}

.related-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.related-card {
    background: var(--card-bg);
    border: 1px solid #3a414c;
    border-radius: 12px;
    padding: 25px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.related-card:hover {
    border-color: rgba(253, 203, 70, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.related-card time {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 10px;
    display: block;
}

.related-card h4 {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 12px;
    flex-grow: 1;
    transition: color 0.3s ease;
}

.related-card:hover h4 {
    color: var(--primary-yellow);
}


/* --- Article layout override --- */
.article-layout {
    grid-template-columns: 240px 1fr;
}


/* --- Responsive --- */
@media (max-width: 992px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-hero h1 {
        font-size: 1.9rem;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .article-hero h1 {
        font-size: 1.6rem;
    }

    .article-content blockquote {
        padding: 18px 20px;
    }

    .article-content h2 {
        font-size: 1.35rem;
    }
}
