/*
Theme Name: dds_drcodingeg.com
Author: Владислав Карпов
Description: Информационная тема о сделках с недвижимостью: осмотр объекта, документы, торг и условия расчётов. Русскоязычная, адаптивная, без форм сбора данных.
Version: 1.1
Text Domain: realtynote
Requires at least: 6.0
Requires PHP: 8.0
*/

/* ===== Переменные ===== */
:root {
    --ink: #14202e;
    --muted: #5b6b7d;
    --brand: #1f4e79;
    --brand-2: #2d6da3;
    --accent: #c76f3d;
    --accent-dark: #a95a2d;
    --bg: #f5f7fa;
    --surface: #ffffff;
    --panel: #eef3f8;
    --line: #dde3ea;
    --footer-bg: #16232f;
    --footer-line: #2a3b4c;
    --footer-text: #c4d0dc;
    --footer-head: #ffffff;
    --radius: 10px;
    --shadow: 0 2px 10px rgba(20, 32, 46, 0.06);
}

/* ===== База ===== */
* { 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; /* A12.5 */
}

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

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

h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); margin: 0 0 0.6em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; } /* без background-color (F) */

/* Единственный контейнер ширины (A12.7) */
.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--brand);
    color: #fff;
    padding: 8px 14px;
    z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; }

.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius);
    font-weight: 600;
    border: 2px solid var(--accent);
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); text-decoration: none; color: #fff; }
.btn-outline {
    background: transparent;
    color: var(--brand);
    border-color: var(--brand);
}
.btn-outline:hover { background: var(--brand); color: #fff; }

/* ===== Шапка ===== */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-logo { max-height: 60px; width: auto; display: block; }
.brand-mark { display: block; }
.brand-text { min-width: 0; }
.site-title {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.3;
}
.site-title:hover { text-decoration: none; color: var(--brand); }
.site-desc {
    margin: 2px 0 0;
    font-size: 0.85rem;
    color: var(--muted);
    max-width: 46ch;
}

.primary-nav .nav-list {
    list-style: none;
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.primary-nav .nav-list a {
    display: block;
    padding: 8px 12px;
    color: var(--ink);
    border-radius: 6px;
    font-weight: 500;
}
.primary-nav .nav-list a:hover {
    background: var(--panel);
    text-decoration: none;
    color: var(--brand);
}
.primary-nav .current-menu-item > a { color: var(--brand); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
}

/* ===== Основная область ===== */
.site-main { padding: 28px 0 48px; }

.breadcrumbs {
    font-size: 0.88rem;
    color: var(--muted);
    margin: 0 0 22px;
}
.breadcrumbs a { color: var(--brand); }
.breadcrumbs .sep { margin: 0 6px; color: #9fb0c1; }

/* Раскладки */
.layout-single { display: block; }
.layout-single .content-area { width: 100%; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 2.35fr) minmax(0, 1fr); /* ~67% / 27% */
    gap: 42px;
    align-items: start;
}

.list-head { margin-bottom: 22px; }
.page-title { margin: 0 0 8px; }
.archive-desc, .page-intro { color: var(--muted); }

/* ===== Карточки записей (A8, A10) ===== */
.card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 26px;
}
.card {
    display: flex;            /* A8 */
    flex-direction: column;   /* A8 */
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.card-thumb-wrap {
    overflow: hidden;
}
.card-thumb-wrap a { display: block; }
.card-thumb {
    display: block;           /* A10 */
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;     /* вертикальная карточка */
    object-fit: cover;
}
.card-body {
    flex: 1;                  /* A8 */
    display: flex;
    flex-direction: column;
    padding: 18px 20px 20px;
    min-width: 0;             /* A12.6 */
}
.card-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
.card-title { font-size: 1.2rem; margin: 0 0 10px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--brand); }
.card-excerpt { color: var(--muted); font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; } /* A8 */
.card-more {
    margin-top: auto;
    padding-top: 12px;
    font-weight: 600;
    color: var(--accent);
}
.card-more:hover { color: var(--accent-dark); }

/* ===== Сайдбар ===== */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}
/* Контраст: светлый сайдбар -> тёмный текст (F) */
.sidebar .widget,
.sidebar .widget p,
.sidebar .widget li { color: var(--ink); }
.sidebar .widget-title {
    margin: 0 0 14px;
    font-size: 1.05rem;
    color: var(--ink);
    border-bottom: 2px solid var(--panel);
    padding-bottom: 8px;
}
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .widget a { color: var(--brand); }
.sidebar .widget .post-date { display: block; font-size: 0.78rem; color: var(--muted); }

