/*
Theme Name: dds_mnogoperegorodok.ru
Author: Дмитрий Стеклов
Description: Экспертный DIY-портал о зонировании и установке перегородок: инструкции, кейсы и идеи для самостоятельного обустройства дома.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: mpg
*/

:root {
    --bg: #f6f2ec;
    --surface: #ffffff;
    --ink: #2a2622;
    --ink-soft: #5c554d;
    --line: #e3dacd;
    --accent: #b56a36;
    --accent-dark: #8f4f24;
    --forest: #314136;
    --forest-deep: #25322a;
    --footer-bg: #25322a;
    --footer-ink: #d9e2d6;
    --footer-muted: #9fb09a;
    --radius: 14px;
    --shadow: 0 8px 24px rgba(42, 38, 34, .08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

h1, h2, h3, h4 {
    font-family: Georgia, "PT Serif", "Times New Roman", serif;
    line-height: 1.25;
    color: var(--ink);
    margin: 0 0 .5em;
}
h1 { font-size: 2.1rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 1.1em; }

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

/* ---------- Header ---------- */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}
.brand-logo, .brand-logo svg { width: 52px; height: 52px; display: block; flex: none; }
.brand-text { min-width: 0; }
.brand-name {
    font-family: Georgia, serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--ink);
    display: block;
    line-height: 1.2;
}
.brand-tagline {
    font-size: .82rem;
    color: var(--ink-soft);
    display: block;
    max-width: 640px;
}
.main-nav { width: 100%; }
.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    border-top: 1px solid var(--line);
    padding-top: 12px;
}
.main-nav a {
    color: var(--ink);
    font-weight: 600;
    padding: 4px 2px;
    border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: var(--accent-dark); border-bottom-color: var(--accent); text-decoration: none; }
.current-menu-item > a { color: var(--accent-dark); border-bottom-color: var(--accent); }

.nav-toggle {
    display: none;
    background: var(--forest);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: .95rem;
    cursor: pointer;
}

/* ---------- Layout ---------- */
.site-main { padding: 34px 0 50px; }
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 6%;
    align-items: start;
}
.layout-single { display: block; }
.layout-single .content-area { width: min(85%, 1000px); margin-inline: auto; }

.breadcrumbs {
    font-size: .85rem;
    color: var(--ink-soft);
    margin-bottom: 22px;
}
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs a:hover { color: var(--accent-dark); }
.breadcrumbs .sep { margin: 0 6px; color: var(--line); }

/* ---------- Cards ---------- */
.card-list { display: grid; gap: 26px; }
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.card-row { flex-direction: row; }
.card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
    background: var(--line);
}
.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-body {
    flex: 1;
    min-width: 0;
    padding: 22px 24px 24px;
    display: flex;
    flex-direction: column;
}
.card-title { margin: 0 0 .4em; font-size: 1.3rem; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent-dark); text-decoration: none; }
.card-meta { font-size: .8rem; color: var(--ink-soft); margin-bottom: .7em; }
.card-excerpt { color: var(--ink-soft); }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-more {
    margin-top: auto;
    align-self: flex-start;
    font-weight: 600;
    color: var(--accent-dark);
}
.card-more::after { content: " →"; }

/* ---------- Front page ---------- */
.section { padding: 40px 0; border-bottom: 1px solid var(--line); }
.section:last-of-type { border-bottom: 0; }
.section-head { max-width: 720px; margin-bottom: 28px; }
.section-head .kicker {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .72rem;
    color: var(--accent-dark);
    font-weight: 700;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 44px;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-media img, .split-media svg {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
}

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.tile {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 22px;
}
.tile-ico { width: 48px; height: 48px; display: block; margin-bottom: 14px; }
.tile h3 { font-size: 1.18rem; }
.tile p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; counter-reset: step; }
.step {
    position: relative;
    padding: 26px 20px 22px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.step::before {
    counter-increment: step;
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-family: Georgia, serif;
    margin-bottom: 14px;
}
.step h3 { font-size: 1.1rem; }
.step p { margin: 0; color: var(--ink-soft); font-size: .93rem; }

.faq { max-width: 820px; }
.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 4px 22px;
    margin-bottom: 14px;
}
.faq summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1.08rem;
    padding: 16px 0;
    list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--accent-dark); font-size: 1.3rem; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--ink-soft); }

.latest-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.latest-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.latest-grid .card-thumb-wrap { flex: none; position: static; aspect-ratio: 16 / 10; }
.latest-grid .card-thumb-wrap a { position: static; }
.latest-grid .card-thumb-wrap img { aspect-ratio: 16 / 10; }

