/*
Theme Name: dds_bs2020kazan.ru
Author: Булат Нигматуллин
Description: Информационный портал о рынке недвижимости Казани и Татарстана: аналитика цен, юридические инструкции, обзоры районов и истории покупателей.
Version: 1.1
Text Domain: kazrealty
*/

:root {
    --bg: #f6f3ec;
    --surface: #ffffff;
    --surface-alt: #efeadf;
    --ink: #1d2b2a;
    --muted: #586664;
    --primary: #14524b;
    --primary-dark: #0f3d38;
    --accent: #c79a3f;
    --accent-dark: #a87f2c;
    --line: #e1dbcd;
    --footer-bg: #112826;
    --footer-ink: #dde6e3;
    --footer-muted: #9cb0ab;
    --radius: 12px;
    --shadow: 0 6px 22px rgba(17, 40, 38, 0.08);
}

* { 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.65;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: Georgia, "Times New Roman", serif;
    color: var(--primary-dark);
    line-height: 1.25;
    margin: 0 0 0.5em;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1.1em; }

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

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

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

.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 0.7em 1.4em;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s ease;
}
.btn:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.btn-ghost {
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent-dark);
}
.btn-ghost:hover { background: var(--accent); color: #fff; }

/* ---------- Header ---------- */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    padding: 1.1rem 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    flex: 1;
}
.brand-logo, .brand-mark { flex: 0 0 auto; display: block; }
.brand-mark { width: 52px; height: 52px; }
.brand-text { min-width: 0; }
.site-title {
    font-family: Georgia, serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0;
    line-height: 1.3;
    display: block;
    max-width: 46ch;
}
.site-title a { color: inherit; }
.site-desc {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
    max-width: 60ch;
}

.main-nav { width: 100%; }
.nav-toggle {
    display: none;
    background: var(--primary);
    color: #fff;
    border: 0;
    padding: 0.55em 0.9em;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
}
.menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
}
.menu a {
    display: block;
    padding: 0.4em 0;
    font-weight: 600;
    color: var(--ink);
}
.menu a:hover { color: var(--primary); text-decoration: none; }
.menu .current-menu-item > a { color: var(--accent-dark); }

/* ---------- Layout ---------- */
.site-main { padding: 2.4rem 0 3rem; }

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

@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .layout-single .content-area { width: 100%; }
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--muted);
    margin: 0 0 1.5rem;
}
.breadcrumbs a { color: var(--primary); }
.breadcrumbs .sep { margin: 0 0.4em; color: var(--accent); }

/* ---------- Sections (front page) ---------- */
.section { padding: 2.6rem 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { margin-bottom: 1.6rem; }
.section-head .eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-dark);
    font-weight: 700;
    margin-bottom: 0.4rem;
}

/* split: text + illustration */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.4rem;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-media img { width: 100%; border-radius: var(--radius); display: block; box-shadow: var(--shadow); }
@media (max-width: 760px) {
    .split { grid-template-columns: 1fr; }
    .split.reverse .split-media { order: 0; }
}

/* feature grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.4rem;
}
.feature {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.feature .ico {
    width: 46px; height: 46px;
    color: var(--primary);
    margin-bottom: 0.8rem;
}
.feature h3 { font-size: 1.15rem; margin-bottom: 0.4rem; }
.feature p { margin: 0; font-size: 0.95rem; color: var(--muted); }

/* steps */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.6rem;
    counter-reset: step;
}
.step { position: relative; padding-left: 3.6rem; }
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0; top: 0;
    width: 2.6rem; height: 2.6rem;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
}
.step h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.step p { margin: 0; font-size: 0.95rem; color: var(--muted); }

/* FAQ */
.faq { max-width: 820px; }
.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 0.8rem;
    padding: 0 1.2rem;
}
.faq summary {
    cursor: pointer;
    font-weight: 600;
    padding: 1rem 0;
    color: var(--primary-dark);
    list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 1rem; color: var(--muted); }

.section-tinted { background: var(--surface-alt); }

/* ---------- Cards ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(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 { display: block; overflow: hidden; }
.card-thumb img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.card-thumb:hover img { transform: scale(1.04); }
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.3rem;
    min-width: 0;
}
.card-title { font-size: 1.2rem; margin: 0 0 0.5rem; }
.card-title a { color: var(--primary-dark); }
.card-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.6rem; }
.card-excerpt { color: var(--muted); font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more { margin-top: auto; padding-top: 0.8rem; }
.card-more a { font-weight: 600; }

/* ---------- Single / Page content ---------- */
.entry-header { margin-bottom: 1.4rem; }
.entry-meta { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }
.entry-thumb { border-radius: var(--radius); margin-bottom: 1.6rem; display: block; }
.entry-content { font-size: 1.05rem; }
.entry-content img { border-radius: 10px; display: block; }
.entry-content h2, .entry-content h3 { margin-top: 1.6em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4rem 0;
    border: 1px solid var(--line);
}
th, td { border: 1px solid var(--line); padding: 0.65em 0.85em; text-align: left; }
th { background: var(--surface-alt); }

