:root {
    /* Новая строгая палитра: глубокий синий, белый, графитовый */
    --bg: #f8f9fa;
    --surface: #ffffff;
    --text-main: #111827;
    --text-muted: #4b5563;
    --accent: #1e3a8a; /* Глубокий синий */
    --accent-hover: #1e40af;
    --border: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* HEADER */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(248, 249, 250, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 8%;
    border-bottom: 1px solid var(--border);
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-full {
    height: 55px;
    width: auto;
    display: block;
    transition: transform 0.3s ease;
}

.logo-compact {
    height: 40px;
    width: auto;
    display: none;
}

.logo a:hover .logo-full {
    transform: scale(1.03);
}

.nav {
    display: flex;
    gap: 30px;
}

.nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    transition: color 0.3s ease;
}

.nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0%;
    height: 2px;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.nav a:hover {
    color: var(--accent);
}

.nav a:hover::after {
    width: 100%;
}

/* HERO */
.hero {
    min-height: 85vh;
    display: flex;
    align-items: center;
    padding: 0 8%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e2e8f0 100%);
}

.hero-content {
    max-width: 800px;
    animation: fadeUp 1s ease-out;
}

.tag {
    display: inline-block;
    background: rgba(30, 58, 138, 0.1);
    color: var(--accent);
    padding: 8px 16px;
    border-radius: 50px;
    margin-bottom: 24px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: 24px;
    color: var(--text-main);
}

.hero p {
    font-size: 1.15rem;
    max-width: 600px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
}

/* BUTTONS */
button {
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    padding: 16px 32px;
    transition: all 0.25s ease;
}

.primary-btn {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 14px rgba(30, 58, 138, 0.3);
}

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.4);
}

.secondary-btn {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-main);
}

.secondary-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(30, 58, 138, 0.05);
}

/* SECTIONS */
.latest-news {
    padding: 100px 8%;
}

.latest-news h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 48px;
    position: relative;
    display: inline-block;
}

.latest-news h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.cards, .news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card, .news-card {
    background: var(--surface);
    padding: 40px 30px;
    border-radius: 16px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card:hover, .news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.card h3, .news-card h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--text-main);
}

.card p, .news-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 40px;
}

/* FOOTER */
footer {
    background: var(--text-main);
    color: white;
    padding: 80px 8%;
    text-align: center;
}

.footer-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    margin-bottom: 12px;
}

.footer-content p {
    color: #9ca3af;
    font-size: 0.95rem;
}

/* ANIMATIONS */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* MOBILE */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 5%;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .hero {
        min-height: 70vh;
        padding: 0 5%;
        text-align: center;
    }

    .hero h1 {
        font-size: 2.8rem;
    }

    .hero p {
        margin: 0 auto 30px auto;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    button {
        width: 100%;
    }

    .trending, .latest-news {
        padding: 60px 5%;
    }

    .trending h2, .latest-news h2 {
        font-size: 2rem;
    }
}
/* Стили для картинок в новостях */
/* Карточка новости */
.news-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Картинка внутри карточки — сохраняет пропорции, ничего не обрезается */
.news-image {
    width: 100%;
    height: auto;              /* Высота подстраивается под пропорции картинки */
    max-height: 300px;         /* Но не выше 300px, чтобы карточка не была гигантской */
    object-fit: contain;       /* Показывает картинку целиком, без обрезки */
    background: #f8f9fa;       /* Светлый фон, если картинка с прозрачностью */
    display: block;
    border-bottom: 1px solid var(--border); /* Визуально отделяем картинку от текста */
    padding: 10px;             /* Небольшой отступ, чтобы график "дышал" */
}

.news-content {
    padding: 25px;
}
/* --- Стили для модального окна (расширенный формат) --- */
.modal {
    display: none; /* Скрыто по умолчанию */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 24, 39, 0.8); /* Темный фон */
    backdrop-filter: blur(5px);
    overflow-y: auto; /* Позволяет скроллить, если статья длинная */
}

.modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.close-btn {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 35px;
    font-weight: bold;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close-btn:hover {
    color: #111827;
}

.modal-image {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 25px;
    padding: 10px;
}
.modal-content h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    margin-bottom: 20px;
    color: #111827;
}

.modal-body {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #4b5563;
}

.modal-body p {
    margin-bottom: 15px;
}

/* Скрываем скролл на фоне, когда открыто модальное окно */
body.modal-open {
    overflow: hidden;
}
/* =========================================
   БЛОК "ГЛАВНЫЕ НОВОСТИ" (featured)
   ========================================= */
.featured-news {
    padding: 100px 8%;
}

.featured-news h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 48px;
    position: relative;
    display: inline-block;
}

.featured-news h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.featured-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Карточка главной новости: картинка слева, текст справа */
.featured-card {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.35s ease;
}

.featured-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.featured-image {
    width: 100%;
    height: 100%;
    min-height: 280px;
    object-fit: cover;
    background: #f8f9fa;
    border-right: 1px solid var(--border);
}

.featured-content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(30, 58, 138, 0.08);
    padding: 6px 14px;
    border-radius: 50px;
    margin-bottom: 16px;
    width: fit-content;
}

.featured-content h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.9rem;
    line-height: 1.25;
    margin-bottom: 16px;
    color: var(--text-main);
}

.featured-content p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Первая карточка — самая крупная */
.featured-card.is-top .featured-content h3 {
    font-size: 2.3rem;
}

/* Мобильная версия */
@media (max-width: 768px) {
    .featured-news {
        padding: 60px 5%;
    }

    .featured-news h2 {
        font-size: 2rem;
    }

    .featured-card {
        grid-template-columns: 1fr;
    }

    .featured-image {
        min-height: 200px;
        max-height: 220px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .featured-content {
        padding: 25px 20px;
    }

    .featured-content h3 {
        font-size: 1.35rem;
    }

    .featured-card.is-top .featured-content h3 {
        font-size: 1.55rem;
    }

    .featured-content p {
        font-size: 0.95rem;
    }
}
/* =========================================
   СТРАНИЦА "КОНТАКТЫ"
   ========================================= */
.contacts-page {
    padding-bottom: 80px;
}

/* Верхний блок */
.contacts-hero {
    padding: 140px 8% 60px 8%;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e2e8f0 100%);
}

.contacts-hero .tag {
    margin-bottom: 20px;
}

.contacts-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    color: var(--text-main);
    margin-bottom: 20px;
    line-height: 1.15;
}

.contacts-hero p {
    color: var(--text-muted);
    font-size: 1.15rem;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Сетка карточек контактов */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    padding: 70px 8%;
    max-width: 1300px;
    margin: 0 auto;
}

.contact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 35px 30px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.contact-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.contact-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: rgba(30, 58, 138, 0.08);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
}

.contact-card h3 {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 12px;
}

.contact-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.65;
    margin-bottom: 20px;
    flex-grow: 1;
}

.contact-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    word-break: break-all;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
    align-self: flex-start;
}

.contact-link:hover {
    border-bottom-color: var(--accent);
}

/* Блок "О проекте" */
.contacts-about {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 8%;
    border-top: 1px solid var(--border);
}

.contacts-about h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--text-main);
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
}

.contacts-about h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
}

.contacts-about p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-top: 25px;
}

.contacts-about strong {
    color: var(--text-main);
}

/* Юридические ссылки внутри "О проекте" */
.legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 35px;
}

