/* Цветовая палитра по техническому заданию */
:root {
    --primary-color: #1b305b;   /* Основной синий цвет */
    --secondary-color: #26a9ab; /* Фирменный изумрудный цвет */
    --text-dark: #1b305b;
    --text-light: #ffffff;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth;
}

body {
    color: var(--text-dark);
    line-height: 1.6;
    background-color: #ffffff;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.hidden {
    display: none !important;
}

/* Шапка сайта */
header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Якоря разделов: компенсируем высоту липкой шапки (≈90px: логотип 70px +
   паддинги 2×10px) плюс «воздух», чтобы заголовок не прилипал к шапке. */
#about,
#directions,
#members,
#our-members,
#documents,
#news,
#expert,
#contacts {
    scroll-margin-top: 110px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

.logo-img {
    height: 70px;
    width: auto;
    display: block;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

nav ul a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    transition: color 0.3s;
}

nav ul a:hover {
    color: var(--secondary-color);
}

.lang-switcher {
    display: flex;
    gap: 5px;
}

.lang-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    color: var(--text-dark);
}

.lang-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.lang-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Первый экран (Карусель) */
.carousel-container {
    position: relative;
    width: 100%;
    /* Держим пропорции фоновой картинки (16:9): логотип и заголовок видны целиком и не пересекаются с текстом слайдов */
    aspect-ratio: 16 / 9;
    min-height: 420px;
    max-height: 700px;
    overflow: hidden;
    background: url('../images/фон для карусели.png') no-repeat center top / cover;
}

@media (max-width: 768px) {
    .carousel-container {
        aspect-ratio: auto;
        /* Высота = реальная высота картинки по ширине экрана (56.25vw = 9/16) + зона под текст слайда */
        height: calc(56.25vw + 300px);
        /* Картинка показывается целиком, без обрезки */
        background-size: contain;
        background-position: center top;
        /* Заливка под картинкой совпадает с её фоном, чтобы стык был незаметен */
        background-color: var(--primary-color);
    }

    /* Текст слайда уменьшаем и помещаем в зону под изображением */
    .slide {
        padding: 0 16px 24px 16px;
    }
    .slide-content {
        max-width: 100%;
        padding: 20px;
    }
    /* На мобильных плашка всегда центрируется по ширине,
       вертикальное положение (align-items) сохраняется. */
    .slide[class*="banner-position-"] {
        justify-content: center;
    }
    .slide[class*="banner-position-"] .slide-content {
        text-align: center;
    }
    .slide[class*="banner-position-"] .hero-btns {
        justify-content: center;
    }
    .slide h2 {
        font-size: 24px;
        margin-bottom: 14px;
    }
    .slide p {
        font-size: 14px;
        margin-bottom: 18px;
    }
    .hero-btns {
        flex-direction: column;
        gap: 12px;
    }
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: flex-end; 
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    padding: 0 20px 35px 20px;
}

