:root {
    --bg-page: #f5f7fa;
    --bg-card: #ffffff;
    --bg-header: #1f2f4d;
    --bg-header-accent: #2f436e;
    --bg-header-topbar: rgba(15,23,42,0.6); /* новая полоска */
    --text-main: #1a1a1a;
    --text-dim: #4a4f5f;
    --text-on-dark: #ffffff;
    --border-soft: #d9dee8;
    --pill-bg: #e9eefc;
    --pill-text: #2f3e83;
    --danger-bg: #fff3f3;
    --danger-text: #a30000;
    --radius-lg: 16px;
    --radius-sm: 8px;
    --shadow-card: 0 12px 32px rgba(15, 23, 42, 0.08);
    --shadow-header: 0 20px 40px rgba(0,0,0,0.4);
    --font-main: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    background: var(--bg-page);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.4;
}

/* ===== Sticky footer layout ===== */
html, body { height: 100%; }
.site{
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}
.site-content{
    flex: 1 0 auto;
    min-height: 0;
}
.site-footer{ margin-top: auto; }

:root { --kv-header-h: 0px; }
.site-header.is-fixed ~ .site-content{ padding-top: var(--kv-header-h); }
.site-content > :last-child{ margin-bottom: 0; }

a {
    color: #1f3a8a;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* topbar removed */

/* ===== Шапка ===== */
header.site-header {
    background: radial-gradient(circle at 20% 20%, var(--bg-header-accent) 0%, var(--bg-header) 60%);
    color: var(--text-on-dark);
    box-shadow: var(--shadow-header);
}

.header-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    max-width: 1280px;
    padding: 16px 20px;
    margin: 0 auto;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.brand-emblem {
    width: 72px;
    height: 72px;
    background: transparent;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    color: #1f2f4d;
    box-shadow: none;
}

.brand-emblem img { max-width: 64px; height: auto; display: block; }

.brand-text {
    color: var(--text-on-dark);
}

/* Расположить название и соцсети в одну линию */
.brand-text{ display:flex; align-items:center; gap:14px; }

.brand-text .org-name {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
}

/* Ссылка названия сайта в шапке */
.site-title-link{ color:#fff; text-decoration:none; }
.site-title-link:hover{ color:#fff; opacity:.85; }

/* Соцсети в шапке (рядом с названием, крупные иконки) */
.brand-social{ display:flex; gap:10px; margin-top:0; }
.brand-social .soc-link{ color:#fff; opacity:.9; display:inline-flex; width:44px; height:44px; align-items:center; justify-content:center; border-radius:8px; background:rgba(255,255,255,.08); }
.brand-social .soc-link svg{ width:36px; height:36px; }
.brand-social .soc-link:hover{ opacity:1; background:rgba(255,255,255,.16); }

/* Бейдж возрастного ограничения */
.brand-social .age-badge{ display:inline-flex; align-items:center; justify-content:center; height:44px; padding:0 10px; border-radius:8px; background:rgba(255,255,255,.12); color:#fff; font-weight:700; font-size:18px; }

.brand-text .org-sub {
    font-size: 13px;
    line-height: 1.3;
    color: rgba(255,255,255,0.75);
}

/* справа в шапке: версия для слабовидящих */
.header-actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 200px;
    text-align: right;
}

.accessibility-btn {
    border: 0;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    color: #1f2f4d;
    box-shadow: 0 10px 24px rgba(0,0,0,0.35);
    line-height: 1.2;
}
.accessibility-btn span.mode {
    font-size: 12px;
    font-weight: 500;
    color: #4a4f5f;
    display: block;
    line-height: 1.2;
}
.accessibility-btn:hover {
    filter: brightness(0.95);
}

/* ===== Навигация ===== */
nav.main-nav {
    background: rgba(0,0,0,0.15);
    backdrop-filter: blur(4px);
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 8px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    font-size: 14px;
}

.nav-link {
    color: var(--text-on-dark);
    font-weight: 500;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
}

.nav-link.active,
.nav-link:hover {
    border-bottom-color: #fff;
}

/* ===== Основная сетка ===== */
.layout {
    max-width: 1280px;
    margin: 24px auto 60px;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    grid-gap: 24px;
}

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

/* ===== Система макетов ===== */
.layout-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 20px;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

/* Варианты ширины центральной колонки */
.content-full {
    flex: 1 1 100%;
    max-width: 100%;
    width: 100%;
}

.content-wide {
    flex: 1 1 70%;
    max-width: 70%;
}

.content-narrow {
    flex: 1 1 60%;
    max-width: 60%;
}

/* Колонки сайдбаров */
.sidebar-col {
    flex: 0 0 30%;
    max-width: 30%;
}

/* Если нужно для двух боковых колонок сделать уже */
.layout-row .sidebar-col.narrow {
    flex: 0 0 20%;
    max-width: 20%;
}

/* Специальные стили для режима без сайдбаров */
.layout-row:has(.content-full) {
    /* Убираем gap для режима без сайдбаров */
    gap: 0;
}

.layout-row:has(.content-full) .content-full {
    /* Контент без сайдбаров занимает всю ширину контейнера */
    flex: 1 1 100%;
    max-width: 100%;
    width: 100%;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .layout-row {
        flex-direction: column;
        gap: 20px; /* Возвращаем gap на мобильных */
    }
    .content-full,
    .content-wide,
    .content-narrow,
    .sidebar-col {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* ===== Блок "важно" ===== */
.alert-block {
    background: var(--danger-bg);
    border-left: 4px solid var(--danger-text);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    color: var(--danger-text);
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(190,0,0,0.08);
}

.alert-block strong {
    font-weight: 600;
}

/* ===== Карточки секций ===== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-soft);
    padding: 20px 24px;
}

.card + .card {
    margin-top: 24px;
}

.card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title .pill {
    background: var(--pill-bg);
    color: var(--pill-text);
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    padding: 4px 8px;
}

.card-more a {
    font-size: 13px;
    font-weight: 500;
}

/* ===== Слайдер новостей ===== */
.news-slider {
    position: relative;
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 24px rgba(0,0,0,0.05);
    display: flex;
    overflow: hidden;
    min-height: 140px;
    margin-bottom: 20px;
}

.news-slide-image {
    flex: 0 0 180px;
    background-size: cover;
    background-position: center;
    background-color: #d9dee8;
}

.news-slide-body {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.slide-date {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.slide-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.35;
    margin-bottom: 8px;
}

.slide-desc {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.4;
}

.news-slider-nav {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: flex;
    gap: 6px;
}
.slider-btn {
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: 0;
    border-radius: var(--radius-sm);
    font-size: 12px;
    line-height: 1;
    font-weight: 600;
    padding: 6px 8px;
    cursor: pointer;
}
.slider-btn:hover {
    filter: brightness(1.2);
}

/* ===== Сетка новостей (6 штук) ===== */
.news-list {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 16px;
}

@media (max-width: 900px) {
    .news-list {
        grid-template-columns: repeat(2,1fr);
    }
}

@media (max-width: 600px) {
    .news-list {
        grid-template-columns: 1fr;
    }
}

.news-item {
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.03);
}

.news-date {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.news-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.35;
    margin-bottom: 8px;
}

.news-title a {
    color: inherit;
    text-decoration: none;
}

.news-title a:hover {
    text-decoration: underline;
}

.news-snippet {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.4;
}

/* ===== Документы ===== */
.docs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.docs-table thead th {
    text-align: left;
    font-weight: 500;
    font-size: 12px;
    color: var(--text-dim);
    padding: 8px 0;
    border-bottom: 1px solid var(--border-soft);
    white-space: nowrap;
}

.docs-table tbody tr + tr td {
    border-top: 1px solid var(--border-soft);
}

.docs-table td {
    padding: 10px 0;
    vertical-align: top;
}

.doc-num {
    font-weight: 600;
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.4;
}

.doc-name {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-main);
}

.doc-meta {
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-dim);
}

.doc-download a {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    background: var(--pill-bg);
    color: var(--pill-text);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    line-height: 1.2;
    text-decoration: none;
    border: 1px solid rgba(47,62,131,0.15);
}

.doc-download a:hover {
    text-decoration: none;
    filter: brightness(0.95);
}

/* ===== Боковая колонка ===== */
.side-block + .side-block {
    margin-top: 24px;
}

.side-block .side-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
}

.contact-card,
.link-list,
.feedback-card,
.banners-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-soft);
    padding: 16px 20px;
    font-size: 13px;
    line-height: 1.5;
}

.contact-line + .contact-line {
    margin-top: 8px;
}

.contact-label {
    color: var(--text-dim);
    font-size: 12px;
    margin-bottom: 2px;
}

.contact-value {
    color: var(--text-main);
    font-weight: 500;
}

.link-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px;
}

