/*
Theme Name: dds_bashmak55.ru
Author: Дмитрий Сотников
Description: Образовательно-информационный портал о применении игровых подходов в обучении и карьере в GameDev.
Version: 1.1
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: bashmak55
*/

:root {
    --ink: #1b1733;
    --ink-soft: #514c6b;
    --bg: #f6f5fb;
    --surface: #ffffff;
    --violet: #7c3aed;
    --violet-dark: #5b21b6;
    --cyan: #0891b2;
    --gold: #b45309;
    --night: #1a1340;
    --night-2: #241a55;
    --line: #e4e1f0;
    --maxw: 1180px;
    --radius: 16px;
    --shadow: 0 10px 30px rgba(28, 19, 64, .08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: "Segoe UI", "Inter", Roboto, system-ui, -apple-system, Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.65;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

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

h1, h2, h3 { line-height: 1.25; color: var(--ink); }

p { margin: 0 0 1em; }

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--night);
    color: #fff;
    padding: 10px 16px;
    z-index: 1000;
}
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- Шапка ---------- */
.site-top {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}
.top-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 16px 0;
    flex-wrap: wrap;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.brand-logo-link { display: inline-flex; flex: 0 0 auto; }
.brand-mark, .brand-logo { display: block; }
.brand-text { min-width: 0; }
.brand-name {
    display: block;
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--ink);
    line-height: 1.3;
}
.brand-name:hover { text-decoration: none; color: var(--violet-dark); }
.brand-desc {
    margin: 4px 0 0;
    font-size: .82rem;
    color: var(--ink-soft);
    max-width: 56ch;
}

/* Навигация (не липкая) */
.primary-nav { min-width: 0; }
.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.nav-list a {
    display: block;
    padding: 8px 14px;
    border-radius: 10px;
    color: var(--ink);
    font-weight: 600;
    font-size: .95rem;
}
.nav-list a:hover {
    background: rgba(124, 58, 237, .1);
    color: var(--violet-dark);
    text-decoration: none;
}
.nav-list .current-menu-item > a { background: var(--violet); color: #fff; }

.nav-toggle {
    display: none;
    width: 44px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
    padding: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    transition: .2s;
}

/* ---------- Раскладки ---------- */
.site-main { display: block; }
.page-shell { padding: 28px 0 56px; }

.layout-with-sidebar {
    display: grid;
    grid-template-columns: minmax(0, 67fr) minmax(0, 27fr);
    gap: 40px;
    align-items: start;
}
.layout-single {
    display: block;
    width: 85%;
    margin-left: auto;
    margin-right: auto;
}
.content-area { min-width: 0; }

@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .layout-single { width: 100%; }
}