.slide-content {
    max-width: 850px;
    background: rgba(27, 48, 91, 0.4);
    padding: 40px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

/* ----------------------------------------------------------
   Расположение текстовой плашки на баннере.
   Класс banner-position-* управляет flex-выравниванием .slide:
   justify-content — по горизонтали, align-items — по вертикали.
   ---------------------------------------------------------- */
.banner-position-center        { justify-content: center;     align-items: center; }
.banner-position-top           { justify-content: center;     align-items: flex-start; }
.banner-position-bottom        { justify-content: center;     align-items: flex-end; }
.banner-position-left          { justify-content: flex-start; align-items: center; }
.banner-position-right         { justify-content: flex-end;   align-items: center; }
.banner-position-top-left      { justify-content: flex-start; align-items: flex-start; }
.banner-position-top-center    { justify-content: center;     align-items: flex-start; }
.banner-position-top-right     { justify-content: flex-end;   align-items: flex-start; }
.banner-position-center-left   { justify-content: flex-start; align-items: center; }
.banner-position-center-right  { justify-content: flex-end;   align-items: center; }
.banner-position-bottom-left   { justify-content: flex-start; align-items: flex-end; }
.banner-position-bottom-center { justify-content: center;     align-items: flex-end; }
.banner-position-bottom-right  { justify-content: flex-end;   align-items: flex-end; }

/* Текст внутри плашки выравниваем по её горизонтальному положению. */
.banner-position-left .slide-content,
.banner-position-top-left .slide-content,
.banner-position-center-left .slide-content,
.banner-position-bottom-left .slide-content { text-align: left; }
.banner-position-right .slide-content,
.banner-position-top-right .slide-content,
.banner-position-center-right .slide-content,
.banner-position-bottom-right .slide-content { text-align: right; }
.banner-position-left .hero-btns,
.banner-position-top-left .hero-btns,
.banner-position-center-left .hero-btns,
.banner-position-bottom-left .hero-btns { justify-content: flex-start; }
.banner-position-right .hero-btns,
.banner-position-top-right .hero-btns,
.banner-position-center-right .hero-btns,
.banner-position-bottom-right .hero-btns { justify-content: flex-end; }

.slide h2 {
    font-size: 42px;
    margin-bottom: 25px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.slide p {
    font-size: 18px;
    margin-bottom: 35px;
    opacity: 0.95;
}

.hero-btns {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn {
    padding: 14px 32px;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: inline-block;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #122143;
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background-color: rgba(255,255,255,0.2);
}

/* Кнопки стрелок */
.carousel-btn {
    position: absolute;
    top: 75%;
    transform: translateY(-50%);
    background: rgba(27, 48, 91, 0.6);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
}
.carousel-btn:hover { background: var(--primary-color); }
.prev { left: 20px; }
.next { right: 20px; }

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}
.dot {
    width: 12px;
    height: 12px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
}
.dot.active { background: var(--secondary-color); }

/* Секции */
section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    font-size: 32px;
    margin-bottom: 45px;
    color: var(--primary-color);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 70px;
    height: 4px;
    background-color: var(--secondary-color);
    margin: 12px auto 0 auto;
    border-radius: 2px;
}

/* Блок Направления + Новость */
.combined-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 992px) {
    .combined-grid { grid-template-columns: 1fr; }
}

.directions-left-layout {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dir-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.direction-item-card {
    background-color: var(--primary-color);
    color: white;
    padding: 25px 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 110px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s;
    flex: 1 1 200px;
    max-width: 250px;
}
.direction-item-card:hover { transform: translateY(-3px); }

.side-news-panel {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
}

.side-news-panel h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 18px;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 8px;
}

.news-date {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 5px;
    display: block;
}

/* Блок Участники (Елочка) */
.members-section {
    background-color: var(--bg-light);
}

/* Секция «Наши участники» — белый фон, чтобы отделить от серого блока выше */
.our-members-section {
    background-color: #ffffff;
}

/* Счётчик реального числа участников под заголовком секции */
.members-count {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--secondary-color);
    margin: -10px 0 25px;
}

.pyramid-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 1000px;
    margin: 0 auto 40px auto;
}

.pyramid-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.member-item-card {
    background: #ffffff;
    color: var(--primary-color);
    padding: 18px 25px;
    border-radius: 6px;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    border: 1px solid var(--border-color);
    flex: 1;
    min-width: 220px;
    max-width: 240px;
}

/* Блок Для чего мы объединились */
.goals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.goal-card {
    border-left: 4px solid var(--secondary-color);
    padding-left: 20px;
}

.goal-card h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 20px;
}

/* Информационные панели */
.info-panels-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .info-panels-grid { grid-template-columns: 1fr; }
}

.info-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    min-height: 200px;
}

.info-card h3 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 22px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.placeholder-text {
    color: #64748b;
    font-style: italic;
    padding: 20px 0;
}

/* Двухколоночный блок обратной связи */
.contacts-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 850px) {
    .contacts-grid { grid-template-columns: 1fr; }
}

.contacts-left-panel {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.contact-tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 5px;
}

.contact-tab-btn {
    background: none;
    border: none;
    padding: 10px 15px;
    font-size: 16px;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.contact-tab-btn.active {
    color: var(--primary-color);
}

.contact-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--secondary-color);
}

.contact-tab-content {
    display: none;
}

.contact-tab-content.active {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 15px;
    color: var(--text-dark);
    outline: none;
}
.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(38,169,171,0.1);
}

/* Сообщение о статусе отправки формы (этап без backend) */
.form-status {
    margin-top: 15px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    background-color: rgba(38, 169, 171, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--secondary-color);
    display: none;
}
.form-status.visible {
    display: block;
}
.form-status.success {
    background-color: rgba(38, 169, 171, 0.1);
    color: var(--primary-color);
    border-color: var(--secondary-color);
}
.form-status.error {
    background-color: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
    border-color: #dc2626;
}

