/*
Theme Name: dds_skopin-adm.ru
Author: Марина Аркадьевна Соловьёва
Description: Образовательный портал по муниципальному управлению и гражданскому просвещению. Дизайн-концепция «Архив управления»: японский минимализм и редакционная эстетика с тёплым медным акцентом.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: skopadm
*/

/* ==================================================================
   Токены
   ================================================================== */
:root {
    --bg:          #F7F5F0;
    --bg-alt:      #EDE9E1;
    --dark:        #1C1A17;
    --graphite:    #2A2825;
    --text:        #2A2825;
    --accent:      #B17A4F;
    --accent-h:    #9E6A42;
    --accent2:     #D4A373;
    --muted:       #8A827A;
    --card-border: #DCD6CD;
    --sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --serif: 'Lora', Georgia, 'Times New Roman', serif;
    --shell: min(92%, 1180px);
}

/* ==================================================================
   База
   ================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--sans);
    color: var(--text);
    line-height: 1.2;
    font-weight: 600;
    margin: 0 0 0.6em;
}

h1 { font-size: 3.5rem; letter-spacing: 0.01em; font-weight: 600; }
h2 { font-size: 2rem; }
h3 { font-size: 1.4rem; }

p { margin: 0 0 1.1em; }

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration: none; }

/* Анимированное подчёркивание текстовых ссылок */
.entry-content a,
.widget-text-block a {
    position: relative;
    color: var(--accent);
}
.entry-content a::after,
.widget-text-block a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 1px;
    background: var(--muted);
    transition: width .3s ease;
}
.entry-content a:hover::after,
.widget-text-block a:hover::after { width: 100%; }

.shell { width: var(--shell); margin-inline: auto; }

/* Цветная полоса сверху страницы */
.top-bar { height: 4px; background: var(--accent2); }

/* ==================================================================
   Кнопки
   ================================================================== */
.btn {
    display: inline-block;
    font-family: var(--sans);
    font-weight: 500;
    font-size: 1rem;
    padding: 0.75em 1.7em;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .2s ease, transform .1s ease, color .2s ease, border-color .2s ease;
}
.btn-filled {
    background: var(--accent);
    color: #fff;
}
.btn-filled:hover {
    background: var(--accent-h);
    color: #fff;
    transform: translateY(2px);
}
.btn-outline {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent2);
}
.btn-outline:hover {
    background: var(--accent-h);
    border-color: var(--accent-h);
    color: #fff;
    transform: translateY(2px);
}
.btn-light {
    background: transparent;
    color: #F7F5F0;
    border-color: var(--accent2);
    font-size: 1.05rem;
    padding: 0.85em 2em;
}
.btn-light:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(2px);
}

/* ==================================================================
   Шапка
   ================================================================== */
.site-header {
    background: var(--dark);
    color: #F7F5F0;
    padding: 1.6rem 0;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    text-decoration: none;
}
.brand-logo { display: block; height: 56px; width: auto; }
.brand-mark { flex: 0 0 auto; }
.brand-text { min-width: 0; }
.brand-name {
    font-family: var(--sans);
    font-weight: 600;
    font-size: 1.15rem;
    color: #F7F5F0;
    line-height: 1.25;
    display: block;
    max-width: 46ch;
}
.brand-desc {
    font-family: var(--serif);
    font-size: 0.85rem;
    color: #b9b0a5;
    line-height: 1.4;
    display: block;
    margin-top: 0.25rem;
    max-width: 60ch;
}

/* Навигация */
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.6rem;
    flex-wrap: wrap;
}
.main-nav a {
    font-family: var(--sans);
    font-size: 0.98rem;
    color: #d8d1c7;
    padding: 0.3rem 0;
    position: relative;
    transition: color .2s ease;
}
.main-nav a::after {
    content: '';
    position: absolute;
    left: 0; bottom: -4px;
    width: 0; height: 2px;
    background: var(--accent2);
    transition: width .3s ease;
}
.main-nav a:hover,
.main-nav .current-menu-item > a { color: #fff; }
.main-nav a:hover::after,
.main-nav .current-menu-item > a::after { width: 100%; }

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid #4a443c;
    color: #F7F5F0;
    font-family: var(--sans);
    padding: 0.5rem 0.9rem;
    border-radius: 4px;
    cursor: pointer;
}

/* ==================================================================
   Хлебные крошки
   ================================================================== */
