/*
Theme Name: dds_bcpcdata.com
Author: Алексей Заречный
Description: Тематический портал-агрегатор загородной недвижимости с экспертным разделом о ландшафтном дизайне и уходе за растениями.
Version: 1.2
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: bcpc
*/

/* =========================================================
   Переменные
   ========================================================= */
:root {
    --green-900: #1f3327;
    --green-700: #2f5540;
    --green-600: #3a6b4f;
    --green-500: #4d825f;
    --leaf: #7fae6b;
    --leaf-soft: #e4efdc;
    --earth: #c07f3c;
    --paper: #f6f4ee;
    --paper-2: #eef0e8;
    --surface: #ffffff;
    --ink: #26302a;
    --ink-soft: #566158;
    --line: #d9ddd2;
    --shadow: 0 6px 22px rgba(31, 51, 39, 0.08);
    --radius: 12px;
    --shell: min(92%, 1180px);
}

/* =========================================================
   База
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

h1, h2, h3, h4 {
    font-family: "Georgia", "PT Serif", serif;
    color: var(--green-900);
    line-height: 1.25;
    margin: 0 0 0.6em;
}

h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.95rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

a { color: var(--green-600); text-decoration: none; }
a:hover { color: var(--earth); text-decoration: underline; }

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

.shell {
    width: var(--shell);
    margin-inline: auto;
}

.btn {
    display: inline-block;
    background: var(--green-600);
    color: #fff;
    padding: 0.7em 1.5em;
    border-radius: 999px;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
}
.btn:hover { background: var(--green-700); color: #fff; text-decoration: none; transform: translateY(-1px); }

/* =========================================================
   Шапка
   ========================================================= */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.1rem 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}
.brand-logo { display: block; height: 52px; width: auto; }
.brand-text { min-width: 0; }
.brand-name {
    font-family: "Georgia", serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--green-900);
    line-height: 1.2;
    display: block;
}
.brand-name a { color: inherit; }
.brand-name a:hover { text-decoration: none; color: var(--green-600); }
.brand-desc {
    font-size: 0.82rem;
    color: var(--ink-soft);
    display: block;
    max-width: 46ch;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.3rem;
}
.main-nav a {
    color: var(--green-900);
    font-weight: 600;
    padding: 0.3em 0;
    display: inline-block;
}
.main-nav a:hover { color: var(--earth); text-decoration: none; }
.main-nav .current-menu-item > a { color: var(--earth); }

.nav-toggle {
    display: none;
    background: var(--green-600);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.55em 0.9em;
    font-size: 1rem;
    cursor: pointer;
}

/* =========================================================
   Раскладки
   ========================================================= */
.site-main { padding: 2.4rem 0 3rem; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.2rem;
}
.layout-single .content-area { width: 100%; }
.content-area { min-width: 0; }

.sidebar { min-width: 0; }

@media (min-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: 67% minmax(0, 27%);
        justify-content: space-between;
    }
}

/* =========================================================
   Хлебные крошки
   ========================================================= */
.crumbs {
    font-size: 0.86rem;
    color: var(--ink-soft);
    margin: 0 0 1.6rem;
}
.crumbs a { color: var(--green-600); }
.crumbs .sep { color: var(--leaf); margin: 0 0.15rem; }

/* =========================================================
   Карточки записей
   ========================================================= */
.cards-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6rem;
}
@media (min-width: 640px) {
    .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.content-area .cards-grid { grid-template-columns: minmax(0, 1fr); }

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(31,51,39,0.12); }

.card-thumb-wrap {
    display: block;
    overflow: hidden;
}
.card-thumb-wrap img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.card:hover .card-thumb-wrap img { transform: scale(1.04); }

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.2rem 1.3rem 1.4rem;
}
.card-title { font-size: 1.2rem; margin: 0 0 0.5rem; }
.card-title a { color: var(--green-900); }
.card-title a:hover { color: var(--earth); text-decoration: none; }
.card-meta {
    font-size: 0.8rem;
    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;
    padding-top: 0.8rem;
    font-weight: 600;
    color: var(--green-600);
    align-self: flex-start;
}

/* Горизонтальная карточка (последние записи на главной) */
.card-row { flex-direction: column; }
@media (min-width: 640px) {
    .card-row { flex-direction: row; }
    .card-row .card-thumb-wrap {
        flex: 0 0 300px;
        position: relative;
        overflow: hidden;
    }
    .card-row .card-thumb-wrap a {
        display: block;
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
    }
    .card-row .card-thumb-wrap img {
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        object-fit: cover;
        display: block;
    }
}
@media (max-width: 639px) {
    .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; }
}

