/*
Theme Name: dds_americannmf.com
Author: Сергей Крылов
Description: Информационный портал о рынке недвижимости России. Дизайн-концепция «Тёплый крафт»: землистая палитра, архитектурные мотивы, тактильная типографика.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
*/

/* ============ ПЕРЕМЕННЫЕ ============ */
:root {
    --bg: #F9F6F0;
    --bg-alt: #F0EBE0;
    --header-bg: #4A3B32;
    --footer-bg: #3D2E26;
    --sidebar-bg: #F4EFE6;
    --text: #2B221D;
    --accent: #C47B4B;
    --accent-2: #8AA68C;
    --muted: #8C7C72;
    --card-border: #E2D8CC;
    --alt-topline: #DAC5B0;
    --plan: #4A3B32;
    --serif: "PT Serif", "Cormorant Garamond", Georgia, serif;
    --grotesk: "Montserrat", "Segoe UI", Arial, sans-serif;
    --shell: min(92%, 1180px);
    --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    --plan-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='300' viewBox='0 0 360 300'%3E%3Cg fill='none' stroke='%234A3B32' stroke-width='2'%3E%3Crect x='20' y='20' width='320' height='260'/%3E%3Cline x1='20' y1='140' x2='200' y2='140'/%3E%3Cline x1='200' y1='20' x2='200' y2='280'/%3E%3Cline x1='200' y1='180' x2='340' y2='180'/%3E%3Cpath d='M120 140 a40 40 0 0 0 40 -40'/%3E%3Cpath d='M200 100 a34 34 0 0 1 34 34'/%3E%3Cline x1='60' y1='20' x2='60' y2='40'/%3E%3Cline x1='260' y1='260' x2='260' y2='280'/%3E%3Crect x='240' y='210' width='60' height='40'/%3E%3C/g%3E%3C/svg%3E");
}

/* ============ БАЗА ============ */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--serif);
    font-size: 18px;
    line-height: 1.7;
    color: var(--text);
    background-color: var(--bg);
    background-image: var(--grain);
    overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--grotesk);
    font-weight: 700;
    line-height: 1.18;
    color: var(--text);
    letter-spacing: -0.01em;
}
h1 { font-size: 3.8rem; margin: 0 0 0.5em; }
h2 { font-size: 2.1rem; }
h3 { font-size: 1.45rem; }
p { margin: 0 0 1.1em; }

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

/* ссылки в тексте контента */
.entry-content a,
.widget a,
.breadcrumbs a {
    text-decoration: underline;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: text-decoration-color .18s, text-decoration-thickness .18s, color .18s;
}
.entry-content a:hover,
.widget a:hover,
.breadcrumbs a:hover {
    text-decoration-thickness: 2.5px;
    text-decoration-color: var(--accent-2);
    color: var(--accent-2);
}

