/*
Theme Name: dds_ctlos.ru
Theme URI: https://ctlos.ru
Author: Диана Захарова
Author URI: https://ctlos.ru
Description: Информационная тема о правовых вопросах недвижимости: договоры, доверенности, выписки, согласия и регистрационные процедуры. Адаптивная, без внешних зависимостей.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: ddsctlos
*/

/* =========================================================
   Переменные
   ========================================================= */
:root {
    --ink: #22282f;
    --muted: #5d6672;
    --navy: #1d3654;
    --navy-2: #15273c;
    --brass: #b0813e;
    --brass-dark: #8f6529;
    --paper: #f5f2ea;
    --card: #ffffff;
    --line: #e0dccf;
    --line-cool: #dde2ea;
    --soft: #ece7db;
    --shell: min(92%, 1180px);
    --shell-wide: min(85%, 1180px);
}

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

html { scroll-behavior: smooth; }

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

h1, h2, h3, h4 {
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.25;
    color: var(--navy-2);
    margin: 0 0 .6em;
    font-weight: 700;
}

h1 { font-size: 2.05rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1.1em; }

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

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

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

/* =========================================================
   Шапка
   ========================================================= */
.site-header {
    background: var(--card);
    border-bottom: 3px solid var(--navy);
    padding: 1.1rem 0;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
    text-decoration: none;
}

.brand-logo,
.brand-mark {
    flex: 0 0 auto;
    display: block;
}

.brand-text { min-width: 0; }

.brand-name {
    font-family: Georgia, serif;
    font-weight: 700;
    font-size: 1.12rem;
    color: var(--navy-2);
    line-height: 1.2;
}

.brand-desc {
    font-size: .82rem;
    color: var(--muted);
    line-height: 1.4;
    margin-top: .15rem;
    max-width: 46ch;
}

.brand:hover .brand-name { color: var(--brass-dark); }

.main-nav { margin-left: auto; min-width: 0; }

.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .3rem 1.25rem;
    margin: 0;
    padding: 0;
}

.main-nav a {
    color: var(--navy-2);
    font-weight: 600;
    font-size: .96rem;
    padding: .35rem .1rem;
    border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav .current-menu-item > a {
    color: var(--brass-dark);
    border-bottom-color: var(--brass);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    background: var(--navy);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: .5rem .8rem;
    font-size: .95rem;
    cursor: pointer;
}

/* =========================================================
   Хлебные крошки
   ========================================================= */
.crumbs {
    font-size: .86rem;
    color: var(--muted);
    padding: .9rem 0 0;
}

.crumbs a { color: var(--brass-dark); }
.crumbs .sep { color: var(--line); margin: 0 .15rem; }

/* =========================================================
   Каркас страницы
   ========================================================= */
.site-main { padding: 1.6rem 0 3rem; }

.layout-with-sidebar {
    width: var(--shell);
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 2.6rem;
    align-items: start;
}

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

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

/* =========================================================
   Контент записи / страницы
   ========================================================= */
.entry {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.9rem 2rem;
    margin-bottom: 1.6rem;
}

.entry-title { margin-top: 0; }

.entry-meta {
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: 1.2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.entry-content { min-width: 0; }
.entry-content p { margin: 0 0 1.15em; }

.entry-content h2 { margin-top: 1.6em; }
.entry-content h3 { margin-top: 1.3em; }

.entry-content img { border-radius: 8px; display: block; }

.entry-content ul,
.entry-content ol { padding-left: 1.4rem; margin: 0 0 1.15em; }

.entry-content blockquote {
    margin: 1.4em 0;
    padding: 1rem 1.3rem;
    background: var(--soft);
    border-left: 4px solid var(--brass);
    border-radius: 0 8px 8px 0;
    color: var(--navy-2);
    font-style: italic;
}

.entry-content a { text-decoration: underline; }

.entry-thumb {
    margin: 0 0 1.4rem;
    border-radius: 8px;
    overflow: hidden;
}
.entry-thumb img { width: 100%; display: block; }

/* Таблицы */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 1.3em;
    font-size: .95rem;
}
.entry-content table,
.entry-content th,
.entry-content td { border: 1px solid var(--line-cool); }
.entry-content th,
.entry-content td { padding: .6rem .8rem; text-align: left; }
.entry-content th { background: var(--soft); }

/* =========================================================
   Карточки записей (A8, A10)
   ========================================================= */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
    gap: 1.5rem;
    margin-bottom: 1.8rem;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

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

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.15rem 1.25rem 1.35rem;
    min-width: 0;
}

