/*
Theme Name: dds_doubleslodge.com
Theme URI: https://doubleslodge.com
Author: Анна Кленова
Author URI: https://doubleslodge.com
Description: Информационная тема онлайн-журнала о загородной жизни: строительство, дизайн, обустройство и атмосфера дома за городом.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: dds
*/

/* ------------------------------------------------------------------ */
/*  Переменные                                                         */
/* ------------------------------------------------------------------ */
:root {
    --green: #3a5a40;
    --green-dark: #2c4431;
    --terra: #bc6c25;
    --terra-dark: #9c581c;
    --cream: #faf7f2;
    --paper: #ffffff;
    --sand: #f1eadd;
    --ink: #2b2b26;
    --ink-soft: #5a5a50;
    --line: #e2dac9;
    --footer-bg: #283127;
    --footer-ink: #d9dcd2;
    --footer-soft: #9faa96;
    --shadow: 0 6px 24px rgba(40, 49, 39, 0.08);
    --radius: 14px;
}

/* ------------------------------------------------------------------ */
/*  База                                                               */
/* ------------------------------------------------------------------ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Georgia", "Times New Roman", serif;
    color: var(--ink);
    background: var(--cream);
    line-height: 1.7;
    font-size: 18px;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
    line-height: 1.25;
    color: var(--green-dark);
    margin: 0 0 0.6em;
}

p { margin: 0 0 1.1em; }

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

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

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

.screen-reader-text {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.muted { color: var(--ink-soft); }

/* ------------------------------------------------------------------ */
/*  Кнопки                                                             */
/* ------------------------------------------------------------------ */
.btn {
    display: inline-block;
    background: var(--terra);
    color: #fff;
    padding: 0.7em 1.5em;
    border-radius: 999px;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    font-weight: 600;
    border: 2px solid var(--terra);
    cursor: pointer;
    transition: background .2s, color .2s;
}
.btn:hover { background: var(--terra-dark); border-color: var(--terra-dark); color: #fff; text-decoration: none; }

.btn-ghost {
    background: transparent;
    color: var(--green-dark);
    border-color: var(--green);
}
.btn-ghost:hover { background: var(--green); color: #fff; }

/* ------------------------------------------------------------------ */
/*  Шапка                                                              */
/* ------------------------------------------------------------------ */
.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 0;
    margin-right: auto;
}
.brand-logo { max-height: 60px; width: auto; display: block; }
.brand-mark { display: inline-flex; flex: 0 0 auto; }
.brand-text { min-width: 0; }
.site-name {
    display: block;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--green-dark);
    line-height: 1.3;
    max-width: 46ch;
}
.site-name:hover { text-decoration: none; color: var(--terra-dark); }
.site-tagline {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
    color: var(--ink-soft);
    line-height: 1.4;
    max-width: 60ch;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

.primary-nav .menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.4rem;
    flex-wrap: wrap;
}
.primary-nav a {
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.98rem;
    padding: 0.3rem 0;
    border-bottom: 2px solid transparent;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a {
    color: var(--green-dark);
    border-bottom-color: var(--terra);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
}
.nav-toggle-bar {
    width: 26px; height: 3px;
    background: var(--green-dark);
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
}
.nav-toggle.is-active .nav-toggle-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.is-active .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-active .nav-toggle-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ------------------------------------------------------------------ */
/*  Основной блок                                                      */
/* ------------------------------------------------------------------ */
.site-main { padding: 2.5rem 0 3.5rem; }

.page-shell { padding: 0; }

.block { padding: 3rem 0; }
.block.intro { padding-top: 1rem; }

.section-title {
    font-size: 1.9rem;
    text-align: center;
    margin-bottom: 0.4em;
}
.section-lead {
    text-align: center;
    color: var(--ink-soft);
    max-width: 60ch;
    margin: 0 auto 2rem;
}

/* Раскладки с/без сайдбара */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 3%;
    align-items: start;
}
.layout-single .content-area {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 2.5rem; }
    .layout-single .content-area { width: 100%; }
}