/* ---------- Хлебные крошки ---------- */
.crumbs {
    font-size: .85rem;
    color: var(--ink-soft);
    margin-bottom: 18px;
}
.crumbs a { color: var(--violet-dark); }
.crumbs .sep { margin: 0 6px; color: #b9b4cf; }

/* ---------- Заголовки страниц ---------- */
.page-head { margin-bottom: 22px; }
.page-title { font-size: 1.85rem; margin: 0 0 6px; }
.archive-desc { color: var(--ink-soft); }

/* ---------- Карточки записей ---------- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 26px;
}
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(28, 19, 64, .14); }
.card-thumb {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--night-2);
}
.card-thumb a { display: block; height: 100%; }
.card-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 18px 20px 20px;
}
.card-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: .78rem;
    color: var(--ink-soft);
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.card-cat {
    background: rgba(124, 58, 237, .12);
    color: var(--violet-dark);
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
}
.card-title { font-size: 1.18rem; margin: 0 0 10px; }
.card-title a { color: var(--ink); }
.card-title a:hover { color: var(--violet-dark); text-decoration: none; }
.card-excerpt { color: var(--ink-soft); font-size: .94rem; }
.card-excerpt p { margin: 0 0 0.5em; background: none; }
.card-more {
    margin-top: auto;
    padding-top: 12px;
    font-weight: 600;
    color: var(--violet-dark);
}

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

/* ---------- Главная ---------- */
.home-wrap { padding-bottom: 20px; }
.block { padding: 56px 0; }
.block:nth-child(even) { background: var(--surface); }
.block-h { font-size: 1.7rem; margin: 0 0 8px; text-align: center; }
.block-lead { text-align: center; color: var(--ink-soft); margin: 0 auto 30px; max-width: 60ch; }

.intro-block {
    background: linear-gradient(135deg, var(--night) 0%, var(--night-2) 100%);
    color: #ece9fb;
}
.intro-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 48px;
    align-items: center;
}
.eyebrow {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: .78rem;
    color: #22d3ee;
    font-weight: 700;
    margin: 0 0 12px;
}
.intro-h { font-size: 2.1rem; color: #fff; margin: 0 0 16px; }
.intro-text p { color: #cdc7ee; }
.intro-media img {
    display: block;
    width: 100%;
    border-radius: 20px;
}

.btn-primary {
    display: inline-block;
    margin-top: 8px;
    background: var(--violet);
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
}
.btn-primary:hover { background: #6d28d9; text-decoration: none; }
.btn-ghost {
    display: inline-block;
    border: 2px solid var(--violet);
    color: var(--violet-dark);
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 700;
}
.btn-ghost:hover { background: var(--violet); color: #fff; text-decoration: none; }

/* Сетка направлений */
.dir-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 26px;
}
.dir-card {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.block:nth-child(even) .dir-card { background: var(--surface); }
.dir-card img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}
.dir-card h3 { margin: 16px 20px 8px; font-size: 1.2rem; }
.dir-card p { margin: 0 20px 20px; color: var(--ink-soft); font-size: .94rem; }

.latest-cta { text-align: center; margin-top: 34px; }

/* Шаги */
.steps-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 24px;
}
.step {
    position: relative;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 22px 22px;
}
.block:nth-child(even) .step { background: var(--surface); }
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--violet), var(--cyan));
    color: #fff;
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 14px;
}
.step h3 { margin: 0 0 8px; font-size: 1.12rem; }
.step p { margin: 0; color: var(--ink-soft); font-size: .93rem; }

/* FAQ */
.faq-list { max-width: 820px; margin-inline: auto; }
.faq-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 14px;
    padding: 0 20px;
}
.block:nth-child(even) .faq-item { background: var(--bg); }
.faq-item summary {
    cursor: pointer;
    font-weight: 600;
    padding: 16px 0;
    list-style: none;
    position: relative;
    padding-right: 28px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--violet);
    font-weight: 700;
    font-size: 1.3rem;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin: 0 0 16px; color: var(--ink-soft); }

/* ---------- Запись / страница ---------- */
.single-post, .single-page {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 34px;
    box-shadow: var(--shadow);
}
.single-title { font-size: 2rem; margin: 0 0 10px; }
.single-meta {
    display: flex;
    gap: 14px;
    align-items: center;
    color: var(--ink-soft);
    font-size: .85rem;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.single-cat {
    background: rgba(124, 58, 237, .12);
    color: var(--violet-dark);
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
}
.single-thumb { margin: 0 0 22px; border-radius: 12px; overflow: hidden; }
.single-thumb img { display: block; width: 100%; }
.single-content { font-size: 1.02rem; }
.single-content img { border-radius: 10px; }
.single-content h2 { margin-top: 1.4em; }
.single-content a { text-decoration: underline; }
.single-tags { margin-top: 24px; display: flex; gap: 10px; flex-wrap: wrap; }
.single-tags a {
    background: var(--bg);
    border: 1px solid var(--line);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: .85rem;
}
.contacts-static { margin-top: 18px; }

/* Таблицы */
.single-content table {
    border-collapse: collapse;
    width: 100%;
    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; }
.single-content th { background: var(--bg); text-align: left; }

/* ---------- Сайдбар + виджеты ---------- */
.sidebar { min-width: 0; }
.widget {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    margin-bottom: 24px;
    color: var(--ink);
}
.widget-title {
    font-size: 1.08rem;
    margin: 0 0 14px;
    color: var(--ink);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--violet);
}
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.widget li:last-child { border-bottom: none; }
.widget a { color: var(--violet-dark); }
.widget .post-date { display: block; color: var(--ink-soft); font-size: .8rem; }

