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

/* =========================================================
   Переменные и сброс
   ========================================================= */
:root {
    --navy: #122a4a;
    --navy-soft: #1c3a61;
    --blue: #5b8fb9;
    --blue-light: #8bb6d6;
    --gold: #c8a24a;
    --gold-dark: #a9842f;
    --ink: #1d2733;
    --muted: #5d6b7d;
    --line: #dde4ee;
    --bg: #f7f8fa;
    --bg-soft: #eef2f8;
    --white: #ffffff;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(18, 42, 74, 0.08);
}

* { 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;
}

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

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--gold-dark); }

h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; font-weight: 700; }

p { margin: 0 0 1em; }

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

/* Единый контейнер ширины (A12.7) */
.shell {
    width: min(92%, 1180px);
    margin-inline: auto;
}

.btn {
    display: inline-block;
    background: var(--gold);
    color: #2a1d00;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 10px;
    border: 1px solid var(--gold);
    transition: background .2s, color .2s;
}
.btn:hover { background: var(--gold-dark); color: #fff; border-color: var(--gold-dark); }

.btn-ghost {
    background: transparent;
    color: var(--navy);
    border: 1px solid var(--navy);
}
.btn-ghost:hover { background: var(--navy); color: #fff; }

/* =========================================================
   Шапка
   ========================================================= */
.site-header {
    background: var(--white);
    border-bottom: 1px solid var(--line);
}
.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 0;
    flex-wrap: wrap;
}
.brand-link {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.brand-logo { height: 46px; width: auto; display: block; }
.brand-mark { display: block; flex: 0 0 auto; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
    font-weight: 700;
    color: var(--navy);
    font-size: 15px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 540px;
}
.brand-desc {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 540px;
}

.primary-menu {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.primary-menu a {
    display: block;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--navy);
    font-weight: 600;
    font-size: 15px;
    transition: background .2s, color .2s;
}
.primary-menu a:hover,
.primary-menu .current-menu-item > a {
    background: var(--bg-soft);
    color: var(--gold-dark);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 8px;
}
.nav-toggle-bar {
    width: 26px; height: 3px;
    background: var(--navy);
    border-radius: 2px;
}

/* =========================================================
   Главная — секции
   ========================================================= */
.site-main { display: block; }

.home-section { padding: 64px 0; }

.section-h { font-size: 30px; margin: 0 0 14px; }
.section-h.center { text-align: center; }
.section-h.light { color: #fff; }
.section-lead { color: var(--muted); margin: 0 0 36px; }
.section-lead.center { text-align: center; }
.center { text-align: center; }
.eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 12px;
    font-weight: 700;
    color: var(--gold-dark);
    margin-bottom: 10px;
}

/* Блок 1: текст + иллюстрация */
.section-intro { background: var(--white); }
.intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 48px;
    align-items: center;
}
.intro-text h1 { font-size: 34px; margin: 0 0 18px; }
.intro-media img { width: 100%; height: auto; display: block; border-radius: var(--radius); }

/* Блок 2: сетка-направления */
.pillars-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}
.pillar {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 22px;
    box-shadow: var(--shadow);
}
.pillar-ic {
    width: 52px; height: 52px;
    border-radius: 12px;
    background: var(--bg-soft);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.pillar h3 { font-size: 19px; margin: 0 0 8px; }
.pillar p { margin: 0; color: var(--muted); font-size: 15px; }

/* Лента записей */
.section-latest { background: var(--bg-soft); }
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}
.empty-note { color: var(--muted); text-align: center; padding: 30px 0; }