.link-list li + li {
    margin-top: 8px;
}

.link-list a {
    color: #1f3a8a;
    text-decoration: none;
    font-weight: 500;
}

/* баннеры / виджеты */
.banners-wrap {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.banner-item a {
    display: block;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}
.banner-item img {
    display: block;
    width: 100%;
    height: auto;
}

/* ===== Подвал ===== */
footer.site-footer {
    background: #111827;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    line-height: 1.5;
    margin-top: 60px;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 32px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-gap: 24px;
}

@media (max-width: 800px) {
    .footer-inner {
        grid-template-columns: 1fr;
    }
}

.footer-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

/* полоса баннеров перед подвалом (опционально для госбаннеров на всю ширину) */
.pre-footer-banners {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px 24px;
}
.pre-footer-banners-inner {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card);
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(140px,1fr));
    gap: 16px;
}
.pre-footer-banners-inner a {
    display: block;
    background: #ffffff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
    text-align: center;
    padding: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-main);
    line-height: 1.3;
}
.pre-footer-banners-inner img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 6px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 16px 20px 32px;
    max-width: 1280px;
    margin: 0 auto;
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
}

/* ===== Документы: фикс сетки колонок ===== */

/* строка таблицы */
.docs-table tbody tr.kvdoc-row {
    vertical-align: top;
}

