/* =========================================================
   Страница статей
   Работает с существующим Smarty-шаблоном без изменения HTML
   ========================================================= */

.news-page {
    --news-blue: #0f5fa8;
    --news-blue-dark: #073d70;
    --news-blue-light: #eaf6ff;
    --news-cyan: #20a8e0;
    --news-border: #d8eaf7;
    --news-text: #17324a;
    --news-muted: #6c8193;

    padding-top: 20px;
    padding-bottom: 70px;
}

/* Заголовок страницы */

.news-page > h1 {
    position: relative;
    margin-bottom: 24px !important;
    color: var(--news-blue-dark);
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1.08;
    letter-spacing: -0.03em;
}


/* Вводный текст */

.news-page .text-block {
    position: relative;
    overflow: hidden;
    margin-bottom: 36px;
    padding: 24px 28px 24px 32px;
    border: 1px solid var(--news-border);
    border-radius: 22px;
    background:
            radial-gradient(
                    circle at 95% 10%,
                    rgba(32, 168, 224, 0.14),
                    transparent 32%
            ),
            linear-gradient(135deg, #ffffff 0%, #f1f9ff 100%);
    box-shadow: 0 14px 38px rgba(15, 95, 168, 0.08);
}

.news-page .text-block::before {
    content: "";
    position: absolute;
    top: 18px;
    bottom: 18px;
    left: 0;
    width: 5px;
    border-radius: 0 10px 10px 0;
    background: linear-gradient(
            180deg,
            var(--news-cyan),
            var(--news-blue)
    );
}

.news-page .text-block p {
    margin: 0;
    color: var(--news-text);
    font-size: 16px;
    line-height: 1.8;
}

/* Сетка */

/*
На desktop и tablet — 2 колонки.
Bootstrap-классы в шаблоне оставляем как есть,
но переопределяем ширину элементов внутри страницы статей.
*/

.news-page #clients-grid > [class*="col-"] {
    width: 50%;
    flex: 0 0 50%;
    max-width: 50%;
}

/* Карточка статьи */

.news-page .clients-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--news-border);
    border-radius: 24px;
    background: #ffffff;
    color: var(--news-text);
    text-decoration: none;
    box-shadow:
            0 10px 30px rgba(18, 81, 133, 0.08),
            0 2px 8px rgba(18, 81, 133, 0.04);
    transform: translateY(0);
    transition:
            transform 0.35s ease,
            box-shadow 0.35s ease,
            border-color 0.35s ease;
}

.news-page .clients-card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0;
    background: linear-gradient(
            135deg,
            rgba(32, 168, 224, 0.08),
            transparent 45%
    );
    transition: opacity 0.35s ease;
}

.news-page .clients-card:hover {
    transform: translateY(-8px);
    border-color: rgba(32, 168, 224, 0.55);
    box-shadow:
            0 24px 55px rgba(15, 95, 168, 0.16),
            0 8px 18px rgba(15, 95, 168, 0.08);
}

.news-page .clients-card:hover::before {
    opacity: 1;
}

/* Дата */

.news-page .article-post__date {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 5;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 100px;
    background: rgba(4, 55, 95, 0.82);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
    box-shadow: 0 6px 16px rgba(0, 39, 72, 0.2);
}

/* Изображение */

.news-page .img-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--news-blue-light);
}

.news-page .img-wrap::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 45%;
    pointer-events: none;
    background: linear-gradient(
            180deg,
            transparent 0%,
            rgba(3, 45, 78, 0.25) 100%
    );
}

.news-page .picture {
    display: block;
    width: 100%;
    height: 100%;
}

.news-page .picture img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
            transform 0.7s cubic-bezier(0.22, 1, 0.36, 1),
            filter 0.4s ease;
}

.news-page .clients-card:hover .picture img {
    transform: scale(1.065);
    filter: saturate(1.05) contrast(1.02);
}

/* Контент карточки */

.news-page .card-body {
    position: relative;
    z-index: 3;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 22px 24px 24px;
}

.news-page .badge-cat {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid #c6e6f7;
    border-radius: 100px;
    background: var(--news-blue-light);
    color: var(--news-blue);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.news-page .badge-cat::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--news-cyan);
    box-shadow: 0 0 0 4px rgba(32, 168, 224, 0.12);
}

/* Название статьи */

