/* ===== Новости ===== */
body.news-page {
    padding-top: 88px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.news-title-section {
    padding: 28px 0 8px;
    text-align: center;
}

.news-main-title {
    margin: 0;
    color: #431c72;
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.news-shop {
    padding: 12px 0 70px;
}

.news-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px 20px;
    margin-bottom: 22px;
}

.news-period,
.news-limit {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.news-toolbar__limit {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.news-toolbar__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(67, 28, 114, 0.65);
    white-space: nowrap;
}

.news-chip {
    box-sizing: border-box;
    min-height: 36px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(67, 28, 114, 0.18);
    background: #fff;
    color: #431c72;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.news-chip--num {
    min-width: 48px;
    padding: 8px 10px;
}

.news-chip:hover {
    border-color: rgba(67, 28, 114, 0.4);
    box-shadow: 0 4px 12px rgba(67, 28, 114, 0.1);
}

.news-chip.is-active {
    background: #431c72;
    border-color: #431c72;
    color: #fff;
    box-shadow: 0 6px 16px rgba(67, 28, 114, 0.28);
}

.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: stretch;
}

.news-card {
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(67, 28, 114, 0.06);
    box-shadow: 0 10px 40px rgba(67, 28, 114, 0.1);
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow 0.35s ease;
}

.news-card:hover {
    box-shadow: 0 16px 44px rgba(67, 28, 114, 0.16);
}

.news-card[hidden] {
    display: none !important;
}

/* Кадр как у фото в посте ВК: 1400×933 */
.news-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 1400 / 933;
    overflow: hidden;
    background: #ececec;
}

.news-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-card__views {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 11;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: calc(100% - 20px);
    padding: 5px 7px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(168, 168, 176, 0.92);
    cursor: default;
    pointer-events: auto;
    line-height: 1;
}

.news-card__views svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
    opacity: 0.85;
    pointer-events: none;
}

.news-card__views-count {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(120, 120, 128, 0.95);
    transition: max-width 0.22s ease, opacity 0.22s ease;
}

.news-card__views:hover,
.news-card__views:focus-visible,
.news-card__views.is-open {
    background: rgba(255, 255, 255, 0.82);
    color: rgba(130, 130, 138, 0.98);
    outline: none;
}

.news-card__image.is-missing {
    opacity: 0;
}

.news-card__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: 8px;
    padding: 18px 18px 20px;
}

.news-card__date {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: rgba(67, 28, 114, 0.65);
}

.news-card__title {
    margin: 0;
    color: #431c72;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    min-height: calc(1.35em * 2);
}

.news-card__title a {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    color: inherit;
    text-decoration: none;
}

.news-card__title a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.news-intro {
    max-width: 720px;
    margin: 12px auto 0;
    color: rgba(67, 28, 114, 0.78);
    font-size: 14px;
    font-weight: 300;
    line-height: 1.55;
    text-align: center;
}

.news-article {
    padding: 28px 0 40px;
}

.news-article__title {
    margin: 0 0 10px;
    color: #431c72;
    font-size: clamp(24px, 3.4vw, 34px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0.02em;
    text-align: center;
}

.news-article__date {
    display: block;
    margin-bottom: 22px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: rgba(67, 28, 114, 0.65);
}

.news-article__card {
    max-width: 860px;
    margin: 0 auto;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(67, 28, 114, 0.06);
    box-shadow: 0 10px 40px rgba(67, 28, 114, 0.1);
}

.news-article__content {
    padding: 22px 26px 28px;
}

.news-article__content p {
    margin: 0 0 14px;
    color: #444;
    font-size: 15px;
    font-weight: 300;
    line-height: 1.65;
}

.news-article__content p:last-child {
    margin-bottom: 0;
}

.news-article__back {
    display: inline-block;
    margin: 22px 0 0;
    color: #431c72;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.news-article__back:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.news-related {
    padding: 0 0 70px;
}

.news-related__title {
    margin: 0 0 20px;
    color: #431c72;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.news-related-carousel {
    --news-related-gap: 16px;
    --news-related-visible: 2;
    display: grid;
    grid-template-columns: 1fr auto auto 1fr;
    grid-template-areas:
        "viewport viewport viewport viewport"
        ". prev next .";
    align-items: center;
    justify-items: center;
    column-gap: 12px;
    row-gap: 16px;
}

.news-related-carousel__viewport {
    grid-area: viewport;
    width: 100%;
    min-width: 0;
}

.news-related-carousel__track {
    display: flex;
    gap: var(--news-related-gap);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.news-related-carousel__track::-webkit-scrollbar {
    display: none;
}

.news-related-carousel__track > .news-card {
    flex: 0 0 calc((100% - (var(--news-related-visible) - 1) * var(--news-related-gap)) / var(--news-related-visible));
    max-width: calc((100% - (var(--news-related-visible) - 1) * var(--news-related-gap)) / var(--news-related-visible));
    min-width: 0;
    scroll-snap-align: start;
    height: auto;
    box-shadow: none;
}

.news-related-carousel__track > .news-card:hover {
    box-shadow: none;
}

.news-related-carousel .news-card__body {
    flex: 1 1 auto;
}

.news-related-carousel .news-card__text {
    margin-top: auto;
}

.news-related-carousel .news-card__more {
    font-size: 11px;
    margin-top: 6px;
}

.news-related-carousel.is-static {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "viewport";
}

.news-related-carousel.is-static .news-related-carousel__track {
    justify-content: center;
    overflow: hidden;
}

.news-related-carousel__btn {
    box-sizing: border-box;
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(67, 28, 114, 0.18);
    background: #fff;
    color: #431c72;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(67, 28, 114, 0.12);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.news-related-carousel__btn--prev {
    grid-area: prev;
    justify-self: end;
}

.news-related-carousel__btn--next {
    grid-area: next;
    justify-self: start;
}

.news-related-carousel__btn svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.news-related-carousel__btn:hover:not(:disabled) {
    border-color: #431c72;
    background: #431c72;
    color: #fff;
    box-shadow: 0 8px 20px rgba(67, 28, 114, 0.28);
}

.news-related-carousel__btn:disabled {
    opacity: 0.35;
    cursor: default;
    box-shadow: none;
}

.news-related-carousel__btn[hidden] {
    display: none !important;
}

@media (max-width: 379px) {
    .news-related-carousel {
        --news-related-visible: 1;
    }
}

@media (min-width: 480px) {
    .news-related-carousel {
        --news-related-gap: 18px;
    }
}

@media (min-width: 769px) {
    .news-related-carousel {
        --news-related-visible: 3;
        --news-related-gap: 24px;
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        grid-template-areas: "prev viewport next";
        column-gap: 16px;
        row-gap: 0;
    }

    .news-related-carousel__btn--prev,
    .news-related-carousel__btn--next {
        justify-self: center;
    }
}

@media (min-width: 1200px) {
    .news-related-carousel {
        --news-related-visible: 4;
        --news-related-gap: 28px;
    }
}

.news-card__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-top: auto;
}

.news-card__excerpt {
    margin: 0;
    color: #555;
    font-size: 12px;
    font-weight: 200;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    min-height: calc(1.5em * 3);
}

.news-card__text.is-expanded .news-card__excerpt {
    display: block;
    -webkit-box-orient: initial;
    -webkit-line-clamp: none;
    line-clamp: none;
    overflow: visible;
    max-height: none;
}

.news-card__more {
    background: none;
    color: #431c72;
    border: none;
    padding: 0;
    margin-top: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    -webkit-user-select: none;
    user-select: none;
}

.news-card__more:hover {
    color: #5a2d8f;
}

.news-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
}