/* =========================================================
   Одиночная запись / страница
   ========================================================= */
.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.8rem 1.9rem 2rem;
    box-shadow: var(--shadow);
}
.entry-header { margin-bottom: 1.2rem; }
.entry-meta { font-size: 0.85rem; color: var(--ink-soft); margin-top: 0.4rem; }
.entry-thumb { margin: 0 0 1.4rem; border-radius: var(--radius); overflow: hidden; }
.entry-thumb img { display: block; width: 100%; }

.entry-content { min-width: 0; }
.entry-content img { border-radius: 8px; height: auto; }
.entry-content h2 { margin-top: 1.6em; }
.entry-content h3 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content blockquote {
    margin: 1.4em 0;
    padding: 1rem 1.3rem;
    background: var(--leaf-soft);
    border-left: 4px solid var(--leaf);
    border-radius: 8px;
    font-style: italic;
    color: var(--green-900);
}
.entry-content a { text-decoration: underline; }

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.3em 0;
}
.entry-content th, .entry-content td {
    border: 1px solid var(--line);
    padding: 0.6em 0.8em;
    text-align: left;
}
.entry-content th { background: var(--paper-2); }

.tags-line { margin-top: 1.6rem; font-size: 0.85rem; }
.tags-line a {
    display: inline-block;
    background: var(--leaf-soft);
    color: var(--green-700);
    padding: 0.2em 0.7em;
    border-radius: 999px;
    margin: 0 0.3em 0.4em 0;
}
.tags-line a:hover { background: var(--leaf); color: #fff; text-decoration: none; }

/* =========================================================
   Сайдбар / виджеты
   ========================================================= */
.widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
    margin-bottom: 1.6rem;
    color: var(--ink);
}
.widget-title {
    font-size: 1.1rem;
    margin: 0 0 0.9rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--leaf-soft);
    color: var(--green-900);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget ul li { padding: 0.4em 0; border-bottom: 1px solid var(--paper-2); }
.widget ul li:last-child { border-bottom: 0; }
.widget a { color: var(--green-600); }
.widget a:hover { color: var(--earth); }
.widget .post-date { display: block; font-size: 0.78rem; color: var(--ink-soft); }