.news-page .card-body > p.fw-medium {
    min-height: auto !important;
    margin-top: 15px !important;
    margin-bottom: 11px !important;
    color: var(--news-blue-dark);
    font-size: clamp(18px, 2vw, 23px) !important;
    font-weight: 700 !important;
    line-height: 1.32;
    letter-spacing: -0.015em;

    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Краткий текст */

.news-page .card-body > p.smaller {
    min-height: auto !important;
    margin-bottom: 18px !important;
    color: var(--news-muted);
    font-size: 14px;
    line-height: 1.68;

    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

/* Псевдокнопка "Читать статью" без изменения HTML */

.news-page .card-body::after {
    content: "Читать статью  →";
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    min-height: 42px;
    margin-top: auto;
    padding: 0 17px;
    border-radius: 12px;
    background: linear-gradient(
            135deg,
            var(--news-blue),
            var(--news-cyan)
    );
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(15, 95, 168, 0.18);
    transition:
            transform 0.3s ease,
            box-shadow 0.3s ease;
}

.news-page .clients-card:hover .card-body::after {
    transform: translateX(4px);
    box-shadow: 0 11px 24px rgba(15, 95, 168, 0.28);
}

/* Появление карточек */

@keyframes newsCardReveal {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.news-page #clients-grid > [class*="col-"] {
    opacity: 0;
    animation: newsCardReveal 0.65s ease forwards;
}

.news-page #clients-grid > [class*="col-"]:nth-child(1) {
    animation-delay: 0.05s;
}

.news-page #clients-grid > [class*="col-"]:nth-child(2) {
    animation-delay: 0.14s;
}

.news-page #clients-grid > [class*="col-"]:nth-child(3) {
    animation-delay: 0.23s;
}

.news-page #clients-grid > [class*="col-"]:nth-child(4) {
    animation-delay: 0.32s;
}

.news-page #clients-grid > [class*="col-"]:nth-child(n + 5) {
    animation-delay: 0.38s;
}

/* Пагинация */

.news-page .block-pagination {
    width: 100%;
    margin-top: 22px;
}

.news-page .pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 0;
}

.news-page .pagination a,
.news-page .pagination span,
.news-page .pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 13px;
    border: 1px solid var(--news-border);
    border-radius: 12px !important;
    background: #ffffff;
    color: var(--news-blue);
    font-weight: 600;
    text-decoration: none;
    box-shadow: none;
    transition:
            color 0.25s ease,
            background 0.25s ease,
            border-color 0.25s ease,
            transform 0.25s ease;
}

.news-page .pagination a:hover,
.news-page .pagination .page-link:hover {
    transform: translateY(-2px);
    border-color: var(--news-cyan);
    background: var(--news-blue-light);
    color: var(--news-blue-dark);
}

.news-page .pagination .active .page-link,
.news-page .pagination .active,
.news-page .pagination span.current {
    border-color: var(--news-blue);
    background: linear-gradient(
            135deg,
            var(--news-blue),
            var(--news-cyan)
    );
    color: #ffffff;
}

/* Планшет */

@media (max-width: 991.98px) {
    .news-page {
        padding-bottom: 50px;
    }

    .news-page .card-body {
        padding: 20px;
    }
}

/* Телефон — одна колонка */

@media (max-width: 767.98px) {
    .news-page #clients-grid > [class*="col-"] {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }

    .news-page > h1 {
        font-size: 34px;
    }

    .news-page .text-block {
        margin-bottom: 26px;
        padding: 20px 19px 20px 24px;
        border-radius: 18px;
    }

    .news-page .text-block p {
        font-size: 15px;
        line-height: 1.7;
    }

    .news-page .clients-card {
        border-radius: 20px;
    }

    .news-page .card-body > p.fw-medium {
        font-size: 20px !important;
    }
}

/* Очень маленькие экраны */

@media (max-width: 420px) {
    .news-page .article-post__date {
        top: 12px;
        left: 12px;
        padding: 7px 10px;
        font-size: 11px;
    }

    .news-page .card-body {
        padding: 18px;
    }

    .news-page .card-body::after {
        width: 100%;
    }
}

/* Для пользователей с отключенной анимацией */

@media (prefers-reduced-motion: reduce) {
    .news-page #clients-grid > [class*="col-"] {
        opacity: 1;
        animation: none;
    }

    .news-page .clients-card,
    .news-page .picture img,
    .news-page .card-body::after {
        transition: none;
    }
}