/*
Theme Name: dds_demolinzfreiheit.com
Theme URI: https://demolinzfreiheit.com/
Author: Екатерина Сергеева
Author URI: https://demolinzfreiheit.com/
Description: Информационная тема для сайта о гражданских инициативах: участие, диалог и свобода объединений. Разборы общественных проектов, прозрачная коммуникация и работа с локальными инициативами.
Version: 1.1
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dlf
*/

/* ============================================================
   Переменные
   ============================================================ */
:root {
    --bg: #f5f2ec;
    --surface: #ffffff;
    --ink: #23282d;
    --muted: #5c6670;
    --primary: #23415c;
    --primary-dark: #1a3247;
    --accent: #b5622f;
    --accent-dark: #9a4f22;
    --line: #e3ddd2;
    --footer-bg: #1b2b3a;
    --footer-ink: #cbd5df;
    --footer-head: #ffffff;
    --sidebar-bg: #ffffff;
    --radius: 12px;
    --shadow: 0 8px 24px rgba(27, 43, 58, 0.08);
    --maxw: 1180px;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.68;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.24;
    color: var(--primary-dark);
    margin: 0 0 0.6em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

.page-wrap { display: flex; flex-direction: column; min-height: 100vh; }

.shell {
    width: min(92%, var(--maxw));
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--primary);
    color: #fff;
    padding: 10px 16px;
    z-index: 999;
    border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    width: 1px; height: 1px;
    overflow: hidden;
}