/* Блок 3: факты */
.section-facts { background: var(--navy); }
.facts-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    text-align: center;
}
.fact { color: #e8eef6; }
.fact-num {
    display: block;
    font-size: 44px;
    font-weight: 800;
    color: var(--gold);
    line-height: 1;
    margin-bottom: 10px;
}
.fact-label { color: #c2d0e2; font-size: 15px; }

/* Блок 4: FAQ */
.section-faq { background: var(--white); }
.faq-shell { width: min(92%, 820px); margin-inline: auto; }
.faq-list { display: flex; flex-direction: column; gap: 14px; }
.faq-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg);
    overflow: hidden;
}
.faq-item summary {
    cursor: pointer;
    padding: 18px 22px;
    font-weight: 600;
    color: var(--navy);
    list-style: none;
    position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 22px;
    color: var(--gold-dark);
    font-size: 22px;
    line-height: 1;
}
.faq-item[open] summary::after { content: "–"; }
.faq-body { padding: 0 22px 18px; color: var(--muted); }
.faq-body p { margin: 0; }

/* =========================================================
   Карточки записей (A8, A10)
   ========================================================= */
.card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.card-thumb-wrap {
    position: relative;
    overflow: hidden;
}
.card-thumb-wrap img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 22px;
}
.card-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 10px;
}
.card-cat a { color: var(--gold-dark); font-weight: 600; }
.card-title { font-size: 20px; margin: 0 0 12px; }
.card-title a { color: var(--navy); }
.card-title a:hover { color: var(--gold-dark); }
.card-excerpt { color: var(--muted); font-size: 15px; margin-bottom: 16px; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    color: var(--gold-dark);
    font-weight: 600;
    font-size: 15px;
}

/* =========================================================
   Внутренние страницы / раскладки
   ========================================================= */
.page-shell { padding: 36px 0 64px; }

.layout-single { display: block; }
.layout-single .content-area { display: block; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.page-head { margin-bottom: 28px; }
.page-h { font-size: 30px; margin: 0 0 8px; }
.page-sub { color: var(--muted); margin: 0; }

.error-404 { text-align: center; padding: 30px 0 60px; }
.error-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }

/* Хлебные крошки */
.breadcrumbs {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 22px;
}
.breadcrumbs a { color: var(--navy); }
.breadcrumbs a:hover { color: var(--gold-dark); }
.breadcrumbs .sep { color: var(--blue-light); margin: 0 4px; }

/* Запись / страница */
.single-post {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 34px;
    box-shadow: var(--shadow);
}
.single-title { font-size: 32px; margin: 0 0 14px; }
.single-meta { display: flex; gap: 14px; color: var(--muted); font-size: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.single-cat a { color: var(--gold-dark); font-weight: 600; }
.single-thumb { margin: 0 0 24px; }
.single-thumb img { width: 100%; height: auto; display: block; border-radius: 10px; }
.single-content { font-size: 17px; }
.single-content img { border-radius: 10px; display: block; }
.single-content h2 { font-size: 25px; margin: 1.4em 0 .5em; }
.single-content h3 { font-size: 21px; margin: 1.3em 0 .5em; }
.single-content a { color: var(--gold-dark); text-decoration: underline; }
.single-content blockquote {
    border-left: 4px solid var(--gold);
    margin: 1.2em 0;
    padding: 4px 0 4px 20px;
    color: var(--navy-soft);
    font-style: italic;
}
.single-content ul, .single-content ol { padding-left: 1.4em; }

.single-tags { margin-top: 26px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag-link {
    background: var(--bg-soft);
    color: var(--navy);
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 14px;
}
.tag-link:hover { background: var(--navy); color: #fff; }

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

/* =========================================================
   Сайдбар (светлый фон → тёмный текст)
   ========================================================= */
.sidebar { display: block; }
.sidebar .widget {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}
.sidebar .widget-title {
    font-size: 17px;
    margin: 0 0 14px;
    color: var(--navy);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--gold);
}
.sidebar .widget,
.sidebar .widget p,
.sidebar .widget li { 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(--navy); }
.sidebar .widget a:hover { color: var(--gold-dark); }
.sidebar .post-date { color: var(--muted); font-size: 13px; display: block; }

/* =========================================================
   Пагинация — type => 'plain' (D5)
   ========================================================= */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 40px;
    justify-content: center;
}
.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: 10px;
    background: var(--white);
    color: var(--navy);
    font-weight: 600;
    transition: background .2s, color .2s, border-color .2s;
}
.pagination a.page-numbers:hover {
    background: var(--bg-soft);
    border-color: var(--blue-light);
}
.pagination .page-numbers.current {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
}
.pagination .page-numbers.dots {
    border: 0;
    background: none;
}

