/*
Theme Name: dds_leadergk.ru
Theme URI: https://leadergk.ru
Author: Руслан Исаев
Author URI: https://leadergk.ru
Description: Контентный сайт о планировках квартир, ремонте и организации жилого пространства с уклоном в инженерную подготовку квартиры под связь, технику и домашний комфорт.
Version: 1.1
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dds_leadergk
*/

/* ============ Базовые сбросы и переменные ============ */
:root {
    --bg: #F7F6F3;
    --text: #2C2C2C;
    --accent: #B85C38;
    --accent-dark: #9A4A2C;
    --linen: #E2D9CD;
    --paper: #FEFCF8;
    --slate: #2E3A3F;
    --border: #D9D5CC;
    --muted: #6A6A6A;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PT Sans", "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

h1, h2, h3, h4, h5, h6 {
    color: var(--slate);
    line-height: 1.25;
    margin: 1.3em 0 0.6em;
    font-weight: 700;
}

h1 { font-size: 2.1em; color: var(--accent); }
h2 { font-size: 1.6em; color: var(--accent); }
h3 { font-size: 1.3em; }
h4 { font-size: 1.1em; }

p {
    margin: 0 0 1em;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5em 0;
}

blockquote {
    background: var(--linen);
    border-left: 4px solid var(--accent);
    margin: 1.5em 0;
    padding: 1em 1.3em;
    color: var(--slate);
    font-style: italic;
}

blockquote p:last-child {
    margin-bottom: 0;
}

code, pre {
    font-family: "SF Mono", Consolas, "Courier New", monospace;
    background: var(--linen);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.92em;
}

pre {
    padding: 1em;
    overflow-x: auto;
}

pre code {
    padding: 0;
    background: transparent;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.3em 0;
    border: 1px solid var(--border);
}

th, td {
    padding: 0.7em 1em;
    text-align: left;
    border: 1px solid var(--border);
}

th {
    background: var(--linen);
    font-weight: 600;
    color: var(--slate);
}

/* ============ Общий каркас ============ */
.page-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 92%;
    max-width: 1240px;
    margin: 0 auto;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    z-index: 10000;
}

.skip-link:focus {
    left: 1em;
    top: 1em;
    background: var(--accent);
    color: #fff;
    padding: 0.6em 1em;
    border-radius: 4px;
}

/* ============ Шапка ============ */
.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--border);
    padding: 1.2em 0 0.9em;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5em;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85em;
    text-decoration: none;
    color: var(--text);
    flex: 1 1 auto;
    min-width: 0;
}

.brand:hover {
    text-decoration: none;
    color: var(--text);
}

.brand-logo,
.brand-logo-fallback {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
    display: block;
}

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

.brand-name {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--slate);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.brand-tagline {
    font-size: 0.82em;
    color: var(--muted);
    margin-top: 0.15em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.5em 0.7em;
    cursor: pointer;
    font-size: 1.1em;
    color: var(--slate);
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5em;
}

.main-nav li {
    position: relative;
}

.main-nav a {
    color: var(--slate);
    font-weight: 500;
    padding: 0.4em 0;
    text-decoration: none;
    display: inline-block;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}

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

.main-nav ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--paper);
    border: 1px solid var(--border);
    min-width: 200px;
    padding: 0.5em 0;
    flex-direction: column;
    gap: 0;
    z-index: 500;
}

.main-nav li:hover > ul {
    display: flex;
}

.main-nav ul ul a {
    padding: 0.5em 1em;
    display: block;
    border-bottom: none;
}

/* ============ Тег-фильтры под шапкой ============ */
.topic-filters {
    background: var(--paper);
    border-bottom: 1px solid var(--border);
    padding: 0.9em 0;
}

.topic-filters-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em 1em;
    align-items: center;
}

.topic-filters-label {
    font-size: 0.88em;
    color: var(--muted);
    margin-right: 0.3em;
}

.topic-filter {
    display: inline-block;
    padding: 0.25em 0.8em;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--slate);
    font-size: 0.88em;
    text-decoration: none;
    transition: all 0.2s;
}

