/*
Theme Name: dds_goods-club.ru
Author: Анна Кравцова
Description: Информационная тема для образовательного ресурса-клуба о финансовой грамотности и разумном потреблении для семей. Адаптивная вёрстка, блог, виджеты, хлебные крошки.
Version: 1.1
Text Domain: goodsclub
*/

/* ============================== Tokens ============================== */
:root {
    --brand: #1f6f54;
    --brand-dark: #154e3b;
    --brand-on: #ffffff;
    --accent: #d4922f;
    --accent-soft: #f6e8d2;
    --ink: #20302a;
    --muted: #5e6c64;
    --bg: #f6f4ec;
    --surface: #ffffff;
    --surface-2: #fbfaf4;
    --border: #e4dfd2;
    --footer-bg: #16261f;
    --footer-ink: #e9efe9;
    --footer-muted: #a7bab0;
    --maxw: 1180px;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(22, 50, 38, 0.07);
}

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

html { scroll-behavior: smooth; }

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

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

h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

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

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

/* ============================== Shell ============================== */
.shell {
    width: min(92%, var(--maxw));
    margin-inline: auto;
}

.section { padding: 56px 0; }
.section-tight { padding: 36px 0; }

/* ============================== Header ============================== */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark, .brand-logo { flex: 0 0 auto; display: block; }
.brand-logo { max-height: 56px; width: auto; }
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    font-family: Georgia, serif;
    font-weight: 700;
    color: var(--brand-dark);
    font-size: 1.05rem;
    line-height: 1.25;
}
.brand-desc {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
    margin-top: 2px;
    max-width: 46ch;
}

.nav-toggle {
    display: none;
    background: var(--brand);
    color: var(--brand-on);
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.95rem;
    cursor: pointer;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 9px 14px;
    border-radius: 9px;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.96rem;
}
.main-nav a:hover { background: var(--accent-soft); text-decoration: none; }
.main-nav .current-menu-item > a { background: var(--brand); color: var(--brand-on); }

/* ============================== Layout ============================== */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 40px;
    align-items: start;
}
.layout-single { display: block; }
.layout-single .content-area {
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 32px; }
    .layout-single .content-area { width: 100%; }
}
.content-area { min-width: 0; }

/* ============================== Breadcrumbs ============================== */
.crumbs {
    font-size: 0.86rem;
    color: var(--muted);
    padding: 16px 0 0;
}
.crumbs a { color: var(--brand); }
.crumbs-sep { color: var(--muted); margin: 0 2px; }

/* ============================== Cards ============================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 26px;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.card-thumb { display: block; }
.card-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 22px;
}
.card-meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }
.card-title { font-size: 1.2rem; margin: 0 0 8px; }
.card-title a { color: var(--brand-dark); }
.card-excerpt { color: var(--ink); }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 12px;
    font-weight: 700;
    color: var(--brand);
}

/* ============================== Pagination ============================== */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 40px 0 0;
}
.pager .page-numbers {
    display: inline-block;
    min-width: 42px;
    text-align: center;
    padding: 9px 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    line-height: 1;
}
.pager a.page-numbers:hover { background: var(--accent-soft); text-decoration: none; }
.pager .page-numbers.current {
    background: var(--brand);
    border-color: var(--brand);
    color: var(--brand-on);
}
.pager .page-numbers.dots { border: 0; background: none; }

/* ============================== Sidebar / Widgets ============================== */
.sidebar { min-width: 0; }
.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 26px;
    color: var(--ink);
}
.widget a { color: var(--brand); }
.widget-title {
    font-size: 1.1rem;
    margin: 0 0 14px;
    color: var(--brand-dark);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.widget li:last-child { border-bottom: 0; }
.widget .post-date { display: block; font-size: 0.78rem; color: var(--muted); }

/* ============================== Article ============================== */
.entry {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 34px;
    box-shadow: var(--shadow);
}
.entry-header { margin-bottom: 20px; }
.entry-meta { font-size: 0.85rem; color: var(--muted); }
.entry-thumb { margin: 0 0 24px; border-radius: var(--radius); overflow: hidden; }
.entry-thumb img { display: block; width: 100%; height: auto; }
.entry-content { min-width: 0; }
.entry-content img { border-radius: 10px; }
.entry-content h2, .entry-content h3 { margin-top: 1.4em; }
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.2em 0;
}
.entry-content table, .entry-content th, .entry-content td {
    border: 1px solid var(--border);
}
.entry-content th, .entry-content td { padding: 10px 12px; text-align: left; }
.entry-content th { background: var(--surface-2); }

.page-title { margin-bottom: 22px; }

/* ============================== Front page ============================== */
.hero {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: var(--brand-on);
}
.hero-inner {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 40px;
    align-items: center;
    padding: 64px 0;
}
.hero h1 { color: var(--brand-on); }
.hero p { color: rgba(255,255,255,0.92); font-size: 1.08rem; }
.hero .btn { margin-top: 8px; }
.hero-art { min-width: 0; }
.hero-art img { display: block; width: 100%; height: auto; border-radius: var(--radius); }

