/*
Theme Name: dds_saw-wood.ru
Author: Яна Нестерова
Description: Информационная тема о выборе товаров: карточки, характеристики, возвраты, сравнение предложений, признаки надёжного продавца и ошибки покупателя.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: sawwood
*/

/* ============================================================
   Переменные
   ============================================================ */
:root {
    --ink: #202531;
    --muted: #5c6472;
    --primary: #2b6b62;
    --primary-dark: #1f5049;
    --accent: #c9772e;
    --accent-soft: #f3e7d6;
    --bg: #f6f4ef;
    --surface: #ffffff;
    --surface-2: #efeae1;
    --line: #e2dccf;
    --footer-bg: #1d2430;
    --footer-panel: #242c3a;
    --footer-text: #c6cdd9;
    --footer-head: #ffffff;
    --radius: 12px;
    --shadow: 0 6px 22px rgba(28, 32, 43, .07);
    --font: 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    overflow-x: hidden;
}

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

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

h1, h2, h3, h4 {
    line-height: 1.25;
    color: var(--ink);
    margin: 0 0 .6em;
    font-weight: 700;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1.1em; }

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--ink);
    color: #fff;
    padding: .6em 1em;
    z-index: 999;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ============================================================
   Шапка
   ============================================================ */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.4rem;
    padding: 1.1rem 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: .85rem;
    min-width: 0;
}
.brand-logo, .brand-mark { flex: 0 0 auto; display: block; }
.brand-mark { width: 46px; height: 46px; }
.brand-text { min-width: 0; }
.brand-name {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.25;
}
.brand-name a { color: inherit; }
.brand-name a:hover { color: var(--primary); text-decoration: none; }
.brand-desc {
    font-size: .82rem;
    color: var(--muted);
    margin-top: .15rem;
    max-width: 46ch;
}

/* Навигация */
.nav-toggle {
    display: none;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: .5rem .7rem;
    font-size: .95rem;
    color: var(--ink);
    cursor: pointer;
    align-items: center;
    gap: .5rem;
}
.main-nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .3rem 1.4rem;
    margin: 0;
    padding: 0;
}
.main-nav a {
    color: var(--ink);
    font-weight: 600;
    padding: .35rem 0;
    display: inline-block;
}
.main-nav a:hover { color: var(--primary); text-decoration: none; }
.main-nav .current-menu-item > a { color: var(--primary); }

/* ============================================================
   Хлебные крошки
   ============================================================ */
.crumbs {
    font-size: .86rem;
    color: var(--muted);
    padding: 1rem 0 .2rem;
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumbs .sep { color: #b7b0a2; margin: 0 .1rem; }
.crumbs span:last-child { color: var(--ink); }

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

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67%) minmax(0, 27%);
    gap: 6%;
    align-items: start;
}
.layout-single .content-area {
    width: 85%;
    margin-inline: auto;
}
.layout-single.layout-narrow .content-area { width: 100%; }

/* ============================================================
   Записи / контент
   ============================================================ */
.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 2rem 2.2rem;
    box-shadow: var(--shadow);
}
.entry-header { margin-bottom: 1.2rem; }
.entry-title { margin-bottom: .4rem; }
.entry-meta { font-size: .85rem; color: var(--muted); }
.entry-thumb { margin: 0 0 1.4rem; border-radius: 10px; overflow: hidden; }
.entry-thumb img { display: block; width: 100%; height: auto; }
.entry-content { min-width: 0; }
.entry-content img { border-radius: 8px; }
.entry-content h2 { margin-top: 1.6rem; }
.entry-content ul, .entry-content ol { padding-left: 1.3rem; }
.entry-content blockquote {
    margin: 1.4rem 0;
    padding: 1.1rem 1.4rem;
    background: var(--accent-soft);
    border-left: 4px solid var(--accent);
    border-radius: 8px;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

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

.list-title {
    font-size: 1.4rem;
    margin-bottom: 1.2rem;
    padding-bottom: .6rem;
    border-bottom: 2px solid var(--line);
}

/* ============================================================
   Карточки записей (A8, A10)
   ============================================================ */
.card-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.6rem;
}
.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 .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(28,32,43,.12); }