/* Карточки новостей, загруженных из API (блок «Новости и события») */
.api-news-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}
.api-news-item:last-child {
    border-bottom: none;
}
.api-news-image {
    display: block;
    width: 100%;
    max-height: 160px;
    object-fit: cover;
    border-radius: 8px;
    margin: 8px 0;
}
.api-news-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--primary-color);
    margin-bottom: 6px;
    /* Заголовок всегда виден: без обрезки/клампа, длинные слова переносятся */
    overflow-wrap: anywhere;
}
.api-news-text {
    font-size: 13px;
    color: #475569;
}

/* Правая колонка: Внешние ресурсы */
.external-resources-panel {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
}

.external-resources-panel h3 {
    color: var(--primary-color);
    font-size: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 8px;
}

.icons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.icon-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 10px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    text-align: center;
}

.icon-link:hover {
    transform: translateY(-3px);
    border-color: var(--secondary-color);
    box-shadow: 0 4px 12px rgba(38, 169, 171, 0.15);
    color: var(--secondary-color);
}

.icon-link svg {
    width: 42px;
    height: 42px;
    fill: var(--primary-color);
    margin-bottom: 12px;
    transition: fill 0.3s;
}

.icon-link:hover svg { fill: var(--secondary-color); }

/* Подвал */
footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 30px 0 0;
    font-size: 14px;
    border-top: 4px solid var(--primary-color);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    padding-bottom: 26px;
    text-align: left;
}
.footer-col h4 {
    color: #fff;
    font-size: 16px;
    margin-bottom: 12px;
}
.footer-col p {
    line-height: 1.6;
    margin: 0 0 6px;
}
.footer-contacts a {
    color: #cbd5e1;
    text-decoration: none;
}
.footer-contacts a:hover {
    text-decoration: underline;
}
.footer-bottom {
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    padding: 16px 0;
    text-align: center;
}
.footer-bottom p {
    margin: 0;
}
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

/* ============================================================
   Кликабельные новости на главной + кнопка «Подробнее»
   ============================================================ */
.api-news-item.clickable,
.side-news-panel.clickable {
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}
.api-news-item.clickable:hover,
.side-news-panel.clickable:hover {
    background-color: #eef6f6;
}
.api-news-more {
    margin-top: 8px;
}

/* Единая текстовая ссылка карточек (новости, экспертный центр и т. п.).
   Лёгкая ссылка вместо тяжёлых кнопок, со стрелкой и единым цветом. */
.article-link {
    display: inline-block;
    align-self: flex-start;
    max-width: 100%;
    padding: 0;
    background: none;
    border: 0;
    font-size: 14px;
    font-weight: 600;
    color: #26a9ab;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s;
}
.article-link::after {
    content: '\00a0\2192';
}
.article-link:hover,
.article-link:focus {
    color: #1b305b;
    text-decoration: none;
}
.news-show-more {
    display: inline-block;
    margin-top: 14px;
    font-size: 14px;
    padding: 8px 18px;
}
.news-all-wrap {
    text-align: center;
    margin-top: 16px;
}
.news-all-btn {
    display: inline-block;
    padding: 10px 22px;
    background-color: #1b305b;
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s;
}
.news-all-btn:hover {
    background-color: #26a9ab;
    color: #fff;
}

/* ============================================================
   Страница просмотра новости (news-detail.html)
   ============================================================ */
.news-detail-section {
    padding: 40px 0 60px;
}
.news-back-btn {
    display: inline-block;
    margin-bottom: 25px;
}
.news-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 40px;
    align-items: start;
}
.news-article {
    min-width: 0;
}

/* Правая лента: другие новости */
.news-sidebar {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 20px;
    position: sticky;
    top: 20px;
}
.news-sidebar-title {
    font-size: 18px;
    color: var(--primary-color);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--secondary-color);
}
.news-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.news-sidebar-item {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
    transition: opacity 0.2s;
}
.news-sidebar-list .news-sidebar-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.news-sidebar-item:hover {
    opacity: 0.8;
}
.news-sidebar-thumb {
    width: 72px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.news-sidebar-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.news-sidebar-date {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
}
.news-sidebar-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1.4;
}
.news-sidebar-empty {
    font-size: 14px;
    color: #64748b;
}
.news-sidebar-all-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-top: 4px;
    padding: 10px 16px;
    background-color: #1b305b;
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s;
}
.news-sidebar-all-btn:hover {
    background-color: #26a9ab;
    color: #fff;
}