.topic-filter:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    text-decoration: none;
}

/* ============ Хлебные крошки ============ */
.breadcrumbs {
    padding: 1em 0 0.3em;
    font-size: 0.9em;
    color: var(--muted);
}

.breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--accent);
}

.breadcrumbs .sep {
    margin: 0 0.4em;
    color: var(--border);
}

/* ============ Основной контент и сайдбар ============ */
.site-main {
    flex: 1;
    padding: 1.5em 0 3em;
}

.layout-with-sidebar {
    display: flex;
    gap: 3%;
    align-items: flex-start;
}

.layout-with-sidebar .content-area {
    flex: 0 0 67%;
    max-width: 67%;
    min-width: 0;
}

.layout-with-sidebar .sidebar-area {
    flex: 0 0 27%;
    max-width: 27%;
    min-width: 0;
}

.layout-no-sidebar .content-area {
    width: 85%;
    margin: 0 auto;
}

/* ============ Карточки записей ============ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5em;
    margin: 1.5em 0 2em;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(46, 58, 63, 0.08);
}

.card-thumb {
    display: block;
    width: 100%;
    background: var(--linen);
}

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

.card-body {
    flex: 1;
    padding: 1.1em 1.2em 1.3em;
    display: flex;
    flex-direction: column;
}

.card-title {
    margin: 0 0 0.5em;
    font-size: 1.15em;
    line-height: 1.35;
}

.card-title a {
    color: var(--slate);
    text-decoration: none;
}

.card-title a:hover {
    color: var(--accent);
    text-decoration: none;
}

.card-meta {
    font-size: 0.83em;
    color: var(--muted);
    margin-bottom: 0.6em;
}

.card-excerpt {
    font-size: 0.94em;
    color: var(--text);
    flex: 1;
}

.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}

.card-excerpt p:last-child {
    margin-bottom: 0;
}

.card-more {
    margin-top: 0.9em;
    display: inline-block;
    padding: 0.45em 1em;
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    background: transparent;
    font-size: 0.9em;
    text-decoration: none;
    transition: all 0.2s;
    align-self: flex-start;
}

.card-more:hover {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
}

/* ============ Запись / страница ============ */
.entry-header {
    margin-bottom: 1.5em;
}

.entry-title {
    margin: 0.2em 0 0.4em;
}

.entry-meta {
    font-size: 0.88em;
    color: var(--muted);
    margin-bottom: 0.7em;
}

.entry-meta a {
    color: var(--muted);
}

.entry-meta a:hover {
    color: var(--accent);
}

.entry-thumb {
    margin: 1em 0 1.5em;
    border-radius: 8px;
    overflow: hidden;
}

.entry-thumb img {
    display: block;
    width: 100%;
    height: auto;
}

.entry-content {
    font-size: 1.03em;
    line-height: 1.75;
}

.entry-content img {
    border-radius: 6px;
    margin: 1em 0;
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.3em;
}

.entry-content li {
    margin-bottom: 0.4em;
}

/* Инженерный блок (тематический callout) */
.engineer-block {
    background: #EEE9DF;
    border-left: 4px solid var(--slate);
    padding: 1em 1.2em;
    margin: 1.5em 0;
    border-radius: 0 6px 6px 0;
    position: relative;
}

.engineer-block::before {
    content: "⚙";
    position: absolute;
    right: 0.8em;
    top: 0.8em;
    font-size: 1.5em;
    color: var(--slate);
    opacity: 0.4;
}

/* ============ Сайдбар ============ */
.widget {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.1em 1.2em;
    margin-bottom: 1.3em;
}

.widget-title {
    margin: 0 0 0.7em;
    font-size: 1.05em;
    color: var(--accent);
    border-bottom: 1px dashed var(--border);
    padding-bottom: 0.4em;
}

.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget li {
    padding: 0.35em 0;
    border-bottom: 1px dotted var(--border);
    font-size: 0.94em;
}

.widget li:last-child {
    border-bottom: none;
}

.widget a {
    color: var(--slate);
    text-decoration: none;
}

.widget a:hover {
    color: var(--accent);
}