/* ===== Пагинация (D5, type=plain -> .page-numbers) ===== */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 34px 0 6px;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 500;
}
.pagination a.page-numbers:hover {
    border-color: var(--brand);
    color: var(--brand);
    text-decoration: none;
}
.pagination .page-numbers.current {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: none;
    background: none;
}

/* ===== Одиночная запись / страница ===== */
.single-post {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 32px;
    box-shadow: var(--shadow);
}
.single-title { margin: 0 0 10px; }
.single-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 18px; }
.single-meta .sep { margin: 0 6px; }
.single-thumb { margin: 0 0 22px; }
.single-thumb img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.single-content { font-size: 1.02rem; }
.single-content img { border-radius: 8px; height: auto; }
.single-content h2 { margin-top: 1.4em; }
.single-content blockquote {
    margin: 1.4em 0;
    background: var(--panel);
    border-left: 4px solid var(--accent);
    padding: 1rem 1.4rem; /* A14 */
    border-radius: 0 var(--radius) var(--radius) 0;
}
.single-content blockquote p:last-child { margin-bottom: 0; }
.single-tags { margin-top: 22px; font-size: 0.9rem; color: var(--muted); }
.single-tags a { color: var(--brand); }
.page-links { margin-top: 1.2em; font-size: 0.9rem; }

/* Таблицы (F) */
.single-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.4em 0;
}
.single-content th, .single-content td {
    border: 1px solid var(--line);
    padding: 10px 12px;
    text-align: left;
}
.single-content th { background: var(--panel); }

/* ===== Комментарии ===== */
.comments-area { margin-top: 34px; }
.comments-title { margin-bottom: 18px; }
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment-list ol.children { list-style: none; margin: 14px 0 0 26px; padding: 0; }
.comment-inner {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px; /* A14 */
    margin-bottom: 14px;
}
.comment-head { display: flex; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.comment-author { font-weight: 600; }
.comment-date { font-size: 0.8rem; color: var(--muted); }
.comment-await { font-style: italic; color: var(--muted); }
.comment-reply a { font-size: 0.85rem; color: var(--accent); }

.comment-respond {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px 24px; /* A14 */
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
}
.comment-form textarea { min-height: 130px; }
.comment-form .form-submit input {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
}

/* ===== Форма поиска ===== */
.search-form .search-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}
.search-row { display: flex; gap: 8px; }
.search-input {
    flex: 1;
    min-width: 0; /* A12.6 */
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1rem;
}
.search-submit {
    background: var(--brand);
    color: #fff;
    border: none;
    padding: 0 18px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* ===== 404 ===== */
.error-404 {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 40px 36px; /* A14 */
    text-align: center;
    box-shadow: var(--shadow);
}
.error-404 .search-form { max-width: 460px; margin: 20px auto; text-align: left; }
.back-home { margin-top: 20px; }

/* ===== Главная ===== */
.front-section { padding: 34px 0; }
.fs-heading {
    font-size: 1.6rem;
    margin: 0 0 24px;
    text-align: center;
}

/* Блок 1: текст + иллюстрация */
.fs-intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
}
.fs-title { font-size: 2.1rem; margin-bottom: 0.5em; }
.fs-intro-text p { color: var(--muted); }
.fs-intro-text .btn { margin-top: 8px; }
.fs-intro-media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
}