@media (max-width: 900px) {
    .news-detail-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .news-sidebar {
        position: static;
    }
}
.news-article-date {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 10px;
}
.news-article-title {
    font-size: 30px;
    line-height: 1.3;
    color: var(--primary-color);
    margin-bottom: 20px;
}
.news-article-image {
    display: block;
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 25px;
}
.news-state {
    text-align: center;
    color: #64748b;
    font-size: 18px;
    padding: 60px 0;
}

/* Типографика санитизированного HTML внутри текста новости */
.news-content {
    font-size: 16px;
    line-height: 1.75;
    color: #334155;
}
.news-content h2 {
    font-size: 24px;
    color: var(--primary-color);
    margin: 28px 0 12px;
}
.news-content h3 {
    font-size: 20px;
    color: var(--primary-color);
    margin: 22px 0 10px;
}
.news-content p {
    margin: 0 0 16px;
}
.news-content ul,
.news-content ol {
    margin: 0 0 16px;
    padding-left: 26px;
}
.news-content li {
    margin-bottom: 8px;
}
.news-content blockquote {
    margin: 0 0 16px;
    padding: 12px 20px;
    border-left: 4px solid var(--secondary-color);
    background: var(--bg-light);
    color: #475569;
    font-style: italic;
}
.news-content a {
    color: var(--secondary-color);
    text-decoration: underline;
}
.news-content a:hover {
    color: var(--primary-color);
}
.news-content strong,
.news-content b {
    font-weight: 700;
}
.news-content em,
.news-content i {
    font-style: italic;
}

@media (max-width: 600px) {
    .news-article-title {
        font-size: 24px;
    }
    .news-content {
        font-size: 15px;
    }
}

/* ============================================================
   Участники Союза — карточки, сетка, фильтры, страница
   ============================================================ */
.members-grid {
    margin-top: 10px;
}
.members-grid-inner {
    display: grid;
    /* minmax(0, 1fr) не даёт колонкам распирать сетку из-за длинного контента. */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}
.member-card {
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 18px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.member-card:hover {
    transform: translateY(-3px);
    border-color: var(--secondary-color);
    box-shadow: 0 6px 18px rgba(38, 169, 171, 0.12);
}
.member-logo {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}
.member-logo img {
    max-height: 70px;
    max-width: 100%;
    object-fit: contain;
}
.member-name {
    min-width: 0;
    font-weight: 700;
    font-size: 15px;
    color: var(--primary-color);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.member-meta {
    font-size: 12px;
    color: var(--secondary-color);
    margin-bottom: 8px;
}
.member-desc {
    font-size: 13px;
    color: #475569;
    margin-bottom: 12px;
    /* Описание — максимум 2 строки с многоточием; полный текст в title.
       min-width: 0 + overflow не дают тексту распирать колонку сетки. */
    min-width: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.member-desc-empty {
    color: #94a3b8;
    font-style: italic;
}
.member-link {
    align-self: flex-start;
    /* Прижимаем ссылку к низу карточки, чтобы карточки были выровнены. */
    margin-top: auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary-color);
    text-decoration: none;
}
.member-link:hover {
    text-decoration: underline;
}

.members-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-top: 24px;
    flex-wrap: wrap;
}

/* Публичная страница участников (members.html) */
.members-page-section {
    padding: 40px 0 60px;
}
.members-filters {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin: 20px 0 30px;
}
.members-search,
.members-select {
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-dark);
    background: #ffffff;
}
.members-search {
    flex: 1 1 280px;
}
.members-select {
    flex: 0 1 240px;
    cursor: pointer;
}
.members-search:focus,
.members-select:focus {
    outline: none;
    border-color: var(--secondary-color);
}
.members-empty {
    text-align: center;
    color: #64748b;
    font-size: 16px;
    padding: 40px 0;
}