/* ============ Главная ============ */
.intro-section {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2em 2.2em;
    margin-bottom: 2em;
}

.intro-section h1 {
    margin-top: 0;
}

.topic-block {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.8em 2em;
    margin-bottom: 1.8em;
}

.topic-block h2 {
    margin-top: 0;
}

.topic-block-accent {
    background: var(--linen);
    border-color: #CFC4B2;
}

.topic-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.3em;
    margin-top: 1em;
}

.topic-col {
    background: var(--bg);
    padding: 1em 1.1em;
    border-radius: 6px;
    border-left: 3px solid var(--accent);
}

.topic-col h3 {
    margin-top: 0;
    font-size: 1.02em;
    color: var(--slate);
}

.topic-col p {
    margin-bottom: 0;
    font-size: 0.93em;
}

.steps-list {
    list-style: none;
    padding: 0;
    margin: 1em 0 0;
    counter-reset: step;
}

.steps-list li {
    counter-increment: step;
    padding: 0.6em 0 0.6em 2.3em;
    position: relative;
    border-bottom: 1px dotted var(--border);
}

.steps-list li:last-child {
    border-bottom: none;
}

.steps-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 1.7em;
    height: 1.7em;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9em;
}

.section-recent {
    margin-bottom: 2em;
}

.section-recent h2 {
    margin-bottom: 0.3em;
}

/* ============ Пагинация ============ */
.pagination {
    margin: 2em 0 1em;
    text-align: center;
}

.pagination .page-numbers {
    display: inline-block;
    min-width: 2.3em;
    height: 2.3em;
    line-height: 2.1em;
    padding: 0 0.6em;
    margin: 0 0.15em;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--slate);
    text-decoration: none;
    font-size: 0.95em;
    transition: all 0.15s;
}

.pagination .page-numbers:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

.pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pagination .dots {
    border: none;
    background: transparent;
}

/* ============ Комментарии ============ */
.comments-area {
    margin-top: 2.5em;
    padding-top: 1.5em;
    border-top: 2px solid var(--border);
}

.comments-title {
    margin-bottom: 1em;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2em;
}

.comment-list li {
    margin-bottom: 1.2em;
}

.comment-body {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1em 1.2em;
}

.comment-author {
    font-weight: 600;
    color: var(--slate);
    display: flex;
    align-items: center;
    gap: 0.6em;
    margin-bottom: 0.4em;
}

.comment-author img {
    border-radius: 50%;
}

.comment-meta {
    font-size: 0.85em;
    color: var(--muted);
    margin-bottom: 0.5em;
}

.comment-meta a {
    color: var(--muted);
}

.comment-reply-link {
    display: inline-block;
    margin-top: 0.4em;
    font-size: 0.88em;
}

.children {
    list-style: none;
    padding-left: 1.5em;
    margin-top: 1em;
}

.comment-respond {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.3em 1.5em;
}

.comment-form label {
    display: block;
    margin-bottom: 0.3em;
    font-weight: 500;
    color: var(--slate);
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.6em 0.8em;
    border: 1px solid var(--border);
    border-radius: 4px;
    font: inherit;
    margin-bottom: 0.9em;
    background: #fff;
    color: var(--text);
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.comment-form .submit,
.form-submit input[type="submit"] {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.55em 1.4em;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 500;
    transition: all 0.2s;
}

.comment-form .submit:hover,
.form-submit input[type="submit"]:hover {
    background: var(--accent);
    color: #fff;
}

.comment-form-cookies-consent {
    display: flex;
    align-items: flex-start;
    gap: 0.5em;
}

.comment-form-cookies-consent label {
    font-weight: normal;
    font-size: 0.9em;
}

/* ============ Поиск ============ */
.search-form {
    display: flex;
    gap: 0;
    max-width: 520px;
    margin: 1em 0;
}

.search-form input[type="search"] {
    flex: 1;
    padding: 0.65em 0.9em;
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 6px 0 0 6px;
    font: inherit;
    background: #fff;
    color: var(--text);
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--accent);
}

