/*
Theme Name: dds_craftnodehosting.com
Author: Алиса Фомина
Description: Информационная тема о выборе объектов недвижимости: планировки, состояние дома, документы, инфраструктура и расходы после покупки.
Version: 1.1
Text Domain: craftnode
Requires at least: 6.0
Requires PHP: 8.0
*/

/* -------------------------------------------------------------------------
 * Переменные и сброс
 * ---------------------------------------------------------------------- */
:root {
    --navy:        #1f3d5c;
    --navy-dark:   #16304a;
    --accent:      #c8763a;
    --accent-soft: #e0a56b;
    --bg:          #f6f4f0;
    --surface:     #ffffff;
    --text:        #2b2f36;
    --muted:       #6b7280;
    --border:      #e3ddd2;
    --radius:      10px;
    --shell:       1180px;
    --shadow:      0 6px 22px rgba(31, 61, 92, .08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

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

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

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

.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: .7em 1.5em;
    border-radius: 6px;
    font-weight: 600;
    transition: background .18s ease;
}
.btn:hover { background: #b3622c; text-decoration: none; color: #fff; }

.btn-ghost {
    background: transparent;
    border: 1.5px solid var(--navy);
    color: var(--navy);
}
.btn-ghost:hover { background: var(--navy); color: #fff; }

/* -------------------------------------------------------------------------
 * Шапка
 * ---------------------------------------------------------------------- */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}
.branding {
    display: flex;
    align-items: center;
    gap: .9rem;
    min-width: 0;
}
.branding .brand-logo { display: block; flex: none; }
.brand-text { min-width: 0; }
.site-title {
    font-family: Georgia, serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
    line-height: 1.25;
}
.site-title a { color: inherit; }
.site-title a:hover { text-decoration: none; color: var(--accent); }
.site-desc {
    margin: .25rem 0 0;
    font-size: .82rem;
    color: var(--muted);
    max-width: 46ch;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.4rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav a {
    color: var(--navy);
    font-weight: 600;
    font-size: .96rem;
}
.main-nav a:hover { color: var(--accent); text-decoration: none; }
.main-nav .current-menu-item > a { color: var(--accent); }

.nav-toggle {
    display: none;
    background: none;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    padding: .45rem .6rem;
    cursor: pointer;
    color: var(--navy);
    font-size: 1.1rem;
    line-height: 1;
}

/* -------------------------------------------------------------------------
 * Основной каркас
 * ---------------------------------------------------------------------- */
.site-main { padding: 2.2rem 0 3rem; }

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

.breadcrumbs {
    font-size: .85rem;
    color: var(--muted);
    margin-bottom: 1.4rem;
}
.breadcrumbs a { color: var(--navy); }
.breadcrumbs .sep { margin: 0 .35rem; color: var(--accent); }

/* -------------------------------------------------------------------------
 * Сайдбар
 * ---------------------------------------------------------------------- */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--text);
}
.sidebar .widget-title {
    font-size: 1.05rem;
    margin-bottom: .9rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--accent-soft);
    color: var(--navy);
}
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: .45rem 0; border-bottom: 1px solid var(--border); }
.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .widget a { color: var(--navy); font-weight: 500; }
.sidebar .widget a:hover { color: var(--accent); }
.sidebar .widget .post-date,
.sidebar .widget time { color: var(--muted); font-size: .8rem; }

/* -------------------------------------------------------------------------
 * Карточки записей
 * ---------------------------------------------------------------------- */
