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

:root {
    --bg: #f6f5f0;
    --surface: #ffffff;
    --ink: #20302a;
    --muted: #5d6b63;
    --primary: #14543e;
    --primary-2: #1d6e51;
    --accent: #e07a3f;
    --accent-soft: #f4d9c4;
    --line: #dde4df;
    --foot-bg: #11362a;
    --foot-ink: #e7efe9;
    --foot-muted: #a9c1b4;
    --side-bg: #eef3ef;
    --maxw: 1180px;
    --radius: 14px;
}

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

html { scroll-behavior: smooth; }

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

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

a { color: var(--primary-2); }
a:hover { color: var(--accent); }

h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); }
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; }

/* p не задаёт фон — фон только на body и блоках */

.screen-reader-text {
    position: absolute;
    width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0 0 0 0);
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--primary);
    color: #fff;
    padding: 8px 14px;
    z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

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

/* --- Кнопки --- */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 11px 22px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background .2s ease;
}
.btn:hover { background: #c9692f; color: #fff; }

/* --- Шапка --- */
.site-head {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.head-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1 1 auto;
}
.brand-link { display: inline-flex; flex: 0 0 auto; }
.brand-logo { display: block; max-height: 56px; width: auto; }
.brand-mark { display: block; }
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    font-weight: 700;
    font-size: 1.05rem;
}
.brand-name a { color: var(--ink); text-decoration: none; }
.brand-name a:hover { color: var(--primary-2); }
.brand-desc {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
    margin-top: 2px;
    max-width: 52ch;
}

.primary-nav { flex: 0 0 auto; }
.primary-nav .menu {
    list-style: none;
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.primary-nav .menu a {
    display: block;
    padding: 8px 14px;
    color: var(--ink);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
}
.primary-nav .menu a:hover,
.primary-nav .menu .current-menu-item > a {
    background: var(--side-bg);
    color: var(--primary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
}
.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
}

/* --- Основной контент --- */
.site-main { padding: 32px 0 56px; }

.crumbs {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 22px;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { margin: 0 6px; color: var(--line); }

/* --- Раскладки --- */
.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 {
    max-width: var(--maxw);
    margin-inline: auto;
}
.content-area { min-width: 0; }

.page-head { margin-bottom: 24px; }
.page-title { margin: 0 0 8px; }

/* --- Сайдбар --- */
.sidebar {
    background: var(--side-bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    min-width: 0;
}
.sidebar .widget { margin-bottom: 26px; }
.sidebar .widget:last-child { margin-bottom: 0; }
.sidebar .widget-title {
    margin: 0 0 14px;
    font-size: 1.05rem;
    color: var(--primary);
}
.sidebar a { color: var(--ink); text-decoration: none; }
.sidebar a:hover { color: var(--accent); }
.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.sidebar li {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    line-height: 1.4;
}
.sidebar li:last-child { border-bottom: none; }
.sidebar .post-date { color: var(--muted); font-size: 0.8rem; }

/* --- Карточки записей --- */
.post-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
.latest-grid,
.dir-grid {
    display: grid;
    gap: 24px;
}
.latest-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    min-width: 0;
}
.card-thumb-wrap {
    display: block;
    overflow: hidden;
}
.card-thumb-wrap a { display: block; }
.card-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 22px;
    min-width: 0;
}
.card-meta {
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 8px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.card-cat a { color: var(--primary-2); text-decoration: none; }
.card-title {
    margin: 0 0 10px;
    font-size: 1.2rem;
}
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a:hover { color: var(--primary-2); }
.card-excerpt { color: var(--muted); font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 12px;
    font-weight: 600;
    text-decoration: none;
    color: var(--accent);
}

/* --- Главная: тематические блоки --- */
.front { padding-top: 4px; }
.block { margin-bottom: 56px; }
.block:last-child { margin-bottom: 0; }
.block-title {
    margin: 0 0 10px;
    font-size: 1.7rem;
}
.block-lead { color: var(--muted); margin-bottom: 26px; }

/* Блок 1: текст + иллюстрация */
.intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 40px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 40px;
}
.intro-title { font-size: 2.2rem; margin: 0 0 16px; }
.intro-text p { color: var(--muted); }
.intro-text .btn { margin-top: 10px; }
.intro-media img { display: block; width: 100%; border-radius: 14px; }

/* Блок 2: сетка направлений */
.dir-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dir-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 22px;
    min-width: 0;
}
.dir-icon {
    display: inline-flex;
    width: 52px;
    height: 52px;
    align-items: center;
    justify-content: center;
    background: var(--side-bg);
    border-radius: 12px;
    margin-bottom: 14px;
}
.dir-card h3 { margin: 0 0 8px; font-size: 1.1rem; }
.dir-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* Блок 3: шаги */
.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    counter-reset: none;
}
.step {
    display: flex;
    gap: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    min-width: 0;
}
.step-num {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}
.step-body { min-width: 0; }
.step-body h3 { margin: 0 0 6px; font-size: 1.1rem; }
.step-body p { margin: 0; color: var(--muted); font-size: 0.92rem; }

