/**
 * iLogist Blog — стилі для /blog/index, /blog/post і "Останні матеріали" на головній.
 */

/* ============================================================
   ХЕДЕР АРХІВУ
   padding-top покриває висоту плаваючої шапки (.site-navbar fixed top:25)
============================================================ */
.blog-hero {
    background: linear-gradient(135deg, #14213d 0%, #1e3a5f 100%);
    color: #fff;
    padding: 140px 0 60px;
}
.blog-hero h1 {
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 700;
    margin-bottom: 12px;
}
.blog-hero p {
    font-size: 16px;
    opacity: 0.85;
    max-width: 700px;
}

/* ============================================================
   ФІЛЬТР КАТЕГОРІЙ
============================================================ */
.blog-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 20px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 30px;
}
.blog-filter {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #1f2937;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}
.blog-filter:hover {
    border-color: #fca311;
    color: #fca311;
    text-decoration: none;
}
.blog-filter.is-active {
    background: #14213d;
    color: #fff;
    border-color: #14213d;
}

/* ============================================================
   СІТКА КАРТОК
============================================================ */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding-bottom: 60px;
}

.blog-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}
.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: inherit;
}
.blog-card__image {
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    background-size: cover;
    background-position: center;
}
.blog-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
    font-size: 48px;
}
.blog-card__body {
    padding: 20px 22px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.blog-card__meta {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
}
.blog-card__type {
    background: #fef3c7;
    color: #92400e;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 600;
}
.blog-card__type--article {
    background: #dbeafe;
    color: #1e40af;
}
.blog-card__category {
    color: #fca311;
    font-weight: 600;
}
.blog-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: #14213d;
    margin-bottom: 10px;
    line-height: 1.35;
    /* clamp до 3 рядків */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card__excerpt {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.55;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card__footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #9ca3af;
}
.blog-card__read {
    color: #fca311;
    font-weight: 600;
}

/* ============================================================
   ПАГІНАЦІЯ
============================================================ */
.blog-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-bottom: 60px;
}
.blog-pagination a, .blog-pagination span {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    color: #1f2937;
    text-decoration: none;
    font-size: 14px;
}
.blog-pagination .is-active {
    background: #14213d;
    color: #fff;
    border-color: #14213d;
}

/* ============================================================
   ОКРЕМА СТАТТЯ (post.php)
============================================================ */
.blog-post {
    max-width: 780px;
    margin: 0 auto;
    padding: 130px 20px 80px;
}
.blog-post__back {
    display: inline-block;
    margin-bottom: 24px;
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
}
.blog-post__back:hover {
    color: #fca311;
    text-decoration: none;
}
.blog-post__meta {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 16px;
    font-size: 13px;
    color: #6b7280;
}
.blog-post h1 {
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 800;
    color: #14213d;
    line-height: 1.2;
    margin-bottom: 20px;
}
.blog-post__hero {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 12px;
    margin: 24px 0 32px;
}
.blog-post__body {
    font-size: 17px;
    line-height: 1.7;
    color: #1f2937;
}
.blog-post__body p {
    margin-bottom: 1em;
}
.blog-post__body h2 {
    font-size: 26px;
    margin-top: 1.5em;
    margin-bottom: 0.6em;
    color: #14213d;
}
.blog-post__body h3 {
    font-size: 21px;
    margin-top: 1.4em;
    margin-bottom: 0.5em;
    color: #14213d;
}
.blog-post__body img {
    max-width: 100%;
    border-radius: 8px;
    margin: 1em 0;
}
.blog-post__body a { color: #fca311; }
.blog-post__body ul, .blog-post__body ol { margin: 1em 0 1em 24px; }
.blog-post__body li { margin-bottom: 0.4em; }
.blog-post__body blockquote {
    border-left: 4px solid #fca311;
    padding: 12px 20px;
    margin: 1.5em 0;
    background: #fef9f1;
    color: #475569;
    font-style: italic;
}

/* Експертний коментар для news */
.blog-expert {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-left: 4px solid #fca311;
    padding: 20px 24px;
    border-radius: 8px;
    margin: 32px 0;
}
.blog-expert__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #92400e;
    font-weight: 700;
    margin-bottom: 8px;
}
.blog-expert__text {
    color: #14213d;
    line-height: 1.6;
}

/* Source link для news */
.blog-source {
    background: #f3f4f6;
    padding: 14px 18px;
    border-radius: 8px;
    margin: 24px 0;
    font-size: 13px;
    color: #6b7280;
}
.blog-source a {
    color: #392ec9;
    font-weight: 600;
}

/* ============================================================
   ОСТАННІ МАТЕРІАЛИ (на головній + sidebar поста)
============================================================ */
.blog-latest-section {
    background: #f8fafc;
    padding: 60px 0;
}
.blog-latest-section h2 {
    text-align: center;
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 700;
    color: #14213d;
    margin-bottom: 8px;
}
.blog-latest-section__lead {
    text-align: center;
    color: #6b7280;
    margin-bottom: 36px;
}
.blog-latest-section__cta {
    text-align: center;
    margin-top: 30px;
}
.blog-latest-section__cta a {
    display: inline-block;
    background: #fca311;
    color: #fff;
    padding: 12px 28px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
}
.blog-latest-section__cta a:hover {
    background: #d97706;
    color: #fff;
    text-decoration: none;
}

/* ============================================================
   MOBILE
============================================================ */
@media (max-width: 768px) {
    .blog-hero { padding: 40px 0 30px; margin-top: 70px; }
    .blog-grid { grid-template-columns: 1fr; gap: 16px; }
    .blog-post { padding: 30px 16px 60px; }
    .blog-post__body { font-size: 16px; }
}