/* ------------------------------------------------------------------ */
/*  Главная: блок 1 — текст + иллюстрация                              */
/* ------------------------------------------------------------------ */
.intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 3rem;
    align-items: center;
}
.eyebrow {
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    color: var(--terra-dark);
    margin: 0 0 0.8rem;
}
.intro-title { font-size: 2.4rem; }
.intro-media img {
    display: block;
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
@media (max-width: 960px) {
    .intro-grid { grid-template-columns: 1fr; gap: 2rem; }
    .intro-title { font-size: 2rem; }
}

/* ------------------------------------------------------------------ */
/*  Главная: блок 2 — сетка рубрик                                     */
/* ------------------------------------------------------------------ */
.topics { background: var(--sand); }
.topics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}
.topic-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.6rem 1.3rem;
    text-align: center;
}
.topic-icon { color: var(--green); display: inline-flex; margin-bottom: 0.6rem; }
.topic-card h3 { font-size: 1.15rem; margin-bottom: 0.4em; }
.topic-card p { font-size: 0.95rem; color: var(--ink-soft); margin: 0; }
@media (max-width: 960px) { .topics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .topics-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ */
/*  Карточки записей                                                   */
/* ------------------------------------------------------------------ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.8rem;
}
@media (max-width: 960px) { .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .cards-grid { grid-template-columns: 1fr; } }

.latest-more { text-align: center; margin-top: 2.2rem; }

.cards-list {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
    margin-bottom: 2.5rem;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.card .card-thumb-wrap {
    overflow: hidden;
}
.card .card-thumb-wrap img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.3rem 1.4rem 1.5rem;
    min-width: 0;
}
.card-meta { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 0.5rem; font-family: "Trebuchet MS", sans-serif; }
.card-title { font-size: 1.25rem; margin-bottom: 0.5rem; }
.card-title a { color: var(--green-dark); }
.card-title a:hover { color: var(--terra-dark); text-decoration: none; }
.card-excerpt { color: var(--ink-soft); font-size: 0.97rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-link {
    margin-top: auto;
    padding-top: 0.8rem;
    font-family: "Trebuchet MS", sans-serif;
    font-weight: 600;
    color: var(--terra-dark);
}

/* Горизонтальные карточки в ленте блога/архива */
@media (min-width: 760px) {
    .cards-list .card {
        flex-direction: row;
    }
    .cards-list .card .card-thumb-wrap {
        flex: 0 0 300px;
        position: relative;
    }
    .cards-list .card .card-thumb-wrap a {
        display: block;
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
    }
    .cards-list .card .card-thumb-wrap img {
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        object-fit: cover;
    }
}
@media (max-width: 600px) {
    .cards-list .card .card-thumb-wrap { flex: none; width: 100%; position: static; }
    .cards-list .card .card-thumb-wrap a { position: static; }
    .cards-list .card .card-thumb-wrap img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
}

/* ------------------------------------------------------------------ */
/*  Главная: блок 3 — шаги                                             */
/* ------------------------------------------------------------------ */
.steps { background: var(--green-dark); }
.steps .section-title { color: #fff; }
.steps-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
}
.step {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--radius);
    padding: 1.6rem 1.3rem;
    color: #e9eee6;
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--terra);
    color: #fff;
    font-family: "Trebuchet MS", sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
}
.step h3 { color: #fff; font-size: 1.1rem; }
.step p { color: #cdd6c8; margin: 0; font-size: 0.95rem; }
@media (max-width: 960px) { .steps-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .steps-list { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ */
/*  Главная: блок 4 — галерея                                          */
/* ------------------------------------------------------------------ */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}
.gallery-item { margin: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}
@media (max-width: 960px) { .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .gallery-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ */
/*  Хлебные крошки                                                     */
/* ------------------------------------------------------------------ */
.crumbs {
    font-size: 0.85rem;
    color: var(--ink-soft);
    padding: 1.4rem 0 0.4rem;
    font-family: "Trebuchet MS", sans-serif;
}
.crumbs a { color: var(--terra-dark); }
.crumbs .sep { color: var(--line); margin: 0 0.2rem; }

/* ------------------------------------------------------------------ */
/*  Контент записи / страницы                                          */
/* ------------------------------------------------------------------ */
.page-title { font-size: 2rem; margin-top: 0.5rem; }
.post-title { font-size: 2.2rem; }
.post-meta { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 1.5rem; font-family: "Trebuchet MS", sans-serif; }
.post-thumb { margin: 0 0 1.8rem; border-radius: var(--radius); overflow: hidden; }
.post-thumb img { display: block; width: 100%; }
.post-content { min-width: 0; }
.post-content img { border-radius: 10px; height: auto; }
.post-content h2 { font-size: 1.6rem; margin-top: 1.6em; }
.post-content h3 { font-size: 1.3rem; margin-top: 1.4em; }
.post-content ul, .post-content ol { padding-left: 1.4em; }
.post-content blockquote {
    margin: 1.5em 0;
    padding: 0.6em 1.4em;
    border-left: 4px solid var(--terra);
    background: var(--sand);
    border-radius: 0 8px 8px 0;
    font-style: italic;
}
.post-tags { margin-top: 1.8rem; font-size: 0.9rem; }
.post-tags a { display: inline-block; background: var(--sand); padding: 0.2em 0.7em; border-radius: 999px; margin: 0 0.3em 0.3em 0; }

table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5em 0;
    border: 1px solid var(--line);
}
th, td { border: 1px solid var(--line); padding: 0.6em 0.9em; text-align: left; }
th { background: var(--sand); }

/* ------------------------------------------------------------------ */
/*  Сайдбар и виджеты                                                  */
/* ------------------------------------------------------------------ */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
    margin-bottom: 1.5rem;
    color: var(--ink);
}
.sidebar .widget-title {
    font-size: 1.1rem;
    color: var(--green-dark);
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--terra);
}
.sidebar .widget a { color: var(--terra-dark); }
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li { padding: 0.45rem 0; border-bottom: 1px dashed var(--line); }
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .post-date { color: var(--ink-soft); font-size: 0.8rem; display: block; }

/* ------------------------------------------------------------------ */
/*  Пагинация (type => plain, .page-numbers)                           */
/* ------------------------------------------------------------------ */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2.5rem;
}
.pager .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 0.5em 0.9em;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink);
    font-family: "Trebuchet MS", sans-serif;
    font-weight: 600;
    text-decoration: none;
}
.pager a.page-numbers:hover { background: var(--sand); text-decoration: none; }
.pager .page-numbers.current {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}
.pager .page-numbers.dots {
    border: 0;
    background: none;
    color: var(--ink-soft);
}