/* Блок 4: FAQ */
.faq {
    display: grid;
    gap: 12px;
    max-width: 820px;
}
.faq-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 6px 22px;
}
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    padding: 14px 0;
    list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    float: right;
    color: var(--accent);
    font-weight: 700;
}
.faq-item[open] summary::after { content: '–'; }
.faq-item p { margin: 0 0 16px; color: var(--muted); }

.empty-note { color: var(--muted); }

/* --- Одиночная запись / страница --- */
.post-single, .page-single { min-width: 0; }
.post-head { margin-bottom: 18px; }
.post-title { margin: 0 0 10px; font-size: 2.1rem; }
.post-meta {
    color: var(--muted);
    font-size: 0.85rem;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}
.post-meta a { color: var(--primary-2); text-decoration: none; }
.post-thumb { margin: 0 0 26px; }
.post-thumb img {
    display: block;
    width: 100%;
    border-radius: var(--radius);
    object-fit: cover;
}
.post-content { font-size: 1.05rem; }
.post-content img { border-radius: 10px; display: block; }
.post-content h2 { margin: 1.4em 0 .5em; }
.post-content h3 { margin: 1.2em 0 .4em; }
.post-tags { margin-top: 26px; }
.post-tags a {
    display: inline-block;
    background: var(--side-bg);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.82rem;
    text-decoration: none;
    margin: 0 6px 6px 0;
}

/* Таблицы */
.post-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.2em 0;
}
.post-content table,
.post-content th,
.post-content td {
    border: 1px solid var(--line);
}
.post-content th, .post-content td { padding: 10px 12px; text-align: left; }
.post-content th { background: var(--side-bg); }

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

/* Пагинация комментариев */
.comments .nav-links {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

/* --- Комментарии --- */
.comments { margin-top: 48px; }
.comments-title { margin-bottom: 18px; }
.comment-list {
    list-style: none;
    margin: 0 0 30px;
    padding: 0;
}
.comment-list ol { list-style: none; padding-left: 24px; }
.comment-item { margin-bottom: 16px; }
.comment-inner {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 20px;
}
.comment-head {
    display: flex;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 8px;
}
.comment-author { font-weight: 600; }
.comment-date { font-size: 0.8rem; color: var(--muted); }
.comment-reply a { font-size: 0.85rem; color: var(--accent); text-decoration: none; }
.comment-moderation { color: var(--muted); font-style: italic; }

.comment-respond {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
}
.comment-form-comment textarea,
.comment-form-author input,
.comment-form-email input,
.comment-form-url input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}
.comment-form label { display: block; margin-bottom: 4px; font-size: 0.9rem; }
.comment-form p { margin-bottom: 14px; }

/* --- Форма поиска --- */
.search-form {
    display: flex;
    gap: 8px;
    margin: 20px 0;
    max-width: 480px;
}
.search-field {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font: inherit;
    background: #fff;
}
.search-submit {
    border: none;
    background: var(--primary);
    color: #fff;
    padding: 0 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
}
.search-submit:hover { background: var(--primary-2); }

.error-404 { text-align: center; padding: 30px 0; }
.error-404 .search-form { margin-inline: auto; }
.back-home { margin-top: 22px; }

/* --- Подвал --- */
.site-foot {
    background: var(--foot-bg);
    color: var(--foot-ink);
    margin-top: 60px;
    padding: 48px 0 28px;
}
.foot-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
}
.foot-col { min-width: 0; }
.site-foot .widget { margin-bottom: 0; }
.site-foot .widget-title {
    color: #fff;
    font-size: 1.05rem;
    margin: 0 0 14px;
}
.site-foot,
.site-foot p,
.site-foot li { color: var(--foot-ink); }
.site-foot a { color: var(--foot-ink); text-decoration: none; }
.site-foot a:hover { color: var(--accent-soft); }
.site-foot ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-foot li { padding: 6px 0; }
.foot-bottom {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.12);
}
.copyright { margin: 0; color: var(--foot-muted); font-size: 0.85rem; }

/* --- Cookie-баннер (правило [hidden] до основного блока, см. A11) --- */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0d2b22;
    color: #e7efe9;
    z-index: 90;
    box-shadow: 0 -6px 24px rgba(0,0,0,0.2);
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.cookie-text { margin: 0; flex: 1; min-width: 220px; font-size: 0.9rem; }
.cookie-accept {
    border: none;
    background: var(--accent);
    color: #fff;
    padding: 10px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    flex: 0 0 auto;
}
.cookie-accept:hover { background: #c9692f; }

/* --- Адаптив --- */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dir-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .intro-grid { grid-template-columns: 1fr; padding: 28px; }
    .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1 { font-size: 1.7rem; }
    .intro-title { font-size: 1.7rem; }
    .block-title { font-size: 1.4rem; }

    .nav-toggle { display: flex; }
    .primary-nav {
        flex-basis: 100%;
        display: none;
    }
    .primary-nav.is-open { display: block; }
    .primary-nav .menu { flex-direction: column; }
    .primary-nav .menu a { padding: 12px 14px; }

    .latest-grid,
    .dir-grid,
    .steps { grid-template-columns: 1fr; }

    .foot-cols { grid-template-columns: 1fr; }
}