.card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.6rem;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.card.card-row {
    flex-direction: row;
    align-items: stretch;
}
.card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
    background: #eef1f4;
}
.card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.card-thumb-placeholder {
    width: 100%;
    height: 100%;
    min-height: 190px;
    display: block;
    background: linear-gradient(135deg, #2b5175, #1f3d5c);
}
.card-body {
    flex: 1;
    min-width: 0;
    padding: 1.3rem 1.5rem;
    display: flex;
    flex-direction: column;
}
.card-title { font-size: 1.2rem; margin-bottom: .5rem; }
.card-title a { color: var(--navy); }
.card-title a:hover { color: var(--accent); }
.card-meta { font-size: .82rem; color: var(--muted); margin-bottom: .7rem; }
.card-excerpt { color: var(--text); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more { margin-top: auto; padding-top: .6rem; }
.card-more a { font-weight: 600; }

/* -------------------------------------------------------------------------
 * Пагинация
 * ---------------------------------------------------------------------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: 2.2rem;
}
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 .6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--navy);
    font-weight: 600;
}
.pagination a.page-numbers:hover {
    background: var(--navy);
    color: #fff;
    text-decoration: none;
}
.pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: none;
    background: none;
}

/* -------------------------------------------------------------------------
 * Одиночная запись / страница
 * ---------------------------------------------------------------------- */
.entry {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 2.2rem;
}
.entry-header { margin-bottom: 1.2rem; }
.entry-title { font-size: 1.9rem; }
.entry-meta { font-size: .85rem; color: var(--muted); margin-top: .4rem; }
.entry-thumb { margin: 0 0 1.5rem; border-radius: var(--radius); overflow: hidden; }
.entry-thumb img { width: 100%; display: block; }
.entry-content { min-width: 0; }
.entry-content img { border-radius: 6px; }
.entry-content h2 { margin-top: 1.6rem; }
.entry-content ul, .entry-content ol { padding-left: 1.4rem; }
.entry-content blockquote {
    margin: 1.4rem 0;
    padding: 1rem 1.4rem;
    background: #eef2f6;
    border-left: 4px solid var(--accent);
    border-radius: 0 6px 6px 0;
    color: var(--navy);
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4rem 0;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--border);
}
.entry-content th, .entry-content td { padding: .6rem .8rem; text-align: left; }
.entry-content th { background: #eef2f6; color: var(--navy); }

.tags-line { margin-top: 1.6rem; font-size: .88rem; }
.tags-line a {
    display: inline-block;
    background: #eef2f6;
    color: var(--navy);
    padding: .2rem .7rem;
    border-radius: 20px;
    margin: 0 .3rem .3rem 0;
}
.tags-line a:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* -------------------------------------------------------------------------
 * Комментарии
 * ---------------------------------------------------------------------- */
.comments-area {
    margin-top: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.8rem 2rem;
}
.comments-area .comment-list { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.comments-area .comment-list ul { list-style: none; padding-left: 1.5rem; }
.comments-area .comment-body {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.comments-area .comment-author { font-weight: 600; color: var(--navy); }
.comments-area .comment-metadata { font-size: .8rem; color: var(--muted); }
.comment-form label { display: block; font-weight: 600; margin: .8rem 0 .3rem; color: var(--navy); }
.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(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: .95rem;
}
.comment-form .form-submit input {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: .7em 1.6em;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-top: .8rem;
}

/* -------------------------------------------------------------------------
 * Форма поиска
 * ---------------------------------------------------------------------- */
.search-form {
    display: flex;
    gap: .5rem;
}
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: .6rem .7rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
}
.search-form button {
    background: var(--navy);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0 1.1rem;
    cursor: pointer;
    font-weight: 600;
}
.sidebar .search-form { margin-top: .3rem; }

/* -------------------------------------------------------------------------
 * Главная
 * ---------------------------------------------------------------------- */
.front-hero {
    background: linear-gradient(120deg, var(--navy-dark), var(--navy));
    color: #fff;
    padding: 3.2rem 0;
    overflow: hidden;
}
.front-hero .hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: 2.4rem;
    align-items: center;
}
.hero-copy h1 { color: #fff; font-size: 2.3rem; }
.hero-copy p { color: #dbe4ee; font-size: 1.08rem; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.2rem; }
.hero-actions .btn-ghost { border-color: #fff; color: #fff; }
.hero-actions .btn-ghost:hover { background: #fff; color: var(--navy); }
.hero-art { justify-self: center; }
.hero-art img, .hero-art svg { width: 100%; max-width: 460px; display: block; }

.front-section { padding: 3rem 0; }
.front-section.alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-head { text-align: center; max-width: 60ch; margin: 0 auto 2rem; }
.section-head p { color: var(--muted); }

/* Текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.6rem;
    align-items: center;
}
.split.reverse .split-media { order: 2; }
.split-media img, .split-media svg { width: 100%; display: block; border-radius: var(--radius); }
.split-copy { min-width: 0; }
.split-copy h2 { text-align: left; }

/* Сетка карточек-иконок */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.4rem;
}
.feature {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem 1.4rem;
    text-align: center;
}
.front-section.alt .feature { background: #fff; }
.feature svg { width: 46px; height: 46px; margin-bottom: .8rem; }
.feature h3 { font-size: 1.08rem; }
.feature p { font-size: .92rem; color: var(--muted); margin: 0; }

/* Шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.4rem;
    counter-reset: step;
}
.step {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem 1.4rem 1.4rem;
    position: relative;
}
.step::before {
    counter-increment: step;
    content: counter(step);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-family: Georgia, serif;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: .8rem;
}
.step h3 { font-size: 1.05rem; }
.step p { font-size: .92rem; color: var(--muted); margin: 0; }

/* Последние записи на главной */
.latest-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.6rem;
}
.latest-grid .card { flex-direction: column; }
.latest-grid .card-thumb-wrap {
    flex: none;
    position: static;
    height: 190px;
}
.latest-grid .card-thumb-wrap a { position: static; }
.front-latest-more { text-align: center; margin-top: 1.8rem; }

/* FAQ */
.faq { max-width: 820px; margin: 0 auto; }
.faq details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.4rem;
    margin-bottom: .9rem;
}
.faq summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--navy);
    font-family: Georgia, serif;
    font-size: 1.05rem;
    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: .9rem 0 0; color: var(--muted); }

/* CTA */
.cta-section {
    background: linear-gradient(120deg, var(--navy), var(--navy-dark));
    color: #fff;
    border-radius: var(--radius);
    padding: 2.6rem 2.4rem;
    text-align: center;
}
.cta-section h2 { color: #fff; }
.cta-section p { color: #dbe4ee; max-width: 60ch; margin: 0 auto 1.4rem; }
.cta-section .btn { background: var(--accent); }
.cta-section .btn:hover { background: #b3622c; }

/* -------------------------------------------------------------------------
 * Подвал
 * ---------------------------------------------------------------------- */
.site-footer {
    background: var(--navy-dark);
    color: #cdd8e3;
    margin-top: 2rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.2rem;
    padding: 2.8rem 0 2rem;
}
.footer-cols .widget { min-width: 0; color: #cdd8e3; }
.footer-cols .widget-title {
    color: #fff;
    font-size: 1.08rem;
    margin-bottom: 1rem;
}
.footer-cols .widget ul { list-style: none; margin: 0; padding: 0; }
.footer-cols .widget li { padding: .35rem 0; }
.footer-cols .widget a { color: var(--accent-soft); }
.footer-cols .widget a:hover { color: #fff; }
.footer-cols .widget .post-date,
.footer-cols .widget time { color: #93a4b6; font-size: .8rem; }
.footer-cols .widget p { color: #cdd8e3; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .12);
    padding: 1.1rem 0;
    font-size: .85rem;
    color: #93a4b6;
    text-align: center;
}

/* -------------------------------------------------------------------------
 * Cookie-баннер
 * ---------------------------------------------------------------------- */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--navy-dark);
    color: #e6edf4;
    padding: 1rem 0;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, .18);
}
.cookie-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    flex-wrap: wrap;
}
.cookie-inner p { margin: 0; font-size: .9rem; }
.cookie-inner a { color: var(--accent-soft); }
.cookie-banner button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: .6em 1.4em;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

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

/* -------------------------------------------------------------------------
 * Контакты / статичные соцсети
 * ---------------------------------------------------------------------- */
.contact-block { margin-top: 1.4rem; }
.contact-block a { font-weight: 600; }
.social-links { display: flex; gap: 1rem; margin-top: 1rem; list-style: none; padding: 0; }

/* -------------------------------------------------------------------------
 * Адаптив
 * ---------------------------------------------------------------------- */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .sidebar { margin-top: 1rem; }
    .front-hero .hero-inner { grid-template-columns: 1fr; text-align: center; }
    .hero-actions { justify-content: center; }
    .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

    .layout-single,
    .layout-single .content-area { width: 100%; }

    .main-nav {
        flex-basis: 100%;
        display: none;
    }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: .2rem; }
    .main-nav li { border-bottom: 1px solid var(--border); padding: .3rem 0; }
    .nav-toggle { display: inline-block; }
    .header-inner { justify-content: space-between; }

    .split { grid-template-columns: 1fr; }
    .split.reverse .split-media { order: 0; }
    .feature-grid { grid-template-columns: 1fr; }
    .steps { grid-template-columns: 1fr; }
    .latest-grid { grid-template-columns: 1fr; }
    .footer-cols { grid-template-columns: 1fr; gap: 1.6rem; }

    .entry { padding: 1.4rem 1.2rem; }
    .cta-section { padding: 1.8rem 1.4rem; }

    .card.card-row { flex-direction: column; }
    .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
        height: auto;
    }
    .card-thumb-wrap a { position: static; }
    .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .card-thumb-placeholder { min-height: 0; aspect-ratio: 16 / 9; }
}
