/* =========================================================
   YAREKS BLOG — Публічні стилі
   ========================================================= */

/* ---- Загальна обгортка сторінок блогу ---- */
.blog-list-page,
.blog-post-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}

/* ---- Шапка сторінки списку ---- */
.blog-page-header {
    margin-bottom: 40px;
}

.blog-page-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 10px 0 12px;
}

.blog-page-desc {
    color: #666;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 700px;
}

/* ---- Breadcrumbs ---- */
.blog-breadcrumbs {
    margin-bottom: 16px;
}

.blog-breadcrumbs .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 4px;
    font-size: 0.85rem;
    color: #999;
}

.blog-breadcrumbs .breadcrumb-item a {
    color: #e50010;
    text-decoration: none;
}

.blog-breadcrumbs .breadcrumb-item a:hover {
    text-decoration: underline;
}

.blog-breadcrumbs .breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    margin-right: 4px;
    color: #bbb;
}

.blog-breadcrumbs .breadcrumb-item.active {
    color: #666;
}

/* ---- Ліаут: сітка + сайдбар ---- */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
    align-items: start;
}

@media (max-width: 900px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }
}

/* ---- Картки статей ---- */
.blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
}

@media (max-width: 700px) {
    .blog-posts-grid {
        grid-template-columns: 1fr;
    }
}

.blog-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    transition: box-shadow 0.2s, transform 0.2s;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.13);
    transform: translateY(-2px);
}

.blog-card__image-link {
    display: block;
    overflow: hidden;
    aspect-ratio: 16/10;
    background: #f0f0f0;
}

.blog-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.blog-card:hover .blog-card__image {
    transform: scale(1.04);
}

.blog-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
    color: #e50010;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: 2px;
}

.blog-card__body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: #888;
    margin-bottom: 10px;
}

.blog-card__category {
    color: #e50010;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    text-decoration: none;
}

.blog-card__category:hover {
    text-decoration: underline;
}

.blog-meta-sep {
    color: #ccc;
}

.blog-card__date,
.blog-card__reading-time {
    color: #999;
}

.blog-card__title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 10px;
    line-height: 1.45;
    flex: 1;
}

.blog-card__title a {
    color: inherit;
    text-decoration: none;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.blog-card__title a:hover {
    color: #e50010;
}

.blog-card__excerpt {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.6;
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__read-more {
    font-size: 0.85rem;
    color: #e50010;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
}

.blog-card__read-more:hover {
    gap: 10px;
}

/* Маленька картка (схожі статті) */
.blog-card--sm .blog-card__title {
    font-size: 0.95rem;
}

.blog-card--sm .blog-card__image-link {
    aspect-ratio: 4/2.5;
}

/* ---- Пустий стан ---- */
.blog-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 1.05rem;
}

/* ---- Сайдбар ---- */
.blog-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.blog-widget {
    background: #fff;
    border-radius: 8px;
    padding: 22px;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

.blog-widget__title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1a1a1a;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e50010;
}

.blog-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.blog-cat-link {
    display: block;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    color: #444;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.blog-cat-link:hover,
.blog-cat-link.active {
    background: #e50010;
    color: #fff;
}

.blog-widget--cta p {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.6;
    margin: 0 0 16px;
}

/* Уникаємо «вилазіння» кнопки через border/padding/line-height */
.blog-widget--cta {
    overflow: hidden;
}

.blog-widget--cta .btn {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

/* ---- Пагінація ---- */
.blog-pagination {
    margin-top: 48px;
}

.blog-pager__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.blog-pager__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid #ddd;
    color: #444;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.15s;
}

.blog-pager__link:hover,
.blog-pager__link--active {
    background: #e50010;
    border-color: #e50010;
    color: #fff;
}

/* ---- Стаття ---- */
.blog-article {
    max-width: 860px;
    margin: 0 auto;
}

.blog-article__header {
    margin-bottom: 28px;
}

.blog-article__category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #e50010;
    text-decoration: none;
    margin-bottom: 12px;
}

.blog-article__category:hover {
    text-decoration: underline;
}

.blog-article__title {
    font-size: 2.1rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.3;
    margin: 0 0 18px;
}

@media (max-width: 600px) {
    .blog-article__title {
        font-size: 1.5rem;
    }
}

.blog-article__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #888;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.blog-article__meta i {
    color: #ccc;
    margin-right: 4px;
}

