/*
Theme Name: dds_cio-sibir.ru
Author: Алексей Громов
Description: Информационно-аналитическая платформа с открытой базой знаний, платными отчётами, инструментами самооценки и закрытым клубным разделом для нетворкинга.
Version: 1.1
Text Domain: cio_sibir
*/

/* ===== Базовые сбросы и переменные ===== */
:root {
    --bg-page: #0F1117;
    --bg-block: #1A1D24;
    --bg-elevated: #20242E;
    --text-main: #EAECF0;
    --text-muted: #A8B0BD;
    --accent-1: #2D9CDB;
    --accent-1-hover: #1A6BA0;
    --accent-2: #F4B942;
    --accent-3: #6C63FF;
    --border-soft: rgba(42, 47, 63, 0.7);
    --border-strong: #2A2F3F;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-head: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Roboto Mono', ui-monospace, 'SF Mono', Consolas, monospace;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg-page);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

a {
    color: var(--accent-1);
    text-decoration: none;
    transition: color 0.2s ease;
}
a:hover { color: var(--accent-1-hover); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.25;
    margin: 0 0 0.6em;
}
h1 { font-size: 2.2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

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

/* ===== Шапка ===== */
.site-header {
    background: linear-gradient(180deg, #0F1117 0%, #12141C 100%);
    border-bottom: 1px solid var(--border-strong);
    padding: 18px 0;
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1 1 auto;
}
.brand-mark {
    flex: 0 0 auto;
}
.brand-mark img,
.brand-mark .brand-logo,
.brand-mark svg {
    display: block;
    width: 48px;
    height: 48px;
}
.brand-text {
    min-width: 0;
}
.brand-name {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.2;
    display: block;
    max-width: 480px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.brand-name a { color: inherit; }
.brand-tagline {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.3;
    margin-top: 4px;
    max-width: 520px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Навигация */
.primary-nav {
    flex: 0 0 auto;
}
.primary-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.primary-nav li a {
    display: inline-block;
    padding: 10px 14px;
    color: var(--text-main);
    font-family: var(--font-head);
    font-weight: 500;
    font-size: 0.95rem;
    border-bottom: 2px solid transparent;
}
.primary-nav li.current-menu-item a,
.primary-nav li.current_page_item a,
.primary-nav li a:hover {
    color: var(--accent-1);
    border-bottom-color: var(--accent-1);
}

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border-strong);
    color: var(--text-main);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-head);
    font-size: 0.9rem;
}
.nav-toggle[hidden] { display: none !important; }

/* ===== Хлебные крошки ===== */
.breadcrumbs {
    font-size: 0.88rem;
    color: var(--text-muted);
    padding: 18px 0 8px;
}
.breadcrumbs a {
    color: var(--text-muted);
}
.breadcrumbs a:hover { color: var(--accent-1); }
.breadcrumbs .sep {
    margin: 0 6px;
    color: var(--border-strong);
}

/* ===== Главная страница ===== */
.front {
    padding: 28px 0 60px;
}
.front-wrap {
    width: 85%;
    margin-inline: auto;
}

.hero {
    background: linear-gradient(135deg, #1A1D24 0%, #11141B 100%);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: 48px 40px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -10%;
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(45,156,219,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.hero h1 {
    font-size: clamp(1.8rem, 3.5vw, 2.6rem);
    max-width: 760px;
    position: relative;
    z-index: 1;
}
.hero-keywords {
    font-family: var(--font-mono);
    color: var(--accent-2);
    font-size: 1.1rem;
    letter-spacing: 0.02em;
    position: relative;
    z-index: 1;
}
.hero-keyword {
    transition: opacity 0.3s ease;
}

/* Тематические блоки */
.feature-block {
    background: var(--bg-block);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: 36px 32px;
    margin-bottom: 32px;
}
.feature-block h2 {
    color: var(--text-main);
    margin-bottom: 0.4em;
}
.feature-block .lead {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 760px;
    margin-bottom: 24px;
}
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 18px;
}
.feature-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    padding: 20px 18px;
    min-width: 0;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.feature-item:hover {
    transform: translateY(-2px);
    border-color: var(--accent-1);
}
.feature-item .icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-1-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: var(--font-mono);
    font-weight: 700;
    margin-bottom: 12px;
}
.feature-item h3 {
    font-size: 1.05rem;
    margin-bottom: 6px;
}
.feature-item p {
    color: var(--text-muted);
    font-size: 0.93rem;
    margin: 0;
}

.metrics-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
    gap: 16px;
    margin-top: 8px;
}
.metric {
    background: var(--bg-elevated);
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    padding: 18px;
    min-width: 0;
}
.metric-value {
    font-family: var(--font-mono);
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--accent-2);
    display: block;
    line-height: 1.1;
}
.metric-label {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 4px;
    display: block;
}

/* Раздел «Последние записи» на главной */
.front-posts {
    margin: 40px 0;
}
.front-posts h2 {
    margin-bottom: 24px;
}
.front-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 22px;
}
.front-posts-grid .card {
    margin: 0;
}

