/* Страница статьи — Figma «СТАТЬЯ» 263:34052 (Desktop) / 263:33972 (Laptop) / 263:33894 (Phone) */

.article-block .block-content {
    padding: 0 20px;
    align-items: stretch;
    gap: 30px;
}

.article-block__page-title {
    color: var(--Black, #1E2529);
    line-height: 38px;
}

/* Белый контейнер статьи: desktop padding 49px 176px, radius 6. */
.article-card {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 49px 176px;
    border-radius: 6px;
    background: var(--Surface-White, #FFF);
}

.article-card__inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 21px;
    width: 100%;
    max-width: 888px;
}

/* Шапка: дата → (20px) → заголовок → (20px) → подзаголовок */
.article-card__head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
}

.article-card__date {
    color: var(--Text-Secondary, #8B8B8B);
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 18px;
}

.article-card__titles {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
}

.article-card__title {
    color: var(--Black, #1E2529);
    font-size: var(--font-section-title, 30px);
    font-style: normal;
    font-weight: 600;
    line-height: 100%;
}

.article-card__lead {
    color: var(--Black, #1E2529);
    font-size: var(--font-step-title, 20px);
    font-style: normal;
    font-weight: 500;
    line-height: 20px;
}

/* Тело: обложка → (30px) → контент */
.article-card__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 30px;
    width: 100%;
}

.article-card__cover {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    margin: 0;
}

.article-card__cover img {
    width: 100%;
    height: 390px;
    object-fit: cover;
    border-radius: 10px;
}

.article-card__cover figcaption {
    color: var(--Text-Secondary, #8B8B8B);
    font-size: 16px;
    font-style: italic;
    font-weight: 400;
    line-height: 1.3;
}

/*
   Типографика контента из редактора. Значения — из макета:
   h2 22/24 medium, h3 18/22 medium, p 16/normal, отступ заголовок→текст 12px,
   между смысловыми блоками 20px.
*/
.article-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
    color: var(--Text-Primary, #1E2433);
}

.article-content > * {
    width: 100%;
    margin: 0;
}

.article-content p {
    color: var(--Text-Primary, #1E2433);
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.article-content h2 {
    color: var(--Text-Primary, #1E2433);
    font-size: 22px;
    font-style: normal;
    font-weight: 500;
    line-height: 24px;
}

.article-content h3,
.article-content h4 {
    color: var(--Text-Primary, #1E2433);
    font-size: 18px;
    font-style: normal;
    font-weight: 500;
    line-height: 22px;
}

/* Заголовок и следующий за ним абзац идут парой с зазором 12px, а не 20px. */
.article-content h2 + p,
.article-content h3 + p,
.article-content h4 + p,
.article-content h2 + ul,
.article-content h3 + ul,
.article-content h2 + ol,
.article-content h3 + ol {
    margin-top: -8px;
}

/* Списки — бежевая плашка по макету (Frame 427320634). */
.article-content ul,
.article-content ol {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 20px 20px 20px 44px;
    border-radius: 10px;
    background: var(--Surface-Beige, #FAF5EF);
    color: var(--Text-Primary, #1E2433);
    font-size: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.article-content ul {
    list-style: disc;
}

.article-content ol {
    list-style: decimal;
}

.article-content li {
    width: auto;
}

.article-content img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    object-fit: cover;
}

.article-content a {
    color: var(--Brand-Primary, #D5A944);
}

.article-content blockquote {
    padding: 20px;
    border-radius: 10px;
    background: var(--Surface-Beige, #FAF5EF);
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
}

.article-content th,
.article-content td {
    padding: 8px 12px;
    border: 1px solid var(--Border-Light, #DBDBDB);
    text-align: left;
    font-size: 16px;
    line-height: normal;
}

/* ---- Блок «Все новости» под статьёй ---- */

.article-news-block .block-content {
    padding: 60px 20px;
    align-items: stretch;
    gap: 20px;
}

.article-news-block__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.article-news-block__title {
    color: var(--Black, #1E2529);
    line-height: 38px;
    /* По макету заголовок и кнопка всегда в одну строку, включая мобильный. */
    white-space: nowrap;
}

/*
   Кнопка «Все новости» по макету — ровно 135×40 (Figma 263:34125): текст 18/20,
   padding 10/40 у .btn-s растянул бы её до 189px, поэтому фиксируем ширину.
*/
.article-news-block__head .btn {
    flex-shrink: 0;
    width: 135px;
    padding: 10px 4px;
}

/* Desktop: 4 карточки в ряд, слайдер выключен, точки скрыты. */
.article-news-slider {
    width: 100%;
    overflow: visible;
}

.article-news-slider .swiper-wrapper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.article-news-slider .swiper-slide {
    display: flex;
    width: auto;
    height: auto;
}

.article-news-slider .swiper-slide > .news-card {
    width: 100%;
}

.article-news-slider__dots {
    display: none;
}

@media (max-width: 1439px) {
    .article-card {
        padding: 30px 40px;
    }

    /* Laptop-макет (263:34047): три карточки в ряд. */
    .article-news-slider .swiper-wrapper {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .article-news-slider .swiper-slide:nth-child(n + 4) {
        display: none;
    }
}

@media (max-width: 989px) {
    .article-block .block-content {
        gap: 20px;
    }

    .article-card {
        padding: 20px;
    }

    .article-card__inner {
        gap: 21px;
    }

    .article-card__cover img {
        height: 181px;
    }

    .article-content ul,
    .article-content ol {
        padding: 20px 20px 20px 44px;
    }

    .article-news-block .block-content {
        padding: 40px 20px;
    }

    .article-news-block__head {
        gap: 12px;
    }

    /* Ниже 990px карточки ведёт Swiper — возвращаем ему flex-раскладку вместо grid. */
    .article-news-slider {
        overflow: hidden;
    }

    /* Четвёртую карточку прячет только laptop-раскладка; в слайдере она снова нужна. */
    .article-news-slider .swiper-slide:nth-child(n + 4) {
        display: flex;
    }

    .article-news-slider .swiper-wrapper {
        display: flex;
        gap: 0;
        /* align-items: stretch растянул бы карточку выше положенных 342px. */
        align-items: flex-start;
    }

    /* Точки — Figma 141:3564 (Pagination/Dots): пилюля 120×26 с полупрозрачным фоном. */
    .article-news-slider__dots.swiper-pagination {
        position: static;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 120px;
        height: 26px;
        margin: 20px auto 0;
        border: 1px solid rgba(255, 255, 255, 0.28);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.1);
        box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.12);
        backdrop-filter: blur(14px);
    }

    .article-news-slider__dots .swiper-pagination-bullet {
        width: 16px;
        height: 16px;
        margin: 0;
        border: 2px solid rgba(0, 0, 0, 0.33);
        border-radius: 8px;
        background: transparent;
        opacity: 1;
    }

    .article-news-slider__dots .swiper-pagination-bullet-active {
        border: 1px solid #000;
        background: rgba(0, 0, 0, 0.33);
    }
}

/*
   Макет нарисован под 360px, где заголовок «Все новости» и кнопка помещаются
   в одну строку. На более узких экранах заголовку разрешаем перенос — иначе
   кнопка фиксированной ширины выталкивает страницу за вьюпорт.
*/
@media (max-width: 359px) {
    .article-news-block__title {
        white-space: normal;
    }
}
