/*
Theme Name: dds_66vn1.com
Author: Евгений Строганов
Description: Информационно-аналитическая тема для блога о недвижимости — статьи, рыночная аналитика, практические руководства и юридический блок. Тёплая «бумажная» палитра, кирпично-терракотовые акценты, тёмная тема.
Version: 1.1
Text Domain: dds66vn1
Requires at least: 6.0
Requires PHP: 8.0
*/

/* ============================================================
   1. Переменные и тема
   ============================================================ */
:root {
    --bg:          #F9F9F7;
    --bg-block:    #FFFFFF;
    --bg-soft:     #F1EDE6;
    --accent:      #B74A2A;
    --accent-dark: #963A1F;
    --secondary:   #4A627A;
    --ink:         #2E2E2A;
    --ink-soft:    #5C5C54;
    --pumpkin:     #E08E3A;
    --line:        #E0D9D1;
    --line-strong: #C9BFB1;
    --footer-bg:   #34322E;
    --footer-ink:  #D8D4CC;
    --footer-soft: #9C988E;
    --legal-bg:    #EEF1F4;
}

html[data-theme="dark"] {
    --bg:          #1C1B19;
    --bg-block:    #262421;
    --bg-soft:     #2E2C28;
    --accent:      #C9572F;
    --accent-dark: #E0703F;
    --secondary:   #8AA1BC;
    --ink:         #E6E2D9;
    --ink-soft:    #A8A399;
    --pumpkin:     #E08E3A;
    --line:        #3C3A35;
    --line-strong: #4A4842;
    --footer-bg:   #141312;
    --footer-ink:  #C7C3BA;
    --footer-soft: #8A867D;
    --legal-bg:    #232A30;
}

/* ============================================================
   2. Базовая типографика
   ============================================================ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    overflow-x: hidden;
    background-color: var(--bg);
    background-image:
        radial-gradient(rgba(0,0,0,0.018) 1px, transparent 1px),
        radial-gradient(rgba(0,0,0,0.018) 1px, transparent 1px);
    background-size: 18px 18px, 18px 18px;
    background-position: 0 0, 9px 9px;
    color: var(--ink);
    font-family: "Roboto", -apple-system, "Segoe UI", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    transition: background-color .35s ease, color .35s ease;
}

h1, h2, h3, h4 {
    font-family: "Playfair Display", Georgia, "Times New Roman", serif;
    line-height: 1.25;
    color: var(--ink);
    margin: 0 0 .5em;
}
h1 { font-size: 2.05rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

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

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

blockquote {
    margin: 1.4em 0;
    padding: .6em 1.2em;
    border-left: 4px solid var(--secondary);
    background: var(--bg-soft);
    color: var(--secondary);
    font-style: italic;
}

code, pre {
    font-family: "Roboto Mono", "Courier New", monospace;
    background: var(--bg-soft);
    border-radius: 4px;
}
code { padding: .12em .35em; font-size: .92em; }
pre { padding: 1em; overflow-x: auto; min-width: 0; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    border: 1px solid var(--line-strong);
}
th, td {
    border: 1px solid var(--line-strong);
    padding: .55em .8em;
    text-align: left;
}
th { background: var(--bg-soft); }

/* ============================================================
   3. Контейнер ширины
   ============================================================ */
.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

/* ============================================================
   4. Кнопки
   ============================================================ */
.btn-cta {
    display: inline-block;
    padding: .7em 1.5em;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    border-bottom-right-radius: 2px;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.12);
    cursor: pointer;
    transition: background .2s ease, box-shadow .2s ease, transform .2s ease;
}
.btn-cta:hover {
    background: var(--accent-dark);
    box-shadow: 5px 6px 14px rgba(0,0,0,0.22);
    transform: translateY(-1px);
    text-decoration: none;
    color: #fff;
}

