/*
Theme Name: dds_talkwebber.ru
Author: Артём Ветров
Description: Экспертный ресурс и база знаний по digital-маркетингу в образовании и EdTech.
Version: 1.1
Text Domain: talkwebber
*/

/* ==========================================================================
   Переменные и сброс
   ========================================================================== */
:root {
    --maxw: 1180px;
    --ink: #1a2233;
    --ink-soft: #4d5970;
    --bg: #f6f7fb;
    --surface: #ffffff;
    --primary: #4338ca;
    --primary-dark: #312e9e;
    --accent: #f2994a;
    --line: #e3e6f0;
    --footer-bg: #171b29;
    --footer-ink: #cdd3e4;
    --footer-soft: #8b93ad;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(26, 34, 51, 0.07);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); margin: 0 0 0.6em; font-weight: 700; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.1em; }

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

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

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

/* ==========================================================================
   Шапка
   ========================================================================== */
.site-head {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.head-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; }
.brand-logo { display: block; }
.brand-mark { width: 46px; height: 46px; flex: 0 0 auto; }
.brand-text { min-width: 0; }
.brand-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
    line-height: 1.25;
}
.brand-title a { color: inherit; }
.brand-desc {
    font-size: 0.82rem;
    color: var(--ink-soft);
    margin: 4px 0 0;
    max-width: 520px;
}

/* Навигация */
.nav-toggle {
    display: none;
    background: var(--primary);
    color: #fff;
    border: 0;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
}
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 6px;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}
.main-nav a {
    display: block;
    padding: 9px 14px;
    border-radius: 9px;
    color: var(--ink-soft);
    font-weight: 600;
    font-size: 0.95rem;
}
.main-nav a:hover { background: var(--bg); color: var(--primary); text-decoration: none; }
.main-nav .current-menu-item > a { background: var(--primary); color: #fff; }

/* ==========================================================================
   Каркас страниц
   ========================================================================== */
.page-wrap { padding: 34px 0 50px; }

.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-left: auto; margin-right: auto; }
.layout-single.full-width .content-area { width: 100%; }

/* Крошки */
.crumbs {
    font-size: 0.85rem;
    color: var(--ink-soft);
    margin-bottom: 20px;
}
.crumbs a { color: var(--ink-soft); }
.crumbs a:hover { color: var(--primary); }
.crumbs .sep { margin: 0 6px; color: var(--line); }
.crumbs span:last-child { color: var(--ink); }

/* ==========================================================================
   Сайдбар / виджеты
   ========================================================================== */
.sidebar { min-width: 0; }
.widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 22px;
    box-shadow: var(--shadow);
}
.widget-title {
    font-size: 1.05rem;
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    color: var(--ink);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: 0; }
.widget a { color: var(--ink); font-weight: 600; }
.widget a:hover { color: var(--primary); }
.widget .post-date { display: block; font-size: 0.78rem; color: var(--ink-soft); margin-top: 2px; }

/* ==========================================================================
   Карточки записей
   ========================================================================== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
    gap: 24px;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    min-width: 0;
}
.card-thumb-wrap { display: block; overflow: hidden; }
.card-thumb-wrap img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.card:hover .card-thumb-wrap img { transform: scale(1.04); }
.card-body { flex: 1; display: flex; flex-direction: column; padding: 20px; min-width: 0; }
.card-meta { font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 8px; }
.card-title { font-size: 1.2rem; margin: 0 0 10px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--primary); text-decoration: none; }
.card-excerpt { color: var(--ink-soft); font-size: 0.95rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 14px;
    font-weight: 700;
    color: var(--primary);
    align-self: flex-start;
}
.card-more:hover { color: var(--primary-dark); text-decoration: none; }

/* Список записей (single column на странице блога/архива) */
.post-list { display: flex; flex-direction: column; gap: 24px; }
.post-list .card { flex-direction: row; }
.post-list .card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
}
.post-list .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.post-list .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
    display: block;
}

/* ==========================================================================
   Запись / страница
   ========================================================================== */
.entry {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}
.entry-title { font-size: 2rem; }
.entry-meta { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 22px; }
.entry-thumb { border-radius: 10px; overflow: hidden; margin-bottom: 24px; }
.entry-thumb img { width: 100%; display: block; }
.entry-content > * { max-width: 100%; }
.entry-content img { border-radius: 8px; }
.entry-content h2 { margin-top: 1.4em; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content blockquote {
    border-left: 4px solid var(--primary);
    margin: 1.4em 0;
    padding: 6px 0 6px 20px;
    color: var(--ink-soft);
    font-style: italic;
}

table { border-collapse: collapse; width: 100%; margin: 1.2em 0; }
table, th, td { border: 1px solid var(--line); }
th, td { padding: 10px 12px; text-align: left; }
th { background: var(--bg); }

/* ==========================================================================
   Пагинация
   ========================================================================== */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 34px;
    justify-content: center;
}
.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);
    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: 0; background: none; }

/* ==========================================================================
   Главная
   ========================================================================== */
.front-section { padding: 26px 0; }
.section-head { margin-bottom: 24px; }
.section-head .eyebrow {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 8px;
}