@media (max-width: 1200px) {
    .members-grid-inner {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 768px) {
    .members-grid-inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 480px) {
    .members-grid-inner {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   ДОКУМЕНТЫ (главная + публичная страница documents.html)
   ============================================================ */
.documents-section {
    background-color: #f8fafc;
}
.documents-page-section {
    padding: 40px 0 60px;
}
.news-page-section {
    padding: 40px 0 60px;
}

/* Верхний блок: заголовок + описание + компактный поиск справа. */
.news-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px 28px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
.news-page-head-text {
    min-width: 0;
    flex: 1 1 320px;
}
.news-page-head .section-title {
    margin-bottom: 6px;
    text-align: left;
}
.news-page-subtitle {
    color: #64748b;
    font-size: 15px;
    max-width: 560px;
}
.news-page-search {
    flex: 0 1 320px;
}
.news-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
}
.news-search-input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* Featured-карточка (первая новость). */
.news-featured {
    margin-bottom: 28px;
}
.news-featured:empty {
    display: none;
}
.news-featured-card {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}
.news-featured-card:hover {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.10);
    transform: translateY(-2px);
}
.news-featured-card.no-image {
    grid-template-columns: 1fr;
}
.news-featured-media {
    min-height: 240px;
    background: #f1f5f9;
}
.news-featured-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.news-featured-body {
    min-width: 0;
    padding: 28px 30px;
    display: flex;
    flex-direction: column;
}
.news-featured-body .news-date {
    margin-bottom: 10px;
}
.news-featured-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.3;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}
.news-featured-text {
    font-size: 15px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 18px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-featured-body .article-link {
    margin-top: auto;
    font-size: 15px;
}

/* Сетка остальных новостей: 3 колонки на desktop. */
.news-page-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
.news-page-grid .empty-state,
.news-page-grid .unavailable-state {
    grid-column: 1 / -1;
}
.news-page-card {
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.news-page-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: var(--secondary-color);
}
.news-page-card .news-date {
    margin-bottom: 8px;
}
.news-page-card .api-news-image {
    width: 100%;
    height: 150px;
    max-height: none;
    object-fit: cover;
    border-radius: 8px;
    margin: 0 0 10px;
}
.news-page-card .api-news-title {
    font-size: 15px;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}
.news-page-card .api-news-text {
    font-size: 13px;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.news-page-card .api-news-more {
    margin-top: auto;
}

@media (max-width: 992px) {
    .news-page-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 768px) {
    .news-page-search {
        flex-basis: 100%;
    }
    .news-featured-card,
    .news-featured-card.no-image {
        grid-template-columns: 1fr;
    }
    .news-featured-media {
        min-height: 200px;
    }
    .news-featured-title {
        font-size: 20px;
    }
    .news-featured-body {
        padding: 22px 20px;
    }
}
@media (max-width: 600px) {
    .news-page-grid {
        grid-template-columns: 1fr;
    }
}
.documents-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 10px;
}
/* ============================================================
   Страница «Документы» (documents.html, .documents-page-section)
   ============================================================ */
.documents-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px 28px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}
.documents-page-head-text {
    min-width: 0;
    flex: 1 1 320px;
}
.documents-page-head .section-title {
    margin-bottom: 6px;
    text-align: left;
}
.docs-subtitle {
    color: #64748b;
    font-size: 15px;
    max-width: 560px;
}
.docs-filters {
    display: flex;
    gap: 12px;
    flex: 1 1 360px;
    max-width: 480px;
    flex-wrap: wrap;
}
.docs-search-input {
    flex: 1 1 200px;
    min-width: 0;
    box-sizing: border-box;
    padding: 11px 16px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
}
.docs-select {
    flex: 0 1 200px;
    box-sizing: border-box;
    padding: 11px 14px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}
.docs-search-input:focus,
.docs-select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.documents-page-section .documents-list {
    margin-top: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}
.documents-page-section .documents-list .empty-state,
.documents-page-section .documents-list .unavailable-state {
    grid-column: 1 / -1;
}
.documents-page-section .document-card {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    min-width: 0;
    height: 100%;
}
.documents-page-section .document-head {
    display: flex;
    align-items: center;
    gap: 12px;
}
.documents-page-section .document-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    font-size: 11px;
    background: rgba(27, 48, 91, 0.06);
    color: var(--primary-color);
}
.documents-page-section .document-category {
    margin-bottom: 0;
    padding: 0;
    background: none;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.documents-page-section .document-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}
.documents-page-section .document-desc {
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.documents-page-section .document-actions {
    margin-top: auto;
    width: auto;
}
.documents-page-section .document-download-btn {
    width: auto;
    align-self: flex-start;
}

@media (max-width: 992px) {
    .documents-page-section .documents-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 768px) {
    .docs-filters {
        flex-basis: 100%;
        max-width: none;
    }
}
@media (max-width: 600px) {
    .documents-page-section .documents-list {
        grid-template-columns: 1fr;
    }
}
.document-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.document-card:hover {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}
.document-icon {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: var(--secondary-color);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.document-body {
    flex: 1 1 auto;
    min-width: 0;
}
.document-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--secondary-color);
    background: rgba(37, 99, 235, 0.08);
    padding: 2px 10px;
    border-radius: 999px;
    margin-bottom: 8px;
}
.document-title {
    font-size: 17px;
    margin: 0 0 6px;
    color: var(--text-dark);
    line-height: 1.35;
}
.document-desc {
    font-size: 14px;
    color: #475569;
    margin: 0 0 10px;
    line-height: 1.5;
}
.document-meta {
    font-size: 13px;
    color: #64748b;
}
.document-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}
.document-download-btn {
    display: inline-block;
    padding: 9px 16px;
    background: var(--secondary-color);
    color: #ffffff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease;
}
.document-download-btn:hover {
    background: var(--primary-color);
}
.document-no-file {
    font-size: 13px;
    color: #94a3b8;
}