/* ============================================================
   Кнопки
   ============================================================ */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.72em 1.4em;
    border: 0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease;
    text-decoration: none;
}
.btn:hover { background: var(--accent-dark); color: #fff; text-decoration: none; }
.btn-light { background: #fff; color: var(--primary-dark); }
.btn-light:hover { background: #f0ece3; color: var(--primary-dark); }

.link-more { font-weight: 600; }

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.1rem 0;
}
.brand { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.brand-logo-link { display: inline-flex; flex: none; }
.brand-mark, .brand-logo { display: block; }
.brand-logo { max-height: 56px; width: auto; }
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-dark);
    line-height: 1.25;
    text-decoration: none;
}
.brand-name:hover { color: var(--primary); text-decoration: none; }
.brand-desc {
    margin: 0.25rem 0 0;
    font-size: 0.86rem;
    color: var(--muted);
    line-height: 1.4;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px; height: 40px;
    background: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    flex: none;
}
.nav-toggle span {
    display: block;
    width: 22px; height: 2px;
    margin: 0 auto;
    background: var(--primary-dark);
    transition: 0.2s;
}

.primary-nav { background: var(--primary); }
.primary-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.primary-menu li { margin: 0; }
.primary-menu a {
    display: block;
    padding: 0.85rem 1.05rem;
    color: #eaf0f5;
    font-weight: 600;
    font-size: 0.98rem;
    text-decoration: none;
    border-radius: 6px;
}
.primary-menu a:hover,
.primary-menu .current-menu-item > a {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
}

/* ============================================================
   Основная область / раскладки
   ============================================================ */
.site-main { flex: 1 0 auto; padding: 2.2rem 0 3rem; }

.crumbs {
    font-size: 0.86rem;
    color: var(--muted);
    margin-bottom: 1.6rem;
}
.crumbs a { color: var(--primary); }
.crumbs .sep { margin: 0 0.35rem; color: #9aa4ad; }

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

/* ============================================================
   Карточки записей
   ============================================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1.6rem;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    min-width: 0;
}
.card-thumb-wrap { overflow: hidden; }
.card-thumb-wrap a { display: block; }
.card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.card:hover .card-thumb { transform: scale(1.04); }

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.1rem 1.2rem 1.3rem;
    min-width: 0;
}
.card-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.4rem;
}
.card-title {
    font-size: 1.18rem;
    margin: 0 0 0.5rem;
}
.card-title a { color: var(--primary-dark); text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-excerpt { color: #444c53; font-size: 0.96rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 0.7rem;
    font-weight: 600;
    font-size: 0.94rem;
}

/* ============================================================
   Записи и страницы
   ============================================================ */
.page-heading { margin-bottom: 1.4rem; }
.post-single, .page-single {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.8rem 2rem;
    box-shadow: var(--shadow);
}
.post-header { margin-bottom: 1.2rem; }
.post-title { margin-bottom: 0.5rem; }
.post-meta { font-size: 0.86rem; color: var(--muted); }
.post-meta .meta-sep { margin: 0 0.4rem; }
.post-meta a { color: var(--primary); }
.post-thumb {
    margin: 0 0 1.5rem;
    border-radius: 10px;
    overflow: hidden;
}
.post-thumb img { display: block; width: 100%; height: auto; }
.post-content { min-width: 0; }
.post-content img { border-radius: 8px; height: auto; }
.post-content h2 { margin-top: 1.6rem; }
.post-content h3 { margin-top: 1.3rem; }
.post-content ul, .post-content ol { padding-left: 1.4rem; }
.post-content blockquote {
    margin: 1.5rem 0;
    padding: 1.1rem 1.4rem;
    background: #eef2f5;
    border-left: 4px solid var(--accent);
    border-radius: 8px;
}
.post-content blockquote p:last-child { margin-bottom: 0; }
.blog-intro { margin-bottom: 1.8rem; color: #444c53; }

.post-tags { margin-top: 1.6rem; font-size: 0.88rem; }
.post-tags .tags-label { color: var(--muted); font-weight: 600; }

.post-navigation, .comment-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin: 1.6rem 0;
    font-weight: 600;
    font-size: 0.94rem;
}

/* Таблицы */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4rem 0;
}
.post-content table, .post-content th, .post-content td {
    border: 1px solid #c9d0d6;
}
.post-content th, .post-content td { padding: 0.6rem 0.8rem; text-align: left; }
.post-content th { background: #eef2f5; }

/* ============================================================
   Сайдбар
   ============================================================ */
.sidebar {
    min-width: 0;
    background: var(--sidebar-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.2rem 1.3rem 1.4rem;
    box-shadow: var(--shadow);
}
.sidebar .widget { margin-bottom: 1.6rem; }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title {
    font-size: 1.05rem;
    color: var(--primary-dark);
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 0 0 0.55rem; padding-bottom: 0.55rem; border-bottom: 1px solid var(--line); }
.sidebar li:last-child { border-bottom: 0; }
.sidebar a { color: var(--primary); }
.sidebar a:hover { color: var(--accent); }
.sidebar .post-date { display: block; font-size: 0.78rem; color: var(--muted); }

/* ============================================================
   Пагинация
   ============================================================ */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 2rem;
    justify-content: center;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 0.7rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--primary-dark);
    font-weight: 600;
    text-decoration: none;
}
.pager a.page-numbers:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.pager .page-numbers.current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.pager .page-numbers.dots {
    border: 0;
    background: none;
}

/* ============================================================
   Формы (поиск, комментарии)
   ============================================================ */
.search-form {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}
.search-field {
    flex: 1 1 200px;
    min-width: 0;
    padding: 0.7rem 0.9rem;
    border: 1px solid #c9d0d6;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
}
.search-field:focus { outline: 2px solid var(--primary); border-color: var(--primary); }

.comments {
    margin-top: 2.4rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.6rem 1.8rem;
    box-shadow: var(--shadow);
}
.comments-title { font-size: 1.3rem; margin-bottom: 1.2rem; }
.comment-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }
.comment-list ol.children { list-style: none; padding-left: 1.4rem; }
.comment-item { margin-bottom: 1.2rem; }
.comment-inner {
    background: #f6f3ee;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.2rem;
}
.comment-head { display: flex; gap: 0.8rem; align-items: baseline; margin-bottom: 0.5rem; flex-wrap: wrap; }
.comment-author { font-weight: 700; color: var(--primary-dark); }
.comment-date { font-size: 0.8rem; color: var(--muted); }
.comment-await { font-size: 0.85rem; color: var(--accent-dark); }
.comment-reply { margin-top: 0.5rem; font-size: 0.88rem; font-weight: 600; }
.comment-form { margin-top: 1.2rem; }
.comment-form p { margin-bottom: 0.9rem; }
.comment-form label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #c9d0d6;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}
.comment-form textarea { min-height: 130px; resize: vertical; }

/* ============================================================
   Подвал
   ============================================================ */
