/* =========================================================
   news
   Header / Footer НЕ ТРОГАЕМ
   ========================================================= */

.news-page {
    background: #f8f8fa;
    color: var(--text, #111122);

    padding: 32px 0 68px;
}

.news-page__container {
    width: min(calc(100% - 48px), 1520px);
    margin: 0 auto;
}


/* =========================================================
   TITLE
   ========================================================= */

.news-page__title {
    margin: 0 0 12px;

    color: var(--green, #23716d);

    font-family: 'Inter', sans-serif;
    font-size: 72px;
    line-height: 1.2;
    font-weight: 700;
}


/* =========================================================
   CATEGORIES
   ========================================================= */

.news-categories {
    display: flex;
    align-items: center;

    gap: 16px;

    height: 48px;

    margin-bottom: 20px;
}

.news-categories__item {
    width: 280px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 10px;

    border: 1px solid var(--green, #23716d);
    border-radius: 12px;

    color: var(--green, #23716d);
    background: transparent;

    font-family: 'Inter', sans-serif;
    font-size: 18px;
    line-height: normal;
    font-weight: 500;

    cursor: pointer;

    box-sizing: border-box;
}

.news-categories__item--active {
    border-color: transparent;

    background: rgba(35, 113, 109, .1);
}


/* =========================================================
   GRID
   ========================================================= */

.news-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(0, 1fr);


    gap: 20px;
}


/* =========================================================
   COLUMN
   ========================================================= */

.news-column {
    display: flex;
    flex-direction: column;

    gap: 20px;

    min-width: 0;
}


/* =========================================================
   CARD
   ========================================================= */
.news-card--horizontal .news-card__date--mobile {
    display: none;
}

.news-card--horizontal .news-card__content > .news-card__date {
    display: flex;

    position: absolute;

    left: 24px;
    top: 24px;

    padding: 10px;

    border-radius: 1000px;

    color: #111122;
    background: rgba(255, 255, 255, .9);

    font-family: 'Inter', sans-serif;
    font-size: 18px;
    line-height: 1;
}

.news-card {
    position: relative;

    min-width: 0;
    min-height: 0;

    overflow: hidden;

    border-radius: 32px;

    background: #fff;
}

.news-card__link {
    position: relative;

    width: 100%;
    height: 100%;

    display: block;

    color: inherit;
    text-decoration: none;
}


/* =========================================================
   LARGE CARD
   ========================================================= */

.news-card--large {
    background: rgba(35, 113, 109, .1);
}

.news-card--large .news-card__image {
    position: absolute;

    left: 50%;
    top: -66px;

    width: 768px;
    height: 960px;

    transform: translateX(-50%);
}

.news-card--large .news-card__image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}

.news-card__overlay {
    position: absolute;

    inset: 0;

    background: rgba(0, 0, 0, .2);
}

.news-card--large .news-card__title {
    position: absolute;

    left: 30px;
    bottom: 30px;

    z-index: 2;

    margin: 0;

    color: #fff;

    font-family: 'Inter', sans-serif;
    font-size: 28px;
    line-height: 1;
    font-weight: 500;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.news-card--large .news-card__date {
    position: absolute;

    left: 24px;
    top: 24px;

    z-index: 3;
}


/* =========================================================
   DATE
   ========================================================= */

.news-card__date {
    display: flex;
    align-items: center;
    justify-content: center;

    width: max-content;

    padding: 10px;

    border-radius: 1000px;

    color: #111122;

    background: rgba(255, 255, 255, .9);

    font-family: 'Inter', sans-serif;
    font-size: 18px;
    line-height: 1;
    font-weight: 400;

    box-sizing: border-box;
}


/* =========================================================
   HORIZONTAL CARD
   ========================================================= */

.news-card--horizontal {
    height: 230px;

    flex: 1 1 230px;
}

.news-card--horizontal .news-card__link {
    display: flex;
    align-items: stretch;
}

.news-card--horizontal .news-card__content {
    position: relative;

    width: calc(100% - 329px);

    height: 100%;

    padding: 24px;

    box-sizing: border-box;
}

.news-card--horizontal .news-card__date {
    position: absolute;

    left: 24px;
    top: 24px;

    padding: 10px;

    backdrop-filter: blur(5px);

    background: rgba(255, 255, 255, .1);

    border: 1px solid rgba(17, 17, 34, .05);
}

.news-card--horizontal .news-card__title {
    position: absolute;

    left: 24px;
    bottom: 24px;

    width: 267px;

    margin: 0;

    color: #111122;

    font-family: 'Inter', sans-serif;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 400;
}

.news-card--horizontal .news-card__image {
    width: 329px;
    height: 230px;

    flex-shrink: 0;

    overflow: hidden;

    border-radius: 32px;
}

.news-card--horizontal .news-card__image img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
}


/* =========================================================
   MOBILE "SHOW MORE"
   ========================================================= */

.news-more {
    display: none;

    width: 280px;
    height: 48px;

    margin: 24px auto 0;

    border: 1px solid #23716d;
    border-radius: 12px;

    color: #23716d;
    background: transparent;

    font-family: 'Inter', sans-serif;
    font-size: 18px;
    line-height: normal;
    font-weight: 500;

    cursor: pointer;
}


/* =========================================================
   CHAT
   ========================================================= */

.news-chat {
    position: fixed;

    right: 30px;
    bottom: 48px;

    z-index: 100;

    width: 120px;
    height: 120px;

    padding: 0;

    border: 0;
    border-radius: 50%;

    background: rgba(35, 113, 109, .18);

    cursor: pointer;
}

.news-chat::before {
    content: '';

    position: absolute;

    inset: 10px;

    border: 8px solid rgba(35, 113, 109, .3);

    border-radius: 50%;
}

.news-chat__button {
    position: absolute;

    left: 24px;
    top: 24px;

    width: 72px;
    height: 72px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #23716d;
}

.news-chat__icon {
    position: relative;

    width: 40px;
    height: 40px;
}

.news-chat__icon::before {
    content: '';

    position: absolute;

    left: 4px;
    top: 5px;

    width: 30px;
    height: 24px;

    border: 2px solid #fff;
    border-radius: 7px;
}

.news-chat__icon::after {
    content: '';

    position: absolute;

    left: 9px;
    top: 26px;

    width: 8px;
    height: 8px;

    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;

    transform: skewY(-30deg);
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 1199px) {

    .news-page__container {
        width: min(calc(100% - 40px), 1000px);
    }

    .news-page__title {
        font-size: 56px;
    }

    .news-categories__item {
        width: 220px;
    }

    .news-grid {
        grid-template-rows: 360px 360px;
    }

    .news-card--large .news-card__image {
        width: 600px;
        height: 750px;
    }

    .news-card--horizontal {
        height: 170px;
    }

    .news-card--horizontal .news-card__image {
        width: 240px;
        height: 170px;
    }

    .news-card--horizontal .news-card__content {
        width: calc(100% - 240px);
    }

    .news-card--horizontal .news-card__title {
        width: 210px;

        font-size: 22px;
    }

    .news-card--horizontal .news-card__date {
        font-size: 14px;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767px) {

    .news-page {
        padding: 24px 0 32px;
    }

    .news-page__container {
        width: calc(100% - 32px);
    }


    /* TITLE */

    .news-page__title {
        margin: 0 0 16px;

        font-size: 36px;
        line-height: 1.2;
    }


    /* CATEGORIES */

    .news-categories {
        width: calc(100vw - 32px);

        height: 48px;

        margin-left: 0;
        margin-bottom: 16px;

        gap: 8px;

        overflow-x: auto;
        overflow-y: hidden;

        scrollbar-width: none;
    }

    .news-categories::-webkit-scrollbar {
        display: none;
    }

    .news-categories__item {
        flex: 0 0 auto;

        width: auto;
        min-width: 70px;

        height: 48px;

        padding: 10px;

        font-size: 18px;

        white-space: nowrap;
    }


    /* GRID */

    .news-grid {
        display: flex;
        flex-direction: column;

        gap: 16px;

        height: auto;
    }

    .news-column {
        display: contents;
    }


    /* MOBILE CARD */

    .news-card {
        width: 100%;

        height: auto;
        min-height: 0;

        flex: none;

        border-radius: 24px;

        background: #fff;
    }

    .news-card__link {
        height: auto;

        display: flex;
        flex-direction: column;

        gap: 12px;

        padding: 16px;

        box-sizing: border-box;
    }


    /* IMAGE */

    .news-card--large .news-card__image,
    .news-card--horizontal .news-card__image {
        position: relative;

        left: auto;
        top: auto;

        width: 100%;
        height: 230px;

        flex: none;

        transform: none;

        overflow: hidden;

        border-radius: 16px;
    }

    .news-card--large .news-card__image img,
    .news-card--horizontal .news-card__image img {
        width: 100%;
        height: 100%;

        object-fit: cover;
    }


    /* RESET LARGE CARD */

    .news-card--large .news-card__title,
    .news-card--horizontal .news-card__title {
        position: relative;

        left: auto;
        bottom: auto;

        width: auto;

        margin: 0;

        order: 2;

        color: #111122;

        font-size: 18px;
        line-height: 1.2;
        font-weight: 400;
        text-shadow: none;
    }


    /* DATE */

    .news-card--large .news-card__date,
    .news-card--horizontal .news-card__date {
        position: absolute;

        left: 24px;
        top: 24px;

        z-index: 5;

        padding: 10px;

        font-size: 16px;

        backdrop-filter: blur(5px);

        background: rgba(255, 255, 255, .1);

        border: 0;
    }


    /* HORIZONTAL CONTENT */

    .news-card--horizontal .news-card__content {
        position: static;

        width: auto;
        height: auto;

        padding: 0;

        /* .title лежит ВНУТРИ .content, а не является прямым ребёнком
           .news-card__link — order на самом .title ничего не даёт (order
           работает только для прямых flex-детей). Поэтому order ставим
           здесь, на обёртке: дата внутри .content на мобильной уже
           скрыта (см. правило __content > __date выше), так что
           визуально это даёт ровно то же — заголовок уезжает под фото,
           как и у --large карточек. */
        order: 2;
    }

    .news-card--horizontal .news-card__image {
        order: 1;
    }


    /* LARGE */

    .news-card--large .news-card__link {
        position: relative;
    }

    .news-card--large .news-card__overlay {
        display: none;
    }


    /* PAGINATION */

    .content-pagination {
        display: none;
    }


    /* SHOW MORE */

    .news-more {
        display: flex;
        align-items: center;
        justify-content: center;
    }


    /* CHAT */

    .news-chat {
        display: none;
    }

    .news-card--horizontal .news-card__content > .news-card__date {
        display: none;
    }

    .news-card--horizontal .news-card__image {
        position: relative;
    }

    .news-card--horizontal .news-card__image .news-card__date--mobile {
        display: flex;

        position: absolute;

        left: 8px;
        top: 8px;

        z-index: 5;

        width: max-content;

        padding: 10px;

        border-radius: 1000px;

        color: #111122;
        background: rgba(255, 255, 255, .9);

        font-family: 'Inter', sans-serif;
        font-size: 16px;
        line-height: 1;
    }
}