/* =========================================
   ПЕРЕМЕННЫЕ И СБРОС
   ========================================= */
: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;
}

img {
    max-width: 100%;
    display: block;
}

/* =========================================
   HEADER
   ========================================= */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 30px;
    padding: 12px 5%;
    background: rgba(248, 249, 250, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.logo img {
    height: 42px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo a:hover img {
    transform: scale(1.04);
}

/* Компактный логотип скрыт — используем только один */
.logo-compact {
    display: none !important;
}

.nav {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 28px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 4px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav::-webkit-scrollbar {
    display: none;
}

.nav a {
    flex-shrink: 0;
    white-space: nowrap;
    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: -5px;
    width: 0%;
    height: 2px;
    background: 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,
.featured-news {
    padding: 100px 8%;
}

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

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

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

/* =========================================
   КАРТОЧКИ НОВОСТЕЙ (Последние материалы)
   ========================================= */
.news-grid,
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.news-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

/* Единый размер фото для всех карточек */
.news-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
    background: #eef2f7;
    border-bottom: 1px solid var(--border);
}

.news-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-content h3 {
    font-size: 1.15rem;
    margin-bottom: 12px;
    color: var(--text-main);
    line-height: 1.35;
}

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

/* Дата */
.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)
   ========================================= */
.featured-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.featured-card {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    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: #eef2f7;
    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;
}

.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 {
    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;
    background: transparent;
    border: none;
    padding: 0;
    width: auto;
}

.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-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;
}

.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;
}

.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;
}

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

body.modal-open {
    overflow: hidden;
}

/* =========================================
   ПРОГРЕСС-БАР ЧТЕНИЯ
   ========================================= */
.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;
}

/* =========================================
   ПОИСК
   ========================================= */
.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;
}

/* =========================================
   ЧИТАТЬ ТАКЖЕ
   ========================================= */
.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;
}

/* =========================================
   КОНТАКТЫ
   ========================================= */
.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);
}

/* =========================================
   РУБРИКИ (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;
}

/* =========================================
   ЮРИДИЧЕСКИЕ СТРАНИЦЫ
   ========================================= */
.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
   ========================================= */
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;
}

.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; }

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

/* =========================================
   МОБИЛЬНАЯ ВЕРСИЯ (≤ 768px)
   ========================================= */
@media (max-width: 768px) {

    /* ХЕДЕР */
    .header {
        gap: 12px;
        padding: 10px 4%;
    }

    .logo img {
        height: 34px;
    }

    .nav {
        gap: 18px;
        padding: 4px 0;
        mask-image: linear-gradient(to right, #000 88%, transparent 100%);
        -webkit-mask-image: linear-gradient(to right, #000 88%, transparent 100%);
    }

    .nav a {
        font-size: 0.88rem;
        padding: 4px 0;
    }

    /* Убираем "уезжание" хедера — на телефоне меню всегда под рукой */
    .header.header-hidden {
        transform: translateY(0);
    }

    /* 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,
    .featured-news {
        padding: 50px 5%;
    }

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

    .news-grid,
    .cards {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .news-image {
        height: 200px;
    }

    .news-content {
        padding: 22px 20px;
    }

    .news-content h3 {
        font-size: 1.1rem;
    }

    /* FEATURED */
    .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;
    }

    /* МОДАЛКА */
    .modal-content {
        width: 92%;
        margin: 8% auto;
        padding: 25px 20px;
        border-radius: 16px;
    }

    .close-btn {
        top: 12px;
        right: 12px;
        font-size: 28px;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 50%;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .modal-image {
        max-height: 260px;
        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.65;
    }

    .modal-body h2 { font-size: 1.35rem; }
    .modal-body h3 { font-size: 1.05rem; }

    .modal-body img {
        max-height: 320px;
        margin: 18px auto;
        border-radius: 8px;
    }

    .reading-progress {
        height: 3px;
    }

    /* ПОИСК */
    .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: 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; }

    /* КОНТАКТЫ */
    .contacts-hero {
        padding: 100px 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; }

    /* РУБРИКИ */
    .category-hero {
        padding: 100px 5% 30px 5%;
    }

    .category-hero h1 { font-size: 2.2rem; }
    .category-hero p { font-size: 0.95rem; }

    /* ЮРИДИЧЕСКИЕ СТРАНИЦЫ */
    .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;
    }
}

/* =========================================
   ОЧЕНЬ МАЛЕНЬКИЕ ЭКРАНЫ (≤ 400px)
   ========================================= */
@media (max-width: 400px) {
    .hero h1 { font-size: 2rem; }
    .nav { gap: 10px; }
    .nav a { font-size: 0.8rem; }
}