.btn-pumpkin { background: var(--pumpkin); color: #3a2a14; }
.btn-pumpkin:hover { background: #c9792c; color: #3a2a14; }

/* Кнопки фильтрации аналитики */
.filter-btn {
    display: inline-block;
    padding: .45em 1em;
    background: transparent;
    color: var(--secondary);
    border: none;
    border-bottom: 2px solid var(--line);
    border-radius: 0;
    font-size: .92rem;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease;
}
.filter-btn:hover,
.filter-btn.is-active {
    border-bottom-color: var(--accent);
    color: var(--accent);
}

/* ============================================================
   5. Шапка
   ============================================================ */
.site-header {
    background: var(--bg-block);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.brand-logo,
.brand-svg { flex: 0 0 auto; display: block; }
.brand-logo { width: 64px; height: 64px; object-fit: contain; }
.brand-text { min-width: 0; }
.brand-title {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.3;
    display: block;
    max-width: 420px;
}
.brand-title:hover { text-decoration: none; color: var(--accent); }
.brand-desc {
    font-size: .82rem;
    color: var(--ink-soft);
    margin: 4px 0 0;
    max-width: 460px;
}
.brand-sign {
    font-family: "Playfair Display", Georgia, serif;
    font-style: italic;
    font-size: .8rem;
    color: var(--secondary);
    transform: rotate(-4deg);
    display: inline-block;
    margin-top: 3px;
}

.header-tools {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* переключатель темы — ключ от квартиры */
.theme-key {
    background: var(--bg-soft);
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    width: 46px;
    height: 30px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    color: var(--secondary);
    transition: color .2s ease, border-color .2s ease;
}
.theme-key:hover { color: var(--accent); border-color: var(--accent); }
.theme-key svg { width: 20px; height: 20px; margin: 0 auto; }

/* основная навигация */
.main-nav { background: var(--secondary); }
.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1rem;
    padding: 12px 0;
    cursor: pointer;
}
.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}
.nav-menu li { position: relative; }
.nav-menu a {
    display: block;
    padding: 13px 18px;
    color: #fff;
    font-size: .95rem;
}
.nav-menu a:hover,
.nav-menu .current-menu-item > a {
    background: rgba(0,0,0,0.18);
    text-decoration: none;
}
.nav-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    left: 0;
    top: 100%;
    background: var(--secondary);
    min-width: 200px;
    display: none;
    z-index: 30;
}
.nav-menu li:hover > ul { display: block; }

/* лента категорий */
.cat-ribbon {
    background: var(--bg-block);
    border-bottom: 1px solid var(--line);
}
.cat-ribbon-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    padding: 10px 0;
    font-size: .85rem;
}
.cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-soft);
}
.cat-chip:hover { color: var(--accent); text-decoration: none; }
.cat-dot {
    width: 9px; height: 9px;
    display: inline-block;
    flex: 0 0 auto;
}

/* ============================================================
   6. Раскладки
   ============================================================ */
.site-main { padding: 32px 0 48px; }

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

.content-area { min-width: 0; }

/* ============================================================
   7. Хлебные крошки
   ============================================================ */
.breadcrumbs {
    font-size: .85rem;
    color: var(--ink-soft);
    margin: 0 0 22px;
}
.breadcrumbs a { color: var(--secondary); }
.breadcrumbs .sep { margin: 0 6px; color: var(--line-strong); }

/* ============================================================
   8. Карточки записей — «архивные карточки с полями»
   ============================================================ */
.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-block);
    border: 1px solid var(--line-strong);
    padding: 6px;
    margin-bottom: 26px;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.10);
}
/* внутренняя рамка — цвет категории */
.card-inner {
    display: flex;
    flex-direction: column;
    flex: 1;
    border: 1px solid var(--cat-color, var(--line));
    min-width: 0;
}

.card-thumb-wrap {
    display: block;
    overflow: hidden;
}
.card-thumb-wrap img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 18px 18px;
    min-width: 0;
}
.card-cat {
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--cat-color, var(--secondary));
    font-weight: 600;
    margin-bottom: 6px;
}
.card-title {
    font-size: 1.18rem;
    margin: 0 0 8px;
}
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent); text-decoration: none; }

.card-excerpt { color: var(--ink-soft); font-size: .95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }

.card-meta {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    font-size: .78rem;
    color: var(--ink-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}

.card-more {
    align-self: flex-start;
    margin-top: 14px;
}

/* сетка карточек */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
}
.card-grid .card { margin-bottom: 0; }

/* ============================================================
   9. Запись и страница
   ============================================================ */
