/**
 * Новый визуал раздела /news/ — стилистика Реестр Гарант.
 * Подключается вместе с существующими news-styles.css; админка и логика не меняются.
 */

/* --- Новая шапка --- */
.news-theme-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 64px;
    background: rgba(247, 243, 238, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #ddd5c8;
    font-family: 'DM Sans', sans-serif;
}
.news-theme-logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    font-weight: 600;
    color: #b07d2e;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
}
.news-theme-logo span { font-weight: 300; color: #1c1814; }
.news-theme-nav-links {
    display: flex;
    gap: 32px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.news-theme-nav-links a {
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #6b6055;
    text-decoration: none;
}
.news-theme-nav-links a:hover { color: #b07d2e; }

/* Выпадающие меню в навигации */
.news-theme-nav-dropdown {
    position: relative;
}
.news-theme-nav-dropdown-trigger {
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #6b6055;
    cursor: pointer;
}
.news-theme-nav-dropdown:hover .news-theme-nav-dropdown-trigger { color: #b07d2e; }
.news-theme-nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin: 8px 0 0;
    padding: 12px 0;
    min-width: 260px;
    background: rgba(247, 243, 238, 0.98);
    border: 1px solid #ddd5c8;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 200;
}
.news-theme-nav-dropdown:hover .news-theme-nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
}
.news-theme-nav-dropdown-menu li {
    margin: 0;
}
.news-theme-nav-dropdown-menu a {
    display: block;
    padding: 10px 20px;
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: none;
    color: #1c1814;
    text-decoration: none;
}
.news-theme-nav-dropdown-menu a:hover {
    background: #ede7de;
    color: #b07d2e;
}

.news-theme-nav-cta {
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    background: #b07d2e;
    color: #fff;
    padding: 10px 24px;
    text-decoration: none;
    font-family: inherit;
}

/* Кнопка «Консультация» — открывает коммерческий попап */
.news-theme-nav-consult {
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    background: transparent;
    color: #b07d2e;
    border: 1.5px solid #b07d2e;
    padding: 8px 20px;
    margin-right: 12px;
    font-family: inherit;
    cursor: pointer;
}
.news-theme-nav-consult:hover {
    background: rgba(176, 125, 46, 0.1);
    color: #8a5f1e;
}
.news-theme-mobile-cta .news-theme-nav-consult {
    margin-right: 10px;
    margin-bottom: 8px;
}

/* Кнопка гамбургера — скрыта на десктопе */
.news-theme-nav-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #1c1814;
}
.news-theme-burger-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: currentColor;
    transition: transform 0.25s, opacity 0.25s;
}
.news-theme-nav-burger[aria-expanded="true"] .news-theme-burger-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.news-theme-nav-burger[aria-expanded="true"] .news-theme-burger-bar:nth-child(2) {
    opacity: 0;
}
.news-theme-nav-burger[aria-expanded="true"] .news-theme-burger-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Подложка мобильного меню */
.news-theme-mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(28, 24, 20, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.news-theme-mobile-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

/* Панель мобильного меню */
.news-theme-mobile-panel {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 320px;
    z-index: 160;
    background: #f7f3ee;
    border-left: 1px solid #ddd5c8;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}
.news-theme-mobile-panel.is-open {
    transform: translateX(0);
}
.news-theme-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #ddd5c8;
}
.news-theme-mobile-head .news-theme-logo { font-size: 18px; }
.news-theme-mobile-close {
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: #6b6055;
    cursor: pointer;
}
.news-theme-mobile-close:hover { color: #1c1814; }
.news-theme-mobile-nav {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.news-theme-mobile-nav > a {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1c1814;
    text-decoration: none;
    padding: 12px 0;
    border-bottom: 1px solid #ede7de;
}
.news-theme-mobile-nav > a:hover { color: #b07d2e; }
.news-theme-mobile-accordion {
    border-bottom: 1px solid #ede7de;
}
.news-theme-mobile-accordion summary {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1c1814;
    padding: 12px 0;
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.news-theme-mobile-accordion summary::-webkit-details-marker { display: none; }
.news-theme-mobile-accordion summary::after {
    content: '+';
    float: right;
    color: #b07d2e;
    font-weight: 600;
}
.news-theme-mobile-accordion[open] summary::after { content: '−'; }
.news-theme-mobile-accordion summary:hover { color: #b07d2e; }
.news-theme-mobile-accordion ul {
    list-style: none;
    margin: 0 0 12px 0;
    padding: 0 0 0 12px;
}
.news-theme-mobile-accordion li { margin: 0; }
.news-theme-mobile-accordion a {
    display: block;
    padding: 8px 0;
    font-size: 13px;
    letter-spacing: 0.02em;
    text-transform: none;
    color: #6b6055;
    text-decoration: none;
}
.news-theme-mobile-accordion a:hover { color: #b07d2e; }
.news-theme-mobile-cta {
    padding: 20px;
    border-top: 1px solid #ddd5c8;
}
.news-theme-mobile-cta .news-theme-nav-cta {
    display: block;
    text-align: center;
}

/* --- Новый футер (симметричный, компактный) --- */
.news-theme-footer {
    background: #1c1814;
    color: #f7f3ee;
    padding: 48px 64px 0;
    margin-top: 60px;
    font-family: 'DM Sans', sans-serif;
}
.news-theme-footer-inner {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 48px 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid rgba(247, 243, 238, 0.12);
    max-width: 1200px;
    margin: 0 auto;
}
.news-theme-footer-col {
    min-width: 0;
}
.news-theme-footer-brand .news-theme-footer-logo {
    margin-bottom: 12px;
}
.news-theme-footer-logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-weight: 600;
    color: #b07d2e;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-block;
}
.news-theme-footer-logo:hover { color: #d4a853; }
.news-theme-footer-logo span { font-weight: 300; color: #f7f3ee; }
.news-theme-footer-desc {
    font-size: 12px;
    color: rgba(247, 243, 238, 0.55);
    line-height: 1.65;
    max-width: 280px;
    margin: 0;
}
.news-theme-footer-heading {
    font-size: 10px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #b07d2e;
    margin-bottom: 16px;
}
.news-theme-footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
}
.news-theme-footer-links li { margin-bottom: 10px; }
.news-theme-footer-links li:last-child { margin-bottom: 0; }
.news-theme-footer-links a {
    color: rgba(247, 243, 238, 0.9);
    text-decoration: none;
    font-size: 13px;
}
.news-theme-footer-links a:hover { color: #d4a853; }
.news-theme-footer-contact {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: rgba(247, 243, 238, 0.9);
    line-height: 1.5;
}
.news-theme-footer-contact a { color: #d4a853; text-decoration: none; }
.news-theme-footer-contact a:hover { text-decoration: underline; }
.news-theme-footer-address {
    margin: 12px 0 0 0;
    font-size: 12px;
    color: rgba(247, 243, 238, 0.6);
    line-height: 1.5;
}
.news-theme-footer-bottom {
    padding: 20px 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
}
.news-theme-footer-copy {
    font-size: 11px;
    color: rgba(247, 243, 238, 0.4);
    margin: 0;
}
.news-theme-footer-legal {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}
.news-theme-footer-legal a {
    color: rgba(247, 243, 238, 0.6);
    text-decoration: none;
}
.news-theme-footer-legal a:hover { color: #d4a853; }
.news-theme-footer-sep {
    color: rgba(247, 243, 238, 0.25);
    user-select: none;
}
/* совместимость со старым классом контактов */
.news-theme-footer-contacts-title { font-size: 10px; letter-spacing: 0.25em; text-transform: uppercase; color: #b07d2e; margin-bottom: 16px; }
.news-theme-footer-contacts p { font-size: 13px; color: rgba(247, 243, 238, 0.9); line-height: 1.5; margin-bottom: 8px; }
.news-theme-footer-contacts a { color: #d4a853; text-decoration: none; }

/* --- Переопределение контента при body.news-theme-new --- */
body.news-theme-new {
    background: #f7f3ee;
    color: #1c1814;
    font-family: 'DM Sans', sans-serif;
}
body.news-theme-new ::selection { background: rgba(176, 125, 46, 0.2); }

/* Хлебные крошки — компактнее под новую шапку */
body.news-theme-new .breadcrumbs {
    margin-top: 76px;
    background: #ede7de;
    border-bottom-color: #ddd5c8;
    padding: 12px 0;
}
body.news-theme-new .breadcrumbs a { color: #b07d2e; }
body.news-theme-new .breadcrumbs a:hover { color: #1c1814; }

/* Основной блок — фон как секция «Блог» на главной */
body.news-theme-new .news-content {
    padding: 48px 0 80px;
    background: #ede7de;
}
body.news-theme-new .container { max-width: 1200px; margin: 0 auto; padding: 0 64px; }
body.news-theme-new .news-header h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(38px, 5vw, 58px);
    font-weight: 300;
    line-height: 1.1;
    color: #1c1814;
}
body.news-theme-new .news-header h1 em { font-style: italic; color: #b07d2e; }
body.news-theme-new .category-description,
body.news-theme-new .search-results { color: #6b6055; }

/* Сайдбар — в новом стиле */
body.news-theme-new .news-sidebar { top: 90px; }
body.news-theme-new .sidebar-widget {
    background: #f7f3ee;
    border: 1px solid #ddd5c8;
    box-shadow: none;
    border-radius: 0;
}
body.news-theme-new .sidebar-widget h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.25rem;
    color: #1c1814;
    font-weight: 400;
}
body.news-theme-new .categories-list a {
    color: #6b6055;
    text-decoration: none;
}
body.news-theme-new .categories-list a:hover,
body.news-theme-new .categories-list a.active {
    background: #b07d2e;
    color: #fff;
}
body.news-theme-new .contact-widget h3,
body.news-theme-new .contact-widget p { color: #1c1814; }
body.news-theme-new .contact-widget .contact-phone,
body.news-theme-new .contact-widget .contact-email { color: #b07d2e; }
body.news-theme-new .btn-primary {
    background: #b07d2e;
    color: #fff;
    border: none;
}

/* CTA виджет в сайдбаре — читаемый текст на градиенте */
body.news-theme-new .cta-widget {
    background: linear-gradient(135deg, #b07d2e 0%, #8a6914 100%);
    color: #ffffff;
    padding: 28px 24px;
    border: none;
    border-radius: 0;
}
body.news-theme-new .cta-widget h3 {
    color: #ffffff;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-size: 1.35rem;
    margin-bottom: 16px;
    border-bottom-color: rgba(255,255,255,0.35);
}
body.news-theme-new .cta-widget p {
    color: #ffffff;
    opacity: 1;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.6;
    text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}
body.news-theme-new .cta-widget .cta-phone,
body.news-theme-new .cta-widget .cta-email {
    color: #ffffff;
    background: rgba(255,255,255,0.18);
}
body.news-theme-new .cta-widget .cta-phone:hover,
body.news-theme-new .cta-widget .cta-email:hover {
    color: #ffffff;
    background: rgba(255,255,255,0.28);
}
body.news-theme-new .cta-widget .btn-primary {
    background: #ffffff;
    color: #8a6914;
    border: none;
}
body.news-theme-new .cta-widget .btn-primary:hover {
    background: #f7f3ee;
    color: #6b5310;
}

/* Мобильный CTA — читаемый текст */
body.news-theme-new .mobile-cta {
    color: #ffffff;
}
body.news-theme-new .mobile-cta-content h3,
body.news-theme-new .mobile-cta-content p {
    color: #ffffff;
    opacity: 1;
}

/* Сетка карточек — ровная, симметричная, одинаковые отступы и размеры */
body.news-theme-new .news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}
body.news-theme-new .news-card {
    background: #f7f3ee;
    border: 1px solid #ddd5c8;
    border-radius: 0;
    box-shadow: none;
    transition: background 0.3s, border-color 0.3s;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
body.news-theme-new .news-card:hover {
    background: #ede7de;
    border-color: #d0c8bc;
}
body.news-theme-new .news-card .news-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    flex-shrink: 0;
    background: #e8e2da;
}
body.news-theme-new .news-card .news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
body.news-theme-new .news-card.no-image .news-content {
    padding-top: 28px;
}
body.news-theme-new .news-card .news-content {
    padding: 28px 28px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
body.news-theme-new .news-card .news-category {
    margin-bottom: 12px;
}
body.news-theme-new .news-card .news-category a,
body.news-theme-new .news-card .featured-badge {
    font-size: 10px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    padding: 6px 12px;
    border: 1px solid rgba(176, 125, 46, 0.4);
    background: transparent;
    color: #b07d2e;
    text-decoration: none;
    display: inline-block;
}
body.news-theme-new .news-card .news-title {
    margin: 0 0 12px 0;
    line-height: 1.3;
    flex: 1;
    min-height: 0;
}
body.news-theme-new .news-card .news-title a {
    font-family: 'Cormorant Garamond', serif;
    font-size: 20px;
    font-weight: 400;
    color: #1c1814;
    text-decoration: none;
    display: block;
}
body.news-theme-new .news-card .news-title a:hover { color: #b07d2e; }
body.news-theme-new .news-card .news-excerpt {
    color: #6b6055;
    font-size: 14px;
    line-height: 1.55;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
body.news-theme-new .news-card .news-meta {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #e8e2da;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
body.news-theme-new .news-card .news-date,
body.news-theme-new .news-card .news-views {
    color: #9a9088;
    font-size: 11px;
}
body.news-theme-new .news-card .featured-badge {
    position: static;
    margin-bottom: 12px;
}

/* Пагинация */
body.news-theme-new .pagination { margin-top: 48px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
body.news-theme-new .pagination-btn {
    padding: 10px 20px;
    border: 1px solid #ddd5c8;
    background: #f7f3ee;
    color: #1c1814;
    text-decoration: none;
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}
body.news-theme-new .pagination-btn:hover,
body.news-theme-new .pagination-btn.active { background: #1c1814; color: #f7f3ee; border-color: #1c1814; }

/* Пустой список */
body.news-theme-new .no-news { background: #f7f3ee; padding: 48px; text-align: center; border: 1px solid #ddd5c8; }
body.news-theme-new .no-news h3 { font-family: 'Cormorant Garamond', serif; color: #1c1814; }
body.news-theme-new .no-news .btn-primary { background: #b07d2e; color: #fff; }

/* Страница одной статьи */
body.news-theme-new .article-content { background: #f7f3ee; padding: 48px 0 80px; }
body.news-theme-new .article-main .article-header h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 300;
    line-height: 1.2;
    color: #1c1814;
}
body.news-theme-new .article-category a {
    font-size: 10px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    padding: 4px 12px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: #b07d2e;
    color: #ffffff;
    text-decoration: none;
}
body.news-theme-new .article-category a:hover {
    background: #8a6914;
    color: #ffffff;
}
body.news-theme-new .article-meta,
body.news-theme-new .article-views { color: #9a9088; font-size: 12px; }
body.news-theme-new .article-body { color: #1c1814; }
body.news-theme-new .article-body a { color: #b07d2e; }

/* Карточки с градиентом — белый текст для контраста */
body.news-theme-new .article-body .custom-challenge-card {
    color: #ffffff !important;
}
.article-body p,
.article-body div {
    margin-top: 0;
    margin-bottom: 1.1em;
}
.article-body * {
    max-width: 100%;
    box-sizing: border-box;
}

@media (min-width: 1280px) {
    body.news-theme-new .news-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
    }
}
@media (max-width: 900px) {
    .news-theme-nav { padding: 16px 24px; }
    .main-home { padding-top: 72px !important; }
    .news-theme-nav-links { display: none; }
    .news-theme-nav-cta,
    .news-theme-nav-consult { display: none; }
    .news-theme-nav-burger { display: flex; }
    .news-theme-mobile-backdrop,
    .news-theme-mobile-panel { display: flex; }
    body.news-theme-new .container { padding: 0 24px; }
    body.news-theme-new .news-layout { grid-template-columns: 1fr; }
    body.news-theme-new .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    body.news-theme-new .news-card .news-content {
        padding: 24px 24px 20px;
    }
    .news-theme-footer-inner { grid-template-columns: 1fr; gap: 32px; padding-left: 24px; padding-right: 24px; }
    .news-theme-footer { padding-left: 24px; padding-right: 24px; }
    .news-theme-footer-bottom { padding-left: 24px; padding-right: 24px; flex-direction: column; align-items: flex-start; }
}

/* Модальное окно «Подать заявку» (попап в шапке) */
.modal {
    display: none !important;
    position: fixed !important;
    z-index: 10000 !important;
    left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6) !important;
    overflow: auto; padding: 20px; box-sizing: border-box;
}
.modal.show {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 100vh !important;
}
.modal-content {
    background: #fff; padding: 24px; border-radius: 12px;
    width: 100%; max-width: 400px; position: relative; margin: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    overflow-y: auto; max-height: 90vh;
}
.modal-close {
    position: absolute; right: 12px; top: 12px; font-size: 22px; font-weight: bold;
    color: #999; cursor: pointer; z-index: 1;
}
.modal-close:hover { color: #1c1814; }
.modal h3 { font-size: 1.25rem; margin: 0 0 6px 0; color: #1c1814; padding-right: 28px; }
.modal .modal-content .form-group { margin-bottom: 14px; }
.modal .form-group label { display: block; font-size: 12px; color: #6b6055; margin-bottom: 4px; }
.modal .form-group input,
.modal .form-group textarea {
    width: 100%; padding: 10px 12px; border: 1px solid #ddd5c8; border-radius: 8px; box-sizing: border-box;
}
.modal .submit-btn {
    width: 100%; padding: 14px; background: #b07d2e; color: #fff; border: none; border-radius: 8px;
    font-weight: 500; cursor: pointer; margin-top: 8px;
}
.modal .submit-btn:hover { background: #1c1814; }
.modal .success-message { color: #27ae60; margin-top: 12px; }
.modal .error-message { color: #c0392b; margin-top: 12px; font-size: 14px; }