/* ===== Карточки записей ===== */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.card {
    display: flex;
    flex-direction: column;
    background: var(--bg-block);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease;
    min-width: 0;
}
.card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-1);
}

.card-thumb {
    display: block;
    aspect-ratio: 16 / 9;
    background: var(--bg-elevated);
    overflow: hidden;
}
.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-body {
    flex: 1;
    padding: 20px 22px 22px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.card-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.card-meta a { color: var(--text-muted); }
.card-meta a:hover { color: var(--accent-1); }
.card-title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.2rem;
    line-height: 1.3;
    margin: 0 0 10px;
}
.card-title a {
    color: var(--text-main);
}
.card-title a:hover { color: var(--accent-1); }
.card-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    flex: 1;
    margin-bottom: 14px;
}
.card-excerpt p {
    margin: 0 0 0.5em;
    background: none;
}
.card-more {
    margin-top: auto;
}

/* Горизонтальные карточки в списке блога */
.posts-list.posts-list-row .card {
    flex-direction: row;
}
.posts-list.posts-list-row .card-thumb-wrap {
    flex: 0 0 280px;
    position: relative;
    overflow: hidden;
    background: var(--bg-elevated);
}
.posts-list.posts-list-row .card-thumb-wrap a {
    display: block;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}
.posts-list.posts-list-row .card-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===== Кнопки ===== */
.btn {
    display: inline-block;
    padding: 11px 22px;
    background: linear-gradient(180deg, var(--accent-1) 0%, var(--accent-1-hover) 100%);
    color: #fff;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: filter 0.2s ease, box-shadow 0.2s ease;
    line-height: 1.2;
    min-height: 44px;
}
.btn:hover {
    color: #fff;
    filter: brightness(1.1);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
}
.btn-outline {
    background: transparent;
    border: 2px solid var(--accent-1);
    color: var(--accent-1);
    padding: 9px 20px;
}
.btn-outline:hover {
    background: rgba(45,156,219,0.18);
    color: var(--accent-1);
    filter: none;
}
.btn-club {
    background: linear-gradient(135deg, var(--accent-3) 0%, #4a45b8 100%);
    border-radius: 40px;
    padding: 11px 24px;
}
.btn-club::before {
    content: '🔒';
    margin-right: 8px;
}

/* ===== Основной макет (контент + сайдбар) ===== */
.layout {
    padding: 20px 0 60px;
}
.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 6%;
    align-items: start;
}
.layout-full {
    display: block;
}
.layout-full .content {
    width: 85%;
    margin-inline: auto;
}

.content {
    min-width: 0;
}

.sidebar {
    min-width: 0;
}

/* ===== Виджеты ===== */
.widget {
    background: var(--bg-block);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 22px 22px 18px;
    margin-bottom: 22px;
    color: var(--text-main);
}
.widget-title {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-main);
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-strong);
}
.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.widget ul li {
    padding: 7px 0;
    border-bottom: 1px solid rgba(42, 47, 63, 0.5);
    color: var(--text-main);
}
.widget ul li:last-child { border-bottom: none; }
.widget ul li a {
    color: var(--text-main);
}
.widget ul li a:hover { color: var(--accent-1); }
.widget .post-date {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    display: block;
    margin-top: 2px;
}