.legal-links a {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 50px;
    background: rgba(30, 58, 138, 0.08);
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.legal-links a:hover {
    background: var(--accent);
    color: #ffffff;
    transform: translateY(-2px);
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .contacts-hero {
        padding: 110px 5% 40px 5%;
    }

    .contacts-hero h1 {
        font-size: 2.2rem;
    }

    .contacts-hero p {
        font-size: 1rem;
    }

    .contacts-grid {
        padding: 40px 5%;
        gap: 20px;
    }

    .contact-card {
        padding: 28px 22px;
    }

    .contacts-about {
        padding: 30px 5% 60px 5%;
    }

    .contacts-about h2 {
        font-size: 1.6rem;
    }

    .contacts-about p {
        font-size: 0.98rem;
    }

    .legal-links {
        flex-direction: column;
    }

    .legal-links a {
        text-align: center;
    }
}
/* =========================================
   АДАПТИВНАЯ ВЕРСИЯ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ
   ========================================= */

@media (max-width: 768px) {
    
    /* Хедер: фиксирован, в одну строку — лого слева, меню справа */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        flex-direction: row;             /* НЕ колонкой, а строкой */
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 12px 5%;
        background: rgba(248, 249, 250, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--border);
        transition: transform 0.4s ease-in-out;
        z-index: 1000;
    }

    /* Класс для плавного скрытия хедера */
    .header-hidden {
        transform: translateY(-100%);
    }

    /* Логотип: компактный, не сжимается */
    .logo-full {
    height: 42px;
}

.logo-compact {
    height: 38px;
}

/* При скролле вниз вместо полного лого показываем PF */
.header.header-hidden .logo-full {
    display: none;
}

.header.header-hidden .logo-compact {
    display: block;
    animation: fadeIn 0.3s ease;
}

.header.header-hidden {
    padding: 8px 5%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

    /* Когда хедер "сжат" — прячем полный лого, показываем PF */
    .header.header-hidden .logo-full {
        display: none;
    }

    .header.header-hidden .logo-compact {
        display: block;
        animation: fadeIn 0.3s ease;
    }

    /* Вместо полного скрытия хедера — делаем его компактным */
    .header.header-hidden {
        transform: translateY(0);           /* Больше не уезжает */
        padding: 8px 5%;                    /* Тоньше */
        box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    }

    .header.header-hidden .nav {
        opacity: 0.9;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}
    /* Меню: одна строка, скроллится пальцем влево-вправо */
    .nav {
        display: flex;
        flex-wrap: nowrap;               /* Строго одна строка! */
        overflow-x: auto;                /* Горизонтальный скролл */
        gap: 20px;
        padding: 6px 2px;
        flex: 1;                         /* Занимает оставшееся место */
        justify-content: flex-start;
        /* Скрываем полосу прокрутки во всех браузерах */
        scrollbar-width: none;           /* Firefox */
        -ms-overflow-style: none;        /* IE/Edge */
    }

    .nav::-webkit-scrollbar {
        display: none;                   /* Chrome/Safari */
    }

    .nav a {
        font-size: 0.9rem;
        white-space: nowrap;             /* Слова не переносятся */
        flex-shrink: 0;                  /* Ссылки не сжимаются */
        padding: 4px 0;
    }

    /* Отступ сверху для Hero, так как хедер теперь фиксирован */
    .hero {
        padding-top: 110px;
    }
    .nav a {
        font-size: 0.9rem;
        padding: 5px 10px; /* Увеличиваем зону нажатия для пальцев */
    }

    /* --- Главный экран (Hero) --- */
    .hero {
        min-height: auto;
        padding: 60px 5%;
        text-align: center; /* Центрируем текст для мобильных */
    }

    .hero h1 {
        font-size: 2.5rem; /* Уменьшаем огромный заголовок */
        line-height: 1.2;
    }

    .hero p {
        font-size: 1rem;
        margin: 0 auto 30px auto;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    button {
        width: 100%; /* Кнопки на всю ширину */
        padding: 14px 20px;
        font-size: 0.95rem;
    }

    /* --- Секции с новостями --- */
    .latest-news {
        padding: 50px 5%;
    }

    .latest-news h2 {
        font-size: 2rem;
        margin-bottom: 30px;
    }

    .cards, .news-grid {
        grid-template-columns: 1fr; /* Строго одна колонка */
        gap: 20px;
    }

    .card, .news-card {
        padding: 25px 20px;
    }

    .card h3, .news-card h3 {
        font-size: 1.15rem;
    }

    .news-image {
        height: 180px; /* Картинки новостей ниже */
    }

    /* --- Модальное окно (Чтение статьи) --- */
    .modal-content {
        width: 92%;
        margin: 10% auto;
        padding: 25px 20px;
        border-radius: 16px;
    }

    .close-btn {
        top: 15px;
        right: 15px;
        font-size: 30px;
        background: rgba(255,255,255,0.8); /* Чтобы крестик не терялся на фото */
        border-radius: 50%;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .modal-image {
        height: 200px; /* Картинка в статье не должна быть слишком высокой */
        margin-bottom: 15px;
    }

    .modal-content h2 {
        font-size: 1.5rem;
        margin-bottom: 15px;
        line-height: 1.3;
    }

    .modal-body {
        font-size: 1rem;
        line-height: 1.6;
    }

/* Для очень маленьких экранов (например, iPhone SE) */
@media (max-width: 400px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .nav {
        gap: 10px;
    }
    
    .nav a {
        font-size: 0.8rem;
    }
}
/* =========================================
   СТРАНИЦА РУБРИКИ (category.html)
   ========================================= */
.category-hero {
    padding: 120px 8% 40px 8%;
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e2e8f0 100%);
}

.category-hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    margin: 20px 0 15px 0;
    color: var(--text-main);
}

.category-hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .category-hero {
        padding: 100px 5% 30px 5%;
    }
    .category-hero h1 {
        font-size: 2.2rem;
    }
    .category-hero p {
        font-size: 0.95rem;
    }
}
/* =========================================
   MARKDOWN-КОНТЕНТ ВНУТРИ МОДАЛЬНОГО ОКНА
   ========================================= */
.modal-body {
    font-size: 1.1rem;
    line-height: 1.75;
    color: var(--text-muted);
}

.modal-body p {
    margin-bottom: 18px;
}

.modal-body h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--text-main);
    margin: 35px 0 18px 0;
    line-height: 1.3;
}