.crumbs {
    font-family: var(--sans);
    font-size: 0.85rem;
    color: var(--muted);
    padding: 1.2rem 0 0;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { margin: 0 0.4rem; color: var(--accent2); }
.crumbs span:last-child { color: var(--text); }

/* ==================================================================
   Раскладки
   ================================================================== */
.site-main { padding: 2.5rem 0 4rem; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 3.5%;
    align-items: start;
}
.layout-single {
    display: block;
    width: 85%;
    margin-inline: auto;
}
.content-area { min-width: 0; }

/* Заголовок секции с точкой-печатью и обрезанной слева линией */
.sec-head {
    position: relative;
    margin: 0 0 2rem;
    padding-bottom: 1rem;
}
.sec-head h1, .sec-head h2 { margin: 0; display: inline-block; }
.sec-head h2::before, .sec-head h1::before {
    content: '';
    display: inline-block;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 0.7rem;
    vertical-align: middle;
}
.sec-head::after {
    content: '';
    position: absolute;
    left: 18%; right: 0; bottom: 0;
    height: 1px;
    background: var(--card-border);
}

/* Разделитель между секциями */
.divider { position: relative; height: 1px; margin: 3rem 0; }
.divider::before {
    content: '';
    position: absolute;
    left: 20%; right: 0; top: 0;
    height: 1px;
    background: var(--card-border);
}
.dots-divider {
    text-align: center;
    color: var(--accent2);
    letter-spacing: 0.5rem;
    margin: 2.5rem 0;
    font-size: 1.2rem;
}

/* ==================================================================
   Карточки записей
   ================================================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 1.8rem;
}
.card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: transform .2s ease, border-color .2s ease;
}
.card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}
.card-thumb {
    position: relative;
    display: block;
    overflow: hidden;
}
.card-thumb img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
}
.card-thumb-fallback {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: var(--graphite);
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-thumb-fallback svg { width: 64px; height: 64px; opacity: 0.5; }
.card-thumb::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 55%;
    background: linear-gradient(to top, rgba(28,26,23,0.75), rgba(28,26,23,0));
    pointer-events: none;
}
.card-date {
    position: absolute;
    left: 1rem; bottom: 0.8rem;
    z-index: 1;
    font-family: var(--sans);
    font-size: 0.78rem;
    color: #F7F5F0;
    letter-spacing: 0.03em;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.3rem 1.4rem 1.5rem;
}
.card-title {
    font-family: var(--sans);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 0.6rem;
}
.card-title a { color: var(--text); transition: color .2s ease; }
.card-title a:hover { color: var(--accent); }
.card-excerpt { font-size: 0.95rem; color: #4a463f; flex: 1; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    font-family: var(--sans);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent);
    margin-top: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.card-more:hover { color: var(--accent-h); }

/* ==================================================================
   Пагинация
   ================================================================== */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 3rem;
}
.pager .page-numbers {
    font-family: var(--sans);
    font-size: 0.95rem;
    min-width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.7rem;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    color: var(--text);
    background: #fff;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.pager a.page-numbers:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.pager .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.pager .page-numbers.dots {
    border: none;
    background: transparent;
}

/* ==================================================================
   Сайдбар и виджеты
   ================================================================== */
.sidebar {
    min-width: 0;
    font-family: var(--serif);
}
.widget {
    margin-bottom: 2rem;
    padding: 1.5rem 1.6rem;
    background: #fff;
    border: 1px solid var(--card-border);
}
.widget-title {
    font-family: var(--sans);
    font-size: 1.1rem;
    color: var(--text);
    margin: 0 0 1rem;
    padding-bottom: 0.6rem;
    position: relative;
}
.widget-title::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 40px; height: 2px;
    background: var(--accent);
}
.sidebar .widget a { color: var(--text); }
.sidebar .widget a:hover { color: var(--accent); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--card-border);
    font-size: 0.95rem;
}
.widget ul li:last-child { border-bottom: none; }
.widget-text-block, .widget .textwidget { color: var(--text); font-size: 0.95rem; }
.widget_recent_entries .post-date { color: var(--muted); font-size: 0.8rem; display: block; }

/* ==================================================================
   Записи и страницы
   ================================================================== */
.entry-header { margin-bottom: 1.5rem; }
.entry-title { font-size: 2.6rem; }
.entry-meta {
    font-family: var(--sans);
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 0.6rem;
}
.entry-meta .cat-links a { color: var(--accent); }
.featured-media { margin: 0 0 2rem; }
.featured-media img { width: 100%; display: block; border: 1px solid var(--card-border); }
.entry-content { font-size: 1.05rem; }
.entry-content h2, .entry-content h3 { margin-top: 1.8rem; }
.entry-content img { display: block; margin: 1.5rem 0; }
.entry-content blockquote {
    margin: 1.8rem 0;
    padding: 1.2rem 1.6rem;
    border-left: 4px solid var(--accent);
    background: var(--bg-alt);
    font-style: italic;
    color: #46423b;
}