.search-form button {
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    padding: 0 1.3em;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font: inherit;
    font-weight: 500;
}

.search-form button:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
}

/* ============ 404 ============ */
.error-404 {
    text-align: center;
    padding: 2em 0;
}

.error-404 .error-code {
    font-size: 5em;
    color: var(--accent);
    margin: 0;
    line-height: 1;
    font-weight: 800;
}

.error-404 .search-form {
    margin: 1.5em auto;
}

.error-404 .home-link {
    display: inline-block;
    margin-top: 1em;
    padding: 0.55em 1.4em;
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    background: transparent;
    text-decoration: none;
    transition: all 0.2s;
}

.error-404 .home-link:hover {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
}

/* ============ Подвал ============ */
.site-footer {
    background: var(--slate);
    color: #D8D5CE;
    padding: 2.5em 0 1.2em;
    font-size: 0.94em;
}

.site-footer a {
    color: #E2D9CD;
}

.site-footer a:hover {
    color: #fff;
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 2em;
    margin-bottom: 2em;
}

.footer-col .widget {
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 0;
}

.footer-col .widget-title {
    color: #fff;
    border-bottom: 1px solid #4A5659;
    padding-bottom: 0.4em;
}

.footer-col .widget ul li {
    border-bottom: 1px dotted #4A5659;
}

.footer-col .widget a {
    color: #D8D5CE;
}

.footer-col .widget a:hover {
    color: #fff;
}

.footer-bottom {
    border-top: 1px solid #4A5659;
    padding-top: 1em;
    text-align: center;
    font-size: 0.87em;
    color: #A8A49B;
}

/* ============ Cookie-баннер ============ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--slate);
    color: #F0EBE1;
    padding: 1em 1.2em;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.18);
    z-index: 9999;
    display: none;
}

.cookie-banner.is-visible {
    display: block;
}

.cookie-banner-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.2em;
    flex-wrap: wrap;
}

.cookie-banner p {
    margin: 0;
    flex: 1;
    min-width: 240px;
    font-size: 0.92em;
}

.cookie-banner button {
    background: transparent;
    color: #fff;
    border: 1px solid var(--accent);
    padding: 0.55em 1.4em;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 500;
    transition: all 0.2s;
}

.cookie-banner button:hover {
    background: var(--accent);
    border-color: var(--accent);
}

/* ============ Адаптив ============ */
@media (max-width: 960px) {
    .layout-with-sidebar {
        flex-direction: column;
    }
    .layout-with-sidebar .content-area,
    .layout-with-sidebar .sidebar-area {
        flex: none;
        max-width: 100%;
        width: 100%;
    }
    .layout-no-sidebar .content-area {
        width: 100%;
    }
}

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

    .nav-toggle {
        display: inline-block;
    }
    .main-nav {
        flex: 1 0 100%;
        display: none;
        margin-top: 0.8em;
    }
    .main-nav.is-open {
        display: block;
    }
    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }
    .main-nav li {
        border-bottom: 1px solid var(--border);
    }
    .main-nav a {
        display: block;
        padding: 0.7em 0;
        border-bottom: none;
    }
    .main-nav ul ul {
        display: block;
        position: static;
        border: none;
        padding: 0 0 0 1em;
    }

    .intro-section,
    .topic-block {
        padding: 1.3em 1.2em;
    }

    .card-more,
    .home-link {
        display: block;
        width: 100%;
        text-align: center;
        padding: 0.75em 1em;
    }
}

@media (max-width: 600px) {
    .container {
        width: 94%;
    }
    .site-header {
        padding: 0.9em 0;
    }
    .header-inner {
        gap: 0.8em;
    }
    .brand-logo,
    .brand-logo-fallback {
        width: 44px;
        height: 44px;
        flex: 0 0 44px;
    }
    .brand-name {
        font-size: 1em;
    }
    .brand-tagline {
        display: none;
    }
    .cookie-banner-inner {
        flex-direction: column;
        align-items: stretch;
    }
    .cookie-banner button {
        width: 100%;
    }
    .cards-grid {
        grid-template-columns: 1fr;
    }
}