/* Блок 2: сетка карточек-направлений */
.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
}
.topic-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 22px; /* A14 */
    box-shadow: var(--shadow);
    min-width: 0;
}
.topic-icon {
    display: inline-flex;
    width: 60px;
    height: 60px;
    align-items: center;
    justify-content: center;
    background: var(--panel);
    border-radius: 12px;
    margin-bottom: 14px;
}
.topic-card h3 { margin: 0 0 8px; }
.topic-card p { color: var(--muted); font-size: 0.94rem; margin: 0; }

/* Блок «последние записи» */
.fs-latest-more { text-align: center; margin-top: 28px; }

/* Блок 3: пошаговый */
.fs-steps {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 34px 30px; /* A14: собственный фон -> отступ со всех сторон */
}
.steps-list {
    list-style: none;
    counter-reset: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
}
.step-item {
    display: flex;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px; /* A14 */
    min-width: 0;
}
.step-num {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.step-body { min-width: 0; }
.step-body h3 { margin: 0 0 6px; font-size: 1.05rem; }
.step-body p { margin: 0; color: var(--muted); font-size: 0.93rem; }

/* Блок 4: FAQ */
.faq-list { max-width: 820px; margin: 0 auto; }
.faq-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 4px 22px; /* A14 */
    margin-bottom: 14px;
}
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    padding: 14px 0;
    list-style: none;
    position: relative;
    padding-right: 28px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
    font-size: 1.4rem;
    line-height: 1;
}
.faq-item[open] summary::after { content: '–'; }
.faq-answer { padding: 0 0 16px; }
.faq-answer p { margin: 0; color: var(--muted); }

/* ===== Подвал ===== */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
    padding: 44px 0 36px;
}
.footer-col { min-width: 0; }
/* Контраст: тёмный футер -> светлый текст (F) */
.footer-col,
.footer-col .widget,
.footer-col .widget p,
.footer-col .widget li,
.footer-col .widget .post-date { color: var(--footer-text); }
.footer-col .widget-title {
    color: var(--footer-head);
    font-size: 1.05rem;
    margin: 0 0 14px;
    border-bottom: 1px solid var(--footer-line);
    padding-bottom: 8px;
}
.footer-col .widget ul { list-style: none; margin: 0; padding: 0; }
.footer-col .widget li { padding: 6px 0; border-bottom: 1px solid var(--footer-line); }
.footer-col .widget li:last-child { border-bottom: none; }
.footer-col .widget a { color: #e6eef6; }
.footer-col .widget a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid var(--footer-line);
    padding: 18px 0;
}
.copyright { margin: 0; font-size: 0.88rem; color: #93a3b3; }

/* ===== Cookie-баннер (D6, A11) ===== */
.cookie-banner[hidden] { display: none !important; } /* до основного блока (A11) */
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    background: var(--ink);
    color: #eef3f8;
    padding: 16px 20px; /* A14 */
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    max-width: 1180px;
    margin: 0 auto;
}
.cookie-text { margin: 0; font-size: 0.9rem; flex: 1; min-width: 220px; }
.cookie-accept {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.6rem 1.4rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: var(--accent-dark); }

.no-results { color: var(--muted); }

/* ===== Адаптив ===== */
@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: minmax(0, 1fr);
        gap: 34px;
    }
    .fs-intro-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    .fs-title { font-size: 1.7rem; }

    .nav-toggle { display: flex; }
    .primary-nav {
        flex-basis: 100%;
        display: none;
    }
    .primary-nav.is-open { display: block; }
    .primary-nav .nav-list { flex-direction: column; gap: 2px; }
    .primary-nav .nav-list a { padding: 12px 10px; border-radius: 8px; }

    .single-post { padding: 22px 20px; }
    .fs-steps { padding: 26px 18px; } /* A14: отступ и в брейкпоинте */
    .faq-item { padding: 2px 18px; }
    .footer-cols { grid-template-columns: minmax(0, 1fr); gap: 26px; }
    .cookie-banner { flex-direction: column; align-items: stretch; }
    .cookie-accept { width: 100%; }
}