.card-thumb-wrap {
    position: relative;
    overflow: hidden;
    background: var(--surface-2);
}
.card-thumb-wrap a { display: block; }
.card-thumb-wrap img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-thumb-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #2b6b62 0%, #3d8478 100%);
    color: #fff;
}
.card-thumb-ph svg { width: 54px; height: 54px; opacity: .9; }

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.2rem 1.35rem 1.4rem;
    min-width: 0;
}
.card-meta { font-size: .78rem; color: var(--muted); margin-bottom: .5rem; }
.card-title { font-size: 1.18rem; margin-bottom: .55rem; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--primary); text-decoration: none; }
.card-excerpt { color: #444a56; font-size: .95rem; }
.card-excerpt p { margin: 0 0 .5em; background: none; }
.card-more {
    margin-top: auto;
    align-self: flex-start;
    font-weight: 600;
    color: var(--primary);
    padding-top: .6rem;
}
.card-more:hover { text-decoration: underline; }

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

/* ============================================================
   Сайдбар и виджеты (F: контраст)
   ============================================================ */
.sidebar { min-width: 0; }
.widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
    margin-bottom: 1.6rem;
    box-shadow: var(--shadow);
}
.widget-title {
    font-size: 1.05rem;
    margin-bottom: .9rem;
    padding-bottom: .55rem;
    border-bottom: 2px solid var(--line);
    color: var(--ink);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: .45rem 0; border-bottom: 1px solid #efeae0; }
.widget li:last-child { border-bottom: none; }
.widget a { color: var(--primary); }
.widget a:hover { color: var(--primary-dark); }
.widget .post-date { display: block; font-size: .78rem; color: var(--muted); margin-top: .15rem; }

/* ============================================================
   Подвал (E2)
   ============================================================ */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 2.6rem 0 1.4rem;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
}
.site-footer .widget {
    background: var(--footer-panel);
    border: 1px solid #2f3848;
    box-shadow: none;
    color: var(--footer-text);
}
.site-footer .widget-title {
    color: var(--footer-head);
    border-bottom-color: #3a4456;
}
.site-footer .widget,
.site-footer .widget p,
.site-footer .widget li { color: var(--footer-text); }
.site-footer .widget li { border-bottom-color: #333c4c; }
.site-footer .widget a { color: #9fd3ca; }
.site-footer .widget a:hover { color: #c8ede6; }
.site-footer .widget .post-date { color: #98a2b3; }

.footer-bottom {
    margin-top: 2rem;
    padding-top: 1.3rem;
    border-top: 1px solid #333c4c;
    text-align: center;
    font-size: .86rem;
    color: #97a1b1;
}

/* ============================================================
   Главная (E3)
   ============================================================ */
.home-wrap { width: 85%; margin-inline: auto; padding: 2rem 0 3rem; }

.front-section { margin-bottom: 3rem; }
.section-head { text-align: center; max-width: 60ch; margin: 0 auto 1.8rem; }
.section-head p { color: var(--muted); margin: 0; }

/* Блок 1: текст + иллюстрация */
.fs-split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 2.4rem;
    align-items: center;
}
.fs-split.reverse .fs-split-media { order: -1; }
.fs-split-text h2 { font-size: 1.7rem; }
.fs-split-text ul { padding-left: 1.2rem; color: #444a56; }
.fs-split-text li { margin-bottom: .5rem; }
.fs-split-media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Блок 2: сетка рубрик */
.fs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}
.fs-tile {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.6rem 1.5rem;
    box-shadow: var(--shadow);
    min-width: 0;
}
.fs-tile-icon {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 12px;
    margin-bottom: .9rem;
}
.fs-tile-icon svg { width: 26px; height: 26px; }
.fs-tile h3 { font-size: 1.12rem; margin-bottom: .4rem; }
.fs-tile p { margin: 0; color: #4b5361; font-size: .95rem; }

/* Блок: последние записи */
.fs-latest .card-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fs-latest-more { text-align: center; margin-top: 1.8rem; }

/* Блок 3: шаги */
.fs-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.4rem;
    counter-reset: step;
}
.fs-step {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem 1.4rem 1.4rem;
    box-shadow: var(--shadow);
    position: relative;
    min-width: 0;
}
.fs-step-num {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: .8rem;
}
.fs-step h3 { font-size: 1.05rem; margin-bottom: .4rem; }
.fs-step p { margin: 0; font-size: .93rem; color: #4b5361; }

/* Блок 4: FAQ */
.fs-faq { max-width: 820px; margin-inline: auto; }
.fs-faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 0;
    margin-bottom: .9rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.fs-faq summary {
    cursor: pointer;
    padding: 1.05rem 1.4rem;
    font-weight: 600;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}
.fs-faq summary::-webkit-details-marker { display: none; }
.fs-faq summary::after {
    content: '+';
    font-size: 1.4rem;
    color: var(--primary);
    line-height: 1;
    flex: 0 0 auto;
}
.fs-faq details[open] summary::after { content: '–'; }
.fs-faq .faq-body { padding: 0 1.4rem 1.2rem; color: #4b5361; }
.fs-faq .faq-body p { margin: 0; }

/* CTA (пример плашки с фоном — A14) */
.fs-cta {
    background: linear-gradient(135deg, #1f5049 0%, #2b6b62 100%);
    color: #fff;
    border-radius: var(--radius);
    padding: 2.4rem 2.2rem;
    text-align: center;
}
.fs-cta h2 { color: #fff; }
.fs-cta p { color: #d7e6e2; max-width: 60ch; margin: 0 auto 1.4rem; }
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    padding: .8rem 1.6rem;
    border-radius: 8px;
}
.btn:hover { background: #b3671f; color: #fff; text-decoration: none; }
.btn-light { background: #fff; color: var(--primary-dark); }
.btn-light:hover { background: #f0efe9; color: var(--primary-dark); }

/* ============================================================
   Форма поиска
   ============================================================ */
.search-form {
    display: flex;
    gap: .5rem;
    min-width: 0;
}
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: .6rem .8rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: .95rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--ink);
}
.search-form .search-submit {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .6rem 1.1rem;
    font-weight: 600;
    cursor: pointer;
}
.search-form .search-submit:hover { background: var(--primary-dark); }

/* ============================================================
   Комментарии
   ============================================================ */
.comments-area {
    margin-top: 2rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.8rem 2rem;
    box-shadow: var(--shadow);
}
.comments-title, .comment-reply-title { font-size: 1.25rem; margin-bottom: 1.1rem; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list ul.children { list-style: none; margin: 0 0 0 1.5rem; padding: 0; }
.comment-item { margin-bottom: 1.2rem; }
.comment-inner {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 1rem 1.2rem;
    background: var(--bg);
}
.comment-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; flex-wrap: wrap; }
.comment-author { font-weight: 700; }
.comment-date { font-size: .8rem; color: var(--muted); }
.comment-actions { font-size: .85rem; margin-top: .4rem; }

.comment-form { display: grid; gap: 1rem; margin-top: 1.2rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: .7rem .85rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: .97rem;
    background: var(--surface);
    color: var(--ink);
}
.comment-form .form-submit .submit {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .75rem 1.6rem;
    font-weight: 600;
    cursor: pointer;
}
.comment-form .form-submit .submit:hover { background: var(--primary-dark); }

/* ============================================================
   404
   ============================================================ */
.error-404 {
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    box-shadow: var(--shadow);
}
.error-404 .code { font-size: 4rem; font-weight: 800; color: var(--primary); line-height: 1; }
.error-404 .search-form { max-width: 460px; margin: 1.6rem auto 0; }

/* ============================================================
   Cookie-баннер (D6, A11)
   ============================================================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    z-index: 900;
    background: var(--ink);
    color: #eef0f4;
    border-radius: 12px;
    padding: 1.1rem 1.3rem;
    box-shadow: 0 10px 40px rgba(0,0,0,.28);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    flex-wrap: wrap;
    max-width: 940px;
    margin-inline: auto;
}
.cookie-banner p { margin: 0; font-size: .9rem; min-width: 0; }
.cookie-banner a { color: #9fd3ca; }
.cookie-accept {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: .65rem 1.4rem;
    font-weight: 600;
    cursor: pointer;
    flex: 0 0 auto;
}
.cookie-accept:hover { background: #b3671f; }

/* ============================================================
   Адаптив
   ============================================================ */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 2rem; }
    .fs-split { grid-template-columns: 1fr; gap: 1.6rem; }
    .fs-split.reverse .fs-split-media { order: 0; }
    .fs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fs-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fs-latest .card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-cols { grid-template-columns: 1fr; gap: 1.4rem; }
    .home-wrap, .layout-single .content-area { width: 100%; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.35rem; }

    .nav-toggle { display: inline-flex; }
    .main-nav {
        flex-basis: 100%;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 0; }
    .main-nav li { border-bottom: 1px solid var(--line); }
    .main-nav a { padding: .7rem 0; }

    .card-list,
    .fs-grid,
    .fs-steps,
    .fs-latest .card-list { grid-template-columns: 1fr; }

    .entry { padding: 1.4rem 1.2rem; }
    .fs-cta { padding: 1.8rem 1.4rem; }
    .comments-area { padding: 1.3rem 1.2rem; }

    .cookie-banner { flex-direction: column; align-items: stretch; text-align: left; }
    .cookie-accept { width: 100%; }
}