/* Принудительно светлый цвет текста виджетов в сайдбаре и футере (фон тёмный везде) */
.sidebar .widget,
.sidebar .widget a,
.site-footer .widget,
.site-footer .widget a {
    color: var(--text-main);
}
.sidebar .widget .post-date,
.site-footer .widget .post-date,
.sidebar .widget .widget-meta,
.site-footer .widget .widget-meta {
    color: var(--text-muted);
}
.sidebar .widget a:hover,
.site-footer .widget a:hover {
    color: var(--accent-1);
}

/* ===== Контент страницы / записи ===== */
.entry-header {
    margin-bottom: 24px;
}
.entry-meta {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}
.entry-meta a { color: var(--text-muted); }
.entry-meta a:hover { color: var(--accent-1); }
.entry-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    margin: 0;
}
.entry-thumbnail {
    margin: 0 0 26px;
    border-radius: 10px;
    overflow: hidden;
}
.entry-thumbnail img {
    display: block;
    width: 100%;
    height: auto;
}
.entry-content {
    font-size: 1.02rem;
}
.entry-content p { margin: 0 0 1.1em; }
.entry-content h2,
.entry-content h3,
.entry-content h4 { margin-top: 1.6em; }
.entry-content a {
    color: var(--accent-1);
    border-bottom: 1px solid rgba(45,156,219,0.4);
}
.entry-content a:hover {
    color: var(--accent-1-hover);
    border-bottom-color: var(--accent-1-hover);
}
.entry-content ul, .entry-content ol { padding-left: 22px; }
.entry-content blockquote {
    border-left: 3px solid var(--accent-1);
    padding: 6px 18px;
    margin: 18px 0;
    font-family: var(--font-mono);
    color: var(--text-muted);
    background: var(--bg-block);
    border-radius: 0 8px 8px 0;
}
.entry-content code {
    font-family: var(--font-mono);
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.92em;
}
.entry-content pre {
    background: var(--bg-elevated);
    padding: 14px 16px;
    border-radius: 8px;
    overflow-x: auto;
}
.entry-content img { border-radius: 8px; }

/* Таблицы */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
}
.entry-content table,
.entry-content th,
.entry-content td {
    border: 1px solid var(--border-strong);
}
.entry-content th, .entry-content td {
    padding: 10px 12px;
    text-align: left;
}
.entry-content th {
    background: var(--bg-elevated);
    font-family: var(--font-head);
}

/* ===== Пагинация ===== */
.pagination {
    margin: 32px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}
.pagination a,
.pagination span {
    display: inline-block;
    padding: 9px 14px;
    background: var(--bg-block);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    color: var(--text-main);
    font-family: var(--font-head);
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    min-width: 40px;
    text-align: center;
}
.pagination a:hover {
    border-color: var(--accent-1);
    color: var(--accent-1);
}
.pagination .current {
    background: var(--accent-1);
    border-color: var(--accent-1);
    color: #fff;
}

/* ===== Комментарии ===== */
.comments-area {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--border-strong);
}
.comments-title {
    font-size: 1.3rem;
    margin-bottom: 18px;
}
.commentlist {
    list-style: none;
    padding: 0;
    margin: 0;
}
.commentlist li {
    background: var(--bg-block);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.commentlist li ul.children {
    list-style: none;
    padding-left: 22px;
    margin-top: 14px;
}
.comment-meta {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.comment-meta .author {
    color: var(--text-main);
    font-weight: 600;
}
.comment-body p { margin: 0 0 0.5em; }

.comment-form label {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    color: var(--text-main);
    padding: 10px 12px;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    margin-bottom: 12px;
}
.comment-form textarea { min-height: 120px; resize: vertical; }
.comment-form .submit {
    background: linear-gradient(180deg, var(--accent-1) 0%, var(--accent-1-hover) 100%);
    color: #fff;
    border: none;
    padding: 11px 22px;
    font-family: var(--font-head);
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    min-height: 44px;
}

/* ===== Поиск ===== */
.search-form {
    display: flex;
    gap: 8px;
    margin: 14px 0;
}
.search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.95rem;
}
.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--accent-1);
}
.search-form button {
    background: linear-gradient(180deg, var(--accent-1) 0%, var(--accent-1-hover) 100%);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 6px;
    font-family: var(--font-head);
    font-weight: 600;
    cursor: pointer;
}