/* ---------- Подвал ---------- */
.site-bottom {
    background: var(--night);
    color: #d8d3f0;
    margin-top: 40px;
}
.foot-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
    gap: 30px;
    padding: 48px 0 28px;
}
.foot-col { min-width: 0; }
/* Контраст текста виджетов в тёмном футере (F) */
.site-bottom .widget {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    color: #d8d3f0;
}
.site-bottom .widget-title {
    color: #ffffff;
    border-bottom-color: #22d3ee;
}
.site-bottom .widget a { color: #a5f3fc; }
.site-bottom .widget a:hover { color: #fff; }
.site-bottom .widget li { border-bottom-color: rgba(255, 255, 255, .12); }
.site-bottom .widget .post-date { color: #b4aede; }

.foot-bottom {
    border-top: 1px solid rgba(255, 255, 255, .14);
    padding: 18px 0;
}
.copyright { margin: 0; font-size: .86rem; color: #b4aede; }

/* ---------- Пагинация (D5 — plain / .page-numbers) ---------- */
.pager {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 36px;
    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(--violet);
    color: var(--violet-dark);
}
.pager .page-numbers.current {
    background: var(--violet);
    border-color: var(--violet);
    color: #fff;
}
.pager .page-numbers.dots {
    border: none;
    background: transparent;
}

/* ---------- Поиск ---------- */
.search-form { margin: 18px 0; }
.search-label {
    display: block;
    font-size: .85rem;
    margin-bottom: 6px;
    color: var(--ink-soft);
}
.search-row { display: flex; gap: 8px; }
.search-input {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: .95rem;
}
.search-submit {
    padding: 11px 20px;
    border: none;
    border-radius: 10px;
    background: var(--violet);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.search-submit:hover { background: #6d28d9; }
.widget .search-form { margin: 0; }

/* ---------- Комментарии ---------- */
.comments-area {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px 30px;
    margin-top: 28px;
    box-shadow: var(--shadow);
}
.comments-title { font-size: 1.3rem; margin: 0 0 18px; }
.comments-list { list-style: none; margin: 0 0 24px; padding: 0; }
.comments-list ol { list-style: none; padding-left: 24px; }
.comment-inner {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.comment-head {
    display: flex;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.comment-author { font-weight: 700; }
.comment-date { font-size: .8rem; color: var(--ink-soft); }
.comment-await { font-size: .85rem; color: var(--gold); }
.comment-reply a { font-size: .85rem; font-weight: 600; }
.comment-form { display: block; }
.comment-form p { margin-bottom: 14px; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-family: inherit;
    font-size: .95rem;
}
.comment-form textarea { min-height: 120px; }
.comment-form .submit {
    background: var(--violet);
    color: #fff;
    border: none;
    padding: 12px 26px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
}
.comment-form .submit:hover { background: #6d28d9; }

/* ---------- 404 ---------- */
.error-404 { text-align: center; padding: 30px 0 10px; }
.error-lead { color: var(--ink-soft); max-width: 52ch; margin: 0 auto 22px; }
.error-404 .search-form { max-width: 440px; margin: 0 auto 22px; }
.error-404 .search-label { text-align: left; }

/* ---------- Cookie-баннер (A11/D6) ---------- */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    background: var(--night);
    color: #e7e3fb;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .25);
}
.cookie-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 0;
    flex-wrap: wrap;
    justify-content: space-between;
}
.cookie-text { margin: 0; font-size: .9rem; flex: 1; min-width: 240px; }
.cookie-accept {
    background: var(--violet);
    color: #fff;
    border: none;
    padding: 11px 26px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    flex: 0 0 auto;
}
.cookie-accept:hover { background: #6d28d9; }

/* ---------- Адаптив ---------- */
@media (max-width: 960px) {
    .intro-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .intro-h { font-size: 1.7rem; }
}

@media (max-width: 600px) {
    .nav-toggle { display: flex; }
    .primary-nav {
        flex-basis: 100%;
        display: none;
    }
    .primary-nav.is-open { display: block; }
    .nav-list { flex-direction: column; gap: 4px; }
    .nav-list a { padding: 10px 14px; }
    .block { padding: 40px 0; }
    .block-h { font-size: 1.4rem; }
    .single-post, .single-page { padding: 22px 18px; }
    .page-title { font-size: 1.5rem; }
    .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); }
}