.blog-article__author {
    font-weight: 500;
    color: #555;
}

.blog-article__author-pos {
    font-weight: 400;
}

.blog-article__featured-image {
    margin-bottom: 36px;
    border-radius: 8px;
    overflow: hidden;
}

.blog-article__featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* ---- Контент статті (типографіка) ---- */
.blog-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.blog-content p,
.blog-content li,
.blog-content a,
.blog-content h2,
.blog-content h3,
.blog-content h4 {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.blog-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 2em 0 0.6em;
    line-height: 1.3;
}

.blog-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 1.6em 0 0.5em;
}

.blog-content h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 1.4em 0 0.4em;
}

.blog-content p {
    margin: 0 0 1.2em;
}

.blog-content ul,
.blog-content ol {
    padding-left: 1.6em;
    margin: 0 0 1.2em;
}

.blog-content li {
    margin-bottom: 0.4em;
}

.blog-content blockquote {
    border-left: 4px solid #e50010;
    padding: 14px 20px;
    margin: 1.6em 0;
    background: #fafafa;
    font-style: italic;
    color: #555;
    border-radius: 0 6px 6px 0;
}

.blog-content blockquote p:last-child {
    margin-bottom: 0;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 1em 0;
    display: block;
}

.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    font-size: 0.92rem;
}

.blog-content table th,
.blog-content table td {
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    text-align: left;
}

.blog-content table th {
    background: #1a1a1a;
    color: #fff;
    font-weight: 600;
}

.blog-content table tr:nth-child(even) td {
    background: #f9f9f9;
}

.blog-content code {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    color: #d63031;
}

.blog-content pre {
    background: #1a1a1a;
    color: #f8f8f2;
    padding: 18px 22px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.4em 0;
    font-size: 0.88rem;
    line-height: 1.6;
}

.blog-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.blog-content a {
    color: #e50010;
    text-decoration: underline;
}

.blog-content a:hover {
    text-decoration: none;
}

.blog-content hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 2em 0;
}

/* ---- Футер статті ---- */
.blog-article__footer {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.blog-article__tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    color: #888;
}

.blog-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    background: #f0f0f0;
    color: #444;
    font-size: 0.82rem;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.blog-tag:hover {
    background: #e50010;
    color: #fff;
}

/* ---- Схожі статті ---- */
.blog-related {
    max-width: 860px;
    margin: 60px auto 0;
    padding-top: 40px;
    border-top: 2px solid #eee;
}

.blog-related__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 24px;
}

.blog-related__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 700px) {
    .blog-related__grid {
        grid-template-columns: 1fr;
    }
}

/* ---- CTA блок внизу статті ---- */
.blog-post-cta {
    max-width: 860px;
    margin: 60px auto 0;
    background: #1a1a1a;
    color: #fff;
    border-radius: 12px;
    padding: 44px 40px;
    text-align: center;
}

.blog-post-cta h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 12px;
}

.blog-post-cta p {
    color: #ccc;
    font-size: 0.95rem;
    margin: 0 0 24px;
    line-height: 1.6;
}

.blog-post-cta__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

/* ---- Кнопки (якщо не визначені в index.css) ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.2;
}

.btn-primary {
    background: #e50010;
    color: #fff;
    border-color: #e50010;
}

.btn-primary:hover {
    background: #c0000d;
    border-color: #c0000d;
}

.btn-outline {
    background: transparent;
    color: #1a1a1a;
    border-color: #ccc;
}

.btn-outline:hover {
    border-color: #1a1a1a;
    color: #1a1a1a;
}

.btn-full {
    width: 100%;
}

@media (max-width: 600px) {
    .blog-list-page,
    .blog-post-page {
        padding: 20px 16px 60px;
    }

    .blog-post-cta {
        padding: 30px 20px;
    }

    .blog-article__title {
        font-size: 1.4rem;
    }
}
