/* ======================
   Blog — CSS Variables
   ====================== */
:root {
    --bc-brand: #d56ed7;
    --bc-text: #434343;
    --bc-gray: #9b9b9b;
    --bc-light: #f2f2f2;
    --bc-cover-bg: #c5d7b6;
}

/* ======================
   Уменьшение отступа перед футером
   ====================== */
.blog-page {
    margin-bottom: -3rem;
}

/* ======================
   Хлебные крошки
   ====================== */
.blog-breadcrumbs {
    font-size: 14px;
    color: var(--bc-gray);
}

.blog-breadcrumbs a {
    color: var(--bc-gray);
    text-decoration: none;
}

.blog-breadcrumbs a:hover {
    color: var(--bc-text);
}

.blog-breadcrumbs span {
    color: var(--bc-text);
}

/* ======================
   Обложка листинга
   ====================== */
.blog-cover {
    background: var(--bc-cover-bg) url('/img/blog/blog-cover.jpg') center / cover no-repeat;
    border-radius: 30px;
    overflow: hidden;
    height: 300px;
    position: relative;
}

.blog-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.21);
}

.blog-cover h1 {
    font-size: 80px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    z-index: 1;
}

/* ======================
   Карточки блога
   ====================== */
.blog-card {
    background-color: var(--bc-light);
    border-radius: 20px;
    overflow: hidden;
    height: 100%;
    min-height: 168px;
    align-items: stretch;
    transition: box-shadow 0.2s ease;
}

.blog-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.blog-card:hover .blog-card__read-more {
    gap: 10px;
}

.blog-card__text {
    flex: 1;
    padding: 24px 14px 20px 27px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.blog-card__title {
    font-size: 22px;
    font-weight: 700;
    color: var(--bc-text);
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--bc-gray);
    margin-bottom: 8px;
}

.blog-card__meta-sep {
    opacity: 0.6;
}

.blog-card__meta-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.blog-card__desc {
    font-size: 14px;
    font-weight: 500;
    color: var(--bc-text);
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__read-more {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--bc-brand);
    transition: gap 0.2s ease;
}

.blog-card__image {
    flex-shrink: 0;
    width: 119px;
    height: 119px;
    margin-right: 16px;
    margin-top: 24px;
    border-radius: 50%;
    overflow: hidden;
}

.blog-card__image img {
    width: 119px;
    height: 119px;
    border-radius: 50%;
    object-fit: cover;
}

/* ======================
   Обложка статьи
   ====================== */
.blog-post-cover {
    border-radius: 30px;
    overflow: hidden;
    height: 514px;
    background-size: cover;
    background-position: center;
    background-color: var(--bc-cover-bg);
}

.blog-post-cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 0;
}

.blog-post-cover h1 {
    font-size: 80px;
    font-weight: 600;
    color: #fff;
    margin: 0;
    z-index: 1;
    max-width: 80%;
}

/* ======================
   Бейдж времени чтения
   ====================== */
.blog-post-badge {
    background-color: var(--bc-brand);
    color: #fff;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    top: 30px;
    right: 30px;
    z-index: 1;
}

/* ======================
   Контент статьи
   ====================== */
.blog-post-content h2 {
    font-size: 35px;
    font-weight: 600;
    color: var(--bc-text);
    margin-top: 32px;
    margin-bottom: 16px;
}

.blog-post-content p {
    font-size: 16px;
    line-height: 1.5;
    color: var(--bc-text);
    margin: 0 0 16px;
}

.blog-post-content p:last-child {
    margin-bottom: 0;
}

.blog-post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 16px 0;
}

.blog-post-content ul,
.blog-post-content ol {
    font-size: 16px;
    line-height: 1.5;
    color: var(--bc-text);
    padding-left: 1.5rem;
    margin: 0 0 16px;
}

.blog-post-content ul > li {
    list-style-type: disc;
    margin-bottom: 6px;
}

.blog-post-content ol > li {
    list-style-type: decimal;
    margin-bottom: 6px;
}

.blog-post-content li::marker {
    color: var(--bc-brand);
}

.blog-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 16px;
    color: var(--bc-text);
}

.blog-post-content th,
.blog-post-content td {
    border: 1px solid #e0e0e0;
    padding: 10px 14px;
    vertical-align: top;
    text-align: left;
}

.blog-post-content th {
    background: var(--bc-light);
    font-weight: 600;
}

.blog-post-content tbody tr:nth-child(even) td {
    background: #fafafa;
}

/* ======================
   Ссылки внутри текста статьи
   ====================== */
.blog-post-content a {
    color: var(--bc-brand);
    text-decoration: underline !important;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.blog-post-content a:hover,
.blog-post-content a:focus {
    color: var(--bc-text);
    text-decoration: underline !important;
}

/* ======================
   Боковая навигация (ToC)
   ====================== */
.blog-post-toc {
    top: 110px;
    padding-left: 20px;
    border-left: 2px solid #e0e0e0;
}

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

.blog-post-toc li {
    margin-bottom: 12px;
}

.blog-post-toc a {
    font-size: 14px;
    color: var(--bc-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-post-toc a:hover,
.blog-post-toc a.active {
    color: var(--bc-brand);
}

/* ======================
   Мобильная адаптация
   ====================== */
@media (max-width: 767.98px) {
    /* Обложка листинга */
    .blog-cover {
        height: 100px;
        border-radius: 15px;
    }

    .blog-cover h1 {
        font-size: 24px;
    }

    /* Карточки */
    .blog-card {
        min-height: 130px;
    }

    .blog-card__text {
        padding: 18px 12px 16px 20px;
    }

    .blog-card__title {
        font-size: 18px;
    }

    .blog-card__meta {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .blog-card__desc {
        font-size: 13px;
        margin-bottom: 8px;
    }

    .blog-card__read-more {
        font-size: 13px;
    }

    .blog-card__image {
        width: 90px;
        height: 90px;
        margin-right: 15px;
        margin-top: 20px;
    }

    .blog-card__image img {
        width: 90px;
        height: 90px;
    }

    /* Обложка статьи */
    .blog-post-cover {
        height: 170px;
        border-radius: 15px;
    }

    .blog-post-cover h1 {
        font-size: 24px;
        max-width: 90%;
    }

    .blog-post-badge {
        top: 15px;
        right: 15px;
        font-size: 12px;
        padding: 4px 12px;
    }

    /* Контент статьи */
    .blog-post-content h2 {
        font-size: 22px;
        margin-top: 24px;
    }

    .blog-post-content p {
        font-size: 15px;
    }

    .blog-post-content ul,
    .blog-post-content ol,
    .blog-post-content table {
        font-size: 15px;
    }

    .blog-post-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .blog-post-content th,
    .blog-post-content td {
        padding: 8px 10px;
    }
}
