/*
Theme Name: dds_makkuzu.com
Author: Алексей Зимин
Description: Информационная тема для практического ресурса о ремонте и обустройстве жилья. Адаптивная вёрстка, собственные хлебные крошки, нумерованная пагинация, cookie-баннер.
Version: 1.1
Text Domain: mkz
Requires at least: 6.0
Requires PHP: 8.0
*/

/* ====================== Базовые переменные ====================== */
:root {
    --paper: #fbf7f1;
    --surface: #ffffff;
    --ink: #2a2521;
    --muted: #6f655c;
    --line: #e7ddd0;
    --accent: #c0633a;
    --accent-deep: #8f4626;
    --sage: #5c6b52;
    --footer-bg: #241f1b;
    --footer-fg: #e9e0d4;
    --footer-muted: #b3a797;
    --shadow: 0 6px 24px rgba(42, 37, 33, 0.08);
}

/* ====================== Сброс / основа ====================== */
* { 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.7;
    color: var(--ink);
    background: var(--paper);
    overflow-x: hidden;
}

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

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

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

h1 { font-size: 2.1rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

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

.wide { width: 85%; max-width: 1180px; margin-inline: auto; }

@media (max-width: 600px) {
    .wide { width: 92%; }
}

/* ====================== Шапка ====================== */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}
.brand-logo, .brand-mark { display: block; }
.brand-text { min-width: 0; }
.brand-name {
    font-family: Georgia, serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.3;
    display: block;
    margin: 0;
}
.brand-name a { color: inherit; }
.brand-desc {
    font-size: 0.82rem;
    color: var(--muted);
    margin: 4px 0 0;
    max-width: 560px;
}

/* Навигация (не липкая) */
.main-nav { position: static; }
.nav-toggle {
    display: none;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 9px 14px;
    font-size: 0.95rem;
    cursor: pointer;
}
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 8px 14px;
    border-radius: 6px;
    color: var(--ink);
    font-size: 0.96rem;
}
.main-nav a:hover { background: var(--paper); text-decoration: none; color: var(--accent-deep); }
.main-nav .current-menu-item > a { background: var(--accent); color: #fff; }

@media (max-width: 960px) {
    .nav-toggle { display: inline-block; }
    .main-nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 12px;
    }
    .main-nav.open ul { display: flex; }
    .main-nav a { padding: 11px 14px; border-radius: 8px; }
}

/* ====================== Раскладки ====================== */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67%) minmax(0, 27%);
    gap: 6%;
    align-items: start;
    padding: 36px 0 60px;
}
.layout-single {
    display: block;
    padding: 36px 0 60px;
}
.layout-single .content-area {
    width: 100%;
}

@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

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

/* ====================== Хлебные крошки ====================== */
.crumbs {
    font-size: 0.86rem;
    color: var(--muted);
    padding: 16px 0 0;
}
.crumbs a { color: var(--accent-deep); }
.crumbs .sep { color: var(--line); margin: 0 4px; }

/* ====================== Карточки записей (A8, A10) ====================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 28px;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.card-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}
.card-thumb-placeholder {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #efe2d4, #d9c4ad);
    display: block;
}
.card-body {
    flex: 1;
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.card-title { font-size: 1.2rem; margin: 0 0 8px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--accent-deep); }
.card-meta { font-size: 0.8rem; color: var(--muted); margin: 0 0 10px; }
.card-excerpt { color: var(--ink); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 12px;
    font-weight: 600;
    color: var(--accent-deep);
}

/* ====================== Контент записи ====================== */
.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 32px 34px;
}
.entry-header { margin-bottom: 18px; }
.entry-meta { font-size: 0.85rem; color: var(--muted); }
.entry-thumb { border-radius: 10px; margin: 6px 0 22px; display: block; width: 100%; }
.entry-content img { border-radius: 8px; display: block; }
.entry-content h2, .entry-content h3 { margin-top: 1.4em; }

@media (max-width: 600px) {
    .entry { padding: 22px 18px; }
}

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

/* ====================== Сайдбар ====================== */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px 22px;
    margin-bottom: 24px;
    color: var(--ink);
}
.sidebar .widget-title {
    font-size: 1.1rem;
    color: var(--ink);
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
}
.sidebar .widget a { color: var(--accent-deep); }
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.sidebar .widget li:last-child { border-bottom: none; }
.sidebar .post-date { display: block; color: var(--muted); font-size: 0.78rem; }