/* ============ КНОПКИ ============ */
.btn {
    display: inline-block;
    font-family: var(--grotesk);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    text-decoration: none;
    padding: 0.72em 1.6em;
    border: 2px solid var(--accent);
    border-radius: 4px;
    color: var(--accent);
    background: transparent;
    cursor: pointer;
    transition: background .16s, color .16s, transform .08s;
}
.btn:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(2px);
}
.btn--solid {
    background: var(--accent);
    color: #fff;
}
.btn--solid:hover { background: #b06a3c; border-color: #b06a3c; }
.btn--ghost-light {
    border-color: #F9F6F0;
    color: #F9F6F0;
}
.btn--ghost-light:hover { background: #F9F6F0; color: var(--text); }

/* ============ ЗАГОЛОВКИ СЕКЦИЙ (двойная линия) ============ */
.section-head {
    margin: 0 0 1.6rem;
}
.section-head::before {
    content: "";
    display: block;
    width: 100%;
    height: 2px;
    background: var(--accent);
    margin-bottom: 0.9rem;
}
.section-head h2 {
    margin: 0;
    text-align: left;
}

/* ============ ШАПКА ============ */
.site-header {
    background: var(--header-bg);
    color: #F1E9DF;
    padding: 1.4rem 0;
    border-bottom: 3px solid var(--accent);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.9rem; min-width: 0; text-decoration: none; }
.brand-logo { display: block; height: 54px; width: auto; }
.brand-svg { display: block; flex: 0 0 auto; }
.brand-text { min-width: 0; }
.brand-name {
    font-family: var(--grotesk);
    font-weight: 700;
    font-size: 1.05rem;
    color: #F9F6F0;
    line-height: 1.3;
    display: block;
    max-width: 46ch;
}
.brand-desc {
    font-size: 0.82rem;
    color: #C9B8AA;
    line-height: 1.5;
    margin-top: 0.25rem;
    max-width: 60ch;
    display: block;
}
.main-nav { margin-left: auto; }
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.4rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav a {
    font-family: var(--grotesk);
    font-weight: 600;
    font-size: 0.95rem;
    color: #EADFD3;
    text-decoration: none;
    padding-bottom: 3px;
    border-bottom: 2px solid transparent;
    transition: color .16s, border-color .16s;
}
.main-nav a:hover,
.main-nav .current-menu-item > a { color: #fff; border-color: var(--accent); }
.nav-toggle {
    display: none;
    margin-left: auto;
    background: transparent;
    border: 2px solid #C9B8AA;
    border-radius: 4px;
    color: #F1E9DF;
    font-size: 0.9rem;
    padding: 0.5em 0.9em;
    cursor: pointer;
}

/* ============ ОБЩИЙ КОНТЕНТ / LAYOUT ============ */
.site-main { padding: 2.4rem 0 3rem; }

.layout { }
.layout--single { display: block; }
.layout--single .content-area { width: 85%; max-width: 1000px; margin-inline: auto; }
.layout--sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 3rem;
    align-items: start;
}
@media (max-width: 960px) {
    .layout--sidebar { grid-template-columns: minmax(0, 1fr); }
    .layout--single .content-area { width: 100%; }
}

.entry-content { line-height: 1.8; }
.entry-content h2 { margin: 1.8rem 0 0.7rem; }
.entry-content h3 { margin: 1.4rem 0 0.6rem; }
.entry-content img { border-radius: 4px; margin: 0.6rem 0; }

/* цитаты — прерывистая карандашная линия */
blockquote {
    margin: 1.6rem 0;
    padding: 0.6rem 1.4rem;
    border-left: 3px dashed var(--accent);
    font-style: italic;
    color: #4a3d34;
}

/* таблицы */
.entry-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.4rem 0;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--card-border);
}
.entry-content th, .entry-content td { padding: 0.6em 0.8em; text-align: left; }
.entry-content th { background: var(--bg-alt); font-family: var(--grotesk); }

/* ============ ХЛЕБНЫЕ КРОШКИ ============ */
.breadcrumbs {
    font-size: 0.86rem;
    color: var(--muted);
    margin: 1.2rem 0 1.6rem;
    font-family: var(--grotesk);
}
.breadcrumbs a { color: var(--muted); text-decoration-color: var(--card-border); }
.breadcrumbs .sep { margin: 0 0.35rem; color: var(--accent); }
.breadcrumbs span:last-child { color: var(--text); }

.page-title {
    margin: 0.3rem 0 1.4rem;
    font-size: 2.4rem;
}

/* ============ КАРТОЧКИ ЗАПИСЕЙ ============ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 1.6rem;
}
.card {
    display: flex;
    flex-direction: column;
    position: relative;
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 0;
    overflow: hidden;
    transition: border-color .16s;
}
.card::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 0;
    background: var(--accent);
    transition: height .16s ease;
}
.card:hover::after { height: 4px; }
.card-thumb {
    display: block;
    position: relative;
    overflow: hidden;
}
.card-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-thumb::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0; height: 45%;
    background: linear-gradient(to top, rgba(43,34,29,0.35), transparent);
    pointer-events: none;
}
.card-thumb--empty {
    aspect-ratio: 16 / 9;
    background: var(--bg-alt) var(--plan-svg) no-repeat center / 60%;
    opacity: 0.9;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.1rem 1.2rem 1.3rem;
    min-width: 0;
}
.card-title {
    font-size: 1.2rem;
    margin: 0 0 0.5rem;
}
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.card-meta {
    font-family: var(--grotesk);
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.6rem;
    letter-spacing: 0.02em;
}
.card-excerpt { flex: 1; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    align-self: flex-start;
    margin-top: 0.6rem;
    font-family: var(--grotesk);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--accent);
}
.card-more:hover { color: var(--accent-2); border-color: var(--accent-2); }

/* ============ ПАГИНАЦИЯ ============ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 2.4rem 0 0.5rem;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 0.7em;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    font-family: var(--grotesk);
    font-size: 0.9rem;
    color: var(--text);
    text-decoration: none;
    background: #fff;
    transition: background .14s, color .14s, border-color .14s;
}
.pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent); }
.pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

/* ============ САЙДБАР ============ */
.sidebar {
    background: var(--sidebar-bg);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    padding: 1.4rem 1.4rem 1.6rem;
    min-width: 0;
}
.sidebar .widget { margin-bottom: 1.8rem; }
.sidebar .widget:last-child { margin-bottom: 0; }
.widget-title,
.sidebar .widget-title {
    font-family: var(--grotesk);
    font-size: 1.05rem;
    color: var(--text);
    margin: 0 0 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}