.btn {
    display: inline-block;
    background: var(--accent);
    color: #2a1d07;
    font-weight: 700;
    padding: 13px 26px;
    border-radius: 11px;
}
.btn:hover { background: #c4842a; text-decoration: none; }
.btn-ghost {
    background: transparent;
    border: 2px solid var(--brand);
    color: var(--brand);
}
.btn-ghost:hover { background: var(--brand); color: var(--brand-on); }

.block-head { text-align: center; max-width: 70ch; margin: 0 auto 36px; }
.block-head p { color: var(--muted); }

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

/* Сетка направлений */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
}
.feature {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.feature-icon {
    width: 52px; height: 52px;
    display: grid; place-items: center;
    background: var(--accent-soft);
    border-radius: 12px;
    margin-bottom: 16px;
}
.feature h3 { margin: 0 0 8px; }
.feature p { margin: 0; color: var(--muted); font-size: 0.96rem; }

/* Шаги */
.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 26px;
    counter-reset: step;
}
.step { min-width: 0; }
.step-num {
    width: 46px; height: 46px;
    display: grid; place-items: center;
    background: var(--brand);
    color: var(--brand-on);
    font-family: Georgia, serif;
    font-weight: 700;
    border-radius: 50%;
    margin-bottom: 14px;
}
.step h3 { margin: 0 0 6px; }
.step p { margin: 0; color: var(--muted); font-size: 0.96rem; }

/* FAQ */
.faq { max-width: 820px; margin-inline: auto; }
.faq details {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px 22px;
    margin-bottom: 14px;
}
.faq summary {
    cursor: pointer;
    font-weight: 700;
    color: var(--brand-dark);
    padding: 16px 0;
    list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--ink); }

.alt-bg { background: var(--surface-2); }

.section-head { margin-bottom: 28px; }

/* ============================== Comments ============================== */
.comments-area { margin-top: 34px; }
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment-list .children { list-style: none; margin: 0 0 0 26px; padding: 0; }
.comment-inner {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 14px;
}
.comment-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.comment-author { font-weight: 700; }
.comment-date { font-size: 0.8rem; color: var(--muted); }
.comment-pending { font-size: 0.85rem; color: var(--accent); }

/* ============================== Search form ============================== */
.search-form { display: flex; gap: 8px; }
.search-form .search-field {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font: inherit;
    background: var(--surface);
    color: var(--ink);
}
.search-form .search-submit {
    border: 0;
    background: var(--brand);
    color: var(--brand-on);
    padding: 11px 20px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

/* ============================== 404 ============================== */
.notfound { text-align: center; padding: 60px 0; }
.notfound .search-form { max-width: 460px; margin: 24px auto 0; }

/* ============================== Footer ============================== */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-ink);
    margin-top: 64px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
    padding: 52px 0 36px;
}
.footer-col { min-width: 0; }
.footer-col .widget {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    color: var(--footer-ink);
}
.footer-col .widget-title { color: var(--footer-ink); }
.footer-col .widget a { color: var(--footer-ink); }
.footer-col .widget a:hover { color: var(--accent); }
.footer-col .widget li { border-bottom: 1px solid rgba(255,255,255,0.12); }
.footer-col .widget .post-date { color: var(--footer-muted); }
.footer-col .widget p { color: var(--footer-ink); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.14);
    padding: 22px 0;
    font-size: 0.86rem;
    color: var(--footer-muted);
    text-align: center;
}

/* ============================== Cookie banner ============================== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 999;
    background: var(--brand-dark);
    color: var(--brand-on);
    border-radius: 14px;
    padding: 18px 22px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: space-between;
}
.cookie-banner p { margin: 0; font-size: 0.92rem; max-width: 70ch; color: rgba(255,255,255,0.92); }
.cookie-banner a { color: var(--accent); }
.cookie-accept {
    border: 0;
    background: var(--accent);
    color: #2a1d07;
    font-weight: 700;
    padding: 11px 22px;
    border-radius: 10px;
    cursor: pointer;
    flex: 0 0 auto;
}

/* ============================== Responsive ============================== */
@media (max-width: 960px) {
    .hero-inner { grid-template-columns: 1fr; padding: 48px 0; }
    .hero-art { order: -1; }
    .split { grid-template-columns: 1fr; gap: 28px; }
    .split.reverse .split-art { order: 0; }
    .footer-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .nav-toggle { display: block; }
    .main-nav {
        flex-basis: 100%;
        display: none;
    }
    .main-nav.is-open { display: block; }
    .main-nav ul { flex-direction: column; gap: 2px; }
    .footer-cols { grid-template-columns: 1fr; gap: 28px; }
    .section { padding: 40px 0; }
}