.news-page-btn {
    box-sizing: border-box;
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(67, 28, 114, 0.18);
    background: #fff;
    color: #431c72;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.news-page-btn:hover:not(:disabled):not(.is-active) {
    border-color: rgba(67, 28, 114, 0.4);
    box-shadow: 0 4px 12px rgba(67, 28, 114, 0.12);
}

.news-page-btn--nav {
    font-size: 22px;
    font-weight: 500;
}

.news-page-btn.is-active {
    background: #431c72;
    border-color: #431c72;
    color: #fff;
    box-shadow: 0 6px 16px rgba(67, 28, 114, 0.28);
}

.news-page-btn:disabled {
    opacity: 0.35;
    cursor: default;
    box-shadow: none;
}

.news-empty {
    margin: 40px 0 10px;
    text-align: center;
    color: rgba(67, 28, 114, 0.7);
    font-size: 15px;
}

.news-empty[hidden] {
    display: none !important;
}

body.news-reader-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
}

.news-reader {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: none;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    overflow: hidden;
}

.news-reader.is-open {
    display: block;
}

.news-reader[hidden] {
    display: none !important;
}

.news-reader__close {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 20001;
    width: 50px;
    height: 50px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #431c72;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(67, 28, 114, 0.28);
}

.news-reader__close:hover {
    background: #5a2d8f;
}

.news-reader__close svg {
    width: 26px;
    height: 26px;
    stroke: #fff;
    pointer-events: none;
}

.news-reader__inner {
    height: 100%;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    padding: 72px 32px 48px;
}

.news-reader__panel {
    max-width: 860px;
    margin: 0 auto;
}

.news-reader__panel .news-article__title {
    text-align: left;
}

.news-reader__panel .news-article__date {
    text-align: left;
}

@media (min-width: 640px) {
    .news-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }
}

@media (min-width: 992px) {
    .news-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 28px;
    }
}

@media (min-width: 1200px) {
    .news-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    body.news-page {
        padding-top: 64px;
    }

    .news-reader,
    .news-reader.is-open {
        display: none !important;
    }

    .news-title-section {
        padding: 20px 0 4px;
    }

    .news-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .news-period {
        flex-wrap: nowrap;
        width: 100%;
        gap: 3px;
        padding: 3px;
        border-radius: 999px;
        background: #fff;
        border: 1px solid rgba(67, 28, 114, 0.12);
        box-shadow: 0 8px 24px rgba(67, 28, 114, 0.06);
    }

    .news-period .news-chip {
        flex: 1 1 0;
        min-width: 0;
        min-height: 36px;
        padding: 0 4px;
        font-size: 11px;
        border: 0;
        box-shadow: none;
        background: transparent;
        white-space: nowrap;
        -webkit-tap-highlight-color: transparent;
    }

    .news-period .news-chip:hover {
        border-color: transparent;
        box-shadow: none;
    }

    .news-period .news-chip.is-active {
        background: #431c72;
        color: #fff;
        box-shadow: 0 4px 12px rgba(67, 28, 114, 0.22);
    }

    .news-toolbar__limit {
        margin-left: 0;
        justify-content: space-between;
    }
}

@media (max-width: 380px) {
    .news-period .news-chip {
        font-size: 10px;
        min-height: 34px;
        padding: 0 2px;
    }

    .news-card__body {
        padding: 16px;
    }

    .news-article__content {
        padding: 16px 16px 20px;
    }

    .news-article__title {
        text-align: left;
    }

    .news-article__date,
    .news-intro {
        text-align: left;
    }
}