.modal-body h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 25px 0 12px 0;
}

.modal-body ul, .modal-body ol {
    margin: 0 0 20px 25px;
}

.modal-body li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.modal-body strong {
    color: var(--text-main);
    font-weight: 700;
}

.modal-body em {
    font-style: italic;
}

.modal-body a {
    color: var(--accent);
    text-decoration: underline;
}

.modal-body blockquote {
    border-left: 4px solid var(--accent);
    background: rgba(30, 58, 138, 0.05);
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: var(--text-main);
}

.modal-body code {
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
}

.loading-modal {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
}

/* Мобильная адаптация MD */
@media (max-width: 768px) {
    .modal-body {
        font-size: 1rem;
        line-height: 1.65;
    }
    .modal-body h2 {
        font-size: 1.35rem;
    }
    .modal-body h3 {
        font-size: 1.05rem;
    }
}
/* =========================================
   КАРТИНКИ ВНУТРИ MARKDOWN-СТАТЬИ
   ========================================= */
.modal-body img {
    max-width: 100%;
    max-height: 500px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 25px auto;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    background: #f8f9fa;
}

@media (max-width: 768px) {
    .modal-body img {
        max-height: 320px;
        margin: 18px auto;
        border-radius: 8px;
    }
}
/* =========================================
   СТРАНИЦЫ С ЮРИДИЧЕСКИМИ ДОКУМЕНТАМИ
   ========================================= */
.legal-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 120px 8% 80px 8%;
}

.legal-page h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: var(--text-main);
    margin-bottom: 40px;
    line-height: 1.2;
}

.legal-page h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    color: var(--text-main);
    margin: 40px 0 15px 0;
}

.legal-page p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 15px;
}

.legal-page ul {
    margin: 0 0 20px 25px;
    color: var(--text-muted);
    line-height: 1.75;
}

.legal-page li {
    margin-bottom: 8px;
}

.legal-page a {
    color: var(--accent);
    text-decoration: underline;
}

