/*
Theme Name: dds_judelartey.com
Author: Максим Кольцов
Description: Информационная тема для аналитического блог-руководства по Web3 и ончейн-анализу. Адаптивная вёрстка, собственные хлебные крошки, пагинация и обработка отрывков.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: jla
*/

/* ============================ Переменные ============================ */
:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --ink: #15192a;
    --muted: #5a6378;
    --line: #e4e8f1;
    --brand: #2f4cdd;
    --brand-d: #2336a8;
    --accent: #0fb5a6;
    --dark: #101627;
    --dark-2: #0a0f1c;
    --dark-ink: #eef1fb;
    --dark-muted: #aeb8d4;
    --radius: 14px;
    --shadow: 0 10px 30px rgba(18, 26, 51, 0.08);
}

/* ============================ База ============================ */
*, *::before, *::after { 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;
    -webkit-font-smoothing: antialiased;
}

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

p { margin: 0 0 1em; }

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

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

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

/* ============================ Контейнеры ============================ */
.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

.wrap {
    margin-block: 44px;
}
.wrap--single {
    width: min(85%, 1120px);
    margin-inline: auto;
    display: block;
}
.wrap--sidebar {
    width: min(92%, 1180px);
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 2.45fr) minmax(0, 1fr);
    gap: 44px;
    align-items: start;
}

.content-area { min-width: 0; }

/* ============================ Кнопки ============================ */
.btn {
    display: inline-block;
    background: var(--brand);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    border: 0;
    cursor: pointer;
    transition: background 0.18s ease;
}
.btn:hover { background: var(--brand-d); color: #fff; text-decoration: none; }
.btn-ghost {
    background: transparent;
    color: var(--brand);
    border: 1.5px solid var(--brand);
}
.btn-ghost:hover { background: var(--brand); color: #fff; }

/* ============================ Шапка ============================ */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.branding {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 320px;
    min-width: 0;
}
.brand-logo-link { display: inline-flex; flex: 0 0 auto; }
.brand-mark { display: block; }
.brand-logo { display: block; max-height: 56px; width: auto; }
.brand-text { min-width: 0; }
.site-title {
    display: block;
    font-family: Georgia, serif;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.site-title:hover { color: var(--brand); text-decoration: none; }
.site-desc {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 9px;
    cursor: pointer;
    margin-left: auto;
}
.nav-toggle span {
    display: block;
    height: 2px;
    width: 22px;
    margin: 0 auto;
    background: var(--ink);
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================ Главная ============================ */
.home {
    width: min(85%, 1180px);
    margin-inline: auto;
}
.block { margin: 64px 0; }
.block:first-child { margin-top: 48px; }
.block-title {
    font-size: 1.85rem;
    margin-bottom: 12px;
}
.block-lead {
    color: var(--muted);
    max-width: 60ch;
    margin-bottom: 28px;
}

/* Блок 1: интро */
.intro-block {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 48px;
    align-items: center;
}
.intro-heading { font-size: 2.3rem; }
.intro-text p { color: #2b3145; }
.intro-media { min-width: 0; }
.intro-illustration {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
}

/* Блок 2: направления */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}
.topic {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px 22px;
    box-shadow: var(--shadow);
}
.topic-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px; height: 50px;
    border-radius: 12px;
    background: rgba(47, 76, 221, 0.1);
    color: var(--brand);
    margin-bottom: 14px;
}
.topic h3 { font-size: 1.12rem; margin-bottom: 6px; }
.topic p { margin: 0; color: var(--muted); font-size: 0.96rem; }

/* Блок: последние записи / списки */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}
.card-grid--list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.latest-cta { text-align: center; margin-top: 34px; }
.empty-note { color: var(--muted); }

/* Карточка записи (вертикальная) */
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.card-thumb-wrap {
    overflow: hidden;
    background: var(--dark);
}
.card-thumb-wrap a { display: block; }
.card-thumb,
.card-thumb-wrap img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.card-thumb-ph {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
}
.card-thumb-ph svg { display: block; width: 100%; height: 100%; }
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px 22px 22px;
    min-width: 0;
}
.card-meta {
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 8px;
}
.card-title { font-size: 1.16rem; margin-bottom: 10px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--brand); text-decoration: none; }
.card-excerpt { color: var(--muted); font-size: 0.97rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 12px;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Блок 3: шаги */
.steps-block {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 38px;
    box-shadow: var(--shadow);
}
.steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
}
.steps li { display: flex; gap: 16px; min-width: 0; }
.step-num {
    flex: 0 0 auto;
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-family: Georgia, serif;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.steps h3 { font-size: 1.08rem; margin-bottom: 4px; }
.steps p { margin: 0; color: var(--muted); font-size: 0.96rem; }

/* Блок 4: FAQ */
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq details {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 4px 22px;
}
.faq summary {
    cursor: pointer;
    font-weight: 600;
    padding: 16px 0;
    list-style: none;
    color: var(--ink);
    position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+";
    position: absolute;
    right: 0;
    color: var(--brand);
    font-size: 1.4rem;
    line-height: 1;
}
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 16px; color: var(--muted); }

