/*
Theme Name: dds_domovladelez.ru
Author: Дмитрий Волков
Description: Информационно-графическая платформа о полном жизненном цикле частного домовладения: от архитектурного замысла и дизайна интерьеров до инженерной эксплуатации, модернизации и управления недвижимостью.
Version: 1.1
Text Domain: dmvz
*/

/* ============================ Базовые ============================ */
:root {
    --ink: #1f2a33;
    --ink-soft: #4a5a66;
    --paper: #f5f2ec;
    --paper-2: #ffffff;
    --line: #d9d2c6;
    --brand: #2f6d5b;
    --brand-dark: #234f43;
    --brand-warm: #c2773f;
    --slate: #243744;
    --slate-soft: #32505f;
}

* { box-sizing: border-box; }

.screen-reader-text {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html { scroll-behavior: smooth; }

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

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

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

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

p { margin: 0 0 1em; }

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

/* ============================ Шапка ============================ */
.site-header {
    background: var(--paper-2);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
    text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo,
.brand-mark { flex: 0 0 auto; display: block; }
.brand-mark { width: 52px; height: 52px; }
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    font-weight: 700;
    color: var(--slate);
    font-size: 1.05rem;
    line-height: 1.25;
    max-width: 46ch;
}
.brand-desc {
    display: block;
    color: var(--ink-soft);
    font-size: 0.82rem;
    margin-top: 0.2rem;
    max-width: 60ch;
}

/* ============================ Навигация ============================ */
.nav-toggle {
    display: none;
    border: 1px solid var(--line);
    background: var(--paper-2);
    color: var(--slate);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
}
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.4rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav a {
    color: var(--slate);
    font-weight: 600;
    padding: 0.35rem 0;
    display: inline-block;
}
.main-nav a:hover { color: var(--brand); text-decoration: none; }
.main-nav .current-menu-item > a { color: var(--brand); border-bottom: 2px solid var(--brand); }

/* ============================ Раскладка ============================ */
.site-main { padding: 2.2rem 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-left: auto; margin-right: auto; }
.layout-single { display: block; }

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

/* ============================ Хлебные крошки ============================ */
.crumbs {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-bottom: 1.4rem;
}
.crumbs a { color: var(--brand-dark); }
.crumbs-sep { color: var(--line); margin: 0 0.15rem; }

/* ============================ Карточки записей ============================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 1.6rem;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(31, 42, 51, 0.1); }
.card-thumb { display: block; }
.card-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.2rem 1.3rem 1.4rem;
}
.card-title { font-size: 1.15rem; margin: 0 0 0.5rem; }
.card-title a { color: var(--slate); }
.card-title a:hover { color: var(--brand); text-decoration: none; }
.card-meta { font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 0.6rem; }
.card-excerpt { color: var(--ink-soft); font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    align-self: flex-start;
    color: var(--brand);
    font-weight: 600;
    padding-top: 0.6rem;
}

/* ============================ Единичная запись / страница ============================ */
.entry { background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; padding: 1.8rem 2rem; }
.entry-title { font-size: 1.9rem; }
.entry-meta { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 1.2rem; }
.entry-thumb { border-radius: 12px; overflow: hidden; margin-bottom: 1.4rem; }
.entry-thumb img { display: block; width: 100%; object-fit: cover; }
.entry-content img { border-radius: 10px; display: block; }
.entry-content h2 { margin-top: 1.6rem; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; }
.entry-content th,
.entry-content td { border: 1px solid var(--line); padding: 0.6rem 0.8rem; text-align: left; }
.entry-content th { background: var(--paper); }

.tag-links { margin-top: 1.6rem; font-size: 0.85rem; }
.tag-links a { display: inline-block; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 0.2rem 0.6rem; margin: 0 0.3rem 0.3rem 0; }

/* ============================ Сайдбар / виджеты ============================ */
.sidebar .widget,
.footer-widgets .widget { margin-bottom: 1.8rem; }

.sidebar {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.4rem 1.4rem 0.4rem;
}
.sidebar .widget-title {
    color: var(--slate);
    font-size: 1.05rem;
    border-bottom: 2px solid var(--brand);
    padding-bottom: 0.4rem;
    margin-bottom: 0.9rem;
}
.sidebar a { color: var(--brand-dark); }
.sidebar li { color: var(--ink); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { padding: 0.4rem 0; border-bottom: 1px dashed var(--line); }
.sidebar li:last-child { border-bottom: none; }
.sidebar .post-date { display: block; font-size: 0.75rem; color: var(--ink-soft); }

/* ============================ Подвал ============================ */
.site-footer { background: var(--slate); color: #d7e0e4; margin-top: 2rem; }
.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    padding: 2.6rem 0;
}
@media (max-width: 960px) {
    .footer-widgets { grid-template-columns: 1fr; gap: 1.4rem; }
}
.footer-widgets .widget-title { color: #ffffff; font-size: 1.05rem; margin-bottom: 0.8rem; }
.footer-widgets,
.footer-widgets p,
.footer-widgets li { color: #cdd8dd; }
.footer-widgets a { color: #f1d9bf; }
.footer-widgets a:hover { color: #ffffff; }
.footer-widgets ul { list-style: none; margin: 0; padding: 0; }
.footer-widgets li { padding: 0.3rem 0; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1.1rem 0;
    font-size: 0.82rem;
    color: #aebac0;
}

/* ============================ Пагинация ============================ */
.pager { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 2.2rem; }
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 0.7rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--paper-2);
    color: var(--slate);
    font-weight: 600;
    text-decoration: none;
}
.pager a.page-numbers:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager .page-numbers.current { background: var(--brand); color: #fff; border-color: var(--brand); }
.pager .page-numbers.dots { border: none; background: none; }

/* ============================ Поиск ============================ */
.search-form { display: flex; gap: 0.5rem; max-width: 460px; }
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 0.95rem;
}
.search-form button {
    border: none;
    background: var(--brand);
    color: #fff;
    padding: 0 1.1rem;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 600;
}
.search-form button:hover { background: var(--brand-dark); }

/* ============================ Комментарии ============================ */
.comments-area { margin-top: 2.4rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: 14px; padding: 1.6rem 1.8rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 1.4rem; padding: 0; }
.comment-item { border-bottom: 1px solid var(--line); padding: 1rem 0; }
.comment-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: 0.85rem; }
.comment-author { font-weight: 700; color: var(--slate); }
.comment-date { color: var(--ink-soft); }
.comment-pending { color: var(--brand-warm); font-size: 0.85rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-family: inherit;
    margin-top: 0.3rem;
}
.comment-form .form-submit input,
.comment-form input[type="submit"] {
    background: var(--brand);
    color: #fff;
    border: none;
    padding: 0.7rem 1.4rem;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 600;
}

/* ============================ Главная: общие секции ============================ */
.home-section { padding: 3rem 0; }
.home-section + .home-section { border-top: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 1.8rem; }
.section-head .eyebrow { display: inline-block; color: var(--brand); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.78rem; margin-bottom: 0.5rem; }
.section-head h2 { font-size: 1.8rem; }
.section-head p { color: var(--ink-soft); margin: 0; }

/* Слайдер (hero) */
.hero { position: relative; }
.slider {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    background: var(--slate);
}
.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.7s ease;
}
.slide.is-active { position: relative; opacity: 1; }
.slide img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 7; }
.slide-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 2rem 2.2rem;
    background: linear-gradient(to top, rgba(20, 30, 36, 0.82), rgba(20, 30, 36, 0));
    color: #fff;
}
.slide-caption h2 { color: #fff; font-size: 1.7rem; margin-bottom: 0.3rem; }
.slide-caption p { color: #e4ecef; margin: 0; max-width: 52ch; }
.slider-dots { position: absolute; bottom: 1rem; right: 1.4rem; display: flex; gap: 0.5rem; z-index: 2; }
.slider-dot { width: 11px; height: 11px; border-radius: 50%; border: none; background: rgba(255,255,255,0.45); cursor: pointer; padding: 0; }
.slider-dot.is-active { background: #fff; }
.slider-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    z-index: 2; border: none; background: rgba(20,30,36,0.5); color: #fff;
    width: 44px; height: 44px; border-radius: 50%; cursor: pointer; font-size: 1.3rem;
}
.slider-btn:hover { background: rgba(20,30,36,0.8); }
.slider-prev { left: 1rem; }
.slider-next { right: 1rem; }

@media (max-width: 600px) {
    .slide img { aspect-ratio: 4 / 3; }
    .slide-caption { padding: 1.2rem; }
    .slide-caption h2 { font-size: 1.25rem; }
    .slider-btn { display: none; }
}

/* Текст + иллюстрация */
.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-text h2 { font-size: 1.7rem; }
.split-text p { color: var(--ink-soft); }
.split-media img { width: 100%; border-radius: 16px; display: block; }
@media (max-width: 760px) {
    .split { grid-template-columns: 1fr; gap: 1.4rem; }
    .split.reverse .split-media { order: 0; }
}

/* Сетка направлений (иконки) */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1.4rem; }
.feature {
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.6rem;
    min-width: 0;
}
.feature-icon { width: 52px; height: 52px; margin-bottom: 1rem; display: block; }
.feature h3 { margin-bottom: 0.4rem; }
.feature p { color: var(--ink-soft); font-size: 0.95rem; margin: 0; }

/* Пошаговый блок */
.steps { background: var(--slate); color: #e6edf0; border-radius: 18px; padding: 2.6rem 2rem; }
.steps .section-head h2 { color: #fff; }
.steps .section-head p { color: #c4d0d6; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1.6rem; counter-reset: step; }
.step { min-width: 0; position: relative; padding-left: 3.2rem; }
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute; left: 0; top: 0;
    width: 2.3rem; height: 2.3rem;
    background: var(--brand-warm); color: #fff;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}
.step h3 { color: #fff; font-size: 1.1rem; margin-bottom: 0.3rem; }
.step p { color: #c4d0d6; font-size: 0.92rem; margin: 0; }

/* Блок «Последние записи» на главной */
.latest-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.latest-head a { font-weight: 600; }

/* ============================ 404 ============================ */
.error-404 { text-align: center; padding: 3rem 0; }
.error-404 .code { font-size: 5rem; font-weight: 800; color: var(--brand); line-height: 1; }
.error-404 .search-form { margin: 1.6rem auto; }

/* ============================ Cookie-баннер ============================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 1rem; right: 1rem; bottom: 1rem;
    z-index: 9999;
    background: var(--slate);
    color: #e6edf0;
    border-radius: 12px;
    padding: 1rem 1.3rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    box-shadow: 0 14px 40px rgba(0,0,0,0.25);
}
.cookie-banner p { margin: 0; flex: 1; min-width: 220px; font-size: 0.9rem; }
.cookie-banner a { color: #f1d9bf; }
.cookie-accept {
    border: none;
    background: var(--brand);
    color: #fff;
    padding: 0.65rem 1.4rem;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}
.cookie-accept:hover { background: var(--brand-dark); }

/* ============================ Адаптив навигации ============================ */
@media (max-width: 760px) {
    .nav-toggle { display: inline-block; }
    .main-nav {
        flex-basis: 100%;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 0.2rem; }
    .main-nav li { border-bottom: 1px solid var(--line); }
}