.card-title { font-size: 1.18rem; margin: 0 0 .4rem; }
.card-title a { color: var(--navy-2); }
.card-title a:hover { color: var(--brass-dark); text-decoration: none; }

.card-meta {
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: .7rem;
}

.card-excerpt { color: #3d4550; font-size: .97rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }

.card-more {
    margin-top: auto;
    padding-top: .6rem;
    font-weight: 600;
    color: var(--brass-dark);
    font-size: .94rem;
}
.card-more:hover { text-decoration: underline; }

/* =========================================================
   Главная — секции
   ========================================================= */
.front { width: var(--shell-wide); margin-inline: auto; padding: 1rem 0 2.5rem; }

.fs { padding: 2.6rem 0; }
.fs + .fs { border-top: 1px solid var(--line); }
.fs-head { margin-bottom: 1.5rem; }
.fs-head h2 { margin: 0 0 .4rem; }
.fs-head .lead { color: var(--muted); margin: 0; font-size: 1.02rem; }

/* Текст + иллюстрация */
.fs-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.4rem;
    align-items: center;
}
.fs-split .figure {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--card);
}
.fs-split .figure img { width: 100%; display: block; }
.fs-split.reverse .figure { order: -1; }
.fs-split h2 { margin-top: 0; }

/* Сетка тем */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 1.3rem;
}
.tile {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.5rem 1.4rem;
    min-width: 0;
}
.tile .ico {
    width: 44px;
    height: 44px;
    color: var(--brass-dark);
    margin-bottom: .8rem;
}
.tile h3 { margin: 0 0 .4rem; }
.tile p { margin: 0; color: var(--muted); font-size: .95rem; }

/* Шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 1.3rem;
    counter-reset: step;
}
.step {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.5rem 1.4rem 1.4rem;
    position: relative;
    min-width: 0;
}
.step .num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-family: Georgia, serif;
    font-weight: 700;
    margin-bottom: .8rem;
}
.step h3 { margin: 0 0 .35rem; font-size: 1.08rem; }
.step p { margin: 0; color: var(--muted); font-size: .94rem; }

/* FAQ / аккордеон */
.faq { display: grid; gap: .8rem; }
.faq-item {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0 1.3rem;
}
.faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: 1.1rem 0;
    font-weight: 600;
    font-family: Georgia, serif;
    color: var(--navy-2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    color: var(--brass-dark);
    font-size: 1.4rem;
    line-height: 1;
    flex: 0 0 auto;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-body { padding: 0 0 1.2rem; color: #3d4550; }
.faq-item .faq-body p { margin: 0; }

/* Последние записи на главной */
.fs-latest .fs-head { margin-bottom: 1.4rem; }

/* CTA */
.fs-cta {
    background: var(--navy);
    color: #eef2f6;
    border-radius: 12px;
    padding: 2.4rem 2.2rem;
    text-align: center;
}
.fs-cta h2 { color: #fff; margin-top: 0; }
.fs-cta p { color: #c9d3de; max-width: 60ch; margin: 0 auto 1.4rem; }
.btn {
    display: inline-block;
    background: var(--brass);
    color: #fff;
    font-weight: 600;
    padding: .8rem 1.6rem;
    border-radius: 8px;
}
.btn:hover { background: var(--brass-dark); text-decoration: none; color: #fff; }

/* =========================================================
   Пагинация (D5)
   ========================================================= */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin: 1.8rem 0 .5rem;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 .7rem;
    border: 1px solid var(--line-cool);
    border-radius: 8px;
    background: var(--card);
    color: var(--navy-2);
    font-weight: 600;
    font-size: .95rem;
}
.pager a.page-numbers:hover {
    border-color: var(--brass);
    color: var(--brass-dark);
    text-decoration: none;
}
.pager .page-numbers.current {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}
.pager .page-numbers.dots {
    border: 0;
    background: none;
}

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

.sidebar .widget {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.3rem 1.4rem;
    margin-bottom: 1.4rem;
    color: var(--ink);
}
.sidebar .widget-title {
    font-size: 1.1rem;
    margin: 0 0 1rem;
    padding-bottom: .6rem;
    border-bottom: 2px solid var(--brass);
    color: var(--navy-2);
}
.sidebar .widget a { color: var(--brass-dark); }
.sidebar .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar .widget li {
    padding: .5rem 0;
    border-bottom: 1px solid var(--line);
    font-size: .96rem;
}
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .widget .post-date {
    display: block;
    font-size: .78rem;
    color: var(--muted);
}

/* =========================================================
   Подвал
   ========================================================= */
.site-footer {
    background: var(--navy-2);
    color: #c4cdd8;
    padding: 2.8rem 0 1.4rem;
    margin-top: auto;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 2rem;
}
.site-footer .widget { margin-bottom: 0; min-width: 0; }
.site-footer .widget-title {
    color: #fff;
    font-size: 1.08rem;
    margin: 0 0 1rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .18);
}
.site-footer .widget,
.site-footer .widget p { color: #c4cdd8; }
.site-footer .widget a { color: #e7c58a; }
.site-footer .widget a:hover { color: #fff; }
.site-footer .widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-footer .widget li { padding: .35rem 0; }
.site-footer .widget .post-date { color: #9aa6b3; font-size: .78rem; display: block; }

.site-info {
    text-align: center;
    margin-top: 2.2rem;
    padding-top: 1.3rem;
    border-top: 1px solid rgba(255, 255, 255, .14);
    font-size: .85rem;
    color: #9aa6b3;
}

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

/* =========================================================
   Формы поиска / комментарии
   ========================================================= */
.search-form {
    display: flex;
    gap: .5rem;
    max-width: 520px;
}
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: .6rem .8rem;
    border: 1px solid var(--line-cool);
    border-radius: 8px;
    font-size: 1rem;
}
.search-form button {
    background: var(--navy);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: .6rem 1.1rem;
    cursor: pointer;
    font-size: 1rem;
}
.search-form button:hover { background: var(--navy-2); }

.comments-area {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1.6rem 1.8rem;
    margin-top: 1.6rem;
}
.comments-title { margin-top: 0; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list ul.children { list-style: none; margin: 0 0 0 1.4rem; padding: 0; }
.comment-item { margin-bottom: 1.2rem; }
.comment-body {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem 1.2rem;
}
.comment-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .4rem;
    font-size: .85rem;
    margin-bottom: .5rem;
}
.comment-author { font-weight: 600; color: var(--navy-2); }
.comment-date { color: var(--muted); }
.comment-reply { font-size: .85rem; margin-top: .4rem; }

.comment-respond {
    margin-top: 1.4rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line);
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: .6rem .7rem;
    border: 1px solid var(--line-cool);
    border-radius: 8px;
    font-family: inherit;
    font-size: .98rem;
    margin-top: .3rem;
}
.comment-form p { margin-bottom: .9rem; }
.comment-form .submit,
.form-submit input {
    background: var(--navy);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: .7rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
}

/* =========================================================
   404
   ========================================================= */
.error-404 {
    width: var(--shell-wide);
    margin-inline: auto;
    text-align: center;
    padding: 2.5rem 0 3rem;
}
.error-404 .code {
    font-family: Georgia, serif;
    font-size: 5rem;
    color: var(--brass);
    line-height: 1;
    margin: 0 0 .4rem;
}
.error-404 .search-form { margin: 1.6rem auto 0; }

/* =========================================================
   Cookie-баннер (D6, A11)
   ========================================================= */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 999;
    background: var(--navy-2);
    color: #e7ecf2;
    border-radius: 12px;
    padding: 1.1rem 1.3rem;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
    max-width: 720px;
    margin-inline: auto;
}
.cookie-banner p { margin: 0; flex: 1; min-width: 220px; font-size: .92rem; }
.cookie-banner a { color: #e7c58a; }
.cookie-banner button {
    background: var(--brass);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: .6rem 1.3rem;
    font-size: .95rem;
    cursor: pointer;
    flex: 0 0 auto;
}
.cookie-banner button:hover { background: var(--brass-dark); }

/* =========================================================
   Адаптив
   ========================================================= */
@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.8rem;
    }
    .fs-split { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
    .fs-split.reverse .figure { order: 0; }
}

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

    .nav-toggle { display: inline-block; }
    .main-nav {
        flex-basis: 100%;
        margin-left: 0;
        display: none;
    }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav li { border-bottom: 1px solid var(--line); }
    .main-nav a { display: block; padding: .7rem 0; border-bottom: 0; }

    .entry { padding: 1.4rem 1.3rem; }
    .fs-cta { padding: 1.9rem 1.4rem; }
    .comments-area { padding: 1.2rem 1.3rem; }

    .cookie-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}