/* ============================ Хлебные крошки ============================ */
.breadcrumbs {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 22px;
}
.breadcrumbs a { color: var(--brand); }
.breadcrumbs .sep { margin: 0 6px; color: #aab1c4; }

/* ============================ Заголовки страниц ============================ */
.page-head { margin-bottom: 28px; }
.page-title { font-size: 2rem; }
.page-sub { color: var(--muted); margin: 0; }

/* ============================ Запись / страница ============================ */
.post-single, .page-single {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 36px;
    box-shadow: var(--shadow);
}
.post-title { font-size: 2rem; margin-bottom: 8px; }
.post-meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 20px; }
.post-feature {
    margin: 0 0 24px;
    border-radius: var(--radius);
    overflow: hidden;
}
.post-feature img { display: block; width: 100%; height: auto; }
.post-content { font-size: 1.02rem; }
.post-content img { border-radius: 10px; }
.post-content h2 { font-size: 1.5rem; margin-top: 1.4em; }
.post-content h3 { font-size: 1.25rem; margin-top: 1.2em; }
.post-content ul, .post-content ol { padding-left: 1.4em; }
.post-content blockquote {
    margin: 1.4em 0;
    padding: 12px 22px;
    border-left: 4px solid var(--brand);
    background: var(--bg);
    color: #2b3145;
}
.post-content a { text-decoration: underline; }
.post-tags { margin-top: 26px; font-size: 0.9rem; color: var(--muted); }
.post-tags a { color: var(--brand); }
.tags-label { font-weight: 600; }

/* Таблицы */
.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 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(--bg); }

/* ============================ Сайдбар ============================ */
.sidebar { min-width: 0; }
.sidebar .widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 22px;
    color: var(--ink);
}
.sidebar .widget-title {
    font-size: 1.1rem;
    margin-bottom: 14px;
    color: var(--ink);
}
.sidebar .widget ul { list-style: none; margin: 0; padding: 0; }
.sidebar .widget li {
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}
.sidebar .widget li:last-child { border-bottom: 0; }
.sidebar .widget a { color: var(--brand); }
.sidebar .widget a:hover { color: var(--brand-d); }
.sidebar .widget .post-date { color: var(--muted); font-size: 0.82rem; display: block; }