.sidebar .widget ul { list-style: none; padding: 0; margin: 0; }
.sidebar .widget li { padding: 0.45rem 0; border-bottom: 1px dashed var(--card-border); }
.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .widget a { color: var(--text); text-decoration: none; }
.sidebar .widget a:hover { color: var(--accent); }
.sidebar .post-date,
.sidebar .rss-date { color: var(--muted); font-size: 0.8rem; }

/* форма поиска */
.search-form { display: flex; gap: 0.4rem; }
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 0.6em 0.8em;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    font-family: var(--serif);
    font-size: 0.95rem;
    background: #fff;
    color: var(--text);
}
.search-form .search-submit {
    font-family: var(--grotesk);
    font-weight: 600;
    padding: 0.6em 1.1em;
    border: 2px solid var(--accent);
    border-radius: 4px;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    transition: background .16s, color .16s, transform .08s;
}
.search-form .search-submit:hover { background: var(--accent); color: #fff; transform: translateY(2px); }

/* ============ КОММЕНТАРИИ ============ */
.comments-area { margin-top: 2.6rem; }
.comments-title, .comment-reply-title { font-family: var(--grotesk); margin-bottom: 1rem; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list li { margin: 0 0 1.2rem; }
.comment-body {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    padding: 1rem 1.2rem;
}
.comment-author { font-family: var(--grotesk); font-weight: 600; }
.comment-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.4rem; }
.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(--card-border);
    border-radius: 4px;
    font-family: var(--serif);
    background: #fff;
    color: var(--text);
    margin-top: 0.3rem;
}
.comment-form p { margin-bottom: 0.9rem; }
.comment-form .submit,
#submit {
    font-family: var(--grotesk);
    font-weight: 600;
    padding: 0.7em 1.6em;
    border: 2px solid var(--accent);
    border-radius: 4px;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
    transition: background .16s, color .16s, transform .08s;
}
.comment-form .submit:hover, #submit:hover { background: var(--accent); color: #fff; transform: translateY(2px); }

/* ============ FRONT PAGE ============ */
.front-inner { width: 85%; max-width: 1200px; margin-inline: auto; }

.front-section { padding: 3.6rem 0; }
.front-section--alt {
    background: var(--bg-alt);
    border-top: 6px solid var(--alt-topline);
}

/* блок 1 — hero */
.hero {
    position: relative;
    min-height: 78vh;
    display: flex;
    align-items: center;
    color: #F9F6F0;
    background: #3A2C24;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}
.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(43,34,29,0.72), rgba(43,34,29,0.35));
    z-index: 1;
}
.hero::after {
    content: "";
    position: absolute;
    right: -30px; bottom: -30px;
    width: 360px; height: 300px;
    background: var(--plan-svg) no-repeat right bottom;
    opacity: 0.06;
    z-index: 1;
    pointer-events: none;
}
.hero-content {
    position: relative;
    z-index: 2;
    width: 85%;
    max-width: 1200px;
    margin-inline: auto;
    padding: 4rem 0;
}
.hero h1 { color: #FBF6EE; max-width: 16ch; text-shadow: 0 2px 18px rgba(0,0,0,0.35); }
.hero-sub {
    font-family: var(--serif);
    font-size: 1.25rem;
    max-width: 52ch;
    color: #EADFD3;
    margin-bottom: 1.8rem;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

/* блок 2 — шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem;
}
.step { position: relative; padding-left: 0.4rem; min-width: 0; }
.step-num {
    font-family: var(--grotesk);
    font-weight: 800;
    font-size: 5rem;
    line-height: 0.9;
    color: var(--alt-topline);
    display: block;
    margin-bottom: 0.4rem;
}
.step h3 { margin: 0 0 0.5rem; }
.step p { font-size: 0.98rem; color: #4a3d34; margin: 0; }

/* блок 3 — цитата */
.pull-quote {
    position: relative;
    text-align: left;
    padding: 1rem 0 1rem 5.5rem;
    max-width: 900px;
}
.pull-quote::before {
    content: "\201C";
    position: absolute;
    left: 0; top: -1.4rem;
    font-family: var(--grotesk);
    font-size: 120px;
    line-height: 1;
    color: var(--accent);
}
.pull-quote blockquote {
    border: none;
    padding: 0;
    margin: 0;
    font-family: var(--grotesk);
    font-weight: 700;
    font-style: normal;
    font-size: 2.2rem;
    line-height: 1.25;
    color: var(--text);
}
.pull-quote cite {
    display: block;
    text-align: right;
    font-family: var(--serif);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--muted);
    margin-top: 1rem;
}

/* блок 4 — рубрикатор */
.rubric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.4rem;
}
.rubric {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 1.6rem 1.5rem;
    border: 4px solid var(--card-border);
    border-radius: 4px;
    background: #fff;
    text-decoration: none;
    color: var(--text);
    transition: border-color .16s, transform .1s;
}
.rubric:hover { border-color: var(--accent); transform: translateY(4px); }
.rubric svg { display: block; }
.rubric span {
    font-family: var(--grotesk);
    font-weight: 700;
    font-size: 1.15rem;
}