/* ------------------------------------------------------------------ */
/*  Комментарии                                                        */
/* ------------------------------------------------------------------ */
.comments-area { margin-top: 3rem; }
.comments-title { font-size: 1.5rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 1.5rem; padding: 0; }
.comment-inner {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem 1.3rem;
    margin-bottom: 1rem;
}
.comment-meta { display: flex; gap: 0.8rem; align-items: baseline; margin-bottom: 0.5rem; }
.comment-author { font-weight: 700; color: var(--green-dark); font-family: "Trebuchet MS", sans-serif; }
.comment-date { font-size: 0.8rem; color: var(--ink-soft); }
.comment-awaiting { color: var(--terra-dark); font-style: italic; }

.comment-form { margin-top: 2rem; }
.comment-form p { margin-bottom: 1rem; }
.comment-form label { display: block; font-weight: 600; margin-bottom: 0.3rem; font-family: "Trebuchet MS", sans-serif; }
.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);
}
.comment-form .submit {
    background: var(--terra);
    color: #fff;
    border: 0;
    padding: 0.7em 1.6em;
    border-radius: 999px;
    cursor: pointer;
    font-family: "Trebuchet MS", sans-serif;
    font-weight: 600;
}

/* ------------------------------------------------------------------ */
/*  Форма поиска                                                       */
/* ------------------------------------------------------------------ */
.search-form { display: flex; gap: 0.5rem; margin: 1.2rem 0; max-width: 480px; }
.search-field {
    flex: 1;
    min-width: 0;
    padding: 0.6em 0.9em;
    border: 1px solid var(--line);
    border-radius: 999px;
    font: inherit;
    background: var(--paper);
}
.search-submit {
    background: var(--green);
    color: #fff;
    border: 0;
    padding: 0.6em 1.3em;
    border-radius: 999px;
    cursor: pointer;
    font-family: "Trebuchet MS", sans-serif;
    font-weight: 600;
}

.error-404 { text-align: center; }
.error-404 .search-form { margin-inline: auto; }
.error-home { margin-top: 1.5rem; }

/* ------------------------------------------------------------------ */
/*  Подвал                                                             */
/* ------------------------------------------------------------------ */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); margin-top: 3rem; }
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
    padding: 3rem 0 2rem;
}
.footer-col { min-width: 0; }
.site-footer .widget { color: var(--footer-ink); }
.site-footer .widget-title {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 0.9rem;
    font-family: "Trebuchet MS", sans-serif;
}
.site-footer .widget p { color: var(--footer-ink); }
.site-footer .widget a { color: #e7d3b8; }
.site-footer .widget a:hover { color: #fff; }
.site-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.site-footer .widget li { padding: 0.35rem 0; border-bottom: 1px solid rgba(255,255,255,0.08); }
.site-footer .widget li:last-child { border-bottom: 0; }
.site-footer .post-date { color: var(--footer-soft); font-size: 0.8rem; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding: 1.2rem 0;
}
.copyright { margin: 0; font-size: 0.85rem; color: var(--footer-soft); font-family: "Trebuchet MS", sans-serif; }

@media (max-width: 960px) { .footer-cols { grid-template-columns: 1fr; gap: 2rem; } }

/* ------------------------------------------------------------------ */
/*  Cookie-баннер                                                      */
/* ------------------------------------------------------------------ */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    background: var(--green-dark);
    color: #f1efe6;
    padding: 1rem 1.3rem;
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    max-width: 760px;
    margin-inline: auto;
}
.cookie-text { margin: 0; flex: 1; min-width: 220px; font-size: 0.9rem; font-family: "Trebuchet MS", sans-serif; }
.cookie-accept {
    background: var(--terra);
    color: #fff;
    border: 0;
    padding: 0.6em 1.6em;
    border-radius: 999px;
    cursor: pointer;
    font-family: "Trebuchet MS", sans-serif;
    font-weight: 600;
    white-space: nowrap;
}
.cookie-accept:hover { background: var(--terra-dark); }

/* ------------------------------------------------------------------ */
/*  Адаптив навигации                                                  */
/* ------------------------------------------------------------------ */
@media (max-width: 768px) {
    .nav-toggle { display: flex; }
    .primary-nav {
        flex-basis: 100%;
        display: none;
    }
    .primary-nav.is-open { display: block; }
    .primary-nav .menu { flex-direction: column; gap: 0.2rem; padding-top: 0.8rem; }
    .primary-nav .menu li { border-bottom: 1px solid var(--line); }
    .primary-nav a { display: block; padding: 0.7rem 0; }
}