/* =========================================================
   Пагинация
   ========================================================= */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2.4rem;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 0.7em;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--green-700);
    font-weight: 600;
}
.pager a.page-numbers:hover { background: var(--leaf-soft); border-color: var(--leaf); text-decoration: none; }
.pager .page-numbers.current { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.pager .page-numbers.dots { border: 0; background: transparent; }

/* =========================================================
   Комментарии
   ========================================================= */
.comments-area {
    margin-top: 2.2rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    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-inner {
    padding: 1rem 0;
    border-bottom: 1px solid var(--paper-2);
}
.comment-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.comment-author { font-weight: 700; color: var(--green-900); }
.comment-date { font-size: 0.8rem; color: var(--ink-soft); }
.comment-await { font-size: 0.85rem; color: var(--earth); }
.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(--line);
    border-radius: 8px;
    font: inherit;
    background: var(--paper);
    margin-top: 0.3rem;
}
.comment-form label { font-size: 0.9rem; font-weight: 600; }
.comment-form p { margin-bottom: 0.9rem; }
.comment-form .form-submit input {
    background: var(--green-600);
    color: #fff;
    border: 0;
    padding: 0.7em 1.6em;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
}

/* =========================================================
   Поиск
   ========================================================= */
.search-form { display: flex; gap: 0.5rem; }
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 0.6em 0.9em;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: var(--surface);
}
.search-form .search-submit {
    background: var(--green-600);
    color: #fff;
    border: 0;
    padding: 0.6em 1.2em;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* =========================================================
   Главная — секции
   ========================================================= */
.hero {
    background: linear-gradient(135deg, var(--green-700), var(--green-500));
    color: #fff;
    padding: 3rem 0 3.2rem;
}
.hero .shell { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 800px) {
    .hero .shell { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
}
.hero h1 { color: #fff; }
.hero p { color: rgba(255,255,255,0.92); font-size: 1.05rem; }
.hero-art { justify-self: center; }
.hero-art img { display: block; width: 100%; border-radius: var(--radius); }
.hero .btn { background: #fff; color: var(--green-700); }
.hero .btn:hover { background: var(--leaf-soft); color: var(--green-900); }

.front-section { padding: 3rem 0; }
.front-section.alt { background: var(--paper-2); }
.section-head { text-align: center; max-width: 62ch; margin: 0 auto 2rem; }
.section-head p { color: var(--ink-soft); }

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

/* Сетка направлений */
.feature-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.4rem;
}
@media (min-width: 560px) { .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .feature-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.feature {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem 1.4rem;
    text-align: center;
    box-shadow: var(--shadow);
    min-width: 0;
}
.feature-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.9rem;
    display: block;
}
.feature h3 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.feature p { font-size: 0.92rem; color: var(--ink-soft); margin: 0; }

/* Последние записи */
.latest-list { display: grid; gap: 1.6rem; }

/* Галерея */
.gallery-mosaic {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}
@media (min-width: 560px) { .gallery-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .gallery-mosaic { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gallery-mosaic figure {
    margin: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    min-width: 0;
}
.gallery-mosaic img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.gallery-mosaic figure:hover img { transform: scale(1.05); }
.gallery-mosaic figcaption {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    color: var(--ink-soft);
    background: var(--surface);
}

/* CTA */
.cta-band {
    background: var(--green-700);
    color: #fff;
    border-radius: var(--radius);
    padding: 2.6rem 2.2rem;
    text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255,255,255,0.9); max-width: 60ch; margin: 0 auto 1.4rem; }
.cta-band .btn { background: #fff; color: var(--green-700); }
.cta-band .btn:hover { background: var(--leaf-soft); color: var(--green-900); }

@media (max-width: 600px) {
    .cta-band { padding: 2rem 1.4rem; }
    .front-section { padding: 2.2rem 0; }
}

/* =========================================================
   Подвал
   ========================================================= */
.site-footer {
    background: var(--green-900);
    color: #d5ded4;
    padding: 2.8rem 0 1.6rem;
    margin-top: 2rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
}
@media (min-width: 700px) { .footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.site-footer .widget {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    color: #d5ded4;
}
.site-footer .widget-title {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.18);
}
.site-footer .widget a { color: #bcd4b6; }
.site-footer .widget a:hover { color: #fff; }
.site-footer .widget ul li { border-bottom-color: rgba(255,255,255,0.1); }
.site-footer .widget .post-date { color: #9fb39a; }
.site-footer p { color: #c3cfc1; }

.footer-bottom {
    margin-top: 2.2rem;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(255,255,255,0.14);
    font-size: 0.85rem;
    color: #9fb39a;
    text-align: center;
}

/* =========================================================
   404
   ========================================================= */
.notfound {
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2.4rem 1.8rem;
    box-shadow: var(--shadow);
}
.notfound .big { font-size: clamp(3rem, 10vw, 5rem); color: var(--leaf); font-family: Georgia, serif; }
.notfound .search-form { max-width: 420px; margin: 1.4rem auto 0; }

/* =========================================================
   Cookie-баннер (см. D6, A11)
   ========================================================= */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    background: var(--green-900);
    color: #eef3ec;
    padding: 1rem 0;
    box-shadow: 0 -4px 18px rgba(0,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: 0.9rem; color: #dbe6d7; }
.cookie-inner a { color: var(--leaf); }
.cookie-accept {
    background: var(--leaf);
    color: var(--green-900);
    border: 0;
    padding: 0.6em 1.5em;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.cookie-accept:hover { background: #fff; }

/* =========================================================
   Контакты (статичные, без форм — см. D7)
   ========================================================= */
.contact-box { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin-top: 1rem; }
.contact-box a { font-weight: 600; }

/* =========================================================
   Мобильное меню
   ========================================================= */
@media (max-width: 860px) {
    .nav-toggle { display: inline-block; }
    .main-nav {
        flex-basis: 100%;
        width: 100%;
    }
    .main-nav ul {
        flex-direction: column;
        gap: 0;
        display: none;
        border-top: 1px solid var(--line);
        margin-top: 0.6rem;
    }
    .main-nav.open ul { display: flex; }
    .main-nav ul li { border-bottom: 1px solid var(--paper-2); }
    .main-nav a { display: block; padding: 0.7em 0; }
}