.entry {
    background: var(--bg-block);
    border: 1px solid var(--line);
    padding: 30px 34px;
}
.entry-title { margin-top: 0; }
.entry-meta {
    font-size: .82rem;
    color: var(--ink-soft);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.entry-thumb { margin: 0 0 22px; }
.entry-content img { height: auto; }
.entry-content h2 { margin-top: 1.4em; }

/* юридический блок-вставка */
.legal-note {
    background: var(--legal-bg);
    border-left: 4px solid var(--secondary);
    padding: 16px 20px;
    margin: 1.6em 0;
    font-family: "Roboto Mono", monospace;
    font-size: .9rem;
    line-height: 1.6;
}

/* блок «Опыт жильцов» */
.resident-note {
    display: flex;
    gap: 18px;
    align-items: center;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px 20px;
    margin: 1.6em 0;
}
.resident-avatar {
    flex: 0 0 56px;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--secondary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Playfair Display", serif;
    font-size: 1.4rem;
}
.resident-body { min-width: 0; }
.resident-body p { margin: 0; }

/* социальный шаринг */
.share-row {
    display: flex;
    gap: 10px;
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    align-items: center;
}
.share-label { font-size: .82rem; color: var(--ink-soft); }
.share-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid var(--secondary);
    color: var(--secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.share-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    text-decoration: none;
}
.share-btn svg { width: 17px; height: 17px; }

.tags-row { margin-top: 20px; font-size: .85rem; }
.tags-row a {
    display: inline-block;
    background: var(--bg-soft);
    color: var(--secondary);
    padding: 3px 10px;
    margin: 0 5px 6px 0;
    border-radius: 4px;
}

/* ============================================================
   10. Главная
   ============================================================ */
.home-section {
    background: var(--bg-block);
    border: 1px solid var(--line);
    padding: 34px 36px;
    margin-bottom: 30px;
}
.home-section > h2 {
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    padding-bottom: 4px;
}
.section-lead { color: var(--ink-soft); }

.feature-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    margin-top: 22px;
}
.feature-card {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    padding: 18px 20px;
    min-width: 0;
}
.feature-card h3 { color: var(--secondary); margin-top: 0; }

/* блок аналитики — прогресс-бары */
.price-bars { margin-top: 22px; }
.price-bar-row { margin-bottom: 16px; }
.price-bar-head {
    display: flex;
    justify-content: space-between;
    font-size: .9rem;
    margin-bottom: 5px;
}
.price-bar-head .region { font-weight: 600; }
.price-bar-head .value { color: var(--accent); font-weight: 600; }
.price-bar-track {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    height: 18px;
    border-radius: 3px;
    overflow: hidden;
}
.price-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary), var(--pumpkin));
}

/* шаги-руководства */
.steps-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 22px;
    counter-reset: step;
}
.step-item {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    padding: 18px;
    min-width: 0;
    position: relative;
}
.step-item::before {
    counter-increment: step;
    content: counter(step);
    font-family: "Playfair Display", serif;
    font-size: 2rem;
    color: var(--accent);
    display: block;
    margin-bottom: 6px;
}

/* фильтры аналитики */
.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 4px;
    margin-top: 18px;
}

.recent-block { margin-bottom: 30px; }
.recent-block > h2 {
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    padding-bottom: 4px;
}

/* ============================================================
   11. Сайдбар и виджеты
   ============================================================ */
.sidebar { min-width: 0; }

.widget {
    background: var(--bg-block);
    border: 1px solid var(--line);
    padding: 20px 22px;
    margin-bottom: 24px;
}
.widget,
.widget p,
.widget li,
.widget a,
.widget td {
    color: var(--ink);
}
.widget-title {
    font-size: 1.05rem;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
    color: var(--ink);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li {
    padding: 7px 0;
    border-bottom: 1px solid var(--line);
    font-size: .92rem;
}
.widget li:last-child { border-bottom: none; }
.widget a { color: var(--secondary); }
.widget a:hover { color: var(--accent); }
.widget .post-date,
.widget .rss-date,
.widget time {
    display: block;
    font-size: .76rem;
    color: var(--ink-soft);
}

/* ============================================================
   12. Пагинация
   ============================================================ */
.pagination {
    margin: 32px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.pagination .page-numbers {
    display: inline-block;
    padding: .45em .85em;
    background: var(--bg-block);
    border: 1px solid var(--line-strong);
    color: var(--secondary);
    font-size: .9rem;
}
.pagination .page-numbers:hover { text-decoration: none; }
.pagination .page-numbers.current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.pagination a.page-numbers:hover {
    background: var(--bg-soft);
    border-color: var(--accent);
}

/* ============================================================
   13. Поиск
   ============================================================ */
.search-form {
    display: flex;
    gap: 8px;
}
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: .6em .8em;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--bg);
    color: var(--ink);
    font: inherit;
}
.search-form button {
    padding: .6em 1.1em;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    border-bottom-right-radius: 2px;
    cursor: pointer;
}
.search-form button:hover { background: var(--accent-dark); }