@media (max-width: 768px) {
    .documents-list {
        grid-template-columns: 1fr;
    }
    .document-card {
        flex-wrap: wrap;
    }
    .document-actions {
        width: 100%;
    }
    .document-download-btn {
        width: 100%;
        text-align: center;
    }
}

/* ============================================================
   Компактные карточки документов на ГЛАВНОЙ (.documents-section).
   Не затрагивает страницу documents.html (.documents-page-section).
   ============================================================ */
.documents-section .documents-list {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.documents-section .document-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 16px;
    border-radius: 10px;
    box-shadow: none;
}
.documents-section .document-card:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    transform: translateY(-2px);
}
.documents-section .document-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
/* Иконка типа файла — деликатный бейдж на лёгкой подложке, без яркой заливки */
.documents-section .document-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3px;
    background: rgba(27, 48, 91, 0.06);
    color: var(--primary-color);
}
/* Категория — приглушённый текст, без плашки */
.documents-section .document-category {
    margin-bottom: 0;
    padding: 0;
    background: none;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.documents-section .document-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    line-height: 1.35;
}
.documents-section .document-desc {
    font-size: 12.5px;
    margin: 0;
    line-height: 1.45;
    color: #64748b;
    /* компактно: не более 2 строк */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.documents-section .document-actions {
    margin-top: auto;
    padding-top: 2px;
}
/* «Скачать →» — текстовая ссылка с акцентом, без заливной кнопки */
.documents-section .document-download-btn {
    padding: 0;
    background: none;
    color: var(--secondary-color);
    font-size: 13px;
    font-weight: 600;
    border-radius: 0;
}
.documents-section .document-download-btn:hover {
    background: none;
    color: var(--primary-color);
    text-decoration: none;
}
.documents-section .document-download-btn::after {
    content: ' \2192'; /* стрелка → */
}

/* tablet: 2 карточки в ряд */
@media (max-width: 1024px) {
    .documents-section .documents-list {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* mobile: 1 карточка в ряд */
@media (max-width: 600px) {
    .documents-section .documents-list {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Экспертный центр (карточки + YouTube embed)
   ============================================================ */
.expert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 24px;
}
.expert-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}
.expert-media {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    background: #0f172a;
}
.expert-media-empty {
    padding-top: 0;
    min-height: 6px;
    background: transparent;
}
.expert-iframe,
.expert-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
}
.expert-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px 18px;
}
.expert-meta {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--secondary-color, #f59e0b);
}
.expert-title {
    margin: 0;
    font-size: 17px;
    line-height: 1.35;
    color: #0f172a;
}
.expert-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #475569;
}
.expert-sub {
    margin: 0;
    font-size: 13px;
    color: #64748b;
    font-style: italic;
}
.expert-link {
    margin-top: 6px;
}

/* Блок экспертного центра на главной */
.expert-home-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 12px;
}
.expert-home-list .expert-card {
    box-shadow: none;
}
.expert-home-actions {
    margin-top: 16px;
}

@media (max-width: 768px) {
    .expert-grid {
        grid-template-columns: 1fr;
    }
    .article-link {
        white-space: normal;
        word-break: break-word;
    }
}

/* ============================================================
   Единые пустые состояния (Empty State / Unavailable State)
   ============================================================ */
.empty-state,
.unavailable-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin: 12px 0;
    padding: 32px 24px;
    text-align: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}
.unavailable-state {
    background: #fff7ed;
    border-color: #fed7aa;
}
.empty-state .state-icon,
.unavailable-state .state-icon {
    font-size: 34px;
    line-height: 1;
}
.empty-state .state-text,
.unavailable-state .state-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
    color: #475569;
    max-width: 420px;
}
.unavailable-state .state-text {
    color: #9a3412;
}