.legal-page em {
    display: block;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: normal;
}

/* Навигация в футере */
.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.footer-nav a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-nav a:hover {
    color: #ffffff;
}

@media (max-width: 768px) {
    .legal-page {
        padding: 100px 5% 60px 5%;
    }
    .legal-page h1 {
        font-size: 2rem;
    }
    .legal-page h2 {
        font-size: 1.3rem;
    }
    .legal-page p {
        font-size: 1rem;
    }
    .footer-nav {
        flex-direction: column;
        gap: 12px;
    }
}
/* Дата в карточках */
.news-date {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 500;
    margin-bottom: 8px;
}

.featured-date {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

/* Дата в модальном окне */
.modal-date {
    display: block;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: -10px;
    margin-bottom: 25px;
    font-weight: 500;
}
/* =========================================
   ПОИСК ПО САЙТУ
   ========================================= */
.search-section {
    padding: 40px 8% 0 8%;
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 8px 20px;
    transition: all 0.3s ease;
    gap: 12px;
}

.search-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.08);
}

.search-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    color: var(--text-main);
    padding: 10px 0;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-clear {
    display: none;
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 5px;
    width: auto;
    transition: color 0.2s;
}

.search-input:not(:placeholder-shown) ~ .search-clear {
    display: block;
}

.search-clear:hover {
    color: var(--text-main);
}

/* Выпадающие результаты */
.search-results {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 8%;
    right: 8%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-height: 500px;
    overflow-y: auto;
    z-index: 900;
}

.search-results.active {
    display: block;
    animation: fadeUp 0.25s ease;
}

.search-result-item {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: rgba(30, 58, 138, 0.04);
}

.search-result-category {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(30, 58, 138, 0.08);
    padding: 4px 10px;
    border-radius: 50px;
    margin-bottom: 8px;
}

.search-result-item h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: var(--text-main);
    margin-bottom: 6px;
    line-height: 1.3;
}

.search-result-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.search-empty {
    padding: 30px 25px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .search-section {
        padding: 25px 5% 0 5%;
    }
    .search-wrapper {
        padding: 6px 16px;
    }
    .search-input {
        font-size: 0.95rem;
    }
    .search-results {
        left: 5%;
        right: 5%;
    }
    .search-result-item {
        padding: 16px 20px;
    }
    .search-result-item h4 {
        font-size: 1rem;
    }
}
/* =========================================
   БЛОК "ЧИТАТЬ ТАКЖЕ"
   ========================================= */
.related-block {
    margin-top: 50px;
    padding-top: 35px;
    border-top: 2px solid var(--border);
}

.related-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
}

.related-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 40px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.related-item {
    padding: 18px 22px;
    background: rgba(30, 58, 138, 0.04);
    border-radius: 12px;
    border-left: 3px solid transparent;
    cursor: pointer;
    transition: all 0.25s ease;
}

.related-item:hover {
    background: rgba(30, 58, 138, 0.08);
    border-left-color: var(--accent);
    transform: translateX(4px);
}

.related-category {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
}

.related-item h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 4px;
    line-height: 1.35;
    transition: color 0.2s;
}

.related-item:hover h4 {
    color: var(--accent);
}

.related-item p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

@media (max-width: 768px) {
    .related-block {
        margin-top: 35px;
        padding-top: 25px;
    }
    .related-title {
        font-size: 1.25rem;
    }
    .related-item {
        padding: 14px 16px;
    }
    .related-item h4 {
        font-size: 1rem;
    }
    .related-item p {
        font-size: 0.85rem;
    }
}
/* =========================================
   ПРОГРЕСС-БАР ЧТЕНИЯ
   ========================================= */
.reading-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), #3b82f6);
    border-radius: 20px 20px 0 0;
    transition: width 0.1s linear;
    z-index: 10;
}

.modal-content {
    position: relative;   /* Нужно для absolute позиционирования полосы */
}

@media (max-width: 768px) {
    .reading-progress {
        height: 3px;
    }
}