/* ====================== Тематические секции главной ====================== */
.home-section { padding: 56px 0; }
.home-section:nth-child(even) { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.section-head p { color: var(--muted); }

/* Блок: текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-media img, .split-media svg { width: 100%; border-radius: 14px; display: block; }
@media (max-width: 760px) {
    .split { grid-template-columns: 1fr; gap: 28px; }
    .split.reverse .split-media { order: 0; }
}

/* Блок: сетка направлений */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}
.feature {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 26px 24px;
    min-width: 0;
}
.home-section:nth-child(even) .feature { background: var(--paper); }
.feature .ico {
    width: 46px; height: 46px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent); color: #fff;
    border-radius: 10px; margin-bottom: 14px;
}
.feature h3 { font-size: 1.15rem; margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; font-size: 0.96rem; }

/* Блок: пошаговый */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px;
    counter-reset: step;
}
.step { min-width: 0; padding-left: 8px; }
.step .num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    background: var(--sage); color: #fff;
    border-radius: 50%; font-family: Georgia, serif; font-size: 1.2rem;
    margin-bottom: 12px;
}
.step h3 { font-size: 1.1rem; margin-bottom: 6px; }
.step p { color: var(--muted); margin: 0; font-size: 0.95rem; }

/* Блок: галерея */
.gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}
.gallery figure { margin: 0; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.gallery figcaption {
    font-size: 0.85rem;
    color: var(--muted);
    padding: 10px 14px;
    background: var(--surface);
}
@media (max-width: 760px) {
    .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
    .gallery { grid-template-columns: 1fr; }
}

/* Кнопка */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 12px 26px;
    border-radius: 8px;
    font-weight: 600;
}
.btn:hover { background: var(--accent-deep); text-decoration: none; color: #fff; }

.home-latest { padding: 56px 0; }

/* ====================== Пагинация (type=plain -> .page-numbers) ====================== */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 40px 0 10px;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font-size: 0.95rem;
}
.pager a.page-numbers:hover { background: var(--paper); text-decoration: none; border-color: var(--accent); }
.pager .page-numbers.current {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.pager .page-numbers.dots {
    border: none;
    background: none;
}

/* ====================== Комментарии ====================== */
.comments-area { margin-top: 36px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 26px; padding: 0; }
.comment-inner {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 16px;
}
.comment-meta { font-size: 0.85rem; margin-bottom: 6px; }
.comment-author { font-weight: 600; }
.comment-date { color: var(--muted); margin-left: 8px; }
.comment-await { color: var(--accent-deep); font-size: 0.85rem; }

.comment-form { display: grid; gap: 14px; max-width: 640px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: var(--surface);
}
.comment-form .submit, .comment-form input[type="submit"] {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 26px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

/* ====================== Форма поиска ====================== */
.search-form {
    display: flex;
    gap: 8px;
}
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: var(--surface);
}
.search-form button {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 20px;
    font: inherit;
    cursor: pointer;
}

/* ====================== 404 ====================== */
.notfound { text-align: center; padding: 60px 0; }
.notfound .code { font-size: 5rem; font-family: Georgia, serif; color: var(--accent); margin: 0; }
.notfound .search-form { max-width: 480px; margin: 24px auto; }

/* ====================== Подвал ====================== */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-fg);
    padding: 50px 0 26px;
    margin-top: 40px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
}
@media (max-width: 760px) {
    .footer-cols { grid-template-columns: 1fr; gap: 28px; }
}
/* Контраст текста в тёмном футере — задаём явно для каждой области */
.site-footer .widget { color: var(--footer-fg); }
.site-footer .widget-title {
    color: #fff;
    font-size: 1.1rem;
    margin: 0 0 14px;
}
.site-footer .widget p { color: var(--footer-fg); }
.site-footer .widget a { color: #f0c9b3; }
.site-footer .widget a:hover { color: #fff; }
.site-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.site-footer .widget li { padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.site-footer .widget li:last-child { border-bottom: none; }
.site-footer .post-date { color: var(--footer-muted); display: block; font-size: 0.78rem; }

.copyright {
    text-align: center;
    color: var(--footer-muted);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 36px;
    padding-top: 22px;
}

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

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 999;
    background: var(--ink);
    color: #f3ece2;
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    box-shadow: 0 10px 34px rgba(0,0,0,0.3);
}
.cookie-banner p { margin: 0; font-size: 0.9rem; flex: 1; min-width: 220px; }
.cookie-banner a { color: #f0c9b3; }
.cookie-accept {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 22px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.cookie-accept:hover { background: var(--accent-deep); }

/* ====================== Утилиты ====================== */
.screen-reader-text {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}
.page-title { margin: 24px 0 8px; }