/* Таблицы */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}
.entry-content table, .entry-content th, .entry-content td {
    border: 1px solid var(--card-border);
}
.entry-content th, .entry-content td { padding: 0.7rem 0.9rem; text-align: left; }
.entry-content th { background: var(--bg-alt); font-family: var(--sans); }

.tag-links {
    margin-top: 2rem;
    font-family: var(--sans);
    font-size: 0.9rem;
}
.tag-links a {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    margin: 0.2rem 0.3rem 0.2rem 0;
    background: var(--bg-alt);
    color: var(--text);
    border-radius: 4px;
}
.tag-links a:hover { background: var(--accent); color: #fff; }

/* Навигация по записям */
.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin: 2.5rem 0;
    flex-wrap: wrap;
    font-family: var(--sans);
    font-size: 0.95rem;
}
.post-nav a { color: var(--accent); }

/* ==================================================================
   Форма поиска
   ================================================================== */
.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 480px;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 0.7rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    font-family: var(--serif);
    font-size: 1rem;
    background: #fff;
    color: var(--text);
}
.search-form .search-submit {
    font-family: var(--sans);
    padding: 0.7rem 1.3rem;
    border: none;
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    transition: background .2s ease, transform .1s ease;
}
.search-form .search-submit:hover { background: var(--accent-h); transform: translateY(2px); }

/* ==================================================================
   Комментарии
   ================================================================== */
.comments-area { margin-top: 3rem; }
.comments-title, .comment-reply-title { font-size: 1.5rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list li { margin: 1.2rem 0; }
.comment-body {
    padding: 1.2rem 1.4rem;
    background: #fff;
    border: 1px solid var(--card-border);
}
.comment-list .children { list-style: none; margin-left: 1.5rem; }
.comment-author { font-family: var(--sans); font-weight: 600; }
.comment-metadata { font-size: 0.8rem; color: var(--muted); }
.comment-metadata a { color: var(--muted); }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    font-family: var(--serif);
    font-size: 1rem;
    background: #fff;
    color: var(--text);
    margin-top: 0.3rem;
}
.comment-form p { margin-bottom: 1rem; }
.comment-form .submit {
    font-family: var(--sans);
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.75em 1.7em;
    border-radius: 4px;
    cursor: pointer;
    transition: background .2s ease, transform .1s ease;
}
.comment-form .submit:hover { background: var(--accent-h); transform: translateY(2px); }

/* ==================================================================
   Подвал
   ================================================================== */