.site-footer {
    flex-shrink: 0;
    background: var(--footer-bg);
    color: var(--footer-ink);
    margin-top: 3rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    padding: 2.6rem 0;
}
.footer-col { min-width: 0; }
.site-footer .widget { margin-bottom: 1rem; }
.site-footer .widget-title {
    color: var(--footer-head);
    font-size: 1.05rem;
    margin-bottom: 0.9rem;
}
.site-footer,
.site-footer p,
.site-footer li,
.site-footer .textwidget { color: var(--footer-ink); }
.site-footer a { color: #ffffff; }
.site-footer a:hover { color: var(--accent); text-decoration: underline; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 0.5rem; }
.site-footer .post-date { display: block; font-size: 0.78rem; color: #9fb0bf; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1.1rem 0;
}
.copyright { margin: 0; font-size: 0.86rem; color: #a9b7c4; }

/* ============================================================
   Cookie-баннер  (правило [hidden] — до основных стилей)
   ============================================================ */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--primary-dark);
    color: #eef2f5;
    padding: 1rem 1.4rem;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.2);
}
.cookie-text { margin: 0; font-size: 0.9rem; max-width: 760px; }
.cookie-accept { flex: none; }

/* ============================================================
   Главная — секции
   ============================================================ */
.front-shell {
    width: min(85%, var(--maxw));
    margin-inline: auto;
}
.fs { margin-bottom: 3.2rem; }
.fs-heading { text-align: center; }
.fs-lead { text-align: center; color: var(--muted); margin-bottom: 1.8rem; }

/* Блок 1: текст + иллюстрация */
.fs-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 2.6rem;
    align-items: center;
}
.fs-intro-text h1 { font-size: 2.15rem; margin-bottom: 0.7rem; }
.fs-intro-text p { color: #414a52; }
.fs-intro-media img { width: 100%; height: auto; display: block; border-radius: 16px; }

/* Блок 2: направления */
.dir-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 1.4rem;
}
.dir-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem 1.4rem;
    box-shadow: var(--shadow);
    min-width: 0;
}
.dir-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px; height: 48px;
    border-radius: 12px;
    background: #eef2f5;
    color: var(--primary);
    margin-bottom: 0.9rem;
}
.dir-card h3 { margin-bottom: 0.4rem; font-size: 1.1rem; }
.dir-card p { margin: 0; color: #4a545c; font-size: 0.94rem; }

/* Центр: последние записи */
.fs-more { text-align: center; margin-top: 1.6rem; margin-bottom: 0; }

/* Блок 3: шаги */
.steps {
    list-style: none;
    counter-reset: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 1.4rem;
}
.step {
    display: flex;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.4rem;
    box-shadow: var(--shadow);
    min-width: 0;
}
.step-num {
    flex: none;
    width: 42px; height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
}
.step-body { min-width: 0; }
.step-body h3 { font-size: 1.05rem; margin-bottom: 0.3rem; }
.step-body p { margin: 0; color: #4a545c; font-size: 0.93rem; }

/* Блок 4: CTA */
.fs-cta {
    background: var(--primary);
    color: #fff;
    border-radius: 16px;
    padding: 2.6rem 2.4rem;
    text-align: center;
}
.fs-cta h2 { color: #fff; margin-bottom: 0.6rem; }
.fs-cta p { color: #dbe6ef; max-width: 620px; margin: 0 auto 1.4rem; }

.empty-note { color: var(--muted); }
.archive-desc { margin-bottom: 1.4rem; color: #4a545c; }

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 2rem; }
    .fs-intro { grid-template-columns: 1fr; gap: 1.8rem; }
    .fs-intro-media { order: -1; }
    .fs-intro-text h1 { font-size: 1.9rem; }
}

@media (max-width: 700px) {
    body { font-size: 16px; }
    .front-shell { width: 92%; }
    .layout-single .content-area { width: 100%; }

    .nav-toggle { display: flex; }
    .nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav-toggle.is-active span:nth-child(2) { opacity: 0; }
    .nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .primary-nav { display: none; }
    .primary-nav.is-open { display: block; }
    .primary-menu { flex-direction: column; padding: 0.5rem 0; gap: 0; }
    .primary-menu a { padding: 0.85rem 0.4rem; border-radius: 0; }

    .footer-cols { grid-template-columns: 1fr; gap: 1.6rem; padding: 2rem 0; }
    .post-single, .page-single { padding: 1.3rem 1.2rem; }
    .fs-cta { padding: 1.9rem 1.4rem; }
    .comments { padding: 1.2rem 1.1rem; }
    h1 { font-size: 1.7rem; }
    .fs-intro-text h1 { font-size: 1.7rem; }
}

@media (max-width: 420px) {
    .brand-desc { display: none; }
}