.comment-pagination .page-numbers,
.comment-pagination {
    display: inline-flex;
    gap: 8px;
    margin-top: 20px;
}

/* =========================================================
   Комментарии
   ========================================================= */
.comments-area {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px;
    margin-top: 30px;
    box-shadow: var(--shadow);
}
.comments-title { font-size: 22px; margin: 0 0 20px; }
.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 {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 14px;
    background: var(--bg);
}
.comment-meta { display: flex; gap: 12px; align-items: baseline; margin-bottom: 8px; }
.comment-author { font-weight: 700; color: var(--navy); }
.comment-date { color: var(--muted); font-size: 13px; }
.comment-actions { font-size: 14px; }
.comment-actions a { color: var(--gold-dark); font-weight: 600; }

.comment-form { margin-top: 10px; }
.comment-form p { margin: 0 0 14px; }
.comment-form label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--navy); }
.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: inherit;
    background: var(--white);
}
.comment-form textarea { min-height: 130px; resize: vertical; }
.comment-form .form-submit input,
.comment-form .submit {
    background: var(--gold);
    color: #2a1d00;
    border: 1px solid var(--gold);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}
.comment-form .form-submit input:hover { background: var(--gold-dark); color: #fff; }

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

/* =========================================================
   Подвал (тёмный фон → светлый текст)
   ========================================================= */
.site-footer { background: var(--navy); color: #cdd9e8; margin-top: 40px; }
.footer-cols {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px;
    padding: 52px 0 40px;
}
.footer-col .widget { margin-bottom: 10px; }
.footer-col .widget-title {
    color: #fff;
    font-size: 17px;
    margin: 0 0 14px;
}
.footer-col,
.footer-col p,
.footer-col li,
.footer-col .widget { color: #cdd9e8; }
.footer-col a { color: #e6edf6; }
.footer-col a:hover { color: var(--gold); }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { padding: 6px 0; }
.footer-col .post-date { color: #9fb2c9; font-size: 13px; display: block; }

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 20px 0;
}
.copyright { margin: 0; color: #9fb2c9; font-size: 14px; text-align: center; }

/* =========================================================
   Cookie-баннер (A11) — правило [hidden] до основного блока
   ========================================================= */
.cookie-banner[hidden] { display: none !important; }

.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 999;
    background: var(--navy);
    color: #e6edf6;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.18);
}
.cookie-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.cookie-text { margin: 0; font-size: 14px; color: #d6e0ed; flex: 1; min-width: 220px; }
.cookie-accept {
    background: var(--gold);
    color: #2a1d00;
    border: 0;
    padding: 11px 26px;
    border-radius: 9px;
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
}
.cookie-accept:hover { background: var(--gold-dark); color: #fff; }

/* =========================================================
   Адаптив
   ========================================================= */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .pillars-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .facts-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .intro-grid { grid-template-columns: 1fr; gap: 32px; }
    .footer-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    body { font-size: 16px; }
    .home-section { padding: 44px 0; }

    .nav-toggle { display: flex; }
    .primary-nav {
        flex-basis: 100%;
        display: none;
    }
    .primary-nav.is-open { display: block; }
    .primary-menu { flex-direction: column; gap: 4px; }

    .pillars-grid,
    .cards-grid,
    .facts-row { grid-template-columns: 1fr; }
    .footer-cols { grid-template-columns: 1fr; }

    .section-h { font-size: 25px; }
    .intro-text h1 { font-size: 28px; }
    .single-post { padding: 22px; }

    /* Сброс абсолютного позиционирования миниатюр (A10) */
    .card-thumb-wrap { position: static; }
    .card-thumb-wrap a { position: static; }
    .card-thumb-wrap img { width: 100%; height: auto; aspect-ratio: 16 / 9; }
}