blockquote {
    border-left: 4px solid var(--accent);
    margin: 1.4rem 0;
    padding: 0.6rem 1.2rem;
    background: var(--surface-alt);
    color: var(--ink);
    border-radius: 0 8px 8px 0;
}

/* big quote section */
.quote-band {
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius);
    padding: 2.6rem;
    text-align: center;
}
.quote-band p { font-family: Georgia, serif; font-size: 1.5rem; line-height: 1.5; margin: 0; }
.quote-band cite { display: block; margin-top: 1rem; font-style: normal; font-size: 0.9rem; color: rgba(255,255,255,0.75); }

/* ---------- Sidebar ---------- */
.sidebar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    min-width: 0;
}
.sidebar .widget { margin-bottom: 1.8rem; }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title {
    font-size: 1.1rem;
    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 { padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.sidebar li:last-child { border-bottom: 0; }
.sidebar a { color: var(--ink); }
.sidebar a:hover { color: var(--primary); }
.sidebar .post-date { display: block; font-size: 0.78rem; color: var(--muted); }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 2.4rem 0 0;
    justify-content: center;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.6rem;
    height: 2.6rem;
    padding: 0 0.7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
}
.pagination a.page-numbers:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.pagination .page-numbers.current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.pagination .page-numbers.dots { border: 0; background: none; }

/* ---------- Search form ---------- */
.search-form { display: flex; gap: 0.5rem; }
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 0.6em 0.8em;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--surface);
    color: var(--ink);
}
.search-form button {
    background: var(--primary);
    color: #fff;
    border: 0;
    padding: 0 1.1em;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}
.search-form button:hover { background: var(--primary-dark); }

/* ---------- Comments ---------- */
.comments-area { margin-top: 2.6rem; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list li { margin-bottom: 1.2rem; }
.comment-body {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.2rem;
}
.comment-author { font-weight: 700; color: var(--primary-dark); }
.comment-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.4rem; }
.comment-respond {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem;
    margin-top: 1.6rem;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.6em 0.8em;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1rem;
    margin-top: 0.3rem;
    background: var(--bg);
    color: var(--ink);
}
.comment-form p { margin-bottom: 1rem; }
.comment-form .submit {
    background: var(--primary);
    color: #fff;
    border: 0;
    padding: 0.7em 1.5em;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    width: auto;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-ink);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 2rem;
}
.site-footer .widget-title {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 0.9rem;
}
.site-footer .widget { color: var(--footer-ink); }
.site-footer p { color: var(--footer-ink); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 0.35rem 0; }
.site-footer a { color: var(--footer-ink); }
.site-footer a:hover { color: var(--accent); }
.site-footer .post-date { color: var(--footer-muted); font-size: 0.78rem; display: block; }
.site-info {
    margin-top: 2.4rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(255,255,255,0.12);
    font-size: 0.85rem;
    color: var(--footer-muted);
    text-align: center;
}

/* ---------- Cookie banner ---------- */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--primary-dark);
    color: #fff;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    box-shadow: 0 -4px 18px rgba(0,0,0,0.18);
}
.cookie-banner p { margin: 0; font-size: 0.9rem; max-width: 70ch; }
.cookie-banner button {
    background: var(--accent);
    color: #1d2b2a;
    border: 0;
    padding: 0.6em 1.4em;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
}
.cookie-banner button:hover { background: #fff; }

/* ---------- 404 ---------- */
.error-404 { text-align: center; padding: 2rem 0; }
.error-404 .big { font-family: Georgia, serif; font-size: 5rem; color: var(--accent); line-height: 1; }
.error-404 .search-form { max-width: 460px; margin: 1.6rem auto; }

/* ---------- Responsive nav ---------- */
@media (max-width: 760px) {
    .nav-toggle { display: inline-block; }
    .menu {
        flex-direction: column;
        gap: 0;
        margin-top: 0.8rem;
    }
    .menu[hidden] { display: none; }
    .menu li { border-bottom: 1px solid var(--line); }
    .site-title { font-size: 1.05rem; }
}
.menu[hidden] { display: none; }
