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

/* ---------------------------------------------------------------------------
   Базовые переменные и сброс
   ------------------------------------------------------------------------- */
:root {
    --green:       #2f6b4f;
    --green-dark:  #234f3b;
    --green-soft:  #e8f1ea;
    --slate:       #1f2a32;
    --slate-2:     #2b3a44;
    --ink:         #25302b;
    --muted:       #5f6f67;
    --cream:       #f6f4ee;
    --paper:       #ffffff;
    --line:        #dcded6;
    --amber:       #c8772f;
    --radius:      14px;
    --shell:       1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

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

p { margin: 0 0 1.1em; }

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

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

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

.shell-wide {
    width: 85%;
    max-width: var(--shell);
    margin-inline: auto;
}

/* ---------------------------------------------------------------------------
   Шапка
   ------------------------------------------------------------------------- */
.site-header {
    background: var(--paper);
    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.9rem;
    min-width: 0;
    text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo, .brand-mark { flex: 0 0 auto; display: block; }
.brand-mark { width: 46px; height: 46px; }
.brand-text { min-width: 0; }
.brand-name {
    font-family: Georgia, serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--slate);
    display: block;
    line-height: 1.3;
    max-width: 520px;
}
.brand-desc {
    font-size: 0.82rem;
    color: var(--muted);
    display: block;
    margin-top: 0.2rem;
    max-width: 520px;
}

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

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.4rem;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav a {
    color: var(--slate);
    font-weight: 600;
    font-size: 0.98rem;
}
.main-nav a:hover { color: var(--green); text-decoration: none; }

/* ---------------------------------------------------------------------------
   Хлебные крошки
   ------------------------------------------------------------------------- */
.crumbs {
    font-size: 0.86rem;
    color: var(--muted);
    padding: 1rem 0 0;
}
.crumbs a { color: var(--green); }
.crumbs .sep { color: var(--line); margin: 0 0.3rem; }

/* ---------------------------------------------------------------------------
   Каркас контента / сайдбар
   ------------------------------------------------------------------------- */
.site-main { padding: 1.5rem 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 { width: 100%; }

.sidebar .widget { margin-bottom: 1.8rem; }

/* ---------------------------------------------------------------------------
   Тематические секции главной
   ------------------------------------------------------------------------- */
.section { padding: 2.6rem 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-title { text-align: center; margin-bottom: 1.6rem; }

/* Блок: текст + иллюстрация */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2.4rem;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-media img { border-radius: var(--radius); display: block; width: 100%; }
.split-text h2 { text-align: left; }
.lead { font-size: 1.05rem; color: var(--slate-2); }

/* Блок: сетка карточек-направлений */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.4rem;
}
.feature {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.feature .ico {
    width: 44px; height: 44px;
    display: block;
    margin-bottom: 0.9rem;
    color: var(--green);
}
.feature h3 { margin-bottom: 0.4rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Блок: пошаговый */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.6rem;
    counter-reset: step;
}
.step { position: relative; padding-left: 3.4rem; }
.step::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0; top: 0;
    width: 2.5rem; height: 2.5rem;
    display: flex; align-items: center; justify-content: center;
    background: var(--green);
    color: #fff;
    border-radius: 50%;
    font-family: Georgia, serif;
    font-weight: 700;
}
.step h3 { margin-bottom: 0.3rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.95rem; }

/* Блок: CTA */
.cta {
    background: var(--slate);
    border-radius: var(--radius);
    padding: 2.6rem 2rem;
    text-align: center;
    color: #eef2ef;
}
.cta h2 { color: #fff; }
.cta p { color: #c3ccc6; max-width: 640px; margin-inline: auto; }
.btn {
    display: inline-block;
    background: var(--amber);
    color: #fff;
    padding: 0.8rem 1.7rem;
    border-radius: 10px;
    font-weight: 600;
    margin-top: 0.6rem;
}
.btn:hover { background: #b0661f; color: #fff; text-decoration: none; }

/* ---------------------------------------------------------------------------
   Карточки записей (см. A8, A10)
   ------------------------------------------------------------------------- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.6rem;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.card-thumb {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.card-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.2rem 1.3rem 1.4rem;
}
.card-title { font-size: 1.18rem; margin-bottom: 0.4rem; }
.card-title a { color: var(--slate); }
.card-title a:hover { color: var(--green); text-decoration: none; }
.card-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.6rem; }
.card-excerpt { color: var(--slate-2); font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    align-self: flex-start;
    font-weight: 600;
    color: var(--green);
    padding-top: 0.4rem;
}

/* Список записей в ленте блога (вертикальный) */
.post-list .card { margin-bottom: 1.6rem; }

/* ---------------------------------------------------------------------------
   Одиночная запись / страница
   ------------------------------------------------------------------------- */
.entry {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem 2.2rem;
}
.entry-header { margin-bottom: 1.2rem; }
.entry-meta { font-size: 0.85rem; color: var(--muted); }
.entry-thumb { margin: 0 0 1.4rem; border-radius: var(--radius); overflow: hidden; }
.entry-thumb img { width: 100%; display: block; }
.entry-content { min-width: 0; }
.entry-content img { border-radius: 8px; }
.entry-content h2, .entry-content h3 { margin-top: 1.4em; }
.entry-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.2em 0;
}
.entry-content table, .entry-content th, .entry-content td {
    border: 1px solid var(--line);
}
.entry-content th, .entry-content td { padding: 0.6rem 0.8rem; text-align: left; }
.entry-content th { background: var(--green-soft); }

/* ---------------------------------------------------------------------------
   Сайдбар-виджеты (контраст на светлом фоне)
   ------------------------------------------------------------------------- */
.sidebar .widget {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
    color: var(--ink);
}
.sidebar .widget-title {
    font-size: 1.05rem;
    color: var(--slate);
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--green-soft);
}
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .widget a { color: var(--green-dark); }
.sidebar .widget a:hover { color: var(--green); }
.sidebar .post-date { display: block; font-size: 0.78rem; color: var(--muted); }

/* ---------------------------------------------------------------------------
   Поиск
   ------------------------------------------------------------------------- */
.search-form {
    display: flex;
    gap: 0.5rem;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.95rem;
}
.search-form .search-submit {
    background: var(--green);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.6rem 1.1rem;
    cursor: pointer;
    font-size: 0.95rem;
}
.search-form .search-submit:hover { background: var(--green-dark); }

/* ---------------------------------------------------------------------------
   Пагинация (type => plain, см. D5)
   ------------------------------------------------------------------------- */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin: 2rem 0 0;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0 0.7rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    color: var(--slate);
    font-weight: 600;
    text-decoration: none;
}
.pager a.page-numbers:hover { background: var(--green-soft); border-color: var(--green); text-decoration: none; }
.pager .page-numbers.current {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}
.pager .page-numbers.dots { border: 0; background: none; }

/* ---------------------------------------------------------------------------
   Комментарии
   ------------------------------------------------------------------------- */
.comments-area { margin-top: 2rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 1.5rem; padding: 0; }
.comment-item { margin-bottom: 1.2rem; }
.comment-body {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
}
.comment-meta { font-size: 0.85rem; margin-bottom: 0.5rem; }
.comment-author { font-weight: 700; color: var(--slate); }
.comment-date { color: var(--muted); margin-left: 0.6rem; }
.comment-respond {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem 1.6rem;
    margin-top: 1.5rem;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
}
.comment-form .submit {
    background: var(--green);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.7rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Подвал
   ------------------------------------------------------------------------- */
.site-footer {
    background: var(--slate);
    color: #c9d2cc;
    padding: 2.6rem 0 1.4rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}
.site-footer .widget { color: #c9d2cc; }
.site-footer .widget-title {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
}
.site-footer .widget p { color: #b6c0ba; }
.site-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.site-footer .widget li { padding: 0.35rem 0; }
.site-footer .widget a { color: #9fd3b6; }
.site-footer .widget a:hover { color: #c7eed8; }
.footer-bottom {
    border-top: 1px solid #3a4a53;
    margin-top: 2rem;
    padding-top: 1.2rem;
    text-align: center;
    font-size: 0.85rem;
    color: #95a39b;
}

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

/* ---------------------------------------------------------------------------
   Cookie-баннер (см. A11, D6) — правило [hidden] до основного блока
   ------------------------------------------------------------------------- */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--slate-2);
    color: #eef2ef;
    padding: 1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 -4px 18px rgba(0,0,0,0.18);
}
.cookie-banner p { margin: 0; font-size: 0.9rem; max-width: 760px; }
.cookie-banner a { color: #9fd3b6; }
.cookie-banner .cookie-accept {
    background: var(--green);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 0.6rem 1.4rem;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}
.cookie-banner .cookie-accept:hover { background: var(--green-dark); }

/* ---------------------------------------------------------------------------
   Адаптив
   ------------------------------------------------------------------------- */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .split { grid-template-columns: 1fr; }
    .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 {
        width: 100%;
        display: none;
    }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav li { border-bottom: 1px solid var(--line); }
    .main-nav a { display: block; padding: 0.7rem 0; }
    .entry { padding: 1.4rem 1.2rem; }
    .brand-desc { display: none; }
}