/* ===== 404 ===== */
.error-404 {
    text-align: center;
    padding: 40px 0;
    width: 85%;
    margin-inline: auto;
}
.error-404 .big {
    font-family: var(--font-mono);
    font-size: clamp(3.5rem, 10vw, 6rem);
    color: var(--accent-2);
    line-height: 1;
    margin: 0 0 12px;
}
.error-404 .search-form { max-width: 520px; margin: 22px auto; }

/* ===== Подвал ===== */
.site-footer {
    background: #0B0D13;
    border-top: 1px solid var(--border-strong);
    padding: 50px 0 24px;
    margin-top: 40px;
    color: var(--text-main);
}
.footer-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 28px;
}
.footer-col {
    min-width: 0;
}
.footer-col .widget {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}
.footer-col .widget-title {
    color: var(--text-main);
    border-bottom-color: var(--border-strong);
    padding-bottom: 10px;
    margin-bottom: 14px;
}
.site-footer .widget ul li {
    border-bottom: 1px solid rgba(42, 47, 63, 0.4);
}
.site-footer .widget ul li:last-child { border-bottom: none; }

.footer-bottom {
    margin-top: 36px;
    padding-top: 18px;
    border-top: 1px solid var(--border-strong);
    font-size: 0.88rem;
    color: var(--text-muted);
    text-align: center;
}

/* ===== Cookie-баннер ===== */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    background: var(--bg-block);
    border: 1px solid var(--accent-1);
    border-radius: 10px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    z-index: 999;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    max-width: 760px;
    margin: 0 auto;
}
.cookie-banner p {
    margin: 0;
    color: var(--text-main);
    font-size: 0.92rem;
    flex: 1;
    min-width: 220px;
}
.cookie-accept {
    background: linear-gradient(180deg, var(--accent-1) 0%, var(--accent-1-hover) 100%);
    color: #fff;
    border: none;
    padding: 10px 22px;
    border-radius: 6px;
    cursor: pointer;
    font-family: var(--font-head);
    font-weight: 600;
    font-size: 0.95rem;
    min-height: 44px;
}

/* ===== Адаптив ===== */
@media (max-width: 960px) {
    .layout-with-sidebar {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .layout-full .content,
    .front-wrap {
        width: 100%;
    }
    .hero { padding: 36px 24px; }
    .feature-block { padding: 28px 22px; }
}

@media (max-width: 600px) {
    h1 { font-size: 1.7rem; }
    h2 { font-size: 1.35rem; }

    .header-inner { gap: 14px; }
    .nav-toggle { display: inline-block; }
    .primary-nav {
        flex: 1 1 100%;
        order: 3;
    }
    .primary-nav[hidden] { display: none !important; }
    .primary-nav ul {
        flex-direction: column;
        gap: 0;
        border-top: 1px solid var(--border-strong);
        padding-top: 8px;
        margin-top: 8px;
    }
    .primary-nav li a {
        display: block;
        padding: 10px 0;
        border-bottom: 1px solid var(--border-soft);
    }
    .brand-name { font-size: 0.95rem; }
    .brand-tagline { -webkit-line-clamp: 3; }

    .posts-list.posts-list-row .card {
        flex-direction: column;
    }
    .posts-list.posts-list-row .card-thumb-wrap {
        flex: none;
        width: 100%;
        position: static;
    }
    .posts-list.posts-list-row .card-thumb-wrap a {
        position: static;
    }
    .posts-list.posts-list-row .card-thumb-wrap img {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .hero { padding: 28px 18px; }
    .feature-block { padding: 22px 18px; }

    .cookie-banner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    .cookie-accept { width: 100%; }
}