/* последние записи на главной */
.front-latest .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.front-latest .front-more { margin-top: 1.8rem; }

/* ============ ПОДВАЛ ============ */
.site-footer {
    position: relative;
    background: var(--footer-bg);
    color: #D8CABE;
    padding: 3rem 0 1.4rem;
    overflow: hidden;
}
.site-footer::after {
    content: "";
    position: absolute;
    right: -20px; bottom: -20px;
    width: 360px; height: 300px;
    background: var(--plan-svg) no-repeat right bottom;
    filter: invert(88%);
    opacity: 0.06;
    pointer-events: none;
}
.footer-cols {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.4rem;
}
.footer-col .widget-title {
    color: #F1E7DC;
    border-color: var(--accent);
}
.footer-col, .footer-col p, .footer-col li { color: #D8CABE; }
.footer-col a { color: #E7DACD; text-decoration: none; }
.footer-col a:hover { color: var(--accent); }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { padding: 0.35rem 0; }
.footer-social a { margin-right: 0.8rem; }
.footer-contact a { text-decoration: underline; text-decoration-color: var(--accent); }
.site-copy {
    position: relative;
    z-index: 1;
    margin-top: 2.4rem;
    padding-top: 1.2rem;
    border-top: 1px solid #55423A;
    font-size: 0.82rem;
    color: #A8968A;
    font-family: var(--grotesk);
}

/* ============ КНОПКА НАВЕРХ ============ */
.to-top {
    position: fixed;
    right: 1.4rem; bottom: 1.4rem;
    width: 46px; height: 46px;
    border: 2px solid var(--accent);
    border-radius: 4px;
    background: var(--bg);
    color: var(--accent);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 40;
    transition: background .16s, color .16s;
}
.to-top.is-visible { display: inline-flex; }
.to-top:hover { background: var(--accent); color: #fff; }
.to-top svg { display: block; }

/* ============ COOKIE ============ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    background: var(--header-bg);
    color: #EFE6DB;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    justify-content: center;
    border-top: 3px solid var(--accent);
    font-size: 0.9rem;
}
.cookie-banner p { margin: 0; max-width: 70ch; }
.cookie-banner a { color: #F1D9C4; }
.cookie-accept {
    font-family: var(--grotesk);
    font-weight: 600;
    padding: 0.55em 1.4em;
    border: 2px solid var(--accent);
    border-radius: 4px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    transition: transform .08s, background .16s;
}
.cookie-accept:hover { background: #b06a3c; transform: translateY(2px); }

/* ============ 404 ============ */
.error-404 { text-align: left; padding: 1rem 0 3rem; }
.error-404 .code { font-family: var(--grotesk); font-size: 6rem; color: var(--accent); margin: 0; }

/* ============ АДАПТИВ ============ */
@media (max-width: 960px) {
    h1 { font-size: 2.8rem; }
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rubric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .front-latest .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    body { font-size: 17px; }
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.7rem; }
    .nav-toggle { display: inline-block; }
    .main-nav { display: none; flex-basis: 100%; margin-left: 0; }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 0.4rem; }
    .front-inner, .layout--single .content-area, .hero-content { width: 92%; }
    .front-section { padding: 2.6rem 0; }
    .steps { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
    .rubric-grid { grid-template-columns: minmax(0, 1fr); }
    .footer-cols { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
    .front-latest .card-grid { grid-template-columns: minmax(0, 1fr); }
    .pull-quote { padding-left: 3.4rem; }
    .pull-quote blockquote { font-size: 1.6rem; }
    .pull-quote::before { font-size: 80px; }
    .hero { min-height: 66vh; }
}