/* ============================ Пагинация ============================ */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 36px;
}
.pagination .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: 9px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
}
.pagination a.page-numbers:hover {
    border-color: var(--brand);
    color: var(--brand);
}
.pagination .page-numbers.current {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.pagination .page-numbers.dots {
    border: 0;
    background: transparent;
}

/* ============================ Форма поиска ============================ */
.search-form {
    display: flex;
    gap: 8px;
    margin: 20px 0;
    max-width: 460px;
}
.search-input {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 1rem;
    background: var(--surface);
    color: var(--ink);
}
.search-submit {
    padding: 11px 20px;
    border: 0;
    border-radius: 9px;
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
.search-submit:hover { background: var(--brand-d); }

/* ============================ 404 ============================ */
.error-404 {
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 56px 32px;
    box-shadow: var(--shadow);
}
.error-code {
    font-family: Georgia, serif;
    font-size: 4.5rem;
    font-weight: 700;
    color: var(--brand);
    margin: 0;
    line-height: 1;
}
.error-404 .search-form { margin-inline: auto; }
.error-home { margin-top: 22px; }

/* ============================ Комментарии ============================ */
.comments-area {
    margin-top: 36px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px;
}
.comments-title { font-size: 1.35rem; margin-bottom: 18px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list ol { list-style: none; }
.comment-list .comment { margin-bottom: 20px; }
.comment-list .children { padding-left: 26px; }
.comment-body {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 9px;
    font-size: 1rem;
    background: var(--surface);
    color: var(--ink);
    margin-top: 4px;
}
.comment-form .form-submit input {
    background: var(--brand);
    color: #fff;
    border: 0;
    border-radius: 9px;
    padding: 11px 24px;
    font-weight: 600;
    cursor: pointer;
}

/* ============================ Подвал ============================ */
.site-footer {
    background: var(--dark);
    color: var(--dark-muted);
    margin-top: 64px;
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
    padding: 48px 0 40px;
}
.footer-col { min-width: 0; }
.site-footer .widget { margin-bottom: 0; color: var(--dark-muted); }
.site-footer .widget-title { color: var(--dark-ink); font-size: 1.1rem; margin-bottom: 14px; }
.site-footer .widget p { color: var(--dark-muted); }
.site-footer .widget ul { list-style: none; margin: 0; padding: 0; }
.site-footer .widget li { padding: 6px 0; }
.site-footer .widget a { color: var(--dark-ink); }
.site-footer .widget a:hover { color: #fff; }
.site-footer .widget .post-date { color: var(--dark-muted); font-size: 0.82rem; display: block; }
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--dark-2);
}
.copyright {
    margin: 0;
    padding: 20px 0;
    font-size: 0.85rem;
    color: var(--dark-muted);
}

/* ============================ Cookie-баннер ============================ */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--dark-2);
    color: var(--dark-ink);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 16px 0;
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.cookie-text { margin: 0; flex: 1 1 320px; font-size: 0.92rem; color: var(--dark-muted); }
.cookie-btn {
    flex: 0 0 auto;
    background: var(--accent);
    color: #06231f;
    border: 0;
    border-radius: 9px;
    padding: 11px 26px;
    font-weight: 700;
    cursor: pointer;
}
.cookie-btn:hover { filter: brightness(1.05); }

/* ============================ Адаптив ============================ */
@media (max-width: 960px) {
    .wrap--sidebar { grid-template-columns: minmax(0, 1fr); gap: 36px; }
    .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .intro-block { grid-template-columns: minmax(0, 1fr); gap: 30px; }
    .intro-heading { font-size: 1.9rem; }
    .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home, .wrap--single { width: 90%; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .nav-toggle { display: flex; }
    .primary-nav {
        flex-basis: 100%;
        display: none;
    }
    .primary-nav.is-open { display: block; }
    .nav-list { flex-direction: column; gap: 2px; }
    .nav-list a { padding: 12px 10px; }
    .topic-grid,
    .card-grid,
    .card-grid--list,
    .steps { grid-template-columns: minmax(0, 1fr); }
    .footer-cols { grid-template-columns: minmax(0, 1fr); }
    .home, .wrap--single { width: 92%; }
    .block { margin: 48px 0; }
    .steps-block, .post-single, .page-single { padding: 24px; }
    .block-title { font-size: 1.55rem; }
    .intro-heading { font-size: 1.7rem; }
}