.site-footer {
    background-color: var(--dark);
    background-image: repeating-linear-gradient(45deg, rgba(58,53,48,0.08) 0, rgba(58,53,48,0.08) 1px, transparent 1px, transparent 8px);
    color: #d8d1c7;
    padding: 3.5rem 0 1.5rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
    margin-bottom: 2.5rem;
}
.footer-cols .widget {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: #c4bcb1;
}
.footer-cols .widget-title { color: #F7F5F0; }
.footer-cols .widget-title::after { background: var(--accent2); }
.footer-cols .widget a { color: #c4bcb1; }
.footer-cols .widget a:hover { color: var(--accent2); }
.footer-cols .widget ul li { border-bottom-color: #3a3530; }
.footer-cols .widget-text-block, .footer-cols .textwidget { color: #c4bcb1; }
.footer-cols .widget_recent_entries .post-date { color: #928a80; }
.site-footer .copyright {
    border-top: 1px solid #3a3530;
    padding-top: 1.5rem;
    font-family: var(--sans);
    font-size: 0.85rem;
    color: #928a80;
    text-align: center;
}

/* ==================================================================
   Cookie-баннер
   ================================================================== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--graphite);
    color: #e6e0d6;
    padding: 1rem 0;
    box-shadow: 0 -2px 14px rgba(0,0,0,0.2);
}
.cookie-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.cookie-inner p { margin: 0; font-size: 0.9rem; font-family: var(--serif); }
.cookie-inner a { color: var(--accent2); }

/* ==================================================================
   ГЛАВНАЯ — тематические блоки
   ================================================================== */
.front-section { padding: 3.5rem 0; }
.front-section.alt { background: var(--bg-alt); }

/* --- 1. Hero --- */
.fs-hero {
    position: relative;
    background: var(--graphite);
    color: #F7F5F0;
    padding: 4.5rem 0;
    overflow: hidden;
}
.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
}
.hero-copy h1 { color: #F7F5F0; font-size: 3.5rem; margin-bottom: 1.2rem; }
.hero-copy p { color: #c4bcb1; font-size: 1.15rem; max-width: 46ch; margin-bottom: 2rem; }
.hero-figure { display: flex; justify-content: center; align-items: center; }
.hero-figure svg { width: min(100%, 300px); height: auto; }
.hero-seal {
    position: absolute;
    right: -40px; bottom: -60px;
    width: 340px; height: 340px;
    opacity: 0.06;
    pointer-events: none;
    color: var(--accent2);
}

/* --- 2. Сетка карточек с иконками --- */
.aud-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
}
.aud-card {
    padding: 2rem 1.6rem;
    border-bottom: 2px solid var(--accent);
    background: transparent;
}
.aud-card .aud-icon { color: var(--accent); margin-bottom: 1rem; }
.aud-card .aud-icon svg { width: 46px; height: 46px; }
.aud-card h3 { font-size: 1.35rem; margin-bottom: 0.6rem; }
.aud-card p { font-size: 0.98rem; color: #4a463f; margin: 0; }

/* --- 3. Цитата / акцентный тезис --- */
.fs-quote { background: var(--bg-alt); }
.quote-block {
    position: relative;
    background: var(--bg-alt);
    border-left: 4px solid var(--accent);
    padding: 2.6rem 3rem 2.6rem 2.4rem;
    clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 0 100%);
}
.quote-block .stamp {
    position: absolute;
    top: -18px; left: 24px;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #F7F5F0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--sans);
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}
.quote-block blockquote {
    margin: 0.6rem 0 0;
    font-family: var(--serif);
    font-size: 1.7rem;
    line-height: 1.4;
    font-style: italic;
    color: #35312b;
}
.quote-block cite {
    display: block;
    margin-top: 1.2rem;
    font-family: var(--sans);
    font-style: normal;
    font-size: 0.95rem;
    color: var(--muted);
}

/* --- 4. Статистика / факты --- */
.fs-stats { background: var(--graphite); }
.stats-block {
    position: relative;
    background: var(--graphite);
    color: #F7F5F0;
    padding: 3rem 2.4rem;
    clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 30px, 100% 100%, 0 100%);
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
}
.stat-item {
    text-align: center;
    padding: 0.5rem 1.4rem;
    border-right: 1px solid #5A5550;
}
.stat-item:last-child { border-right: none; }
.stat-num {
    font-family: var(--sans);
    font-size: 3.2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent2);
}
.stat-label {
    font-family: var(--serif);
    font-size: 0.9rem;
    color: #c4bcb1;
    margin-top: 0.6rem;
}

/* --- Блок последних записей на главной --- */
.fs-latest .front-head { margin-bottom: 2.2rem; }
.latest-more { text-align: center; margin-top: 2.5rem; }

/* CTA — на всякий случай, с полными отступами (A14) */
.fs-cta {
    background: var(--graphite);
    color: #F7F5F0;
    padding: 3rem 2.4rem;
    border-radius: 4px;
    text-align: center;
}
.fs-cta h2 { color: #F7F5F0; }
.fs-cta p { color: #c4bcb1; }

/* ==================================================================
   404 / без результатов
   ================================================================== */
.notfound { text-align: center; padding: 2rem 0 3rem; }
.notfound .big { font-size: 6rem; color: var(--accent2); font-family: var(--sans); line-height: 1; }
.notfound .search-form { margin: 2rem auto; }

/* ==================================================================
   Адаптив
   ================================================================== */
@media (max-width: 960px) {
    h1 { font-size: 2.7rem; }
    .hero-copy h1 { font-size: 2.7rem; }
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 2.5rem; }
    .hero-grid { grid-template-columns: 1fr; }
    .hero-figure { order: -1; }
    .hero-figure svg { width: 200px; }
    .aud-grid { grid-template-columns: 1fr; }
    .footer-cols { grid-template-columns: 1fr 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem 0; }
    .stat-item:nth-child(2) { border-right: none; }
}

@media (max-width: 600px) {
    body { font-size: 17px; }
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.6rem; }
    .entry-title { font-size: 1.9rem; }
    .hero-copy h1 { font-size: 2.2rem; }
    .front-section { padding: 2.5rem 0; }
    .fs-hero { padding: 3rem 0; }
    .layout-single { width: 100%; }
    .header-inner { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
    .nav-toggle { display: inline-block; align-self: flex-end; }
    .main-nav { width: 100%; }
    .main-nav ul {
        display: none;
        flex-direction: column;
        gap: 0.3rem;
        width: 100%;
    }
    .main-nav.open ul { display: flex; }
    .footer-cols { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .quote-block { padding: 2.2rem 1.6rem 2rem; }
    .quote-block blockquote { font-size: 1.35rem; }
    .stats-block { padding: 2.2rem 1.4rem; }
    .stat-num { font-size: 2.4rem; }
    .cookie-inner { flex-direction: column; align-items: flex-start; }
}
