/* Карточки списка блога. Шаблон — theme/new/articles/archive.tpl */

.blog-list {
    --blog-accent: #2244cc;
    --blog-border: #d8dade;
    --blog-line: #e9eaee;
    --blog-title: #0a0d12;
    --blog-muted: #6b7280;
}

/* ---------- фильтр по категориям ---------- */

.blog-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.blog-filter__item {
    display: inline-block;
    padding: 9px 18px;
    border: 1px solid var(--blog-border);
    border-radius: 999px;
    font-size: 16px;
    line-height: 20px;
    color: var(--blog-title);
    background: #fff;
    text-decoration: none;
    transition: 0.25s;
}

.blog-filter__item:hover {
    border-color: var(--blog-accent);
    color: var(--blog-accent);
    text-decoration: none;
}

.blog-filter__item.is-active {
    background: var(--blog-accent);
    border-color: var(--blog-accent);
    color: #fff;
}

/* ---------- сетка ---------- */

.blog-grid__cell {
    margin-bottom: 24px;
}

/* ---------- карточка ---------- */

.blog-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid var(--blog-border);
    border-radius: 9px;
    transition: 0.4s;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 5px 50px 0 rgba(0, 0, 0, 0.09);
    border-color: #fff;
}

.blog-card__thumb {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

/* Блик: белая полоса под -45°, при наведении разворачивается по картинке и тает */
.blog-card__thumb::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 200%;
    height: 0;
    background-color: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%) rotate(-45deg);
    z-index: 1;
}

.blog-card:hover .blog-card__thumb::after {
    height: 250%;
    background-color: transparent;
    transition: 600ms linear;
}

.blog-card__img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.blog-card__img--empty {
    background: linear-gradient(135deg, #eef1f8 0%, #dfe4f2 100%);
}

.blog-card__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 16px;
}

/* строка «категория — время чтения» */

.blog-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--blog-line);
}

.blog-card__categ {
    font-size: 16px;
    font-weight: 600;
    line-height: 16px;
    color: var(--blog-title);
    text-decoration: none;
    transition: 0.25s;
}

.blog-card__categ:hover {
    color: var(--blog-accent);
    text-decoration: none;
}

.blog-card__time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    font-size: 16px;
    line-height: 16px;
    color: var(--blog-title);
}

.blog-card__icon {
    flex-shrink: 0;
    color: var(--blog-muted);
}

/* заголовок и текст */

.blog-card__title {
    margin: 16px 0 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 28px;
}

.blog-card__title a {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--blog-title);
    text-decoration: none;
    transition: 0.4s;
}

.blog-card__title a:hover {
    color: var(--blog-accent);
    text-decoration: none;
}

.blog-card__text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 16px 0 20px;
    font-size: 16px;
    line-height: 26px;
    color: var(--blog-muted);
}

/* дата */

.blog-card__footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--blog-line);
}

.blog-card__date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    line-height: 16px;
    color: var(--blog-title);
}

.blog-empty {
    margin: 0;
    font-size: 17px;
    color: var(--blog-muted);
}

/* ---------- мобильные ---------- */

@media (max-width: 575px) {
    .blog-filter {
        margin-bottom: 24px;
    }

    .blog-filter__item {
        padding: 7px 14px;
        font-size: 15px;
    }

    .blog-card__title {
        font-size: 19px;
        line-height: 26px;
    }

    .blog-card__meta,
    .blog-card__categ,
    .blog-card__time,
    .blog-card__date {
        font-size: 15px;
    }

    .blog-card:hover {
        transform: none;
    }
}

/* ================= переход к соседним статьям =================
   Шаблон — theme/new/articles/show.tpl (блок .blog-nav) */

.blog-nav {
    --blog-accent: #2244cc;
    --blog-line: #e9eaee;
    --blog-title: #0a0d12;
    --blog-muted: #6b7280;

    position: relative;
    display: flex;
    align-items: stretch;
    margin-top: 40px;
    margin-bottom: 40px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 34px 0 rgba(0, 0, 0, 0.1);
}

/* разделитель между половинами — с отступом сверху и снизу, не во всю высоту */
.blog-nav--split::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 22px;
    bottom: 22px;
    width: 1px;
    background: var(--blog-line);
}

.blog-nav__item {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 50%;
    min-width: 0;
    box-sizing: border-box;
    padding: 22px 24px;
    text-decoration: none;
}

.blog-nav__item:hover {
    text-decoration: none;
}

/* правая половина — зеркало левой: текст, картинка, стрелка */
.blog-nav__item--next {
    flex-direction: row-reverse;
    text-align: right;
}

.blog-nav__item--blank {
    pointer-events: none;
}

.blog-nav__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 16px;
    color: var(--blog-accent);
    transition: 0.25s;
}

.blog-nav__item--prev:hover .blog-nav__arrow {
    transform: translateX(-4px);
}

.blog-nav__item--next:hover .blog-nav__arrow {
    transform: translateX(4px);
}

.blog-nav__thumb {
    flex-shrink: 0;
    width: 80px;
    height: 64px;
    border-radius: 8px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

.blog-nav__thumb--empty {
    background: linear-gradient(135deg, #eef1f8 0%, #dfe4f2 100%);
}

.blog-nav__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.blog-nav__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 18px;
    font-weight: 700;
    line-height: 24px;
    color: var(--blog-title);
    transition: 0.25s;
}

.blog-nav__item:hover .blog-nav__title {
    color: var(--blog-accent);
}

.blog-nav__date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    line-height: 16px;
    color: var(--blog-muted);
}

.blog-nav__item--next .blog-nav__date {
    flex-direction: row-reverse;
}

.blog-nav__icon {
    flex-shrink: 0;
    color: var(--blog-accent);
}

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

    .blog-nav--split::before {
        left: 24px;
        right: 24px;
        top: 50%;
        bottom: auto;
        width: auto;
        height: 1px;
    }

    /* стрелка остаётся справа — сразу видно, что это «следующая», но текст
       в узкой колонке выравниваем по левому краю, как у верхней половины */
    .blog-nav__item--next {
        text-align: left;
    }

    .blog-nav__item--next .blog-nav__date {
        flex-direction: row;
    }

    .blog-nav__item--blank {
        display: none;
    }

    .blog-nav__title {
        font-size: 17px;
        line-height: 22px;
    }
}