/* ============================================================
   14. Комментарии
   ============================================================ */
.comments-area {
    background: var(--bg-block);
    border: 1px solid var(--line);
    padding: 26px 30px;
    margin-top: 28px;
}
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list ul.children { list-style: none; padding-left: 26px; }
.comment-body {
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
}
.comment-author { font-weight: 600; }
.comment-meta { font-size: .78rem; color: var(--ink-soft); }
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
    width: 100%;
    min-width: 0;
    padding: .55em .7em;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--bg);
    color: var(--ink);
    font: inherit;
    margin-bottom: 12px;
}
.comment-respond textarea { min-height: 130px; }

/* ============================================================
   15. Подвал — «фундамент»
   ============================================================ */
.site-footer {
    background-color: var(--footer-bg);
    background-image:
        linear-gradient(135deg, rgba(255,255,255,0.025) 0 25%, transparent 25% 50%, rgba(255,255,255,0.025) 50% 75%, transparent 75%);
    background-size: 26px 26px;
    color: var(--footer-ink);
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
    padding: 40px 0 26px;
}
.footer-col { min-width: 0; }
.footer-col .widget {
    background: transparent;
    border: none;
    padding: 0;
}
.footer-col .widget,
.footer-col .widget p,
.footer-col .widget li,
.footer-col .widget a,
.footer-col .widget td {
    color: var(--footer-ink);
}
.footer-col .widget-title {
    color: #fff;
    border-bottom-color: var(--accent);
}
.footer-col .widget li { border-bottom-color: rgba(255,255,255,0.12); }
.footer-col .widget a { color: var(--footer-ink); }
.footer-col .widget a:hover { color: var(--pumpkin); }
.footer-col .widget .post-date,
.footer-col .widget time { color: var(--footer-soft); }

.footer-motto {
    text-align: center;
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-size: 1.15rem;
    color: var(--pumpkin);
    padding: 18px 0;
    border-top: 1px solid rgba(255,255,255,0.12);
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-bottom {
    text-align: center;
    font-size: .82rem;
    color: var(--footer-soft);
    padding: 18px 0 26px;
}

/* ============================================================
   16. Кнопка «Наверх» — домовая табличка
   ============================================================ */
.to-top {
    position: fixed;
    right: 22px;
    bottom: 86px;
    width: 42px;
    padding: 14px 0;
    background: var(--secondary);
    color: #fff;
    border: none;
    border-radius: 14px 14px 4px 4px;
    cursor: pointer;
    writing-mode: vertical-rl;
    font-size: .8rem;
    letter-spacing: .08em;
    box-shadow: 2px 3px 8px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease, background .2s ease;
    z-index: 60;
}
.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top:hover { background: var(--accent); }

/* ============================================================
   17. Cookie-баннер
   ============================================================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--footer-bg);
    color: var(--footer-ink);
    padding: 14px 0;
    z-index: 80;
    box-shadow: 0 -3px 14px rgba(0,0,0,0.25);
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.cookie-inner p { margin: 0; font-size: .88rem; flex: 1; min-width: 200px; }
.cookie-inner a { color: var(--pumpkin); }

/* ============================================================
   18. 404
   ============================================================ */
.error-404 {
    background: var(--bg-block);
    border: 1px solid var(--line);
    padding: 40px 36px;
    text-align: center;
}
.error-404 .big { font-size: 4rem; color: var(--accent); margin: 0; }

/* ============================================================
   19. Адаптив
   ============================================================ */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 34px; }
    .layout-single .content-area,
    .front-area { width: 100%; }
    .feature-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-cols { grid-template-columns: 1fr; gap: 26px; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.4rem; }
    .card-grid { grid-template-columns: 1fr; }
    .feature-cols { grid-template-columns: 1fr; }
    .steps-row { grid-template-columns: 1fr; }
    .entry { padding: 22px 18px; }
    .home-section { padding: 24px 20px; }
    .nav-toggle { display: block; }
    .nav-menu {
        display: none;
        flex-direction: column;
    }
    .nav-menu.is-open { display: flex; }
    .nav-menu ul {
        position: static;
        display: block;
        min-width: 0;
        padding-left: 16px;
    }
    .header-inner { gap: 14px; }
    .resident-note { flex-direction: column; text-align: center; }
}