/* колонка № / дата */
.kvdoc-col-num {
    width: 140px;
    min-width: 140px;
    max-width: 160px;
    white-space: nowrap;
    font-size: 13px;
    line-height: 1.4;
}

/* колонка Наименование */
.kvdoc-col-title {
    /* занимает всё свободное место */
    width: auto;
    max-width: 100%;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* название документа */
.kvdoc-col-title .doc-name {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

/* колонка Статус */
.kvdoc-col-status {
    width: 110px;
    min-width: 110px;
    max-width: 130px;
    font-size: 12px;
    line-height: 1.4;
    text-wrap: nowrap;
}

/* колонка Скачать */
.kvdoc-col-download {
    width: 110px;
    min-width: 110px;
    max-width: 130px;
    text-align: right;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
}

/* стиль кнопки Скачать (она и так у нас есть, но усилим чтобы не прыгала) */
.kvdoc-col-download .doc-download a,
.kvdoc-col-download a {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    background: var(--pill-bg);
    color: var(--pill-text);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    line-height: 1.2;
    border: 1px solid rgba(47,62,131,0.15);
    text-decoration: none;
}

.kvdoc-col-download a:hover {
    filter: brightness(0.95);
    text-decoration: none;
}

/* визуальный статус */
.status-text {
    font-weight: 500;
    color: var(--text-main);
}
.status-text[data-status="Отменено"] {
    color: var(--danger-text);
}
.status-text[data-status="Утратил силу"] {
    color: var(--text-dim);
}

/* ===== Внутренние страницы ===== */
/* Стили для внутренних страниц теперь управляются через .layout-row */

.page-content .page-body,
.post-content .post-body {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-main);
}

.post-thumb img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.news-list .news-item {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.03);
}

/* ===== Кнопка обращения граждан ===== */
.kv-appeal-btn {
    display: inline-block;
    background: var(--pill-bg);
    color: var(--pill-text);
    border: 1px solid rgba(47,62,131,0.15);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    margin-top: 12px;
    transition: all 0.2s ease;
}

.kv-appeal-btn:hover {
    filter: brightness(0.95);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(47,62,131,0.2);
}

/* ===== Виджеты ===== */

/* Основной сайдбар */
.kv-gos-sidebar {
    width: 300px;
    flex-shrink: 0;
}

.kv-gos-sidebar .widget {
    background: #fff;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.03);
}

.kv-gos-sidebar .widget-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-soft);
}

/* Футер виджеты */
.site-footer {
    background: #1a1a1a;
    color: #fff;
    padding: 30px 0;
    font-size: 14px;
    line-height: 1.4;
}

.footer-widgets {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 1280px;
    margin: 0 auto 20px auto;
    padding: 0 20px;
}

.footer-col {
    flex: 1;
    min-width: 220px;
}

.footer-widget .widget-title,
.footer-widget-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #fff;
}

.footer-widget a {
    color: #fff;
    text-decoration: none;
}

.footer-widget a:hover {
    color: #e0e0e0;
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.2);
    text-align: center;
    padding: 15px 20px;
    color: rgba(255,255,255,.7);
}

.footer-bottom p {
    margin: 0;
}

/* Адаптивность для виджетов */
@media (max-width: 768px) {
    .footer-widgets {
        flex-direction: column;
        gap: 15px;
    }
    
    .footer-col {
        min-width: 100%;
    }
    
    .kv-gos-sidebar {
        width: 100%;
        margin-top: 20px;
    }
}