/* Hero / текст+иллюстрация */
.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 40px;
    align-items: center;
}
.split.reverse .split-media { order: -1; }
.split-text h2 { font-size: 1.9rem; }
.split-text .lead { color: var(--ink-soft); font-size: 1.05rem; }
.split-media img, .split-media svg {
    width: 100%;
    border-radius: var(--radius);
    display: block;
}
.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    margin-top: 8px;
}
.btn:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.btn-ghost {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 10px 22px;
}
.btn-ghost:hover { background: var(--primary); color: #fff; }

/* Сетка преимуществ/направлений */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 22px;
}
.feature {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.feature-icon {
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(67, 56, 202, 0.1);
    border-radius: 12px;
    margin-bottom: 14px;
}
.feature h3 { font-size: 1.1rem; margin-bottom: 8px; }
.feature p { color: var(--ink-soft); font-size: 0.93rem; margin: 0; }

/* Шаги */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 24px; counter-reset: step; }
.step { position: relative; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.step::before {
    counter-increment: step;
    content: counter(step);
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    background: var(--accent); color: #fff;
    border-radius: 50%;
    font-weight: 700;
    margin-bottom: 12px;
}
.step h3 { font-size: 1.08rem; margin-bottom: 6px; }
.step p { color: var(--ink-soft); font-size: 0.92rem; margin: 0; }

/* Статистика */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 24px;
    background: var(--primary);
    border-radius: var(--radius);
    padding: 38px 28px;
    color: #fff;
}
.stat { text-align: center; min-width: 0; }
.stat-num { font-size: 2.4rem; font-weight: 800; display: block; }
.stat-label { color: rgba(255, 255, 255, 0.85); font-size: 0.92rem; }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 4px 20px;
    box-shadow: var(--shadow);
}
.faq summary {
    cursor: pointer;
    font-weight: 700;
    padding: 14px 0;
    list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; float: right; color: var(--primary); font-size: 1.3rem; }
.faq details[open] summary::after { content: '−'; }
.faq details p { color: var(--ink-soft); margin: 0 0 14px; }

/* Цитата */
.pullquote {
    background: var(--footer-bg);
    color: #fff;
    border-radius: var(--radius);
    padding: 48px 40px;
    text-align: center;
}
.pullquote p { font-size: 1.5rem; font-weight: 600; line-height: 1.4; margin: 0 0 14px; max-width: 760px; margin-inline: auto; }
.pullquote cite { color: var(--accent); font-style: normal; font-weight: 700; }

/* Последние записи на главной */
.latest-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ==========================================================================
   Поиск
   ========================================================================== */
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--surface);
    color: var(--ink);
}
.search-form button {
    background: var(--primary);
    color: #fff;
    border: 0;
    padding: 0 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

/* ==========================================================================
   Комментарии
   ========================================================================== */
.comments-area { margin-top: 34px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.comment-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comment-list .children { list-style: none; margin-left: 28px; padding: 0; }
.comment-item { border-bottom: 1px solid var(--line); padding: 16px 0; }
.comment-head { display: flex; gap: 12px; align-items: baseline; margin-bottom: 6px; }
.comment-author { font-weight: 700; }
.comment-date { font-size: 0.8rem; color: var(--ink-soft); }
.comment-moderation { color: var(--accent); font-size: 0.85rem; }
.comment-form p { margin-bottom: 14px; }
.comment-form label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 0.9rem; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
}
.comment-form input[type="submit"], .form-submit input {
    background: var(--primary);
    color: #fff;
    border: 0;
    padding: 12px 26px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}

/* ==========================================================================
   404
   ========================================================================== */
.error-404 { text-align: center; padding: 40px 0; }
.error-404 .code { font-size: 5rem; font-weight: 800; color: var(--primary); line-height: 1; }
.error-404 .search-form { max-width: 460px; margin: 24px auto 0; }

/* ==========================================================================
   Подвал
   ========================================================================== */
.site-foot {
    background: var(--footer-bg);
    color: var(--footer-ink);
    padding: 48px 0 0;
    margin-top: 40px;
}
.foot-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 32px;
}
.foot-cols .widget {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
    color: var(--footer-ink);
}
.foot-cols .widget-title { color: #fff; border-bottom-color: rgba(255, 255, 255, 0.18); }
.foot-cols .widget,
.foot-cols .widget p { color: var(--footer-ink); }
.foot-cols .widget a { color: var(--footer-ink); }
.foot-cols .widget a:hover { color: #fff; }
.foot-cols .widget li { border-bottom-color: rgba(255, 255, 255, 0.1); }
.foot-cols .widget .post-date { color: var(--footer-soft); }
.site-copy {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    margin-top: 38px;
    padding: 22px 0;
    text-align: center;
    color: var(--footer-soft);
    font-size: 0.88rem;
}

/* ==========================================================================
   Cookie-баннер
   ========================================================================== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 16px; right: 16px; bottom: 16px;
    z-index: 9999;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    max-width: var(--maxw);
    margin-inline: auto;
}
.cookie-banner p { margin: 0; font-size: 0.9rem; color: var(--ink-soft); min-width: 0; flex: 1; }
.cookie-accept {
    background: var(--primary);
    color: #fff;
    border: 0;
    padding: 11px 24px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
}
.cookie-accept:hover { background: var(--primary-dark); }

/* ==========================================================================
   Адаптив
   ========================================================================== */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; gap: 34px; }
    .split { grid-template-columns: 1fr; gap: 26px; }
    .split.reverse .split-media { order: 0; }
    .pullquote p { font-size: 1.25rem; }
    .layout-single .content-area { width: 100%; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    h1, .entry-title { font-size: 1.7rem; }
    .nav-toggle { display: inline-block; }
    .main-nav { display: none; width: 100%; }
    .main-nav.open { display: block; }
    .main-nav ul { flex-direction: column; gap: 2px; }
    .head-inner { gap: 14px; }

    .post-list .card { flex-direction: column; }
    .post-list .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .post-list .card-thumb-wrap a { position: static; }
    .post-list .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .entry, .widget, .comments-area { padding: 20px; }
    .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; }
}