.cta {
    background: var(--forest);
    color: #fff;
    border-radius: var(--radius);
    padding: 44px 40px;
    text-align: center;
}
.cta h2 { color: #fff; }
.cta p { color: #d7e1d2; max-width: 620px; margin-inline: auto; }
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 13px 30px;
    border-radius: 10px;
    font-weight: 600;
    margin-top: 12px;
}
.btn:hover { background: var(--accent-dark); text-decoration: none; color: #fff; }

/* ---------- Single / Page ---------- */
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 34px; box-shadow: var(--shadow); }
.entry-title { font-size: 2rem; }
.entry-meta { font-size: .85rem; color: var(--ink-soft); margin-bottom: 18px; }
.entry-thumb { border-radius: var(--radius); margin-bottom: 20px; display: block; }
.entry-content { word-wrap: break-word; }
.entry-content img { border-radius: 10px; display: block; }
.entry-content h2, .entry-content h3 { margin-top: 1.2em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }

table { border-collapse: collapse; width: 100%; margin: 1.2em 0; }
table, th, td { border: 1px solid var(--line); }
th, td { padding: 9px 12px; text-align: left; }
th { background: var(--bg); }

/* ---------- Sidebar (light bg → dark text) ---------- */
.sidebar { min-width: 0; }
.widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 22px;
    color: var(--ink);
}
.widget .widget-title, .widget h2 {
    font-size: 1.1rem;
    margin: 0 0 14px;
    color: var(--ink);
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: 0; }
.widget a { color: var(--ink); }
.widget a:hover { color: var(--accent-dark); }
.widget .post-date { display: block; font-size: .78rem; color: var(--ink-soft); }

/* ---------- Footer (dark bg → light text) ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); margin-top: 40px; }
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
    padding: 44px 0 30px;
}
.footer-col .widget {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    color: var(--footer-ink);
}
.footer-col .widget-title, .footer-col .widget h2 {
    color: #fff;
    border-bottom-color: var(--accent);
}
.footer-col .widget a { color: var(--footer-ink); }
.footer-col .widget a:hover { color: #fff; }
.footer-col .widget li { border-bottom-color: rgba(255, 255, 255, .12); }
.footer-col .widget .post-date { color: var(--footer-muted); }
.footer-col p { color: var(--footer-ink); }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .14);
    padding: 18px 0;
    font-size: .85rem;
    color: var(--footer-muted);
    text-align: center;
}

/* ---------- Pagination (type=plain → .page-numbers) ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 40px 0 0; }
.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: 9px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
}
.pagination a.page-numbers:hover { border-color: var(--accent); color: var(--accent-dark); text-decoration: none; }
.pagination .page-numbers.current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .page-numbers.dots { border-color: transparent; background: transparent; }

/* ---------- Search form ---------- */
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: .95rem;
    background: var(--surface);
    color: var(--ink);
}
.search-form button {
    border: 0;
    background: var(--forest);
    color: #fff;
    padding: 10px 18px;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 600;
}

/* ---------- Comments ---------- */
.comments-area { margin-top: 36px; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; }
.comment-meta { font-size: .82rem; color: var(--ink-soft); margin-bottom: 6px; }
.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: 9px;
    font-family: inherit;
    font-size: .95rem;
    margin-bottom: 12px;
}
.comment-form .submit, .comment-form input[type="submit"] {
    background: var(--accent);
    color: #fff;
    border: 0;
    padding: 11px 26px;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 600;
}

/* ---------- 404 ---------- */
.page-404 { text-align: center; padding: 30px 0 10px; }
.page-404 .big { font-size: 4rem; font-family: Georgia, serif; color: var(--accent); margin: 0; }
.page-404 .search-form { max-width: 460px; margin: 22px auto 0; }

/* ---------- Cookie banner ---------- */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--forest-deep);
    color: #eef2ec;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, .18);
}
.cookie-banner p { margin: 0; font-size: .9rem; max-width: 760px; }
.cookie-banner a { color: #f0c9a4; }
.cookie-accept {
    background: var(--accent);
    color: #fff;
    border: 0;
    padding: 11px 26px;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}
.cookie-accept:hover { background: var(--accent-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 34px; }
    .tiles, .steps, .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split { grid-template-columns: 1fr; gap: 26px; }
    .split.reverse .split-media { order: 0; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.4rem; }
    .nav-toggle { display: inline-block; }
    .main-nav ul { display: none; flex-direction: column; gap: 2px; }
    .main-nav.open ul { display: flex; }
    .tiles, .steps, .latest-grid { grid-template-columns: 1fr; }
    .layout-single .content-area { width: 100%; }
    .card-row { flex-direction: column; }
    .card-row .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .card-row .card-thumb-wrap a { position: static; }
    .card-row .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .home-shell { width: 90%; }
    .cta { padding: 32px 22px; }
}
